diff --git a/decompiler/ObjectFile/ObjectFileDB.h b/decompiler/ObjectFile/ObjectFileDB.h index e75b8945e3..1db8ad242c 100644 --- a/decompiler/ObjectFile/ObjectFileDB.h +++ b/decompiler/ObjectFile/ObjectFileDB.h @@ -201,7 +201,18 @@ class ObjectFileDB { // symbol-name : type-name std::unordered_map symbol_types; - std::vector type_defs; + struct TypeInfo { + bool from_inspect_method = false; // does this come from an inspect method? + // if from inspect method: + std::string type_definition; // the deftype generated from the inspect method. + // if not from inspect method: + u32 flags = 0; + std::string parent; + }; + + std::vector type_names_in_order; + std::unordered_map type_info; + std::string symbol_defs; }; void ir2_analyze_all_types(const fs::path& output_file, diff --git a/decompiler/ObjectFile/ObjectFileDB_IR2.cpp b/decompiler/ObjectFile/ObjectFileDB_IR2.cpp index e056bffb7c..3d11c4e462 100644 --- a/decompiler/ObjectFile/ObjectFileDB_IR2.cpp +++ b/decompiler/ObjectFile/ObjectFileDB_IR2.cpp @@ -328,9 +328,16 @@ void ObjectFileDB::ir2_analyze_all_types(const fs::path& output_file, for_each_function_def_order_in_obj(data, [&](Function& f, int seg) { if (seg != TOP_LEVEL_SEGMENT) { if (f.is_inspect_method && bad_types.find(f.guessed_name.type_name) == bad_types.end()) { - object_result.type_defs.push_back( + auto deftype_from_inspect = inspect_inspect_method(f, f.guessed_name.type_name, dts, data.linked_data, - previous_game_ts, ti_cache, object_result)); + previous_game_ts, ti_cache, object_result); + bool already_seen = object_result.type_info.count(f.guessed_name.type_name) > 0; + if (!already_seen) { + object_result.type_names_in_order.push_back(f.guessed_name.type_name); + } + auto& info = object_result.type_info[f.guessed_name.type_name]; + info.from_inspect_method = true; + info.type_definition = deftype_from_inspect; } else { // no inspect methods // - can we solve custom print methods in a generic way? ie `entity-links` @@ -351,8 +358,9 @@ void ObjectFileDB::ir2_analyze_all_types(const fs::path& output_file, result += fmt::format(";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n"); result += fmt::format(";; {:30s} ;;\n", obj.object_name); result += fmt::format(";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\n"); - for (auto& t : obj.type_defs) { - result += t; + for (const auto& type_name : obj.type_names_in_order) { + auto& info = obj.type_info.at(type_name); + result += info.type_definition; result += "\n"; } result += obj.symbol_defs; diff --git a/decompiler/analysis/analyze_inspect_method.cpp b/decompiler/analysis/analyze_inspect_method.cpp index dc4cf5759e..3c26986434 100644 --- a/decompiler/analysis/analyze_inspect_method.cpp +++ b/decompiler/analysis/analyze_inspect_method.cpp @@ -31,7 +31,9 @@ bool is_set_reg_to_int(AtomicOp* op, Register dst, s64 value) { return true; } -bool is_set_reg_to_symbol_value(AtomicOp* op, Register dst, const std::string& value) { +bool is_set_reg_to_symbol_value(AtomicOp* op, + std::optional dst, + const std::string& value) { // should be a set reg to int math 2 ir auto set = dynamic_cast(op); if (!set) { @@ -39,9 +41,11 @@ bool is_set_reg_to_symbol_value(AtomicOp* op, Register dst, const std::string& v } // destination should be a register - auto dest = set->dst(); - if (dst != dest.reg()) { - return false; + if (dst) { + auto dest = set->dst(); + if (dst != dest.reg()) { + return false; + } } auto math = set->src(); @@ -58,7 +62,7 @@ bool is_set_reg_to_symbol_value(AtomicOp* op, Register dst, const std::string& v return true; } -bool is_set_reg_to_symbol_ptr(AtomicOp* op, Register dst, const std::string& value) { +bool is_set_reg_to_symbol_ptr(AtomicOp* op, std::optional dst, const std::string& value) { // should be a set reg to int math 2 ir auto set = dynamic_cast(op); if (!set) { @@ -66,9 +70,11 @@ bool is_set_reg_to_symbol_ptr(AtomicOp* op, Register dst, const std::string& val } // destination should be a register - auto dest = set->dst(); - if (dst != dest.reg()) { - return false; + if (dst) { + auto dest = set->dst(); + if (dst != dest.reg()) { + return false; + } } auto math = set->src(); @@ -85,6 +91,131 @@ bool is_set_reg_to_symbol_ptr(AtomicOp* op, Register dst, const std::string& val return true; } +std::optional get_set_reg_to_symbol_ptr(AtomicOp* op, std::optional dst) { + // should be a set reg to int math 2 ir + auto set = dynamic_cast(op); + if (!set) { + return {}; + } + + // destination should be a register + if (dst) { + auto dest = set->dst(); + if (dst != dest.reg()) { + return {}; + } + } + + auto math = set->src(); + if (SimpleExpression::Kind::IDENTITY != math.kind()) { + return {}; + } + + auto arg = math.get_arg(0); + + if (!arg.is_sym_ptr()) { + return {}; + } + + return arg.get_str(); +} + +std::optional get_set_reg_to_symbol_value(AtomicOp* op, std::optional dst) { + // should be a set reg to int math 2 ir + auto set = dynamic_cast(op); + if (!set) { + return {}; + } + + // destination should be a register + if (dst) { + auto dest = set->dst(); + if (dst != dest.reg()) { + return {}; + } + } + + auto math = set->src(); + if (SimpleExpression::Kind::IDENTITY != math.kind()) { + return {}; + } + + auto arg = math.get_arg(0); + + if (!arg.is_sym_val()) { + return {}; + } + + return arg.get_str(); +} + +bool is_set_reg_to_load(AtomicOp* op, Register dst, int offset) { + auto lvo = dynamic_cast(op); + if (!lvo) { + return false; + } + + // destination should be a register + auto dest = lvo->get_set_destination(); + if (dst != dest.reg()) { + return false; + } + + if (lvo->kind() != LoadVarOp::Kind::UNSIGNED) { + return false; + } + + if (lvo->size() != 4) { + return false; + } + + IR2_RegOffset ro; + if (!get_as_reg_offset(lvo->src(), &ro)) { + return false; + } + if (ro.offset != offset) { + return false; + } + + return true; +} + +std::optional get_set_reg_to_u64_load(AtomicOp* op, + Register dst, + const LinkedObjectFile& file) { + auto lvo = dynamic_cast(op); + if (!lvo) { + return false; + } + + // destination should be a register + auto dest = lvo->get_set_destination(); + if (dst != dest.reg()) { + return false; + } + + if (lvo->src().kind() != SimpleExpression::Kind::IDENTITY) { + return false; + } + + if (lvo->size() != 8) { + return false; + } + + const auto& s = lvo->src().get_arg(0); + if (!s.is_label()) { + return false; + } + auto lab = file.labels.at(s.label()); + + auto& low = file.words_by_seg.at(lab.target_segment).at(lab.offset / 4); + auto& hi = file.words_by_seg.at(lab.target_segment).at((lab.offset / 4) + 1); + if (low.kind() != LinkedWord::PLAIN_DATA || hi.kind() != LinkedWord::PLAIN_DATA) { + return false; + } + return ((u64)low.data) | (((u64)hi.data) << 32); +} + std::optional get_string_loaded_to_reg(AtomicOp* op, Register reg, LinkedObjectFile& file) { @@ -1275,11 +1406,11 @@ std::string get_label_type_name(LinkedObjectFile& file, std::string label_name) } } -std::string inspect_top_level_for_metadata(Function& top_level, - LinkedObjectFile& file, - DecompilerTypeSystem& dts, - DecompilerTypeSystem& previous_game_ts, - ObjectFileDB::PerObjectAllTypeInfo& objectFile) { +void inspect_top_level_for_metadata(Function& top_level, + LinkedObjectFile& file, + DecompilerTypeSystem& dts, + DecompilerTypeSystem& previous_game_ts, + ObjectFileDB::PerObjectAllTypeInfo& objectFile) { // State as a method: /* lui v1, L267 ;; [ 77] (set! gp-0 L267) [] -> [gp: ] @@ -1297,9 +1428,10 @@ std::string inspect_top_level_for_metadata(Function& top_level, sw v1, target-roll(s7) ;; [355] (s.w! target-roll v1-38) [v1: ] -> [] */ if (!top_level.ir2.atomic_ops) { - return ""; + return; } - std::string result; + + // Check for non-method states std::string last_seen_label = ""; // TODO - safely increment op number for (int i = 0; i < top_level.ir2.atomic_ops->ops.size(); i++) { @@ -1352,7 +1484,75 @@ std::string inspect_top_level_for_metadata(Function& top_level, objectFile.state_methods[type_match][method_id] = state_name; } } - return ""; + + // Check for types + // if there's no inspect method, we can use just use the call to the type's new method + // to find the type + const auto& env = top_level.ir2.env; + for (int i = 0; i < ((int)top_level.ir2.atomic_ops->ops.size()) - 5; i++) { + // lw v1, type(s7) ;; [ 20] (set! v1-10 type) [] -> [v1: ] + const auto& aop_0 = top_level.ir2.atomic_ops->ops.at(i); + if (!is_set_reg_to_symbol_value(aop_0.get(), {}, "type")) { + continue; + } + + fmt::print("got 1\n"); + + // lwu t9, 16(v1) ;; [ 21] (set! t9-0 (l.wu (+ v1-10 16))) + // ;; [v1: ] -> [t9: (function symbol type int type) + const auto& aop_1 = top_level.ir2.atomic_ops->ops.at(i + 1); + if (!is_set_reg_to_load(aop_1.get(), Register(Reg::GPR, Reg::T9), 16)) { + fmt::print("fail1\n"); + continue; + } + + // daddiu a0, s7, float-type ;; [ 22] (set! a0-0 'float-type) [] -> [a0: symbol ] + const auto& aop_2 = top_level.ir2.atomic_ops->ops.at(i + 2); + auto type_name = get_set_reg_to_symbol_ptr(aop_2.get(), Register(Reg::GPR, Reg::A0)); + if (!type_name) { + fmt::print("fail2\n"); + continue; + } + + // lw a1, uint32(s7) ;; [ 23] (set! a1-0 uint32) [] -> [a1: ] + const auto& aop_3 = top_level.ir2.atomic_ops->ops.at(i + 3); + auto parent_name = get_set_reg_to_symbol_value(aop_3.get(), Register(Reg::GPR, Reg::A1)); + if (!parent_name) { + fmt::print("fail3\n"); + continue; + } + + // ld a2, L117(fp) ;; [ 24] (set! a2-0 (l.d L117)) [] -> [a2: uint ] + const auto& aop_4 = top_level.ir2.atomic_ops->ops.at(i + 4); + auto flags = get_set_reg_to_u64_load(aop_4.get(), Register(Reg::GPR, Reg::A2), file); + if (!flags) { + fmt::print("fail3\n"); + continue; + } + + // jalr ra, t9 ;; [ 25] (call! a0-0 a1-0 a2-0) + const auto& aop_5 = top_level.ir2.atomic_ops->ops.at(i + 5); + if (!dynamic_cast(aop_5.get())) { + fmt::print("fial4\n"); + continue; + } + + if (objectFile.type_info.count(*type_name) == 0) { + objectFile.type_names_in_order.push_back(*type_name); + } + auto& info = objectFile.type_info[*type_name]; + if (!info.from_inspect_method) { + // no inspect method! generate a deftype. + info.type_definition = fmt::format( + ";; (deftype {} ({})\n" + ";; ()\n" + ";; :flag-assert #x{:x}\n" + ";; )\n", + *type_name, *parent_name, *flags); + } + info.parent = *parent_name; + info.flags = *flags; + } } std::string inspect_top_level_symbol_defines(Function& top_level, diff --git a/decompiler/analysis/analyze_inspect_method.h b/decompiler/analysis/analyze_inspect_method.h index dd0322610b..8a681a4eed 100644 --- a/decompiler/analysis/analyze_inspect_method.h +++ b/decompiler/analysis/analyze_inspect_method.h @@ -44,11 +44,11 @@ std::string inspect_inspect_method(Function& inspect_method, TypeInspectorCache& ti_cache, ObjectFileDB::PerObjectAllTypeInfo& object_file_meta); -std::string inspect_top_level_for_metadata(Function& top_level, - LinkedObjectFile& file, - DecompilerTypeSystem& dts, - DecompilerTypeSystem& previous_game_ts, - ObjectFileDB::PerObjectAllTypeInfo& object_file_meta); +void inspect_top_level_for_metadata(Function& top_level, + LinkedObjectFile& file, + DecompilerTypeSystem& dts, + DecompilerTypeSystem& previous_game_ts, + ObjectFileDB::PerObjectAllTypeInfo& object_file_meta); std::string inspect_top_level_symbol_defines(Function& top_level, LinkedObjectFile& file, diff --git a/decompiler/config/jak2/all-types.gc b/decompiler/config/jak2/all-types.gc index 67bd1f6feb..ace5237645 100644 --- a/decompiler/config/jak2/all-types.gc +++ b/decompiler/config/jak2/all-types.gc @@ -7471,6 +7471,18 @@ ) |# +#| +(deftype drawable-inline-array-node (drawable-inline-array) + () + :method-count-assert 17 + :size-assert #x44 + :flag-assert #x1100000044 + ;; Failed to read fields. + (:methods + ) + ) +|# + #| (deftype draw-node-dma (structure) ((banka draw-node 32 :offset-assert 4) ;; guessed by decompiler @@ -7487,6 +7499,16 @@ ;; drawable-tree-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; (deftype drawable-tree (drawable-group) +;; () +;; :flag-assert #x1100000020 +;; ) + +;; (deftype drawable-tree-array (drawable-group) +;; () +;; :flag-assert #x1100000020 +;; ) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; drawable-actor-h ;; @@ -7504,6 +7526,16 @@ ) |# +;; (deftype drawable-tree-actor (drawable-tree) +;; () +;; :flag-assert #x1100000020 +;; ) + +;; (deftype drawable-inline-array-actor (drawable-inline-array) +;; () +;; :flag-assert #x1100000044 +;; ) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; region-h ;; @@ -7567,6 +7599,11 @@ ) |# +;; (deftype drawable-inline-array-region-prim (drawable-inline-array) +;; () +;; :flag-assert #x1100000044 +;; ) + #| (deftype drawable-region-sphere (drawable-region-prim) () @@ -7808,16 +7845,6 @@ ) |# -#| -(deftype gsf-vertex-array (UNKNOWN) - ((vtx gsf-vertex :dynamic :offset-assert 0) ;; guessed by decompiler - ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ) -|# - #| (deftype gsf-fx-vertex (structure) ((clr vector4ub :inline :offset-assert 0) @@ -7829,16 +7856,6 @@ ) |# -#| -(deftype gsf-fx-vertex-array (UNKNOWN) - ((data gsf-fx-vertex :dynamic :offset-assert 0) ;; guessed by decompiler - ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ) -|# - #| (deftype gsf-header (structure) ((num-strips uint8 :offset-assert 0) @@ -8046,6 +8063,26 @@ ) |# +#| +(deftype gsf-vertex-array (UNKNOWN) + ((vtx gsf-vertex :dynamic :offset-assert 0) ;; guessed by decompiler + ) + :method-count-assert 0 + :size-assert #x0 + :flag-assert #x0 + ) +|# + +#| +(deftype gsf-fx-vertex-array (UNKNOWN) + ((data gsf-fx-vertex :dynamic :offset-assert 0) ;; guessed by decompiler + ) + :method-count-assert 0 + :size-assert #x0 + :flag-assert #x0 + ) +|# + ;; (define-extern *gsf-buffer* object) ;; gsf-buffer ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -9137,6 +9174,11 @@ ) |# +;; (deftype joint-anim-matrix (joint-anim) +;; () +;; :flag-assert #x900000010 +;; ) + #| (deftype joint-anim-transformq (joint-anim) () @@ -9253,6 +9295,11 @@ ) |# +;; (deftype art-mesh-anim (art-element) +;; () +;; :flag-assert #xd00000020 +;; ) + #| (deftype art-joint-anim (art-element) ((speed float :offset-assert 20) @@ -9273,6 +9320,30 @@ ) |# +#| +(deftype art-group (art) + () + :method-count-assert 15 + :size-assert #x20 + :flag-assert #xf00000020 + ;; Failed to read fields. + (:methods + (art-group-method-13 () none 13) ;; (link-art! (_type_) art-group 13) + (art-group-method-14 () none 14) ;; (unlink-art! (_type_) int 14) + ) + ) +|# + +;; (deftype art-mesh-geo (art-element) +;; () +;; :flag-assert #xd00000020 +;; ) + +;; (deftype art-joint-geo (art-element) +;; () +;; :flag-assert #xd00000020 +;; ) + #| (deftype art-joint-anim-manager-slot (structure) ((anim basic :offset-assert 0) @@ -9908,6 +9979,16 @@ ) |# +#| +(deftype merc-blend-data (UNKNOWN) + ((int8-data int8 :dynamic :offset-assert 0) ;; guessed by decompiler + ) + :method-count-assert 0 + :size-assert #x0 + :flag-assert #x0 + ) +|# + ;; (define-extern merc-fragment-fp-data function) ;; (function merc-fragment merc-fp-header) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -10666,6 +10747,11 @@ ;; memcard-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; (deftype mc-handle (int32) +;; () +;; :flag-assert #x900000004 +;; ) + #| (deftype mc-file-info (structure) ((present int32 :offset-assert 0) @@ -10940,6 +11026,34 @@ ) |# +#| +(deftype gui-control (basic) + () + :method-count-assert 25 + :size-assert #xcd0 + :flag-assert #x1900000cd0 + ;; Failed to read fields. + (:methods + (gui-control-method-9 () none 9) + (gui-control-method-10 () none 10) + (gui-control-method-11 () none 11) + (gui-control-method-12 () none 12) + (gui-control-method-13 () none 13) + (gui-control-method-14 () none 14) + (gui-control-method-15 () none 15) + (gui-control-method-16 () none 16) + (gui-control-method-17 () none 17) + (gui-control-method-18 () none 18) + (gui-control-method-19 () none 19) + (gui-control-method-20 () none 20) + (gui-control-method-21 () none 21) + (gui-control-method-22 () none 22) + (gui-control-method-23 () none 23) + (gui-control-method-24 () none 24) + ) + ) +|# + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ambient-h ;; @@ -13439,6 +13553,11 @@ ;; generic-obs-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; (deftype manipy (process-drawable) +;; () +;; :flag-assert #x1501000174 +;; ) + #| (deftype part-spawner (process) ((root trsqv :offset-assert 124) ;; guessed by decompiler @@ -13798,6 +13917,11 @@ ;; collide-target-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; (deftype control-info (collide-shape-moving) +;; () +;; :flag-assert #x4400001910 +;; ) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; collide-touch-h ;; @@ -14276,6 +14400,11 @@ ) |# +;; (deftype drawable-tree-collide-fragment (drawable-tree) +;; () +;; :flag-assert #x1100000020 +;; ) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; collide-hash-h ;; @@ -15100,6 +15229,16 @@ ) |# +;; (deftype drawable-inline-array-instance-shrub (drawable-inline-array) +;; () +;; :flag-assert #x1100000074 +;; ) + +;; (deftype drawable-tree-instance-shrub (drawable-tree) +;; () +;; :flag-assert #x1100000020 +;; ) + #| (deftype generic-shrub-fragment (drawable) ((textures (inline-array adgif-shader) :offset-assert 4) ;; guessed by decompiler @@ -15121,6 +15260,28 @@ ) |# +#| +(deftype prototype-shrubbery (drawable-inline-array) + () + :method-count-assert 17 + :size-assert #x44 + :flag-assert #x1100000044 + ;; Failed to read fields. + (:methods + ) + ) +|# + +;; (deftype prototype-trans-shrubbery (prototype-shrubbery) +;; () +;; :flag-assert #x1100000044 +;; ) + +;; (deftype prototype-generic-shrub (drawable-group) +;; () +;; :flag-assert #x1100000020 +;; ) + #| (deftype shrubbery-matrix (structure) ((mat matrix :inline :offset-assert 0) @@ -15298,6 +15459,18 @@ ) |# +#| +(deftype drawable-inline-array-instance-tie (drawable-inline-array) + () + :method-count-assert 17 + :size-assert #x64 + :flag-assert #x1100000064 + ;; Failed to read fields. + (:methods + ) + ) +|# + #| (deftype drawable-tree-instance-tie (drawable-tree) () @@ -15310,6 +15483,19 @@ ) |# +#| +(deftype prototype-tie (drawable-inline-array) + () + :method-count-assert 17 + :size-assert #x64 + :flag-assert #x1100000064 + ;; Failed to read fields. + (:methods + ) + ) +|# + + #| (deftype tie-matrix (structure) ((mat matrix :inline :offset-assert 0) @@ -15637,6 +15823,43 @@ ) |# +#| +(deftype drawable-inline-array-tfrag (drawable-inline-array) + () + :method-count-assert 17 + :size-assert #x64 + :flag-assert #x1100000064 + ;; Failed to read fields. + (:methods + ) + ) +|# + +;; (deftype drawable-inline-array-tfrag-trans (drawable-inline-array-tfrag) +;; () +;; :flag-assert #x11000000b4 +;; ) + +;; (deftype drawable-inline-array-tfrag-water (drawable-inline-array-tfrag) +;; () +;; :flag-assert #x11000000b4 +;; ) + +;; (deftype drawable-tree-tfrag (drawable-tree) +;; () +;; :flag-assert #x1100000020 +;; ) + +;; (deftype drawable-tree-tfrag-trans (drawable-tree-tfrag) +;; () +;; :flag-assert #x1100000020 +;; ) + +;; (deftype drawable-tree-tfrag-water (drawable-tree-tfrag-trans) +;; () +;; :flag-assert #x1100000020 +;; ) + #| (deftype tfrag-dists (structure) ((data uint32 16 :offset-assert 0) ;; guessed by decompiler @@ -16076,6 +16299,64 @@ ) |# +(deftype entity (res-lump) + ((pad uint32 5)) + :method-count-assert 27 + :size-assert #x34 + :flag-assert #x1b00000034 + ;; Failed to read fields. + (:methods + (entity-method-22 () none 22) ;; (birth! (_type_) _type_ 22) + (entity-method-23 () none 23) ;; (kill! (_type_) _type_ 23) + (entity-method-24 () none 24) ;; (add-to-level! (_type_ level-group level actor-id) none 24) + (entity-method-25 () none 25) ;; (remove-from-level! (_type_ level-group) _type_ 25) + (entity-method-26 () none 26) ;; (get-level (_type_) level 26) + ) + ) + +;; (deftype entity-camera (entity) +;; () +;; :flag-assert #x1b00000050 +;; ) + +#| +(deftype entity-nav-mesh (entity) + () + :method-count-assert 29 + :size-assert #x38 + :flag-assert #x1d00000038 + ;; Failed to read fields. + (:methods + (entity-nav-mesh-method-27 () none 27) + (entity-nav-mesh-method-28 () none 28) + ) + ) +|# + +;; (deftype entity-race-mesh (entity) +;; () +;; :flag-assert #x1d00000038 +;; ) + +(declare-type entity-actor entity) +#| +(deftype entity-actor (entity) + () + :method-count-assert 33 + :size-assert #x50 + :flag-assert #x2100000050 + ;; Failed to read fields. + (:methods + (entity-actor-method-27 () none 27) ;; (next-actor (_type_) entity-actor 27) + (entity-actor-method-28 () none 28) ;; (prev-actor (_type_) entity-actor 28) + (entity-actor-method-29 () none 29) ;; (debug-print (_type_ symbol type) none 29) + (entity-actor-method-30 () none 30) ;; (dummy-30 (_type_ entity-perm-status symbol) none 30) + (entity-actor-method-31 () none 31) + (entity-actor-method-32 () none 32) + ) + ) +|# + #| (deftype actor-reference (structure) ((actor basic :offset-assert 0) @@ -18864,6 +19145,11 @@ ;; spatial-hash-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; (deftype grid-hash-word (uint8) +;; () +;; :flag-assert #x900000001 +;; ) + #| (deftype grid-hash-box (structure) ((min UNKNOWN 3 :offset-assert 0) @@ -19247,19 +19533,6 @@ ;; joint ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| -(deftype art-group (art) - () - :method-count-assert 15 - :size-assert #x20 - :flag-assert #xf00000020 - ;; Failed to read fields. - (:methods - (art-group-method-13 () none 13) ;; (link-art! (_type_) art-group 13) - (art-group-method-14 () none 14) ;; (unlink-art! (_type_) int 14) - ) - ) -|# ;; (define-extern joint-anim-login function) ;; (function joint-anim-drawable joint-anim-drawable) ;; (define-extern joint-anim-inspect-elt function) ;; (function joint-anim float joint-anim) @@ -20533,35 +20806,12 @@ ;; draw-node ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| -(deftype drawable-inline-array-node (drawable-inline-array) - () - :method-count-assert 17 - :size-assert #x44 - :flag-assert #x1100000044 - ;; Failed to read fields. - (:methods - ) - ) -|# - ;; (define-extern draw-node-cull function) ;; (function pointer pointer (inline-array draw-node) int none) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; shrubbery ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| -(deftype prototype-shrubbery (drawable-inline-array) - () - :method-count-assert 17 - :size-assert #x44 - :flag-assert #x1100000044 - ;; Failed to read fields. - (:methods - ) - ) -|# #| (deftype dma-test (structure) @@ -20622,18 +20872,6 @@ ;; tfrag ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| -(deftype drawable-inline-array-tfrag (drawable-inline-array) - () - :method-count-assert 17 - :size-assert #x64 - :flag-assert #x1100000064 - ;; Failed to read fields. - (:methods - ) - ) -|# - ;; (define-extern *tfrag-display-stats* object) ;; symbol ;; (define-extern tfrag-vu1-block object) ;; vu-function ;; (define-extern tfrag-data-setup function) ;; (function tfrag-data int none) @@ -20688,29 +20926,6 @@ ;; tie ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| -(deftype drawable-inline-array-instance-tie (drawable-inline-array) - () - :method-count-assert 17 - :size-assert #x64 - :flag-assert #x1100000064 - ;; Failed to read fields. - (:methods - ) - ) -|# - -#| -(deftype prototype-tie (drawable-inline-array) - () - :method-count-assert 17 - :size-assert #x64 - :flag-assert #x1100000064 - ;; Failed to read fields. - (:methods - ) - ) -|# #| (deftype tie-consts (structure) @@ -21208,34 +21423,6 @@ ) |# -#| -(deftype gui-control (basic) - () - :method-count-assert 25 - :size-assert #xcd0 - :flag-assert #x1900000cd0 - ;; Failed to read fields. - (:methods - (gui-control-method-9 () none 9) - (gui-control-method-10 () none 10) - (gui-control-method-11 () none 11) - (gui-control-method-12 () none 12) - (gui-control-method-13 () none 13) - (gui-control-method-14 () none 14) - (gui-control-method-15 () none 15) - (gui-control-method-16 () none 16) - (gui-control-method-17 () none 17) - (gui-control-method-18 () none 18) - (gui-control-method-19 () none 19) - (gui-control-method-20 () none 20) - (gui-control-method-21 () none 21) - (gui-control-method-22 () none 22) - (gui-control-method-23 () none 23) - (gui-control-method-24 () none 24) - ) - ) -|# - ;; (define-extern drawable-load function) ;; (function drawable kheap drawable) ;; (define-extern art-load function) ;; (function string kheap art) ;; (define-extern art-group-load-check function) ;; (function string kheap int art-group) @@ -25676,55 +25863,6 @@ |# -(deftype entity (res-lump) - ((pad uint32 5)) - :method-count-assert 27 - :size-assert #x34 - :flag-assert #x1b00000034 - ;; Failed to read fields. - (:methods - (entity-method-22 () none 22) ;; (birth! (_type_) _type_ 22) - (entity-method-23 () none 23) ;; (kill! (_type_) _type_ 23) - (entity-method-24 () none 24) ;; (add-to-level! (_type_ level-group level actor-id) none 24) - (entity-method-25 () none 25) ;; (remove-from-level! (_type_ level-group) _type_ 25) - (entity-method-26 () none 26) ;; (get-level (_type_) level 26) - ) - ) - - -#| -(deftype entity-nav-mesh (entity) - () - :method-count-assert 29 - :size-assert #x38 - :flag-assert #x1d00000038 - ;; Failed to read fields. - (:methods - (entity-nav-mesh-method-27 () none 27) - (entity-nav-mesh-method-28 () none 28) - ) - ) -|# - -(declare-type entity-actor entity) -#| -(deftype entity-actor (entity) - () - :method-count-assert 33 - :size-assert #x50 - :flag-assert #x2100000050 - ;; Failed to read fields. - (:methods - (entity-actor-method-27 () none 27) ;; (next-actor (_type_) entity-actor 27) - (entity-actor-method-28 () none 28) ;; (prev-actor (_type_) entity-actor 28) - (entity-actor-method-29 () none 29) ;; (debug-print (_type_ symbol type) none 29) - (entity-actor-method-30 () none 30) ;; (dummy-30 (_type_ entity-perm-status symbol) none 30) - (entity-actor-method-31 () none 31) - (entity-actor-method-32 () none 32) - ) - ) -|# - #| (deftype debug-actor-info (basic) ((name basic :offset-assert 4) @@ -32230,6 +32368,11 @@ ) |# +;; (deftype predator-edge (structure) +;; () +;; :flag-assert #x900000004 +;; ) + #| (deftype predator-graph (structure) ((node-count uint16 :offset-assert 0)