W/nav debugging (#2077)

Co-authored-by: Tyler Wilding <xtvaser@gmail.com>
This commit is contained in:
water111
2023-01-01 12:11:18 -05:00
committed by GitHub
parent 08ad352e94
commit 0cddf6b6a5
67 changed files with 27239 additions and 595 deletions
+1 -1
View File
@@ -188,7 +188,7 @@ goos::Object SimpleAtom::to_form(const std::vector<DecompilerLabel>& labels, con
return goos::Object::make_float(f);
} else {
// nan or weird
return pretty_print::to_symbol(fmt::format("(the-as float #x{:x})", m_int));
return pretty_print::to_symbol(fmt::format("(the-as float #x{:x})", (u32)m_int));
}
} else {
if (std::abs(m_int) > INT32_MAX) {
+2
View File
@@ -1088,6 +1088,7 @@ Mips2C_Line handle_normal_instr(Mips2C_Output& output,
case InstructionKind::SLTU:
case InstructionKind::DSRAV:
case InstructionKind::DSLLV:
case InstructionKind::DSRLV:
case InstructionKind::SLLV:
case InstructionKind::PAND:
case InstructionKind::PCEQB:
@@ -1116,6 +1117,7 @@ Mips2C_Line handle_normal_instr(Mips2C_Output& output,
return handle_daddiu(output, i0, instr_str, version);
case InstructionKind::ADDIU:
case InstructionKind::SLTI:
case InstructionKind::SLTIU:
return handle_generic_op2_u16(i0, instr_str);
case InstructionKind::QMTC2:
return handle_generic_op2(i0, instr_str, "mov128_vf_gpr");
+224 -257
View File
@@ -6038,16 +6038,16 @@
(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) ;; (level-update (_type_) int 16)
(actors-update (_type_) none 17) ;; (level-get-target-inside (_type_) level 17)
(level-group-method-18 (_type_) none 18) ;; (alloc-levels! (_type_ symbol) int 18)
(level-update (_type_) none 19) ;;
(level-get-target-inside (_type_) level 20) ;; (art-group-get-by-name (_type_ string) art-group 20)
(assign-draw-indices (_type_) none 16)
(actors-update (_type_) none 17)
(update-nav-meshes (_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) ;; (print-volume-sizes (_type_) none 24)
(update-vis-volumes (_type_) none 25) ;; (level-status (_type_ symbol) symbol 25)
(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)
@@ -16107,7 +16107,7 @@
(collide-with collide-spec :offset-assert 20)
(action collide-action :offset-assert 24) ;; guessed by decompiler
(prim-type prim-type :offset-assert 28)
(unused1 uint8 3 :offset-assert 29)
(unused1 uint8 3 :offset-assert 29)
(quad uint128 2 :offset 0) ;; guessed by decompiler
)
:method-count-assert 9
@@ -16210,8 +16210,9 @@
(defenum nav-flags
:type uint8
:bitfield #t
(nav-flags0 0)
(nav-flags1 1)
(has-root-sphere 0)
(has-extra-sphere 1)
(has-child-spheres 2)
)
;; ---collide-shape-h:nav-flags
@@ -19691,7 +19692,7 @@
:bitfield #t
:type uint16
(bit-0 0) ;; blocks birth
(bit-1 1)
(bit-1 1) ;; dead? error?
(dead 2)
(no-kill 3)
(bit-4 4)
@@ -19800,7 +19801,7 @@
:size-assert #x38
:flag-assert #x1d00000038
(:methods
(entity-nav-mesh-method-27 (_type_) none 27)
(initialize-nav-mesh! "Initialize the nav-mesh in this entity." (_type_) none 27)
(debug-draw (_type_) none 28)
)
)
@@ -19834,8 +19835,8 @@
(prev-actor (_type_) entity-actor 28)
(debug-print (_type_ symbol type) none 29)
(toggle-status (_type_ entity-perm-status symbol) none 30)
(entity-actor-method-31 (_type_ vector vector vector object float) nav-mesh 31)
(entity-actor-method-32 (_type_ vector vector nav-poly float) nav-poly 32)
(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)
)
)
@@ -22313,7 +22314,7 @@
)
(deftype nav-poly (structure)
((data uint8 64 :offset-assert 0 :score -1)
((data uint8 64 :offset-assert 0 :score -10)
(vertex vector 4 :inline :offset 0) ;; changed to vector from uint8 in jak 1
(vertex0 vector :inline :offset 0)
(vertex1 vector :inline :offset 16)
@@ -22396,7 +22397,7 @@
)
(deftype clamp-travel-vector-to-mesh-return-info (structure)
((found-boundary basic :offset-assert 0)
((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)
@@ -22453,48 +22454,44 @@
:size-assert #x70
:flag-assert #x2f00000070
(:methods
(nav-mesh-method-9 (_type_) none 9) ;; (tri-centroid-world (_type_ nav-poly vector) vector 9)
(nav-mesh-method-10 (_type_ vector vector nav-poly) nav-poly 10) ;; (tri-centroid-local (_type_ nav-poly vector) vector 10)
(nav-mesh-method-11 (_type_ nav-poly vector) vector 11) ;; (get-adj-poly (_type_ nav-poly nav-poly symbol) nav-poly 11)
(nav-mesh-method-12 (_type_ nav-poly vector) none 12) ;; (setup-portal (_type_ nav-poly nav-poly nav-route-portal) object 12)
(nav-mesh-method-13 (_type_ nav-poly nav-poly) nav-poly 13) ;; (initialize-mesh! (_type_) none 13)
(get-route-portal (_type_ nav-poly nav-poly nav-route-portal) (inline-array nav-vertex) 14) ;; (move-along-nav-ray! (_type_ nav-ray) none 14)
(initialize-mesh! (_type_) none 15) ;; (try-move-along-ray (_type_ nav-poly vector vector float) meters 15)
(move-along-nav-ray! (_type_ nav-ray) none 16) ;; (TODO-RENAME-16 (_type_ vector nav-poly vector symbol float clip-travel-vector-to-mesh-return-info) none 16)
(try-move-along-ray (_type_ nav-poly vector vector float) meters 17) ;; (update-route-table (_type_) none 17)
(nav-mesh-method-18 (_type_ vector nav-poly vector float symbol clamp-travel-vector-to-mesh-return-info) none 18) ;; (dummy-18 (_type_ int vector int (pointer int8) int) none 18)
(nav-mesh-method-19 (_type_) none 19) ;; (compute-bounding-box (_type_ vector vector) none 19)
(nav-mesh-method-20 (_type_ clamp-travel-vector-to-mesh-return-info) none 20) ;; (debug-draw-poly (_type_ nav-poly rgba) none 20)
(find-adjacent-bounds-one (_type_ vector nav-poly int int) none 21) ;; (point-in-poly? (_type_ nav-poly vector) symbol 21)
(nav-mesh-method-22 (_type_ vector vector) none 22) ;; (find-opposite-vertices (_type_ nav-poly nav-poly) uint 22)
(nav-mesh-method-23 (_type_ entity-nav-mesh) none 23) ;; (dummy-23 (_type_ nav-poly vector vector vector nav-route-portal) vector 23)
(nav-mesh-method-24 (_type_) none 24) ;; (closest-point-on-boundary (_type_ nav-poly vector vector) vector 24)
(nav-mesh-method-25 (_type_) none 25) ;; (project-point-into-tri-3d (_type_ nav-poly vector vector) none 25)
(nav-mesh-method-26 (_type_) none 26) ;; (project-point-into-tri-2d (_type_ nav-poly vector vector) vector 26)
(new-nav-control (_type_ process-drawable int) nav-control 27) ;; (find-poly-fast (_type_ vector meters) nav-poly 27)
(nav-mesh-method-28 (_type_ object) none 28) ;; (find-poly (_type_ vector meters (pointer nav-control-flags)) nav-poly 28)
(nav-mesh-method-29 (_type_ process-drawable symbol) nav-control 29) ;; (is-in-mesh? (_type_ vector float meters) symbol 29)
(nav-mesh-method-30 (_type_ process-drawable) none 30)
(change-to (_type_ process-drawable) none 31)
(nav-mesh-method-32 "arg1 is a [[nav-mesh-link]] `id`" (_type_ uint32) none 32)
(nav-mesh-method-33 "arg1 is a [[nav-mesh-link]] `id`" (_type_ uint32) symbol 33)
(nav-mesh-method-34 (_type_ object vector float) none 34)
(nav-mesh-method-35
"TODO - Assertion failed: 'std::isfinite(value)'
Source: C:/Users/xtvas/Repositories/opengoal/jak-project/common/util/print_float.cpp:90
Function: int __cdecl float_to_cstr(float, char *, bool)"
() none 35)
(nav-mesh-method-36 (_type_ nav-poly rgba) none 36)
(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 int) 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 symbol) 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) none 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 object) vector 38)
(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)
(nav-mesh-method-40 (_type_ nav-poly vector object vector) none 40)
(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)
(nav-mesh-method-42 (_type_ nav-find-poly-parms) nav-poly 42)
(nav-mesh-method-43 (_type_ nav-find-poly-parms) none 43)
(nav-mesh-method-44 (_type_ vector float float) symbol 44)
(nav-mesh-method-45 "TODO - asm expression building error" (_type_ entity-perm) none 45) ;; entity-perm is wrong
(nav-mesh-method-46 (_type_ object) none 46)
(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)
)
)
@@ -22602,18 +22599,18 @@
(debug-draw (_type_) none 9)
(nav-state-method-10
"Virtual/Stub" (_type_) none 10)
(nav-state-method-11 (_type_ nav-gap-info) symbol 11)
(nav-state-method-12 (_type_ vector) vector 12)
(nav-state-method-13 (_type_ vector) vector 13)
(nav-state-method-14 (_type_ vector) vector 14)
(nav-state-method-15 (_type_ vector) vector 15)
(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)
(get-rotation-rate
"@returns `rotation-rate`"
(_type_) float 17)
(nav-state-method-18 (_type_ vector object vector) none 18)
(try-projecting-to-current-poly (_type_ vector object vector) symbol 18)
(get-current-poly
"@returns `current-poly`"
(_type_) nav-poly 19)
@@ -22623,37 +22620,37 @@
(nav-state-method-21 () none 21)
(nav-state-method-22 () none 22)
(nav-state-method-23 () none 23)
(nav-state-method-24 (_type_) none 24)
(nav-state-method-25 (_type_) none 25)
(nav-state-method-26 (_type_) none 26)
(nav-state-method-27 (_type_) none 27)
(nav-state-method-28 (_type_) none 28)
(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)
(nav-state-method-31 (_type_) none 31)
(nav-state-method-32 (_type_) none 32)
(nav-state-method-33 (_type_) none 33)
(nav-state-method-34 (_type_) none 34)
(nav-state-method-35 (_type_) none 35)
(nav-state-method-36 (_type_ vector) none 36)
(nav-state-method-37 (_type_) none 37)
(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 () none 39)
(nav-state-method-40 (_type_) none 40)
(nav-state-method-41 (_type_ vector) symbol 41)
(nav-state-method-42 (_type_ vector) none 42)
(nav-state-method-43 (_type_ vector) none 43)
(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)
(nav-state-method-47 (_type_ nav-control) none 47)
(reset! (_type_ nav-control) none 47)
(nav-state-method-48 () none 48)
(nav-state-method-49 (_type_ clamp-travel-vector-to-mesh-return-info) none 49)
(navigate-using-best-dir-use-existing-avoid-spheres (_type_ nav-avoid-spheres-params) none 49)
(nav-state-method-50 "Virtual/Stub" (_type_) none 50)
(nav-state-method-51 "TODO - #1888" () none 51)
(nav-state-method-52 (_type_) none 52)
(nav-state-method-53 (_type_) none 53)
(nav-state-method-54 (_type_) none 54)
(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)
)
)
@@ -22702,45 +22699,45 @@
(:methods
;; (new (symbol type collide-shape int float) _type_ 0)
(debug-draw (_type_) none 9)
(point-in-bounds?
(point-in-bsphere?
"Is the given point ([[vector]]) outside of the [[nav-mesh]]'s `bounds` [[sphere]] radius"
(_type_ vector) symbol 10)
(nav-control-method-11 "TODO" (_type_ vector) vector 11) ;; (dummy-11 (_type_ vector) vector 11)
(nav-control-method-12 (_type_ vector vector nav-poly) nav-poly 12) ;; (TODO-RENAME-12 (_type_ nav-gap-info) symbol 12)
(find-poly "TODO" (_type_ vector) nav-poly 13) ;; (dummy-13 (_type_ vector vector) vector 13)
(nav-control-method-14 (_type_ nav-poly vector object vector) none 14) ;; (set-current-poly! (_type_ nav-poly) none 14)
(nav-control-method-15 "TODO - same as 11" (_type_ vector) none 15) ;; (set-target-pos! (_type_ vector) none 15)
(nav-control-method-16 (_type_ vector float) symbol 16) ;; (dummy-16 (_type_ vector) nav-poly 16)
(is-in-mesh? "TODO" (_type_ vector float) symbol 17) ;; (project-onto-nav-mesh (_type_ vector vector) vector 17)
(nav-control-method-18 () none 18) ;; (find-poly (_type_ vector) nav-poly 18)
(nav-control-method-19 () none 19) ;; (dummy-19 (_type_ vector collide-shape-moving vector float) none 19)
(nav-control-method-20 (_type_ vector nav-poly vector float symbol symbol) none 20) ;; (project-point-into-tri-3d (_type_ nav-poly vector vector) vector 20)
(nav-control-method-21 (_type_) none 21) ;; (TODO-RENAME-21 (_type_ vector) nav-poly 21)
(nav-control-method-22 (_type_ vector nav-avoid-spheres-params) float 22) ;; (TODO-RENAME-22 (_type_ vector float) symbol 22)
(nav-control-method-23 "TODO" (_type_) none 23) ;; (dummy-23 (_type_ vector check-vector-collision-with-nav-spheres-info) float 23)
(nav-control-method-24 (_type_ vector int) none 24) ;; (dummy-24 (_type_ float clip-travel-vector-to-mesh-return-info) none 24)
(get-max-rotation-rate (_type_) float 25) ;; (is-in-mesh? (_type_ vector float) symbol 25)
(get-sphere-mask (_type_) none 26) ;; (TODO-RENAME-26 (_type_) none 26)
(get-target-speed (_type_) meters 27) ;; (TODO-RENAME-27 (_type_) none 27)
(nav-control-method-28 "TODO - Clears `nav-flags::1` on `shape`'s `flags`" (_type_) none 28) ;; (TODO-RENAME-28 (_type_ collide-kind) none 28)
(nav-control-method-29 "TODO - Sets `nav-flags::1` on `shape`'s `flags`" (_type_) none 29) ;; (should-display? (_type_) symbol 29)
(copy-extra-nav-sphere! "Copies the given [[sphere]] into `extra-nav-sphere`" (_type_ sphere) none 30) ;; (dummy-30 (_type_ vector vector vector) sphere 30)
(set-extra-nav-sphere! "Set the `extra-nav-sphere` with the data in the given [[sphere]]" (_type_ sphere) none 31) ;; (intersect-ray-line-segment? (_type_ vector vector vector vector) symbol 31)
(set-extra-nav-sphere-radius! "Set's `extra-nav-sphere`'s radius" (_type_ float) none 32) ;; (TODO-ASM-32 (_type_ vector vector vector vector float) symbol 32)
(set-nearest-y-thres! "Set `nearest-y-threshold`" (_type_ float) none 33) ;; (TODO-RENAME-33 (_type_ vector vector vector vector float) symbol 33)
(set-nav-cull-radius! "Set `nav-cull-radius`" (_type_ meters) none 34) ;; (dummy-34 () none 34)
(set-speed-scale! "Set `speed-scale`" (_type_ float) none 35) ;; (dummy-35 (_type_ vector vector vector vector float) none 35)
(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) none 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)
(nav-control-method-41 "TODO - calls nav-mesh::28" (_type_) none 41)
(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)
(nav-control-method-45 (_type_ vector vector vector) sphere 45)
(find-sphere "TODO" (_type_ symbol) none 46)
(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)
)
)
@@ -22788,7 +22785,7 @@
:size-assert #x58
:flag-assert #x1900000058
(:methods
(new (symbol type int int) _type_ 0)
(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)
@@ -22816,7 +22813,7 @@
(len int16 :offset-assert 20)
(max-len int16 :offset-assert 22)
(mask uint8 :offset-assert 24)
(array uint32 :offset-assert 28)
(array (pointer uint8) :offset-assert 28)
)
:method-count-assert 9
:size-assert #x20
@@ -22840,8 +22837,8 @@
(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)
(sphere-hash-method-30 (_type_ find-nav-sphere-ids-params) none 30)
(sphere-hash-method-31 (_type_ vector int int) none 31)
(find-nav-sphere-ids (_type_ find-nav-sphere-ids-params) none 30)
(add-sphere-with-mask-and-id (_type_ vector int int) none 31)
(sphere-hash-method-32 (_type_ vector vector float int) symbol 32)
(remove-by-id (_type_ sphere int) none 33)
)
@@ -29802,9 +29799,9 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(deftype nav-engine-spr-buffer (structure)
((mem-addr uint32 :offset-assert 0)
((mem-addr (pointer nav-mesh) :offset-assert 0) ;; TODO - pretty sure these are wrong...
(mem-nav uint32 :offset 0)
(spr-addr uint32 :offset-assert 4)
(spr-addr (inline-array nav-control) :offset-assert 4) ;; TODO - pretty sure these are wrong...
(spr-nav uint32 :offset 4)
(q-size uint32 :offset-assert 8)
(i-nav uint8 :offset-assert 12)
@@ -29831,7 +29828,7 @@
(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 basic :offset 8)
(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)
@@ -29845,18 +29842,18 @@
:flag-assert #x1600000060
(:methods
(inc-spr-addr! "Adds the given integer to `spr-addr` and returns it" (_type_ uint) uint 9)
(nav-engine-method-10 (_type_ object) none 10)
(nav-engine-method-11 (_type_) none 11)
(nav-engine-method-12 (_type_ nav-mesh object) none 12)
(nav-engine-method-13 (_type_) none 13)
(nav-engine-method-14 (_type_) none 14)
(nav-engine-method-15 (_type_) none 15)
(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)
(nav-engine-method-17 (_type_ nav-engine-spr-buffer) none 17)
(nav-engine-method-18 (_type_ nav-engine-spr-buffer) none 18)
(nav-engine-method-19 (_type_ nav-engine-spr-buffer) none 19)
(nav-engine-method-20 () none 20)
(nav-engine-method-21 (_type_) none 21)
(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)
)
)
@@ -29868,15 +29865,15 @@
(define-extern *debug-offset* vector) ;; vector
(define-extern *nav-mesh-work* nav-mesh-work)
(define-extern *default-nav-mesh* nav-mesh) ;; nav-mesh
(define-extern nav-mesh-connect-from-ent (function entity-nav-mesh none))
(define-extern nav-mesh-connect-from-ent "Connect this process to the nav-mesh associate with the entity that spawned the process" (function process-drawable symbol))
(define-extern connection-validate (function connection none))
(define-extern connection-list-validate (function (inline-array connection) symbol))
(define-extern nav-control-validate (function nav-control none))
(define-extern nav-control-validate (function process-drawable none))
(define-extern debug-validate-nav-poly (function nav-mesh-link nav-poly none))
(define-extern nav-dma-send-to-spr-no-flush (function object object object none))
(define-extern nav-dma-send-from-spr-no-flush (function none))
(define-extern nav-dma-send-to-spr-no-flush (function pointer pointer int none))
(define-extern nav-dma-send-from-spr-no-flush (function pointer pointer int none))
(define-extern inc-mod3 "Increments and returns the provided [[int]], if the value exceeds `2`, wrap back to `0`" (function int int)) ;;
(define-extern nav-state-patch-pointers (function none))
(define-extern nav-state-patch-pointers (function nav-state int none))
(define-extern vu-point-triangle-intersection? (function vector vector vector vector symbol)) ;;
(define-extern poly-in-height-range? (function nav-poly float float symbol))
(define-extern init-ray-local (function nav-ray nav-poly vector vector none)) ;;
@@ -29889,12 +29886,8 @@
(define-extern plane-height-at-xz-point (function plane vector float))
(define-extern nav-normal-from-3-points (function vector vector vector vector none))
(define-extern get-nav-mesh (function actor-id nav-mesh))
(define-extern find-nearest-nav-mesh (function vector int nav-mesh))
;; (define-extern point-to-poly-boundary
;; "TODO - assertion:
;; Assertion failed: 'std::isfinite(value)'
;; Source: C:/Users/xtvas/Repositories/opengoal/jak-project/common/util/print_float.cpp:90"
;; (function nav-poly object vector object none))
(define-extern find-nearest-nav-mesh (function vector float nav-mesh))
(define-extern point-to-poly-boundary (function nav-poly vector vector float))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; nav-control ;;
@@ -29931,11 +29924,12 @@
(define-extern debug-nav-validate-current-poly (function nav-mesh nav-poly vector symbol))
(define-extern debug-report-nav-stats "Does nothing" (function none))
(define-extern get-nav-control
"Given a [[process-drawable]] return the associated [[nav-control]] using either:
"Given a [[process-drawable]] get the associated [[nav-control]] using either:
- the provided `nav-mesh` arg
- the `nav-mesh` associated with the [[process-drawable]]'s [[entity]]
If no [[nav-mesh]] is set or found, set the [[entity]]'s [[entity-perm-status]] to TODO and return an error"
(function process-drawable nav-mesh nav-control))
If no [[nav-mesh]] is set or found, set the [[entity]]'s [[entity-perm-status]] to TODO and return an error.
Note that this doesn't actually return the nav-control, but instead adds this process-drawable to the nav-mesh."
(function process-drawable nav-mesh none))
(define-extern add-nav-sphere
"Adds the given [[sphere]] to the [[nav-control]]'s `sphere-array` so long as
`max-spheres` is less than [[nav-control]]'s `sphere-count`"
@@ -35147,7 +35141,6 @@
;; hover-nav-control-h ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#|
(deftype nav-network-adjacency (structure)
((index int32 :offset-assert 0)
(dist float :offset-assert 4)
@@ -35156,21 +35149,14 @@
:size-assert #x8
:flag-assert #x900000008
)
|#
#|
(deftype nav-network-adjacency-array (inline-array-class)
((length int32 :offset-assert 4)
(allocated-length int32 :offset-assert 8)
(data UNKNOWN :dynamic :offset-assert 16)
)
((data nav-network-adjacency :inline :dynamic :offset-assert 16))
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
|#
#|
(deftype list-node (structure)
((next list-node :offset-assert 0)
(prev list-node :offset-assert 4)
@@ -35179,45 +35165,48 @@
:size-assert #x8
:flag-assert #x900000008
)
|#
#|
;; +++hover-nav-control-h:net-path-node-status
(defenum net-path-node-status
:bitfield #t
:type uint16
(open)
(closed))
;; ---hover-nav-control-h:net-path-node-status
(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)
)
:method-count-assert 9
:size-assert #x1c
:flag-assert #x90000001c
;; Failed to read fields.
)
|#
#|
(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 uint32 :offset-assert 64)
(adjacency (inline-array nav-network-adjacency) :offset-assert 64) ;; TODO - this is probably wrong and should instead be just `nav-network-adjacency-array`
)
:method-count-assert 9
:size-assert #x44
:flag-assert #x900000044
)
|#
#|
(deftype nav-network-info-array (inline-array-class)
((length int32 :offset-assert 4)
(allocated-length int32 :offset-assert 8)
(data UNKNOWN :dynamic :offset-assert 16)
((data nav-network-info :inline :dynamic :offset-assert 16)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
|#
#|
(deftype hover-nav-sphere (list-node)
((sphere sphere :inline :offset-assert 16)
(handle uint64 :offset-assert 32)
@@ -35227,25 +35216,21 @@
:size-assert #x30
:flag-assert #x900000030
)
|#
#|
(deftype hover-nav-path-segment (list-node)
((curve-matrix matrix :inline :offset-assert 16)
(pos-index UNKNOWN 2 :offset-assert 80)
(pos-index int32 2 :offset-assert 80)
(dist float :offset-assert 88)
(du float :offset-assert 92)
(du float :offset-assert 92) ;; TODO stands for...?
)
:method-count-assert 10
:size-assert #x60
:flag-assert #xa00000060
(:methods
(hover-nav-path-segment-method-9 () none 9)
(hover-nav-path-segment-method-9 (_type_ float) none 9)
)
)
|#
#|
(deftype hover-nav-path-info (structure)
((segment-list hover-nav-path-segment :offset-assert 0)
(tail-segment hover-nav-path-segment :offset-assert 4)
@@ -35259,31 +35244,25 @@
(hover-nav-path-info-method-9 () none 9)
)
)
|#
#|
(deftype path-index-array (inline-array-class)
((length int32 :offset-assert 4)
(allocated-length int32 :offset-assert 8)
(data UNKNOWN :dynamic :offset-assert 16)
((data hover-nav-path-info :inline :dynamic :offset-assert 16)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
|#
#|
(deftype nav-network (basic)
((network basic :offset-assert 4)
(dummy nav-network-info :inline :offset-assert 16)
(control-handle uint64 :offset-assert 88)
(list-table UNKNOWN 5 :offset-assert 96)
(open-list nav-network-path-node :offset-assert 96)
(closed-list nav-network-path-node :offset-assert 100)
(sphere-list hover-nav-sphere :offset-assert 108)
(free-segment-list hover-nav-path-segment :offset-assert 104)
(free-sphere-list hover-nav-sphere :offset-assert 112)
(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 uint32 :offset-assert 116)
(sphere-pool uint32 :offset-assert 120)
)
@@ -35291,35 +35270,33 @@
:size-assert #x7c
:flag-assert #x210000007c
(:methods
(nav-network-method-9 () none 9)
(nav-network-method-10 () none 10)
(nav-network-method-11 () none 11)
(nav-network-method-12 () none 12)
(nav-network-method-13 () none 13)
(nav-network-method-14 () none 14)
(nav-network-method-15 () none 15)
(nav-network-method-16 () none 16)
(nav-network-method-17 () none 17)
(nav-network-method-18 () none 18)
(nav-network-method-19 () none 19)
(nav-network-method-20 () none 20)
(nav-network-method-21 () none 21)
(nav-network-method-22 () none 22)
(nav-network-method-23 () none 23)
(nav-network-method-24 () none 24)
(nav-network-method-25 () none 25)
(nav-network-method-26 () none 26)
(nav-network-method-27 () none 27)
(nav-network-method-28 () none 28)
(nav-network-method-29 () none 29)
(nav-network-method-30 () none 30)
(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_) none 13)
(nav-network-method-14 (_type_ int) none 14)
(nav-network-method-15 (_type_) none 15)
(nav-network-method-16 (_type_) none 16)
(nav-network-method-17 (_type_) nav-network-path-node 17)
(nav-network-method-18 (_type_) none 18)
(nav-network-method-19 (_type_) none 19)
(nav-network-method-20 (_type_) none 20)
(nav-network-method-21 (_type_) none 21)
(nav-network-method-22 (_type_) none 22)
(nav-network-method-23 (_type_) none 23)
(nav-network-method-24 (_type_) none 24)
(nav-network-method-25 (_type_) none 25)
(nav-network-method-26 (_type_) none 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_) basic 30)
(nav-network-method-31 () none 31)
(nav-network-method-32 () none 32)
)
)
|#
#|
(deftype hover-nav-params (structure)
((max-speed float :offset-assert 0)
(max-acceleration float :offset-assert 4)
@@ -35330,9 +35307,7 @@
:size-assert #x10
:flag-assert #x900000010
)
|#
#|
(deftype hover-nav-control (basic)
((root basic :offset-assert 4)
(nav basic :offset-assert 8)
@@ -35365,34 +35340,33 @@
:size-assert #xd8
:flag-assert #x20000000d8
(:methods
(hover-nav-control-method-9 () none 9)
(hover-nav-control-method-10 () none 10)
(hover-nav-control-method-11 () none 11)
(hover-nav-control-method-12 () none 12)
(hover-nav-control-method-13 () none 13)
(hover-nav-control-method-14 () none 14)
(hover-nav-control-method-15 () none 15)
(hover-nav-control-method-16 () none 16)
(hover-nav-control-method-17 () none 17)
(hover-nav-control-method-18 () none 18)
(hover-nav-control-method-19 () none 19)
(hover-nav-control-method-20 () none 20)
(hover-nav-control-method-21 () none 21)
(hover-nav-control-method-22 () none 22)
(hover-nav-control-method-23 () none 23)
(hover-nav-control-method-24 () none 24)
(hover-nav-control-method-25 () none 25)
(hover-nav-control-method-26 () none 26)
(hover-nav-control-method-27 () none 27)
(hover-nav-control-method-28 () none 28)
(hover-nav-control-method-29 () none 29)
(hover-nav-control-method-30 () none 30)
(hover-nav-control-method-31 () none 31)
(hover-nav-control-method-9 (_type_) none 9)
(hover-nav-control-method-10 (_type_) none 10)
(hover-nav-control-method-11 (_type_) 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_) none 15)
(hover-nav-control-method-16 (_type_) none 16)
(hover-nav-control-method-17 (_type_) none 17)
(hover-nav-control-method-18 (_type_) none 18)
(hover-nav-control-method-19 (_type_) 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_) none 26)
(hover-nav-control-method-27 (_type_) none 27)
(hover-nav-control-method-28 (_type_) none 28)
(hover-nav-control-method-29 (_type_) none 29)
(hover-nav-control-method-30 (_type_) float 30)
(hover-nav-control-method-31 (_type_) float 31)
)
)
|#
;; (define-extern *hover-nav-time-offset* object)
(define-extern *hover-nav-time-offset* int)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; hover-enemy-h ;;
@@ -35475,39 +35449,32 @@
;; hover-nav-network ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; (define-extern *drill-adjacency* array)
;; (define-extern *fortress-adjacency* array)
;; (define-extern *forest-adjacency* array)
;; (define-extern *under-adjacency* array)
;; (define-extern *nestb-adjacency* array)
(define-extern *drill-adjacency* (array nav-network-info))
(define-extern *fortress-adjacency* (array nav-network-info))
(define-extern *forest-adjacency* (array nav-network-info))
(define-extern *under-adjacency* (array nav-network-info))
(define-extern *nestb-adjacency* (array nav-network-info))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; hover-nav-control ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#|
(deftype nav-network-control (process)
((nav-network basic :offset-assert 124)
((nav-network nav-network :offset-assert 128)
)
:method-count-assert 15
:size-assert #x84
:flag-assert #xf00100084
(:methods
(nav-network-control-method-9 () none 9)
(nav-network-control-method-10 () none 10)
(nav-network-control-method-11 () none 11)
(nav-network-control-method-12 () none 12)
(nav-network-control-method-13 () none 13)
(idle () _type_ :state 14)
)
)
|#
;; (define-extern *debug-hover* object)
;; (define-extern nav-network-control-init-by-other function)
(define-extern *debug-hover* symbol)
(define-extern nav-network-control-init-by-other (function nav-network level none :behavior nav-network-control))
;; (define-extern detect-loop function)
;; (define-extern list-contains function)
;; (define-extern *nav-network* object)
(define-extern *nav-network* nav-network)
;; (define-extern hover-bounce-reaction function)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -42896,7 +42863,7 @@
(define-extern movie-nest-metalkor-shot-draw-impact (function scene-player vector vector none))
(define-extern nestb-login (function none))
(define-extern nestb-deactivate (function none))
(define-extern nestb-activate (function none))
(define-extern nestb-activate (function level none))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; nestb-part ;;
+38 -8
View File
@@ -285,12 +285,12 @@
"bsp-camera-asm": [1, 2, 3, 4, 6, 7],
"(method 9 texture-page-dir)": [5, 6],
"level-remap-texture": [2, 3, 4, 5, 6],
"(method 27 nav-mesh)": [0, 1, 2, 4, 5],
"(method 31 nav-mesh)": [0, 1, 2, 7, 8, 9, 11, 12, 13, 15],
"(method 45 nav-mesh)": [1, 4, 5, 8],
"(method 46 nav-mesh)": [1, 2, 3, 5],
"(method 32 nav-mesh)": [0, 1, 2, 4],
"(method 33 nav-mesh)": [0, 1, 2, 4],
"(method 27 nav-mesh)": [1, 2],
"(method 31 nav-mesh)": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
"(method 46 nav-mesh)": [2, 3],
"(method 32 nav-mesh)": [1, 2],
"(method 33 nav-mesh)": [1, 2],
"(method 42 nav-mesh)": [1, 2, 3, 7],
"point-poly-distance-min": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
"(method 34 nav-mesh)": [1, 2, 3, 7],
@@ -465,7 +465,25 @@
"(anon-function 4 gun-states)": [94, 96, 98],
"target-board-handler": [
13, 14, 18
]
],
"find-closest-circle-ray-intersection": [
0, 4, 15, 16, 17, 18
],
"(method 18 nav-control)": [
11, // L283
12, // L300
19, // L295
20, // L293
31, // weird jump back
34 // weird jump no delay slot
],
"(method 19 nav-control)": [9, 10],
"(method 19 nav-mesh)": [7],
"(method 18 nav-mesh)": [9],
"(method 40 nav-state)": [1, 2],
"(method 45 nav-mesh)": [5, 6],
"(method 43 nav-mesh)": [0, 1, 2, 12, 13, 14, 15, 16, 17, 18, 19, 20]
},
// Sometimes the game might use format strings that are fetched dynamically,
@@ -580,7 +598,19 @@
"add-light-sphere-to-light-group",
"light-hash-add-items",
"light-hash-count-items",
"light-hash-get-bucket-index"
"light-hash-get-bucket-index",
// nav-mesh / nav-control related
// TODO - it would be nice to eventually figure out the asm blocks for the majority of these
"nav-state-patch-pointers",
"(method 20 nav-engine)",
// "find-closest-circle-ray-intersection",
// "(method 18 nav-control)",
"nav-dma-send-to-spr-no-flush",
"nav-dma-send-from-spr-no-flush",
"(method 17 nav-engine)",
"(method 18 nav-engine)",
"(method 21 nav-engine)",
"(method 39 nav-state)"
],
"mips2c_jump_table_functions": {},
+13 -6
View File
@@ -667,10 +667,10 @@
],
"(method 31 entity-actor)": [[16, "nav-find-poly-parms"]],
"(method 32 entity-actor)": [[32, "nav-find-poly-parms"]],
"(method 36 nav-mesh)": [[16, "nav-route-portal"]],
"(method 36 nav-mesh)": [[16, ["inline-array", "vector", 3]]],
"(method 13 nav-engine)": [[16, "nav-vertex"]],
"(method 12 nav-mesh)": [[16, "nav-vertex"]],
"(method 44 nav-mesh)": [[32, "nav-poly"]],
"(method 44 nav-mesh)": [[32, "nav-find-poly-parms"]],
"(method 15 nav-mesh)": [[16, "vector"]],
"(method 40 nav-mesh)": [
[16, "vector"],
@@ -1067,7 +1067,7 @@
"(method 37 nav-state)": [[16, "vector"]],
"(method 33 nav-state)": [[16, "clamp-travel-vector-to-mesh-return-info"]],
"(method 32 nav-state)": [
[16, "check-vector-collision-with-nav-spheres-info"]
[16, "nav-control-cfs-work"]
],
"(method 28 nav-state)": [[208, "vector"]],
"(method 11 nav-state)": [
@@ -1160,8 +1160,6 @@
"(method 45 collide-shape)": [[16, "do-push-aways-work"]],
"(method 50 collide-shape)": [[32, "vector"]],
"(method 44 collide-shape)": [[16, "pull-rider-info"]],
// placeholder
"placeholder-do-not-add-below": [],
"(method 25 guard-shot)": [[32, "vector"]],
"(enter impact guard-shot)": [[16, "traffic-danger-info"]],
"(method 38 guard-shot)": [[16, "collide-query"]],
@@ -1258,5 +1256,14 @@
],
"check-pop-level-firework-green-userdata": [[16, "vector"]],
"check-pop-level-firework-red-userdata": [[16, "vector"]],
"check-pop-level-firework-userdata": [[16, "vector"]]
"check-pop-level-firework-userdata": [[16, "vector"]],
"(method 13 nav-mesh)": [[16, ["array", "int8", 4]]],
"point-to-poly-boundary": [[16, ["inline-array", "vector", 4]]],
"(method 35 nav-mesh)": [[16, ["inline-array", "nav-poly", 3]]],
"(method 51 nav-state)": [[16, "vector"], [32, "nav-route-portal"], [80, ["inline-array", "vector", 2]], [192, "matrix"]],
"(method 18 nav-control)": [[16, "nav-control-cfs-work"]],
"(method 19 nav-control)": [[16, "nav-control-cfs-work"]],
"(method 19 nav-mesh)": [[16, "nav-ray"], [96, "vector"]],
"(method 18 nav-mesh)": [[16, "nav-ray"]]
}
+23 -6
View File
@@ -1921,7 +1921,10 @@
[199, "v1", "float"],
[220, "v1", "float"]
],
"(method 45 nav-mesh)": [[15, "v1", "entity-nav-mesh"]],
"(method 45 nav-mesh)": [
[15, "v1", "entity-nav-mesh"],
[[34, 43], "v1", "nav-mesh"]
],
"(method 13 nav-engine)": [
[[53, 65], "s4", "nav-mesh"],
[[38, 50], "s3", "nav-mesh"]
@@ -3707,10 +3710,6 @@
],
"connection-list-validate": [[5, "gp", "connection"]],
"point-poly-distance-min": [[94, "f0", "float"]],
"(method 42 nav-mesh)": [
[12, "s4", "grid-hash-box"],
[59, "s4", "grid-hash-box"]
],
"(method 26 nav-mesh)": [[[23, 78], "s4", "nav-engine"]],
"compute-dir-parm": [[10, "v1", "float"]],
"(trans idle fma-sphere)": [[39, "a2", "process-drawable"]],
@@ -5411,5 +5410,23 @@
[45, "a0", "(pointer gs-test)"],
[47, "a0", "(pointer gs-reg64)"],
[[72, 102], "t1", "rgba"]
]
],
"(method 16 nav-engine)": [[92, "gp", "nav-engine-spr-buffer"]],
"(method 12 nav-engine)": [
[[22, 28], "v1", "connection"],
[[29, 31], "a0", "process-focusable"],
[[34, 86], "s2", "collide-shape"],
[90, "v1", "collide-shape-prim-group"],
[110, "s2", "collide-shape-prim-sphere"]
],
"compute-dir-parm": [
[18, "f0", "float"],
[8, "a2", "uint"],
[10, "v1", "float"]
],
"(method 11 nav-state)": [[37, "v1", "float"]],
"(method 18 nav-control)": [[252, "a2", "float"]],
"(method 23 nav-mesh)": [["_stack_", 16, "res-tag"]],
"nav-control-validate": [[29, "s5", "int"], [29, "v1", "int"]],
"(method 43 nav-mesh)": [["_stack_", 28, "float"]]
}
+2
View File
@@ -733,6 +733,8 @@ const std::unordered_map<
{{"init-specs", ArrayFieldDecompMeta(TypeSpec("sp-field-init-spec"), 16)}}},
{"sparticle-launch-group",
{{"launcher", ArrayFieldDecompMeta(TypeSpec("sparticle-group-item"), 32)}}},
{"nav-network-info",
{{"adjacency", ArrayFieldDecompMeta(TypeSpec("nav-network-adjacency"), 16)}}},
{"sig-path", {{"samples", ArrayFieldDecompMeta(TypeSpec("sig-path-sample"), 64)}}},
{"race-info",
{{"turbo-pad-array", ArrayFieldDecompMeta(TypeSpec("race-turbo-pad"), 32)},
+2
View File
@@ -93,6 +93,8 @@ set(RUNTIME_SOURCE
mips2c/jak2_functions/foreground.cpp
mips2c/jak2_functions/joint.cpp
mips2c/jak2_functions/lights.cpp
mips2c/jak2_functions/nav_control.cpp
mips2c/jak2_functions/nav_mesh.cpp
mips2c/jak2_functions/sky.cpp
mips2c/jak2_functions/sparticle.cpp
mips2c/jak2_functions/sparticle_launcher.cpp
+274
View File
@@ -0,0 +1,274 @@
//--------------------------MIPS2C---------------------
// clang-format off
#include "game/mips2c/mips2c_private.h"
#include "game/kernel/jak2/kscheme.h"
using ::jak2::intern_from_c;
namespace Mips2C::jak2 {
namespace method_39_nav_state {
u64 execute(void* ctxt) {
auto* c = (ExecutionContext*)ctxt;
bool bc = false;
bool cop1_bc = false;
c->daddiu(sp, sp, -96); // daddiu sp, sp, -96
c->swc1(f20, 80, sp); // swc1 f20, 80(sp)
c->swc1(f22, 84, sp); // swc1 f22, 84(sp)
c->lwc1(f0, 32, a0); // lwc1 f0, 32(a0)
c->lwu(v1, 4, a0); // lwu v1, 4(a0)
c->lwc1(f1, 28, v1); // lwc1 f1, 28(v1)
c->muls(f1, f0, f1); // mul.s f1, f0, f1
c->daddiu(v1, a0, 48); // daddiu v1, a0, 48
c->lwc1(f0, 0, v1); // lwc1 f0, 0(v1)
c->lwc1(f2, 0, v1); // lwc1 f2, 0(v1)
c->muls(f0, f0, f2); // mul.s f0, f0, f2
c->lwc1(f2, 8, v1); // lwc1 f2, 8(v1)
c->lwc1(f3, 8, v1); // lwc1 f3, 8(v1)
c->muls(f2, f2, f3); // mul.s f2, f2, f3
c->adds(f0, f0, f2); // add.s f0, f0, f2
c->sqrts(f0, f0); // sqrt.s f0, f0
c->mfc1(v1, f0); // mfc1 v1, f0
c->mtc1(f0, v1); // mtc1 f0, v1
c->daddiu(v1, sp, 16); // daddiu v1, sp, 16
c->daddiu(a1, sp, 32); // daddiu a1, sp, 32
c->lwu(a2, 12, a0); // lwu a2, 12(a0)
c->lwu(a3, 0, a2); // lwu a3, 0(a2)
c->lwu(a2, 12, a0); // lwu a2, 12(a0)
c->lwu(a2, 0, a2); // lwu a2, 0(a2)
c->lwc1(f2, 28, a2); // lwc1 f2, 28(a2)
cop1_bc = c->fprs[f2] < c->fprs[f0]; // c.lt.s f2, f0
bc = !cop1_bc; // bc1f L154
c->mov64(v0, s7); // or v0, s7, r0
if (bc) {goto block_6;} // branch non-likely
c->mov64(a2, v1); // or a2, v1, r0
c->daddiu(t0, a0, 48); // daddiu t0, a0, 48
c->lui(t1, 16256); // lui t1, 16256
c->mtc1(f2, t1); // mtc1 f2, t1
c->divs(f2, f2, f0); // div.s f2, f2, f0
c->lqc2(vf1, 0, t0); // lqc2 vf1, 0(t0)
c->mfc1(t0, f2); // mfc1 t0, f2
c->mov128_vf_gpr(vf2, t0); // qmtc2.i vf2, t0
c->vadd_bc(DEST::w, BC::x, vf1, vf0, vf0); // vaddx.w vf1, vf0, vf0
c->vmul_bc(DEST::xyz, BC::x, vf1, vf1, vf2); // vmulx.xyz vf1, vf1, vf2
c->sqc2(vf1, 0, a2); // sqc2 vf1, 0(a2)
c->mtc1(f2, r0); // mtc1 f2, r0
c->swc1(f2, 4, v1); // swc1 f2, 4(v1)
c->mov64(a2, a1); // or a2, a1, r0
c->lwc1(f2, 16, a3); // lwc1 f2, 16(a3)
c->cvtws(f1, f1); // cvt.w.s f1, f1
c->mfc1(a3, f1); // mfc1 a3, f1
c->dsll32(a3, a3, 16); // dsll32 a3, a3, 16
c->dsra32(a3, a3, 16); // dsra32 a3, a3, 16
c->mtc1(f1, a3); // mtc1 f1, a3
c->cvtsw(f1, f1); // cvt.s.w f1, f1
c->muls(f1, f2, f1); // mul.s f1, f2, f1
c->lui(a3, 16255); // lui a3, 16255
c->lui(t0, -16854); // lui t0, -16854
c->ori(a3, a3, 65502); // ori a3, a3, 65502
c->ori(t0, t0, 43253); // ori t0, t0, 43253
c->subs(f22, f22, f22); // sub.s f22, f22, f22
c->lui(t1, 15368); // lui t1, 15368
c->mtc1(f10, a3); // mtc1 f10, a3
c->ori(a3, t1, 27638); // ori a3, t1, 27638
c->mtc1(f11, t0); // mtc1 f11, t0
c->lui(t0, -18099); // lui t0, -18099
c->muls(f2, f1, f1); // mul.s f2, f1, f1
c->ori(t0, t0, 8306); // ori t0, t0, 8306
c->mtc1(f12, a3); // mtc1 f12, a3
c->lui(a3, 13850); // lui a3, 13850
c->mtc1(f14, t0); // mtc1 f14, t0
c->ori(t0, a3, 41599); // ori t0, a3, 41599
// Unknown instr: mula.s f1, f10
float acc;
acc = c->fprs[f1] * c->fprs[f10];
c->lui(a3, 16256); // lui a3, 16256
c->muls(f3, f2, f1); // mul.s f3, f2, f1
c->mov64(a3, a3); // or a3, a3, r0
c->muls(f4, f2, f2); // mul.s f4, f2, f2
c->lui(t1, -16641); // lui t1, -16641
c->mtc1(f15, t0); // mtc1 f15, t0
c->lui(t0, -16641); // lui t0, -16641
c->or_(t0, t1, t0); // or t0, t1, t0
c->mtc1(f16, a3); // mtc1 f16, a3
// nop // sll r0, r0, 0
c->mtc1(f17, t0); // mtc1 f17, t0
// nop // sll r0, r0, 0
c->muls(f5, f3, f2); // mul.s f5, f3, f2
// nop // sll r0, r0, 0
c->muls(f6, f3, f3); // mul.s f6, f3, f3
// nop // sll r0, r0, 0
c->muls(f7, f4, f3); // mul.s f7, f4, f3
// nop // sll r0, r0, 0
c->muls(f8, f4, f4); // mul.s f8, f4, f4
// nop // sll r0, r0, 0
c->muls(f9, f5, f4); // mul.s f9, f5, f4
c->lui(a3, 15658); // lui a3, 15658
// Unknown instr: madda.s f3, f11
acc += c->fprs[f3] * c->fprs[f11];
c->ori(a3, a3, 31272); // ori a3, a3, 31272
// Unknown instr: madda.s f5, f12
acc += c->fprs[f5] * c->fprs[f12];
c->lui(t0, -17742); // lui t0, -17742
// Unknown instr: madda.s f7, f14
acc += c->fprs[f7] * c->fprs[f14];
c->ori(t0, t0, 48177); // ori t0, t0, 48177
// Unknown instr: madd.s f21, f9, f15
c->fprs[f21] = acc + (c->fprs[f9] * c->fprs[f15]);
c->lui(t1, 14249); // lui t1, 14249
c->mtc1(f18, a3); // mtc1 f18, a3
c->ori(a3, t1, 13291); // ori a3, t1, 13291
c->mtc1(f19, t0); // mtc1 f19, t0
// nop // sll r0, r0, 0
c->mtc1(f20, a3); // mtc1 f20, a3
// nop // sll r0, r0, 0
// Unknown instr: mula.s f16, f16
acc = c->fprs[f16] * c->fprs[f16];
// nop // sll r0, r0, 0
// Unknown instr: madda.s f2, f17
acc += c->fprs[f2] + c->fprs[f17];
// nop // sll r0, r0, 0
// Unknown instr: madda.s f4, f18
acc += c->fprs[f4] + c->fprs[f18];
// nop // sll r0, r0, 0
// Unknown instr: madda.s f6, f19
acc += c->fprs[f6] + c->fprs[f19];
// nop // sll r0, r0, 0
// Unknown instr: madd.s f22, f8, f20
c->fprs[f22] = acc + (c->fprs[f8] * c->fprs[f20]);
// nop // sll r0, r0, 0
c->swc1(f21, 0, a2); // swc1 f21, 0(a2)
// nop // sll r0, r0, 0
c->swc1(f22, 4, a2); // swc1 f22, 4(a2)
c->gprs[a2].du64[0] = 0; // or a2, r0, r0
c->mov64(a3, v1); // or a3, v1, r0
c->daddiu(a2, a0, 144); // daddiu a2, a0, 144
c->lwc1(f1, 0, a3); // lwc1 f1, 0(a3)
c->lwc1(f2, 4, a3); // lwc1 f2, 4(a3)
c->lwc1(f3, 8, a3); // lwc1 f3, 8(a3)
c->lwc1(f4, 0, a2); // lwc1 f4, 0(a2)
c->lwc1(f5, 4, a2); // lwc1 f5, 4(a2)
c->lwc1(f6, 8, a2); // lwc1 f6, 8(a2)
// Unknown instr: mula.s f1, f4
// Unknown instr: madda.s f2, f5
// Unknown instr: madd.s f1, f3, f6
c->fprs[f1] = (c->fprs[f3] * c->fprs[f6]) + (c->fprs[f2] * c->fprs[f5]) + (c->fprs[f1] * c->fprs[f4]);
c->mfc1(a2, f1); // mfc1 a2, f1
c->mtc1(f1, a2); // mtc1 f1, a2
c->lwc1(f2, 4, a1); // lwc1 f2, 4(a1)
cop1_bc = c->fprs[f1] < c->fprs[f2]; // c.lt.s f1, f2
bc = !cop1_bc; // bc1f L154
c->mov64(v0, s7); // or v0, s7, r0
if (bc) {goto block_6;} // branch non-likely
c->daddiu(a2, sp, 48); // daddiu a2, sp, 48
c->daddiu(a3, sp, 64); // daddiu a3, sp, 64
c->mov64(t0, a2); // or t0, a2, r0
c->daddiu(t1, a0, 144); // daddiu t1, a0, 144
c->lwc1(f1, 0, a1); // lwc1 f1, 0(a1)
c->lwc1(f3, 4, a1); // lwc1 f3, 4(a1)
c->lwc1(f2, 0, t1); // lwc1 f2, 0(t1)
c->lwc1(f4, 8, t1); // lwc1 f4, 8(t1)
c->muls(f5, f3, f2); // mul.s f5, f3, f2
c->muls(f6, f1, f4); // mul.s f6, f1, f4
c->adds(f5, f5, f6); // add.s f5, f5, f6
c->swc1(f5, 0, t0); // swc1 f5, 0(t0)
c->lwc1(f5, 4, t1); // lwc1 f5, 4(t1)
c->swc1(f5, 4, t0); // swc1 f5, 4(t0)
c->muls(f3, f3, f4); // mul.s f3, f3, f4
c->muls(f1, f1, f2); // mul.s f1, f1, f2
c->subs(f1, f3, f1); // sub.s f1, f3, f1
c->swc1(f1, 8, t0); // swc1 f1, 8(t0)
c->mfc1(t0, f1); // mfc1 t0, f1
c->mov64(t0, a3); // or t0, a3, r0
c->daddiu(t1, a0, 144); // daddiu t1, a0, 144
c->lwc1(f1, 0, a1); // lwc1 f1, 0(a1)
c->negs(f1, f1); // neg.s f1, f1
c->lwc1(f3, 4, a1); // lwc1 f3, 4(a1)
c->lwc1(f2, 0, t1); // lwc1 f2, 0(t1)
c->lwc1(f4, 8, t1); // lwc1 f4, 8(t1)
c->muls(f5, f3, f2); // mul.s f5, f3, f2
c->muls(f6, f1, f4); // mul.s f6, f1, f4
c->adds(f5, f5, f6); // add.s f5, f5, f6
c->swc1(f5, 0, t0); // swc1 f5, 0(t0)
c->lwc1(f5, 4, t1); // lwc1 f5, 4(t1)
c->swc1(f5, 4, t0); // swc1 f5, 4(t0)
c->muls(f3, f3, f4); // mul.s f3, f3, f4
c->muls(f1, f1, f2); // mul.s f1, f1, f2
c->subs(f1, f3, f1); // sub.s f1, f3, f1
c->swc1(f1, 8, t0); // swc1 f1, 8(t0)
c->mfc1(a1, f1); // mfc1 a1, f1
c->mov64(t0, a2); // or t0, a2, r0
c->mov64(a1, v1); // or a1, v1, r0
c->lwc1(f1, 0, t0); // lwc1 f1, 0(t0)
c->lwc1(f2, 4, t0); // lwc1 f2, 4(t0)
c->lwc1(f3, 8, t0); // lwc1 f3, 8(t0)
c->lwc1(f4, 0, a1); // lwc1 f4, 0(a1)
c->lwc1(f5, 4, a1); // lwc1 f5, 4(a1)
c->lwc1(f6, 8, a1); // lwc1 f6, 8(a1)
// Unknown instr: mula.s f1, f4
// Unknown instr: madda.s f2, f5
// Unknown instr: madd.s f1, f3, f6
c->fprs[f1] = (c->fprs[f3] * c->fprs[f6]) + (c->fprs[f2] * c->fprs[f5]) + (c->fprs[f1] * c->fprs[f4]);
c->mfc1(a1, f1); // mfc1 a1, f1
c->mtc1(f1, a1); // mtc1 f1, a1
c->mov64(t0, a3); // or t0, a3, r0
c->mov64(a1, v1); // or a1, v1, r0
c->lwc1(f2, 0, t0); // lwc1 f2, 0(t0)
c->lwc1(f3, 4, t0); // lwc1 f3, 4(t0)
c->lwc1(f4, 8, t0); // lwc1 f4, 8(t0)
c->lwc1(f5, 0, a1); // lwc1 f5, 0(a1)
c->lwc1(f6, 4, a1); // lwc1 f6, 4(a1)
c->lwc1(f7, 8, a1); // lwc1 f7, 8(a1)
// Unknown instr: mula.s f2, f5
// Unknown instr: madda.s f3, f6
// Unknown instr: madd.s f2, f4, f7
c->fprs[f2] = (c->fprs[f4] * c->fprs[f7]) + (c->fprs[f3] * c->fprs[f6]) + (c->fprs[f2] * c->fprs[f5]);
c->mfc1(a1, f2); // mfc1 a1, f2
c->mtc1(f2, a1); // mtc1 f2, a1
cop1_bc = c->fprs[f2] < c->fprs[f1]; // c.lt.s f2, f1
bc = !cop1_bc; // bc1f L152
// nop // sll r0, r0, 0
if (bc) {goto block_4;} // branch non-likely
c->mov64(a1, v1); // or a1, v1, r0
c->lq(a2, 0, a2); // lq a2, 0(a2)
c->sq(a2, 0, a1); // sq a2, 0(a1)
//beq r0, r0, L153 // beq r0, r0, L153
// nop // sll r0, r0, 0
goto block_5; // branch always
block_4:
c->mov64(a1, v1); // or a1, v1, r0
c->lq(a2, 0, a3); // lq a2, 0(a3)
c->sq(a2, 0, a1); // sq a2, 0(a1)
block_5:
c->daddiu(a0, a0, 48); // daddiu a0, a0, 48
c->lqc2(vf1, 0, v1); // lqc2 vf1, 0(v1)
c->mfc1(v1, f0); // mfc1 v1, f0
c->mov128_vf_gpr(vf2, v1); // qmtc2.i vf2, v1
c->vadd_bc(DEST::w, BC::x, vf1, vf0, vf0); // vaddx.w vf1, vf0, vf0
c->vmul_bc(DEST::xyz, BC::x, vf1, vf1, vf2); // vmulx.xyz vf1, vf1, vf2
c->sqc2(vf1, 0, a0); // sqc2 vf1, 0(a0)
c->daddiu(v0, s7, 4); // daddiu v0, s7, #t
block_6:
c->lwc1(f22, 84, sp); // lwc1 f22, 84(sp)
c->lwc1(f20, 80, sp); // lwc1 f20, 80(sp)
//jr ra // jr ra
c->daddiu(sp, sp, 96); // daddiu sp, sp, 96
goto end_of_function; // return
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
end_of_function:
return c->gprs[v0].du64[0];
}
void link() {
gLinkedFunctionTable.reg("(method 39 nav-state)", execute, 96);
}
} // namespace method_39_nav_state
} // namespace Mips2C
+939
View File
@@ -0,0 +1,939 @@
//--------------------------MIPS2C---------------------
// clang-format off
#include "game/mips2c/mips2c_private.h"
#include "game/kernel/jak2/kscheme.h"
using ::jak2::intern_from_c;
namespace Mips2C::jak2 {
namespace nav_state_patch_pointers {
u64 execute(void* ctxt) {
auto* c = (ExecutionContext*)ctxt;
c->lw(v1, 16, a0); // lw v1, 16(a0)
c->daddu(a2, v1, a1); // daddu a2, v1, a1
c->xor_(a3, v1, s7); // xor a3, v1, s7
c->sltiu(a3, a3, 1); // sltiu a3, a3, 1
c->movz(v1, a2, a3); // movz v1, a2, a3
c->sw(v1, 16, a0); // sw v1, 16(a0)
c->lw(v1, 28, a0); // lw v1, 28(a0)
c->daddu(a2, v1, a1); // daddu a2, v1, a1
c->xor_(a3, v1, s7); // xor a3, v1, s7
c->sltiu(a3, a3, 1); // sltiu a3, a3, 1
c->movz(v1, a2, a3); // movz v1, a2, a3
c->sw(v1, 28, a0); // sw v1, 28(a0)
c->lw(v1, 24, a0); // lw v1, 24(a0)
c->daddu(a2, v1, a1); // daddu a2, v1, a1
c->xor_(a3, v1, s7); // xor a3, v1, s7
c->sltiu(a3, a3, 1); // sltiu a3, a3, 1
c->movz(v1, a2, a3); // movz v1, a2, a3
c->sw(v1, 24, a0); // sw v1, 24(a0)
c->lw(v1, 20, a0); // lw v1, 20(a0)
c->daddu(a1, v1, a1); // daddu a1, v1, a1
c->xor_(a2, v1, s7); // xor a2, v1, s7
c->sltiu(a2, a2, 1); // sltiu a2, a2, 1
c->movz(v1, a1, a2); // movz v1, a1, a2
c->sw(v1, 20, a0); // sw v1, 20(a0)
c->gprs[v0].du64[0] = 0; // or v0, r0, r0
//jr ra // jr ra
c->daddu(sp, sp, r0); // daddu sp, sp, r0
goto end_of_function; // return
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
end_of_function:
return c->gprs[v0].du64[0];
}
void link() {
gLinkedFunctionTable.reg("nav-state-patch-pointers", execute, 0);
}
} // namespace nav_state_patch_pointers
namespace method_45_nav_mesh {
struct Cache {
void* entity_nav_mesh; // entity-nav-mesh
void* entity_nav_mesh_by_aid; // entity-nav-mesh-by-aid
void* type; // type?
} cache;
u64 execute(void* ctxt) {
auto* c = (ExecutionContext*)ctxt;
bool bc = false;
u32 call_addr = 0;
c->daddiu(sp, sp, -64); // daddiu sp, sp, -64
c->sd(ra, 0, sp); // sd ra, 0(sp)
c->sq(s4, 16, sp); // sq s4, 16(sp)
c->sq(s5, 32, sp); // sq s5, 32(sp)
c->sq(gp, 48, sp); // sq gp, 48(sp)
c->mov64(s5, a0); // or s5, a0, r0
c->mov64(gp, a1); // or gp, a1, r0
c->lwu(v1, 12, gp); // lwu v1, 12(gp)
bc = c->sgpr64(s7) != c->sgpr64(v1); // bne s7, v1, L274
c->mov64(v0, s7); // or v0, s7, r0
if (bc) {goto block_12;} // branch non-likely
c->load_symbol2(t9, cache.entity_nav_mesh_by_aid);// lw t9, entity-nav-mesh-by-aid(s7)
c->lwu(a0, 4, gp); // lwu a0, 4(gp)
call_addr = c->gprs[t9].du32[0]; // function call:
c->sll(v0, ra, 0); // sll v0, ra, 0
c->jalr(call_addr); // jalr ra, t9
c->mov64(s4, v0); // or s4, v0, r0
c->load_symbol2(t9, cache.type); // lw t9, type?(s7)
c->mov64(a0, s4); // or a0, s4, r0
c->load_symbol2(a1, cache.entity_nav_mesh); // lw a1, entity-nav-mesh(s7)
call_addr = c->gprs[t9].du32[0]; // function call:
c->sll(v0, ra, 0); // sll v0, ra, 0
c->jalr(call_addr); // jalr ra, t9
bc = c->sgpr64(s7) == c->sgpr64(v0); // beq s7, v0, L269
c->mov64(v1, s7); // or v1, s7, r0
if (bc) {goto block_3;} // branch non-likely
c->mov64(v1, s4); // or v1, s4, r0
block_3:
bc = c->sgpr64(s7) == c->sgpr64(v1); // beq s7, v1, L274
c->mov64(v0, s7); // or v0, s7, r0
if (bc) {goto block_12;} // branch non-likely
c->lwu(a0, 48, v1); // lwu a0, 48(v1)
c->mov64(v1, s7); // or v1, s7, r0
c->addiu(a1, r0, 0); // addiu a1, r0, 0
//beq r0, r0, L272 // beq r0, r0, L272
// nop // sll r0, r0, 0
goto block_8; // branch always
block_5:
c->lwu(a2, 64, a0); // lwu a2, 64(a0)
c->dsll(a3, a1, 4); // dsll a3, a1, 4
c->daddu(a2, a2, a3); // daddu a2, a2, a3
c->lwu(a3, 0, gp); // lwu a3, 0(gp)
c->lwu(t0, 0, a2); // lwu t0, 0(a2)
bc = c->sgpr64(t0) != c->sgpr64(a3); // bne t0, a3, L271
c->mov64(a3, s7); // or a3, s7, r0
if (bc) {goto block_7;} // branch non-likely
c->mov64(v1, a2); // or v1, a2, r0
//beq r0, r0, L273 // beq r0, r0, L273
// nop // sll r0, r0, 0
goto block_10; // branch always
block_7:
c->daddiu(a1, a1, 1); // daddiu a1, a1, 1
block_8:
c->lbu(a2, 68, a0); // lbu a2, 68(a0)
c->slt(a2, a1, a2); // slt a2, a1, a2
bc = c->sgpr64(a2) != 0; // bne a2, r0, L270
// nop // sll r0, r0, 0
if (bc) {goto block_5;} // branch non-likely
c->mov64(a1, s7); // or a1, s7, r0
c->mov64(a1, s7); // or a1, s7, r0
block_10:
bc = c->sgpr64(s7) == c->sgpr64(v1); // beq s7, v1, L274
c->mov64(v0, s7); // or v0, s7, r0
if (bc) {goto block_12;} // branch non-likely
c->sw(a0, 12, gp); // sw a0, 12(gp)
c->sw(s5, 12, v1); // sw s5, 12(v1)
c->lbu(a0, 9, v1); // lbu a0, 9(v1)
c->sb(a0, 10, gp); // sb a0, 10(gp)
c->lbu(a0, 8, v1); // lbu a0, 8(v1)
c->sb(a0, 11, gp); // sb a0, 11(gp)
c->lbu(a0, 9, gp); // lbu a0, 9(gp)
c->sb(a0, 10, v1); // sb a0, 10(v1)
c->lbu(a0, 8, gp); // lbu a0, 8(gp)
c->sb(a0, 11, v1); // sb a0, 11(v1)
c->daddiu(v0, s7, 4); // daddiu v0, s7, #t
block_12:
c->ld(ra, 0, sp); // ld ra, 0(sp)
c->lq(gp, 48, sp); // lq gp, 48(sp)
c->lq(s5, 32, sp); // lq s5, 32(sp)
c->lq(s4, 16, sp); // lq s4, 16(sp)
//jr ra // jr ra
c->daddiu(sp, sp, 64); // daddiu sp, sp, 64
goto end_of_function; // return
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
end_of_function:
return c->gprs[v0].du64[0];
}
void link() {
cache.entity_nav_mesh = intern_from_c("entity-nav-mesh").c();
cache.entity_nav_mesh_by_aid = intern_from_c("entity-nav-mesh-by-aid").c();
cache.type = intern_from_c("type?").c();
gLinkedFunctionTable.reg("(method 45 nav-mesh)", execute, 64);
}
} // namespace method_45_nav_mesh
namespace method_20_nav_engine {
u64 execute(void* ctxt) {
auto* c = (ExecutionContext*)ctxt;
bool bc = false;
c->lwu(v1, 8, a0); // lwu v1, 8(a0)
c->lwu(v1, 4, v1); // lwu v1, 4(v1)
c->lwu(a2, 80, a0); // lwu a2, 80(a0)
c->lwu(a2, 4, a2); // lwu a2, 4(a2)
c->dsubu(v1, v1, a2); // dsubu v1, v1, a2
c->addiu(a2, r0, 0); // addiu a2, r0, 0
//beq r0, r0, L178 // beq r0, r0, L178
// nop // sll r0, r0, 0
goto block_6; // branch always
block_1:
c->lwu(a3, 4, a1); // lwu a3, 4(a1)
c->addiu(t0, r0, 288); // addiu t0, r0, 288
c->mult3(t0, t0, a2); // mult3 t0, t0, a2
c->daddu(a3, a3, t0); // daddu a3, a3, t0
c->daddiu(t0, a3, 112); // daddiu t0, a3, 112
c->lwu(t1, 8, a3); // lwu t1, 8(a3)
bc = c->sgpr64(s7) == c->sgpr64(t1); // beq s7, t1, L177
c->mov64(t1, s7); // or t1, s7, r0
if (bc) {goto block_5;} // branch non-likely
c->addiu(t1, r0, -257); // addiu t1, r0, -257
c->lwu(t2, 0, a3); // lwu t2, 0(a3)
c->and_(t1, t1, t2); // and t1, t1, t2
c->sw(t1, 0, a3); // sw t1, 0(a3)
c->lwu(t1, 8, a3); // lwu t1, 8(a3)
c->lwu(t1, 4, t1); // lwu t1, 4(t1)
c->andi(t1, t1, 2048); // andi t1, t1, 2048
bc = c->sgpr64(t1) == 0; // beq t1, r0, L176
c->mov64(t1, s7); // or t1, s7, r0
if (bc) {goto block_4;} // branch non-likely
c->lwu(t1, 0, a3); // lwu t1, 0(a3)
c->ori(t1, t1, 256); // ori t1, t1, 256
c->sw(t1, 0, a3); // sw t1, 0(a3)
block_4:
c->lwu(t1, 4, a0); // lwu t1, 4(a0)
c->daddiu(t1, t1, 32); // daddiu t1, t1, 32
c->sw(t1, 56, a3); // sw t1, 56(a3)
c->lwu(t1, 8, a0); // lwu t1, 8(a0)
c->sw(t1, 124, a3); // sw t1, 124(a3)
c->mov64(t1, v1); // or t1, v1, r0
c->lw(t2, 16, t0); // lw t2, 16(t0)
c->daddu(t3, t2, t1); // daddu t3, t2, t1
c->xor_(t4, t2, s7); // xor t4, t2, s7
c->slti(t4, t4, 1); // Unknown instr: sltiu t4, t4, 1
c->movz(t2, t3, t4); // movz t2, t3, t4
c->sw(t2, 16, t0); // sw t2, 16(t0)
c->lw(t2, 28, t0); // lw t2, 28(t0)
c->daddu(t3, t2, t1); // daddu t3, t2, t1
c->xor_(t4, t2, s7); // xor t4, t2, s7
c->slti(t4, t4, 1); // Unknown instr: sltiu t4, t4, 1
c->movz(t2, t3, t4); // movz t2, t3, t4
c->sw(t2, 28, t0); // sw t2, 28(t0)
c->lw(t2, 24, t0); // lw t2, 24(t0)
c->daddu(t3, t2, t1); // daddu t3, t2, t1
c->xor_(t4, t2, s7); // xor t4, t2, s7
c->slti(t4, t4, 1); // Unknown instr: sltiu t4, t4, 1
c->movz(t2, t3, t4); // movz t2, t3, t4
c->sw(t2, 24, t0); // sw t2, 24(t0)
c->lw(t2, 20, t0); // lw t2, 20(t0)
c->daddu(t1, t2, t1); // daddu t1, t2, t1
c->xor_(t3, t2, s7); // xor t3, t2, s7
c->slti(t3, t3, 1); // Unknown instr: sltiu t3, t3, 1
c->movz(t2, t1, t3); // movz t2, t1, t3
c->sw(t2, 20, t0); // sw t2, 20(t0)
c->gprs[t0].du64[0] = 0; // or t0, r0, r0
c->lwu(a3, 8, a3); // lwu a3, 8(a3)
c->sw(s7, 140, a3); // sw s7, 140(a3)
c->mov64(t1, s7); // or t1, s7, r0
block_5:
c->daddiu(a2, a2, 1); // daddiu a2, a2, 1
block_6:
c->lb(a3, 14, a1); // lb a3, 14(a1)
c->slt(a3, a2, a3); // slt a3, a2, a3
bc = c->sgpr64(a3) != 0; // bne a3, r0, L175
// nop // sll r0, r0, 0
if (bc) {goto block_1;} // branch non-likely
c->mov64(v1, s7); // or v1, s7, r0
c->mov64(v1, s7); // or v1, s7, r0
c->gprs[v0].du64[0] = 0; // or v0, r0, r0
//jr ra // jr ra
c->daddu(sp, sp, r0); // daddu sp, sp, r0
goto end_of_function; // return
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
end_of_function:
return c->gprs[v0].du64[0];
}
void link() {
gLinkedFunctionTable.reg("(method 20 nav-engine)", execute, 0);
}
} // namespace method_20_nav_engine
namespace method_43_nav_mesh {
struct Cache {
void* point_poly_distance_min; // point-poly-distance-min
} cache;
u64 execute(void* ctxt) {
auto* c = (ExecutionContext*)ctxt;
bool bc = false;
u32 call_addr = 0;
bool cop1_bc = false;
c->daddiu(sp, sp, -176); // daddiu sp, sp, -176
c->sd(ra, 0, sp); // sd ra, 0(sp)
c->sq(s0, 64, sp); // sq s0, 64(sp)
c->sq(s1, 80, sp); // sq s1, 80(sp)
c->sq(s2, 96, sp); // sq s2, 96(sp)
c->sq(s3, 112, sp); // sq s3, 112(sp)
c->sq(s4, 128, sp); // sq s4, 128(sp)
c->sq(s5, 144, sp); // sq s5, 144(sp)
c->sq(gp, 160, sp); // sq gp, 160(sp)
c->mov64(s5, a0); // or s5, a0, r0
c->mov64(gp, a1); // or gp, a1, r0
c->sw(s7, 16, sp); // sw s7, 16(sp)
c->lwu(a0, 16, s5); // lwu a0, 16(s5)
c->lwu(v1, -4, a0); // lwu v1, -4(a0)
c->lwu(t9, 68, v1); // lwu t9, 68(v1)
c->daddu(a1, r0, gp); // daddu a1, r0, gp
c->lui(a2, 17984); // lui a2, 17984
call_addr = c->gprs[t9].du32[0]; // function call:
c->sll(v0, ra, 0); // sll v0, ra, 0
c->jalr(call_addr); // jalr ra, t9
c->mov64(v1, v0); // or v1, v0, r0
c->sw(v1, 20, sp); // sw v1, 20(sp)
c->sw(s7, 32, gp); // sw s7, 32(gp)
c->lwu(v1, 16, s5); // lwu v1, 16(s5)
c->lh(s4, 10, v1); // lh s4, 10(v1)
c->lwu(s3, 20, sp); // lwu s3, 20(sp)
c->gprs[s2].du64[0] = 0; // or s2, r0, r0
// nop // sll r0, r0, 0
block_1:
c->dsll(s1, s2, 3); // dsll s1, s2, 3
c->lbu(s0, 0, s3); // lbu s0, 0(s3)
bc = c->sgpr64(s0) == 0; // beq s0, r0, L100
// nop // sll r0, r0, 0
if (bc) {goto block_17;} // branch non-likely
block_2:
c->andi(v1, s0, 1); // andi v1, s0, 1
// nop // sll r0, r0, 0
bc = c->sgpr64(v1) == 0; // beq v1, r0, L99
// nop // sll r0, r0, 0
if (bc) {goto block_16;} // branch non-likely
c->lwu(v1, 4, s5); // lwu v1, 4(s5)
c->dsll(a0, s1, 6); // dsll a0, s1, 6
c->daddu(v1, v1, a0); // daddu v1, v1, a0
c->sw(v1, 24, sp); // sw v1, 24(sp)
c->lwu(v1, 24, sp); // lwu v1, 24(sp)
c->lwc1(f0, 4, gp); // lwc1 f0, 4(gp)
c->lwc1(f1, 16, gp); // lwc1 f1, 16(gp)
c->lwc1(f2, 60, v1); // lwc1 f2, 60(v1)
c->adds(f2, f2, f1); // add.s f2, f2, f1
cop1_bc = c->fprs[f2] < c->fprs[f0]; // c.lt.s f2, f0
bc = !cop1_bc; // bc1f L96
c->daddiu(a0, s7, 4); // daddiu a0, s7, 4
if (bc) {goto block_5;} // branch non-likely
c->mov64(a0, s7); // or a0, s7, r0
block_5:
if (((s64)c->sgpr64(s7)) == ((s64)c->sgpr64(a0))) {// beql s7, a0, L97
c->mov64(v1, a0); // or v1, a0, r0
goto block_9;
}
c->lwc1(f2, 44, v1); // lwc1 f2, 44(v1)
c->subs(f1, f2, f1); // sub.s f1, f2, f1
cop1_bc = c->fprs[f0] < c->fprs[f1]; // c.lt.s f0, f1
bc = !cop1_bc; // bc1f L97
c->daddiu(v1, s7, 4); // daddiu v1, s7, 4
if (bc) {goto block_9;} // branch non-likely
c->mov64(v1, s7); // or v1, s7, r0
block_9:
if (((s64)c->sgpr64(s7)) == ((s64)c->sgpr64(v1))) {// beql s7, v1, L98
c->mov64(v1, v1); // or v1, v1, r0
goto block_12;
}
c->daddiu(v1, s7, 4); // daddiu v1, s7, 4
c->lwu(a0, 24, sp); // lwu a0, 24(sp)
c->lbu(a0, 13, a0); // lbu a0, 13(a0)
c->lbu(a1, 20, gp); // lbu a1, 20(gp)
c->and_(a0, a0, a1); // and a0, a0, a1
c->movn(v1, s7, a0); // movn v1, s7, a0
block_12:
bc = c->sgpr64(s7) == c->sgpr64(v1); // beq s7, v1, L99
c->mov64(v1, s7); // or v1, s7, r0
if (bc) {goto block_16;} // branch non-likely
c->mov64(a0, s5); // or a0, s5, r0
c->lwu(v1, -4, a0); // lwu v1, -4(a0)
c->lwu(t9, 164, v1); // lwu t9, 164(v1)
c->lwu(a1, 24, sp); // lwu a1, 24(sp)
c->daddu(a2, r0, gp); // daddu a2, r0, gp
call_addr = c->gprs[t9].du32[0]; // function call:
c->sll(v0, ra, 0); // sll v0, ra, 0
c->jalr(call_addr); // jalr ra, t9
c->mov64(v1, v0); // or v1, v0, r0
bc = c->sgpr64(s7) == c->sgpr64(v1); // beq s7, v1, L99
c->mov64(v1, s7); // or v1, s7, r0
if (bc) {goto block_16;} // branch non-likely
c->daddiu(v1, s7, 4); // daddiu v1, s7, #t
c->sw(v1, 32, gp); // sw v1, 32(gp)
c->mtc1(f0, r0); // mtc1 f0, r0
c->swc1(f0, 28, gp); // swc1 f0, 28(gp)
c->lwu(v1, 24, sp); // lwu v1, 24(sp)
c->sw(v1, 16, sp); // sw v1, 16(sp)
//beq r0, r0, L109 // beq r0, r0, L109
// nop // sll r0, r0, 0
goto block_38; // branch always
// nop // sll r0, r0, 0
block_16:
c->dsra(s0, s0, 1); // dsra s0, s0, 1
// nop // sll r0, r0, 0
bc = c->sgpr64(s0) != 0; // bne s0, r0, L95
c->daddiu(s1, s1, 1); // daddiu s1, s1, 1
if (bc) {goto block_2;} // branch non-likely
block_17:
c->daddiu(s2, s2, 1); // daddiu s2, s2, 1
c->daddiu(s3, s3, 1); // daddiu s3, s3, 1
c->slt(v1, s2, s4); // slt v1, s2, s4
// nop // sll r0, r0, 0
bc = c->sgpr64(v1) != 0; // bne v1, r0, L94
// nop // sll r0, r0, 0
if (bc) {goto block_1;} // branch non-likely
c->lui(v1, 31984); // lui v1, 31984
c->ori(v1, v1, 48578); // ori v1, v1, 48578
c->mtc1(f0, v1); // mtc1 f0, v1
c->swc1(f0, 28, sp); // swc1 f0, 28(sp)
c->sd(r0, 32, sp); // sd r0, 32(sp)
c->sd(r0, 40, sp); // sd r0, 40(sp)
c->lwu(v1, 16, s5); // lwu v1, 16(s5)
c->lh(s4, 10, v1); // lh s4, 10(v1)
c->lwu(s3, 20, sp); // lwu s3, 20(sp)
c->gprs[s2].du64[0] = 0; // or s2, r0, r0
block_19:
c->dsll(s1, s2, 3); // dsll s1, s2, 3
c->lbu(s0, 0, s3); // lbu s0, 0(s3)
bc = c->sgpr64(s0) == 0; // beq s0, r0, L107
// nop // sll r0, r0, 0
if (bc) {goto block_34;} // branch non-likely
block_20:
c->andi(v1, s0, 1); // andi v1, s0, 1
// nop // sll r0, r0, 0
bc = c->sgpr64(v1) == 0; // beq v1, r0, L106
// nop // sll r0, r0, 0
if (bc) {goto block_33;} // branch non-likely
c->lwu(v1, 4, s5); // lwu v1, 4(s5)
c->dsll(a0, s1, 6); // dsll a0, s1, 6
c->daddu(v1, v1, a0); // daddu v1, v1, a0
c->sw(v1, 48, sp); // sw v1, 48(sp)
c->lwu(v1, 48, sp); // lwu v1, 48(sp)
c->lwc1(f0, 4, gp); // lwc1 f0, 4(gp)
c->lwc1(f1, 16, gp); // lwc1 f1, 16(gp)
c->lwc1(f2, 60, v1); // lwc1 f2, 60(v1)
c->adds(f2, f2, f1); // add.s f2, f2, f1
cop1_bc = c->fprs[f2] < c->fprs[f0]; // c.lt.s f2, f0
bc = !cop1_bc; // bc1f L103
c->daddiu(a0, s7, 4); // daddiu a0, s7, 4
if (bc) {goto block_23;} // branch non-likely
c->mov64(a0, s7); // or a0, s7, r0
block_23:
if (((s64)c->sgpr64(s7)) == ((s64)c->sgpr64(a0))) {// beql s7, a0, L104
c->mov64(v1, a0); // or v1, a0, r0
goto block_27;
}
c->lwc1(f2, 44, v1); // lwc1 f2, 44(v1)
c->subs(f1, f2, f1); // sub.s f1, f2, f1
cop1_bc = c->fprs[f0] < c->fprs[f1]; // c.lt.s f0, f1
bc = !cop1_bc; // bc1f L104
c->daddiu(v1, s7, 4); // daddiu v1, s7, 4
if (bc) {goto block_27;} // branch non-likely
c->mov64(v1, s7); // or v1, s7, r0
block_27:
if (((s64)c->sgpr64(s7)) == ((s64)c->sgpr64(v1))) {// beql s7, v1, L105
c->mov64(v1, v1); // or v1, v1, r0
goto block_30;
}
c->daddiu(v1, s7, 4); // daddiu v1, s7, 4
c->lwu(a0, 48, sp); // lwu a0, 48(sp)
c->lbu(a0, 13, a0); // lbu a0, 13(a0)
c->lbu(a1, 20, gp); // lbu a1, 20(gp)
c->and_(a0, a0, a1); // and a0, a0, a1
c->movn(v1, s7, a0); // movn v1, s7, a0
block_30:
bc = c->sgpr64(s7) == c->sgpr64(v1); // beq s7, v1, L106
c->mov64(v1, s7); // or v1, s7, r0
if (bc) {goto block_33;} // branch non-likely
c->ld(v1, 40, sp); // ld v1, 40(sp)
c->daddiu(v1, v1, 1); // daddiu v1, v1, 1
c->sd(v1, 40, sp); // sd v1, 40(sp)
c->load_symbol2(t9, cache.point_poly_distance_min);// lw t9, point-poly-distance-min(s7)
c->lwu(a0, 0, s5); // lwu a0, 0(s5)
c->daddu(a1, r0, gp); // daddu a1, r0, gp
c->lw(a2, 28, sp); // lw a2, 28(sp)
c->lwu(a3, 48, sp); // lwu a3, 48(sp)
call_addr = c->gprs[t9].du32[0]; // function call:
c->sll(v0, ra, 0); // sll v0, ra, 0
c->jalr(call_addr); // jalr ra, t9
c->mtc1(f0, v0); // mtc1 f0, v0
c->swc1(f0, 52, sp); // swc1 f0, 52(sp)
c->lw(v1, 52, sp); // lw v1, 52(sp)
c->mtc1(f0, v1); // mtc1 f0, v1
c->lw(v1, 28, sp); // lw v1, 28(sp)
c->mtc1(f1, v1); // mtc1 f1, v1
cop1_bc = c->fprs[f0] < c->fprs[f1]; // c.lt.s f0, f1
bc = !cop1_bc; // bc1f L106
c->mov64(v1, s7); // or v1, s7, r0
if (bc) {goto block_33;} // branch non-likely
c->lw(v1, 52, sp); // lw v1, 52(sp)
c->mtc1(f0, v1); // mtc1 f0, v1
c->swc1(f0, 28, sp); // swc1 f0, 28(sp)
c->lwu(v1, 48, sp); // lwu v1, 48(sp)
c->sw(v1, 16, sp); // sw v1, 16(sp)
// nop // sll r0, r0, 0
block_33:
c->dsra(s0, s0, 1); // dsra s0, s0, 1
// nop // sll r0, r0, 0
bc = c->sgpr64(s0) != 0; // bne s0, r0, L102
c->daddiu(s1, s1, 1); // daddiu s1, s1, 1
if (bc) {goto block_20;} // branch non-likely
block_34:
c->daddiu(s2, s2, 1); // daddiu s2, s2, 1
c->daddiu(s3, s3, 1); // daddiu s3, s3, 1
c->slt(v1, s2, s4); // slt v1, s2, s4
// nop // sll r0, r0, 0
bc = c->sgpr64(v1) != 0; // bne v1, r0, L101
// nop // sll r0, r0, 0
if (bc) {goto block_19;} // branch non-likely
c->lwu(v1, 16, sp); // lwu v1, 16(sp)
bc = c->sgpr64(s7) != c->sgpr64(v1); // bne s7, v1, L108
c->mov64(v1, s7); // or v1, s7, r0
if (bc) {goto block_37;} // branch non-likely
c->lwu(v1, 4, s5); // lwu v1, 4(s5)
c->daddu(v1, r0, v1); // daddu v1, r0, v1
c->sw(v1, 16, sp); // sw v1, 16(sp)
block_37:
c->lw(v1, 28, sp); // lw v1, 28(sp)
c->mtc1(f0, v1); // mtc1 f0, v1
c->swc1(f0, 28, gp); // swc1 f0, 28(gp)
c->mfc1(v1, f0); // mfc1 v1, f0
block_38:
c->lwu(v1, 16, sp); // lwu v1, 16(sp)
c->sw(v1, 24, gp); // sw v1, 24(gp)
c->mov64(v0, gp); // or v0, gp, r0
c->ld(ra, 0, sp); // ld ra, 0(sp)
c->lq(gp, 160, sp); // lq gp, 160(sp)
c->lq(s5, 144, sp); // lq s5, 144(sp)
c->lq(s4, 128, sp); // lq s4, 128(sp)
c->lq(s3, 112, sp); // lq s3, 112(sp)
c->lq(s2, 96, sp); // lq s2, 96(sp)
c->lq(s1, 80, sp); // lq s1, 80(sp)
c->lq(s0, 64, sp); // lq s0, 64(sp)
//jr ra // jr ra
c->daddiu(sp, sp, 176); // daddiu sp, sp, 176
goto end_of_function; // return
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
end_of_function:
return c->gprs[v0].du64[0];
}
void link() {
cache.point_poly_distance_min = intern_from_c("point-poly-distance-min").c();
gLinkedFunctionTable.reg("(method 43 nav-mesh)", execute, 176);
}
} // namespace method_43_nav_mesh
namespace nav_dma_send_to_spr_no_flush {
struct Cache {
void* fake_scratchpad_data; // *fake-scratchpad-data*
} cache;
u64 execute(void* ctxt) {
auto* c = (ExecutionContext*)ctxt;
c->lui(v1, 4096); // lui v1, 4096
c->ori(v1, v1, 54272); // ori v1, v1, 54272
c->addiu(a3, r0, 0); // addiu a3, r0, 0
/*
block_1:
c->lw(a3, 0, v1); // lw a3, 0(v1)
c->andi(a3, a3, 256); // andi a3, a3, 256
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
bc = c->sgpr64(a3) != 0; // bne a3, r0, L194
// nop // sll r0, r0, 0
if (bc) {goto block_1;} // branch non-likely
*/
// Unknown instr: sync.l
c->lui(a3, 4095); // lui a3, 4095
c->ori(a3, a3, 65535); // ori a3, a3, 65535
c->and_(a1, a3, a1); // and a1, a3, a1
// c->sw(a1, 16, v1); // sw a1, 16(v1)
u32 madr = c->sgpr64(a1);
c->lui(a1, 4095); // lui a1, 4095
c->ori(a1, a1, 65535); // ori a1, a1, 65535
c->and_(a0, a1, a0); // and a0, a1, a0
// c->sw(a0, 128, v1); // sw a0, 128(v1)
u32 sadr = c->sgpr64(a0);
// c->sw(a2, 32, v1); // sw a2, 32(v1)
u32 qwc = c->sgpr64(a2);
// Unknown instr: sync.l
c->addiu(a0, r0, 256); // addiu a0, r0, 256
// c->sw(a0, 0, v1); // sw a0, 0(v1)
spad_to_dma(cache.fake_scratchpad_data, madr, sadr, qwc);
// Unknown instr: sync.l
c->gprs[v0].du64[0] = 0; // or v0, r0, r0
//jr ra // jr ra
c->daddu(sp, sp, r0); // daddu sp, sp, r0
goto end_of_function; // return
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
end_of_function:
return c->gprs[v0].du64[0];
}
void link() {
cache.fake_scratchpad_data = intern_from_c("*fake-scratchpad-data*").c();
gLinkedFunctionTable.reg("nav-dma-send-to-spr-no-flush", execute, 0);
}
} // namespace nav_dma_send_to_spr_no_flush
namespace nav_dma_send_from_spr_no_flush {
struct Cache {
void* fake_scratchpad_data; // *fake-scratchpad-data*
} cache;
u64 execute(void* ctxt) {
auto* c = (ExecutionContext*)ctxt;
c->lui(v1, 4096); // lui v1, 4096
c->ori(v1, v1, 53248); // ori v1, v1, 53248
c->addiu(a3, r0, 0); // addiu a3, r0, 0
/*
block_1:
c->lw(a3, 0, v1); // lw a3, 0(v1)
c->andi(a3, a3, 256); // andi a3, a3, 256
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
bc = c->sgpr64(a3) != 0; // bne a3, r0, L192
// nop // sll r0, r0, 0
if (bc) {goto block_1;} // branch non-likely
*/
// Unknown instr: sync.l
c->lui(a3, 4095); // lui a3, 4095
c->ori(a3, a3, 65535); // ori a3, a3, 65535
c->and_(a0, a3, a0); // and a0, a3, a0
//c->sw(a0, 16, v1); // sw a0, 16(v1)
u32 madr = c->sgpr64(a0);
c->lui(a0, 4095); // lui a0, 4095
c->ori(a0, a0, 65535); // ori a0, a0, 65535
c->and_(a0, a0, a1); // and a0, a0, a1
// c->sw(a0, 128, v1); // sw a0, 128(v1)
u32 sadr = c->sgpr64(a0);
// c->sw(a2, 32, v1); // sw a2, 32(v1)
u32 qwc = c->sgpr64(a2);
// Unknown instr: sync.l
c->addiu(a0, r0, 256); // addiu a0, r0, 256
// c->sw(a0, 0, v1); // sw a0, 0(v1)
spad_from_dma(cache.fake_scratchpad_data, madr, sadr, qwc);
// Unknown instr: sync.l
c->gprs[v0].du64[0] = 0; // or v0, r0, r0
//jr ra // jr ra
c->daddu(sp, sp, r0); // daddu sp, sp, r0
goto end_of_function; // return
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
end_of_function:
return c->gprs[v0].du64[0];
}
void link() {
cache.fake_scratchpad_data = intern_from_c("*fake-scratchpad-data*").c();
gLinkedFunctionTable.reg("nav-dma-send-from-spr-no-flush", execute, 0);
}
} // namespace nav_dma_send_from_spr_no_flush
namespace method_17_nav_engine {
struct Cache {
void* fake_scratchpad_data; // *fake-scratchpad-data*
} cache;
u64 execute(void* ctxt) {
auto* c = (ExecutionContext*)ctxt;
c->lwu(v1, 4, a1); // lwu v1, 4(a1)
c->lwu(a2, 0, a1); // lwu a2, 0(a1)
c->lwu(a0, 8, a1); // lwu a0, 8(a1)
c->lui(a1, 4096); // lui a1, 4096
c->ori(a1, a1, 54272); // ori a1, a1, 54272
c->addiu(a3, r0, 0); // addiu a3, r0, 0
//block_1:
// c->lw(a3, 0, a1); // lw a3, 0(a1)
// c->andi(a3, a3, 256); // andi a3, a3, 256
// // nop // sll r0, r0, 0
// // nop // sll r0, r0, 0
// // nop // sll r0, r0, 0
// // nop // sll r0, r0, 0
// bc = c->sgpr64(a3) != 0; // bne a3, r0, L188
// // nop // sll r0, r0, 0
// if (bc) {goto block_1;} // branch non-likely
// Unknown instr: sync.l
c->lui(a3, 4095); // lui a3, 4095
c->ori(a3, a3, 65535); // ori a3, a3, 65535
c->and_(a2, a3, a2); // and a2, a3, a2
// c->sw(a2, 16, a1); // sw a2, 16(a1)
u32 madr = c->sgpr64(a2);
c->lui(a2, 4095); // lui a2, 4095
c->ori(a2, a2, 65535); // ori a2, a2, 65535
c->and_(v1, a2, v1); // and v1, a2, v1
// c->sw(v1, 128, a1); // sw v1, 128(a1)
u32 sadr = c->sgpr64(v1);
// c->sw(a0, 32, a1); // sw a0, 32(a1)
u32 qwc = c->sgpr64(a0);
// Unknown instr: sync.l
c->addiu(v1, r0, 256); // addiu v1, r0, 256
// c->sw(v1, 0, a1); // sw v1, 0(a1)
spad_to_dma(cache.fake_scratchpad_data, madr, sadr, qwc);
// Unknown instr: sync.l
c->gprs[v1].du64[0] = 0; // or v1, r0, r0
c->gprs[v0].du64[0] = 0; // or v0, r0, r0
//jr ra // jr ra
c->daddu(sp, sp, r0); // daddu sp, sp, r0
goto end_of_function; // return
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
end_of_function:
return c->gprs[v0].du64[0];
}
void link() {
gLinkedFunctionTable.reg("(method 17 nav-engine)", execute, 0);
cache.fake_scratchpad_data = intern_from_c("*fake-scratchpad-data*").c();
}
} // namespace method_17_nav_engine
namespace method_18_nav_engine {
struct Cache {
void* fake_scratchpad_data; // *fake-scratchpad-data*
} cache;
u64 execute(void* ctxt) {
auto* c = (ExecutionContext*)ctxt;
c->lwu(a2, 0, a1); // lwu a2, 0(a1)
c->lwu(v1, 4, a1); // lwu v1, 4(a1)
c->lwu(a0, 8, a1); // lwu a0, 8(a1)
c->lui(a1, 4096); // lui a1, 4096
c->ori(a1, a1, 53248); // ori a1, a1, 53248
c->addiu(a3, r0, 0); // addiu a3, r0, 0
//block_1:
// c->lw(a3, 0, a1); // lw a3, 0(a1)
// c->andi(a3, a3, 256); // andi a3, a3, 256
// // nop // sll r0, r0, 0
// // nop // sll r0, r0, 0
// // nop // sll r0, r0, 0
// // nop // sll r0, r0, 0
// bc = c->sgpr64(a3) != 0; // bne a3, r0, L186
// // nop // sll r0, r0, 0
// if (bc) {goto block_1;} // branch non-likely
// Unknown instr: sync.l
c->lui(a3, 4095); // lui a3, 4095
c->ori(a3, a3, 65535); // ori a3, a3, 65535
c->and_(a2, a3, a2); // and a2, a3, a2
// c->sw(a2, 16, a1); // sw a2, 16(a1)
u32 madr = c->sgpr64(a2);
c->lui(a2, 4095); // lui a2, 4095
c->ori(a2, a2, 65535); // ori a2, a2, 65535
c->and_(v1, a2, v1); // and v1, a2, v1
// c->sw(v1, 128, a1); // sw v1, 128(a1)
u32 sadr = c->sgpr64(v1);
// c->sw(a0, 32, a1); // sw a0, 32(a1)
u32 qwc = c->sgpr64(a0);
// Unknown instr: sync.l
c->addiu(v1, r0, 256); // addiu v1, r0, 256
// c->sw(v1, 0, a1); // sw v1, 0(a1)
spad_from_dma(cache.fake_scratchpad_data, madr, sadr, qwc);
// Unknown instr: sync.l
c->gprs[v1].du64[0] = 0; // or v1, r0, r0
c->gprs[v0].du64[0] = 0; // or v0, r0, r0
//jr ra // jr ra
c->daddu(sp, sp, r0); // daddu sp, sp, r0
goto end_of_function; // return
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
end_of_function:
return c->gprs[v0].du64[0];
}
void link() {
gLinkedFunctionTable.reg("(method 18 nav-engine)", execute, 0);
cache.fake_scratchpad_data = intern_from_c("*fake-scratchpad-data*").c();
}
} // namespace method_18_nav_engine
namespace method_21_nav_engine {
u64 execute(void* ctxt) {
auto* c = (ExecutionContext*)ctxt;
bool bc = false;
c->lwu(v1, 80, a0); // lwu v1, 80(a0)
c->lwu(v1, 4, v1); // lwu v1, 4(v1)
c->lwu(a2, 8, a0); // lwu a2, 8(a0)
c->lwu(a2, 4, a2); // lwu a2, 4(a2)
c->dsubu(v1, v1, a2); // dsubu v1, v1, a2
c->addiu(a2, r0, 0); // addiu a2, r0, 0
//beq r0, r0, L173 // beq r0, r0, L173
// nop // sll r0, r0, 0
goto block_4; // branch always
block_1:
c->lwu(a3, 4, a1); // lwu a3, 4(a1)
c->addiu(t0, r0, 288); // addiu t0, r0, 288
c->mult3(t0, t0, a2); // mult3 t0, t0, a2
c->daddu(a3, a3, t0); // daddu a3, a3, t0
c->daddiu(t0, a3, 112); // daddiu t0, a3, 112
c->lwu(t1, 8, a3); // lwu t1, 8(a3)
bc = c->sgpr64(s7) == c->sgpr64(t1); // beq s7, t1, L172
c->mov64(t1, s7); // or t1, s7, r0
if (bc) {goto block_3;} // branch non-likely
c->lwu(t1, 76, a0); // lwu t1, 76(a0)
c->daddiu(t1, t1, 32); // daddiu t1, t1, 32
c->sw(t1, 56, a3); // sw t1, 56(a3)
c->lwu(t1, 80, a0); // lwu t1, 80(a0)
c->sw(t1, 124, a3); // sw t1, 124(a3)
c->lwu(t1, 0, a1); // lwu t1, 0(a1)
c->addiu(t2, r0, 288); // addiu t2, r0, 288
c->mult3(t2, t2, a2); // mult3 t2, t2, a2
c->daddu(t1, t1, t2); // daddu t1, t1, t2
c->sw(t1, 4, t0); // sw t1, 4(t0)
c->mov64(t1, v1); // or t1, v1, r0
c->lw(t2, 16, t0); // lw t2, 16(t0)
c->daddu(t3, t2, t1); // daddu t3, t2, t1
c->xor_(t4, t2, s7); // xor t4, t2, s7
c->sltiu(t4, t4, 1); // Unknown instr: sltiu t4, t4, 1
c->movz(t2, t3, t4); // movz t2, t3, t4
c->sw(t2, 16, t0); // sw t2, 16(t0)
c->lw(t2, 28, t0); // lw t2, 28(t0)
c->daddu(t3, t2, t1); // daddu t3, t2, t1
c->xor_(t4, t2, s7); // xor t4, t2, s7
c->sltiu(t4, t4, 1); // Unknown instr: sltiu t4, t4, 1
c->movz(t2, t3, t4); // movz t2, t3, t4
c->sw(t2, 28, t0); // sw t2, 28(t0)
c->lw(t2, 24, t0); // lw t2, 24(t0)
c->daddu(t3, t2, t1); // daddu t3, t2, t1
c->xor_(t4, t2, s7); // xor t4, t2, s7
c->sltiu(t4, t4, 1); // Unknown instr: sltiu t4, t4, 1
c->movz(t2, t3, t4); // movz t2, t3, t4
c->sw(t2, 24, t0); // sw t2, 24(t0)
c->lw(t2, 20, t0); // lw t2, 20(t0)
c->daddu(t1, t2, t1); // daddu t1, t2, t1
c->xor_(t3, t2, s7); // xor t3, t2, s7
c->sltiu(t3, t3, 1); // Unknown instr: sltiu t3, t3, 1
c->movz(t2, t1, t3); // movz t2, t1, t3
c->sw(t2, 20, t0); // sw t2, 20(t0)
c->gprs[t0].du64[0] = 0; // or t0, r0, r0
c->lwu(t0, 0, a1); // lwu t0, 0(a1)
c->addiu(t1, r0, 288); // addiu t1, r0, 288
c->mult3(t1, t1, a2); // mult3 t1, t1, a2
c->daddu(t1, t0, t1); // daddu t1, t0, t1
c->lwu(a3, 8, a3); // lwu a3, 8(a3)
c->sw(t1, 140, a3); // sw t1, 140(a3)
block_3:
c->daddiu(a2, a2, 1); // daddiu a2, a2, 1
block_4:
c->lb(a3, 14, a1); // lb a3, 14(a1)
c->slt(a3, a2, a3); // slt a3, a2, a3
bc = c->sgpr64(a3) != 0; // bne a3, r0, L171
// nop // sll r0, r0, 0
if (bc) {goto block_1;} // branch non-likely
c->mov64(v1, s7); // or v1, s7, r0
c->mov64(v1, s7); // or v1, s7, r0
c->gprs[v0].du64[0] = 0; // or v0, r0, r0
//jr ra // jr ra
c->daddu(sp, sp, r0); // daddu sp, sp, r0
goto end_of_function; // return
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
end_of_function:
return c->gprs[v0].du64[0];
}
void link() {
gLinkedFunctionTable.reg("(method 21 nav-engine)", execute, 0);
}
} // namespace method_21_nav_engine
} // namespace Mips2C
+1 -1
View File
@@ -1597,7 +1597,7 @@ inline void spad_to_dma_no_sadr_off_bones_interleave(void* spad_sym_addr,
inline void spad_from_dma(void* spad_sym_addr, u32 madr, u32 sadr, u32 qwc) {
u32 spad_addr_goal;
memcpy(&spad_addr_goal, spad_sym_addr, 4);
memcpy(&spad_addr_goal, align4_ptr(spad_sym_addr), 4);
sadr -= spad_addr_goal;
ASSERT((madr & 0xf) == 0);
ASSERT((sadr & 0xf) == 0);
+77 -64
View File
@@ -199,6 +199,17 @@ namespace add_light_sphere_to_light_group { extern void link(); }
namespace light_hash_add_items { extern void link(); }
namespace light_hash_count_items { extern void link(); }
namespace light_hash_get_bucket_index { extern void link(); }
namespace nav_state_patch_pointers { extern void link(); }
namespace method_45_nav_mesh { extern void link(); }
namespace method_20_nav_engine { extern void link(); }
namespace method_43_nav_mesh { extern void link(); }
namespace nav_dma_send_to_spr_no_flush { extern void link(); }
namespace nav_dma_send_from_spr_no_flush { extern void link(); }
namespace method_17_nav_engine { extern void link(); }
namespace method_39_nav_state { extern void link(); }
namespace method_17_nav_engine { extern void link(); }
namespace method_18_nav_engine { extern void link(); }
namespace method_21_nav_engine { extern void link(); }
}
// clang-format on
@@ -275,69 +286,71 @@ PerGameVersion<std::unordered_map<std::string, std::vector<void (*)()>>> gMips2C
jak1::draw_inline_array_prototype_tie_generic_asm::link}},
{"generic-tie", {jak1::generic_tie_dma_to_spad_sync::link, jak1::generic_tie_convert::link}}},
/////////// JAK 2
{
{"collide-func",
{jak2::collide_do_primitives::link, jak2::moving_sphere_triangle_intersect::link}},
{"joint",
{jak2::calc_animation_from_spr::link, jak2::cspace_parented_transformq_joint::link}},
{"font",
{jak2::draw_string::link, jak2::get_string_length::link, jak2::draw_string_asm::link}},
{"texture", {jak2::adgif_shader_texture_with_update::link}},
{"debug",
{jak2::debug_line_clip::link, jak2::init_boundary_regs::link,
jak2::render_boundary_quad::link, jak2::render_boundary_tri::link,
jak2::set_sky_vf27::link, jak2::draw_boundary_polygon::link}},
{"sparticle-launcher",
{jak2::sp_init_fields::link, jak2::particle_adgif::link,
jak2::sp_launch_particles_var::link, jak2::sparticle_motion_blur::link}},
{"sparticle", {jak2::sp_process_block_2d::link, jak2::sp_process_block_3d::link}},
{"sky-tng",
{jak2::set_tex_offset::link, jak2::draw_large_polygon::link, jak2::render_sky_quad::link,
jak2::render_sky_tri::link, jak2::method_16_sky_work::link,
jak2::method_17_sky_work::link, jak2::method_32_sky_work::link,
jak2::method_33_sky_work::link, jak2::method_28_sky_work::link,
jak2::method_29_sky_work::link, jak2::method_30_sky_work::link,
jak2::set_sky_vf23_value::link}},
{"collide-hash",
{jak2::method_11_collide_hash::link, jak2::method_12_collide_hash::link,
jak2::fill_bg_using_box_new::link, jak2::fill_bg_using_line_sphere_new::link}},
{"collide-mesh",
{jak2::method_12_collide_mesh::link, jak2::method_14_collide_mesh::link,
jak2::method_15_collide_mesh::link}},
{"collide-edge-grab",
{jak2::method_10_collide_edge_hold_list::link, jak2::method_19_collide_edge_work::link,
jak2::method_9_edge_grab_info::link, jak2::method_16_collide_edge_work::link,
jak2::method_17_collide_edge_work::link, jak2::method_18_collide_edge_work::link}},
{"ocean-vu0",
{jak2::method_16_ocean::link, jak2::method_15_ocean::link, jak2::method_14_ocean::link}},
{"ocean",
{jak2::init_ocean_far_regs::link, jak2::draw_large_polygon_ocean::link,
jak2::render_ocean_quad::link}},
{"spatial-hash",
{jak2::method_18_grid_hash::link, jak2::method_19_grid_hash::link,
jak2::method_20_grid_hash::link, jak2::method_22_grid_hash::link,
jak2::method_28_sphere_hash::link, jak2::method_33_sky_work::link,
jak2::method_29_sphere_hash::link, jak2::method_30_sphere_hash::link,
jak2::method_31_sphere_hash::link, jak2::method_32_sphere_hash::link,
jak2::method_33_spatial_hash::link, jak2::method_39_spatial_hash::link,
jak2::method_36_spatial_hash::link, jak2::method_37_spatial_hash::link,
jak2::method_35_spatial_hash::link, jak2::method_33_sphere_hash::link}},
{"collide-cache",
{jak2::method_10_collide_shape_prim_mesh::link,
jak2::method_10_collide_shape_prim_sphere::link,
jak2::method_10_collide_shape_prim_group::link,
jak2::method_11_collide_shape_prim_mesh::link,
jak2::method_11_collide_shape_prim_sphere::link,
jak2::method_11_collide_shape_prim_group::link, jak2::method_9_collide_cache_prim::link,
jak2::method_10_collide_cache_prim::link, jak2::method_17_collide_cache::link,
jak2::method_9_collide_puss_work::link, jak2::method_10_collide_puss_work::link}},
{"bones", {jak2::bones_mtx_calc::link}},
{"foreground",
{jak2::foreground_check_longest_edge_asm::link, jak2::foreground_merc::link}},
{"lights",
{jak2::add_light_sphere_to_light_group::link, jak2::light_hash_add_items::link,
jak2::light_hash_count_items::link, jak2::light_hash_get_bucket_index::link}},
},
{{"collide-func",
{jak2::collide_do_primitives::link, jak2::moving_sphere_triangle_intersect::link}},
{"joint", {jak2::calc_animation_from_spr::link, jak2::cspace_parented_transformq_joint::link}},
{"font",
{jak2::draw_string::link, jak2::get_string_length::link, jak2::draw_string_asm::link}},
{"texture", {jak2::adgif_shader_texture_with_update::link}},
{"debug",
{jak2::debug_line_clip::link, jak2::init_boundary_regs::link,
jak2::render_boundary_quad::link, jak2::render_boundary_tri::link, jak2::set_sky_vf27::link,
jak2::draw_boundary_polygon::link}},
{"sparticle-launcher",
{jak2::sp_init_fields::link, jak2::particle_adgif::link, jak2::sp_launch_particles_var::link,
jak2::sparticle_motion_blur::link}},
{"sparticle", {jak2::sp_process_block_2d::link, jak2::sp_process_block_3d::link}},
{"sky-tng",
{jak2::set_tex_offset::link, jak2::draw_large_polygon::link, jak2::render_sky_quad::link,
jak2::render_sky_tri::link, jak2::method_16_sky_work::link, jak2::method_17_sky_work::link,
jak2::method_32_sky_work::link, jak2::method_33_sky_work::link,
jak2::method_28_sky_work::link, jak2::method_29_sky_work::link,
jak2::method_30_sky_work::link, jak2::set_sky_vf23_value::link}},
{"collide-hash",
{jak2::method_11_collide_hash::link, jak2::method_12_collide_hash::link,
jak2::fill_bg_using_box_new::link, jak2::fill_bg_using_line_sphere_new::link}},
{"collide-mesh",
{jak2::method_12_collide_mesh::link, jak2::method_14_collide_mesh::link,
jak2::method_15_collide_mesh::link}},
{"collide-edge-grab",
{jak2::method_10_collide_edge_hold_list::link, jak2::method_19_collide_edge_work::link,
jak2::method_9_edge_grab_info::link, jak2::method_16_collide_edge_work::link,
jak2::method_17_collide_edge_work::link, jak2::method_18_collide_edge_work::link}},
{"ocean-vu0",
{jak2::method_16_ocean::link, jak2::method_15_ocean::link, jak2::method_14_ocean::link}},
{"ocean",
{jak2::init_ocean_far_regs::link, jak2::draw_large_polygon_ocean::link,
jak2::render_ocean_quad::link}},
{"spatial-hash",
{jak2::method_18_grid_hash::link, jak2::method_19_grid_hash::link,
jak2::method_20_grid_hash::link, jak2::method_22_grid_hash::link,
jak2::method_28_sphere_hash::link, jak2::method_33_sky_work::link,
jak2::method_29_sphere_hash::link, jak2::method_30_sphere_hash::link,
jak2::method_31_sphere_hash::link, jak2::method_32_sphere_hash::link,
jak2::method_33_spatial_hash::link, jak2::method_39_spatial_hash::link,
jak2::method_36_spatial_hash::link, jak2::method_37_spatial_hash::link,
jak2::method_35_spatial_hash::link, jak2::method_33_sphere_hash::link}},
{"collide-cache",
{jak2::method_10_collide_shape_prim_mesh::link,
jak2::method_10_collide_shape_prim_sphere::link,
jak2::method_10_collide_shape_prim_group::link,
jak2::method_11_collide_shape_prim_mesh::link,
jak2::method_11_collide_shape_prim_sphere::link,
jak2::method_11_collide_shape_prim_group::link, jak2::method_9_collide_cache_prim::link,
jak2::method_10_collide_cache_prim::link, jak2::method_17_collide_cache::link,
jak2::method_9_collide_puss_work::link, jak2::method_10_collide_puss_work::link}},
{"bones", {jak2::bones_mtx_calc::link}},
{"foreground", {jak2::foreground_check_longest_edge_asm::link, jak2::foreground_merc::link}},
{"lights",
{jak2::add_light_sphere_to_light_group::link, jak2::light_hash_add_items::link,
jak2::light_hash_count_items::link, jak2::light_hash_get_bucket_index::link}},
{"nav-control", {jak2::method_39_nav_state::link}},
{"nav-mesh",
{jak2::nav_state_patch_pointers::link, jak2::method_45_nav_mesh::link,
jak2::method_20_nav_engine::link, jak2::method_43_nav_mesh::link,
jak2::nav_dma_send_to_spr_no_flush::link, jak2::nav_dma_send_from_spr_no_flush::link,
jak2::method_17_nav_engine::link, jak2::method_18_nav_engine::link,
jak2::method_21_nav_engine::link}}},
};
void LinkedFunctionTable::reg(const std::string& name, u64 (*exec)(void*), u32 stack_size) {
@@ -421,4 +434,4 @@ u32 LinkedFunctionTable::get(const std::string& name) {
}
return it->second.goal_trampoline.offset;
}
} // namespace Mips2C
} // namespace Mips2C
+1 -1
View File
@@ -2248,7 +2248,7 @@
)
(logclear! (-> self draw status) (draw-control-status no-draw))
(logclear! (-> self enemy-flags) (enemy-flag victory))
(logior! (-> self root-override2 nav-flags) (nav-flags nav-flags0))
(logior! (-> self root-override2 nav-flags) (nav-flags has-root-sphere))
(none)
)
:code (the-as (function none :behavior enemy) sleep-code)
+2 -2
View File
@@ -239,10 +239,10 @@
)
(logclear! (-> self mask) (process-mask actor-pause enemy))
(when (logtest? (-> self mode) (fma-sphere-mode nav))
(let ((a0-32 (find-nearest-nav-mesh (-> self root-override trans) #x7f800000)))
(let ((a0-32 (find-nearest-nav-mesh (-> self root-override trans) (the-as float #x7f800000))))
(cond
(a0-32
(nav-mesh-method-29 a0-32 self #f)
(add-process-drawable-to-navmesh a0-32 self #f)
)
(else
(format 0 "ERROR: fma-sphere-init-by-other: failed to find nearest nav-mesh!~%")
@@ -271,8 +271,9 @@
(defenum nav-flags
:type uint8
:bitfield #t
(nav-flags0 0)
(nav-flags1 1)
(has-root-sphere 0)
(has-extra-sphere 1)
(has-child-spheres 2)
)
;; ---nav-flags
@@ -627,7 +628,7 @@
(set! (-> s5-0 actor-hash-index) -1)
(set! (-> s5-0 process) arg0)
(set! (-> s5-0 max-iteration-count) (the-as uint 1))
(set! (-> s5-0 nav-flags) (nav-flags nav-flags0))
(set! (-> s5-0 nav-flags) (nav-flags has-root-sphere))
(set! (-> s5-0 event-self) #f)
(set! (-> s5-0 event-other) #f)
(set! (-> s5-0 riders) (the-as (inline-array collide-rider) #f))
@@ -451,7 +451,7 @@
)
(set! (-> obj timeout) (res-lump-float arg0 'timeout))
(if (not (logtest? (-> obj button-status) (button-status button-status-1)))
(nav-mesh-connect-from-ent (the-as entity-nav-mesh obj))
(nav-mesh-connect-from-ent obj)
)
(prepare-trigger-event! obj)
(basebutton-method-33 obj)
+3 -3
View File
@@ -10,8 +10,8 @@
;; DECOMP BEGINS
(defskelgroup skel-crate-krimson crate crate-krimson-lod0-jg crate-idle-ja
((crate-krimson-lod0-mg (meters 20)) (crate-krimson-lod1-mg (meters 999999)))
(defskelgroup skel-crate-krimson crate 0 3
((1 (meters 20)) (2 (meters 999999)))
:bounds (static-spherem 0 1 0 1.6)
:texture-level 6
)
@@ -1348,7 +1348,7 @@
)
(set! (-> obj base quad) (-> obj root-override2 trans quad))
(crate-post)
(nav-mesh-connect-from-ent (the-as entity-nav-mesh obj))
(nav-mesh-connect-from-ent obj)
(none)
)
@@ -41,6 +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
(set! (-> (the-as (pointer int32) s4-0)) (the-as int gp-0))
)
)
@@ -2487,7 +2488,7 @@
)
)
(set! (-> obj sound-id) (new-sound-id))
(nav-mesh-connect-from-ent (the-as entity-nav-mesh obj))
(nav-mesh-connect-from-ent obj)
(go (method-of-object obj idle))
(none)
)
+1 -4
View File
@@ -1506,13 +1506,10 @@
(actors-update *level*)
)
;; ??
(with-profiler 'nav *profile-nav-color*
;; ((method-of-object *level* level-group-method-18))
(update-nav-meshes *level*)
)
(with-profiler 'background *profile-background-color*
;; Run the background renderers!
+3 -3
View File
@@ -173,7 +173,7 @@
:size-assert #x38
:flag-assert #x1d00000038
(:methods
(entity-nav-mesh-method-27 (_type_) none 27)
(initialize-nav-mesh! (_type_) none 27)
(debug-draw (_type_) none 28)
)
)
@@ -205,8 +205,8 @@
(prev-actor (_type_) entity-actor 28)
(debug-print (_type_ symbol type) none 29)
(toggle-status (_type_ entity-perm-status symbol) none 30)
(entity-actor-method-31 (_type_ vector vector vector object float) nav-mesh 31)
(entity-actor-method-32 (_type_ vector vector nav-poly float) nav-poly 32)
(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)
)
)
+4 -4
View File
@@ -238,7 +238,7 @@
)
)
(defmethod level-group-method-18 level-group ((obj level-group))
(defmethod update-nav-meshes level-group ((obj level-group))
(when (not (paused?))
(dotimes (s5-0 (-> obj length))
(let ((v1-4 (-> obj level s5-0)))
@@ -246,7 +246,7 @@
(let ((s4-0 (-> v1-4 bsp nav-meshes)))
(when (nonzero? s4-0)
(dotimes (s3-0 (-> s4-0 length))
(nav-mesh-method-26 (-> s4-0 s3-0 nav-mesh))
(update-navigation (-> s4-0 s3-0 nav-mesh))
)
)
)
@@ -868,7 +868,7 @@
(when a0-25
(set! sv-96 (new 'stack-no-clear 'vector))
(set! sv-112 (new 'stack-no-clear 'vector))
(nav-mesh-method-22 a0-25 sv-96 sv-112)
(compute-bounding-box-from-vertices a0-25 sv-96 sv-112)
(expand-bounding-box sv-20 sv-24 sv-96 sv-112)
)
)
@@ -880,7 +880,7 @@
(else
(let ((a0-28 (nav-mesh-from-res-tag sv-40 'nav-mesh-actor 0)))
(if a0-28
(nav-mesh-method-22 a0-28 sv-20 sv-24)
(compute-bounding-box-from-vertices a0-28 sv-20 sv-24)
)
)
)
+1 -1
View File
@@ -382,7 +382,7 @@
(debug-draw-actors (_type_ symbol) none 15)
(assign-draw-indices (_type_) none 16)
(actors-update (_type_) none 17)
(level-group-method-18 (_type_) none 18)
(update-nav-meshes (_type_) none 18)
(level-update (_type_) none 19)
(level-get-target-inside (_type_) level 20)
(alloc-levels-if-needed (_type_ symbol) none 21)
+3 -3
View File
@@ -1292,7 +1292,7 @@
)
)
)
;; (goto cfg-1)
(goto cfg-1)
)
;; next is nav-meshes
@@ -1304,12 +1304,12 @@
(+! (-> lstate state) 1)
)
(else
(entity-nav-mesh-method-27 (-> lev-bsp nav-meshes (the-as uint login-state-pos)))
(initialize-nav-mesh! (-> lev-bsp nav-meshes (the-as uint login-state-pos)))
(+! (-> lstate pos) 1)
)
)
)
;; (goto cfg-1)
(goto cfg-1)
)
+51 -51
View File
@@ -116,50 +116,50 @@
(:methods
(debug-draw (_type_) none 9)
(nav-state-method-10 (_type_) none 10)
(nav-state-method-11 (_type_ nav-gap-info) symbol 11)
(nav-state-method-12 (_type_ vector) vector 12)
(nav-state-method-13 (_type_ vector) vector 13)
(nav-state-method-14 (_type_ vector) vector 14)
(nav-state-method-15 (_type_ vector) vector 15)
(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)
(nav-state-method-18 (_type_ vector object vector) none 18)
(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)
(nav-state-method-24 (_type_) none 24)
(nav-state-method-25 (_type_) none 25)
(nav-state-method-26 (_type_) none 26)
(nav-state-method-27 (_type_) none 27)
(nav-state-method-28 (_type_) none 28)
(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)
(nav-state-method-31 (_type_) none 31)
(nav-state-method-32 (_type_) none 32)
(nav-state-method-33 (_type_) none 33)
(nav-state-method-34 (_type_) none 34)
(nav-state-method-35 (_type_) none 35)
(nav-state-method-36 (_type_ vector) none 36)
(nav-state-method-37 (_type_) none 37)
(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 () none 39)
(nav-state-method-40 (_type_) none 40)
(nav-state-method-41 (_type_ vector) symbol 41)
(nav-state-method-42 (_type_ vector) none 42)
(nav-state-method-43 (_type_ vector) none 43)
(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)
(nav-state-method-47 (_type_ nav-control) none 47)
(reset! (_type_ nav-control) none 47)
(nav-state-method-48 () none 48)
(nav-state-method-49 (_type_ clamp-travel-vector-to-mesh-return-info) none 49)
(navigate-using-best-dir-use-existing-avoid-spheres (_type_ nav-avoid-spheres-params) none 49)
(nav-state-method-50 (_type_) none 50)
(nav-state-method-51 () none 51)
(nav-state-method-52 (_type_) none 52)
(nav-state-method-53 (_type_) none 53)
(nav-state-method-54 (_type_) none 54)
(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)
)
)
@@ -193,28 +193,28 @@
:flag-assert #x2f00000120
(:methods
(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_ vector vector nav-poly) nav-poly 12)
(find-poly (_type_ vector) nav-poly 13)
(nav-control-method-14 (_type_ nav-poly vector object vector) none 14)
(nav-control-method-15 (_type_ vector) none 15)
(nav-control-method-16 (_type_ vector float) symbol 16)
(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)
(nav-control-method-18 () none 18)
(nav-control-method-19 () none 19)
(nav-control-method-20 (_type_ vector nav-poly vector float symbol symbol) none 20)
(nav-control-method-21 (_type_) none 21)
(nav-control-method-22 (_type_ vector nav-avoid-spheres-params) float 22)
(nav-control-method-23 (_type_) none 23)
(nav-control-method-24 (_type_ vector int) none 24)
(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) none 24)
(get-max-rotation-rate (_type_) float 25)
(get-sphere-mask (_type_) none 26)
(get-sphere-mask (_type_) uint 26)
(get-target-speed (_type_) meters 27)
(nav-control-method-28 (_type_) none 28)
(nav-control-method-29 (_type_) none 29)
(enable-extra-sphere! (_type_) none 28)
(disable-extra-sphere! (_type_) none 29)
(copy-extra-nav-sphere! (_type_ sphere) none 30)
(set-extra-nav-sphere! (_type_ sphere) none 31)
(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)
@@ -224,11 +224,11 @@
(set-turning-acceleration! (_type_ meters) none 38)
(set-max-rotation-rate! (_type_ float) none 39)
(set-sphere-mask! (_type_ uint) none 40)
(nav-control-method-41 (_type_) none 41)
(init! (_type_ collide-shape) none 42)
(remove! (_type_) none 41)
(init! (_type_ collide-shape) none 42)
(display-marks? (_type_) symbol 43)
(nav-control-method-44 () none 44)
(nav-control-method-45 (_type_ vector vector vector) sphere 45)
(find-sphere (_type_ symbol) none 46)
(find-first-sphere-intersecting-ray (_type_ vector vector vector) sphere 45)
(find-sphere-ids-from-sphere-hash (_type_ symbol) none 46)
)
)
File diff suppressed because it is too large Load Diff
+31 -31
View File
@@ -14,8 +14,8 @@
(declare-type grid-hash basic)
(declare-type sphere-hash grid-hash)
(define-extern nav-mesh-connect-from-ent (function entity-nav-mesh none))
(define-extern find-nearest-nav-mesh (function vector int nav-mesh))
(define-extern nav-mesh-connect-from-ent (function process-drawable symbol))
(define-extern find-nearest-nav-mesh (function vector float nav-mesh))
;; DECOMP BEGINS
@@ -171,7 +171,7 @@
(deftype clamp-travel-vector-to-mesh-return-info (structure)
((found-boundary basic :offset-assert 0)
((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)
@@ -221,44 +221,44 @@
:size-assert #x70
:flag-assert #x2f00000070
(:methods
(nav-mesh-method-9 (_type_) none 9)
(debug-draw (_type_) none 9)
(nav-mesh-method-10 (_type_ vector vector nav-poly) nav-poly 10)
(nav-mesh-method-11 (_type_ nav-poly vector) vector 11)
(nav-mesh-method-12 (_type_ nav-poly vector) none 12)
(nav-mesh-method-13 (_type_ nav-poly nav-poly) nav-poly 13)
(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)
(nav-mesh-method-18 (_type_ vector nav-poly vector float symbol clamp-travel-vector-to-mesh-return-info) none 18)
(nav-mesh-method-19 (_type_) none 19)
(nav-mesh-method-20 (_type_ clamp-travel-vector-to-mesh-return-info) none 20)
(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)
(nav-mesh-method-22 (_type_ vector vector) none 22)
(nav-mesh-method-23 (_type_ entity-nav-mesh) none 23)
(nav-mesh-method-24 (_type_) none 24)
(nav-mesh-method-25 (_type_) none 25)
(nav-mesh-method-26 (_type_) none 26)
(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 int) nav-control 27)
(nav-mesh-method-28 (_type_ object) none 28)
(nav-mesh-method-29 (_type_ process-drawable symbol) nav-control 29)
(nav-mesh-method-30 (_type_ process-drawable) none 30)
(change-to (_type_ process-drawable) none 31)
(nav-mesh-method-32 (_type_ uint32) none 32)
(nav-mesh-method-33 (_type_ uint32) symbol 33)
(nav-mesh-method-34 (_type_ object vector float) none 34)
(nav-mesh-method-35 () none 35)
(nav-mesh-method-36 (_type_ nav-poly rgba) none 36)
(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 symbol) 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) none 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 object) vector 38)
(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)
(nav-mesh-method-40 (_type_ nav-poly vector object vector) none 40)
(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)
(nav-mesh-method-42 (_type_ nav-find-poly-parms) nav-poly 42)
(nav-mesh-method-43 (_type_ nav-find-poly-parms) none 43)
(nav-mesh-method-44 (_type_ vector float float) symbol 44)
(nav-mesh-method-45 (_type_ entity-perm) none 45)
(nav-mesh-method-46 (_type_ object) none 46)
(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)
)
)
File diff suppressed because it is too large Load Diff
+4 -4
View File
@@ -314,16 +314,16 @@
)
)
(when s4-1
(let ((a2-3 ((method-of-type nav-control nav-control-method-11) (the-as nav-control s4-1) arg1)))
(let ((a2-3 ((method-of-type nav-control find-poly-containing-point-1) (the-as nav-control s4-1) arg1)))
(if a2-3
((method-of-type nav-control nav-control-method-20)
((method-of-type nav-control clamp-vector-to-mesh-cross-gaps)
(the-as nav-control s4-1)
arg1
(the-as nav-poly a2-3)
a2-3
arg0
2048.0
#f
#f
(the-as clamp-travel-vector-to-mesh-return-info #f)
)
(set! (-> arg0 quad) (the-as uint128 0))
)
@@ -539,7 +539,7 @@
)
(let ((a0-3 (-> obj nav)))
(if (and a0-3 (nonzero? a0-3))
(nav-control-method-41 a0-3)
(remove! a0-3)
)
)
(let* ((s5-0 (-> obj root))
@@ -137,8 +137,8 @@
(the-as (function process int symbol event-message-block object) simple-nav-sphere-event-handler)
)
(if arg2
(nav-mesh-method-29 arg2 self #f)
(nav-mesh-connect-from-ent (the-as entity-nav-mesh self))
(add-process-drawable-to-navmesh arg2 self #f)
(nav-mesh-connect-from-ent self)
)
(if (>= (-> self track-joint) 0)
(go-virtual active)
@@ -50,7 +50,7 @@
:size-assert #x58
:flag-assert #x1900000058
(:methods
(new (symbol type int int) _type_ 0)
(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)
@@ -72,12 +72,12 @@
(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 uint32 :offset-assert 28)
((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)
)
:method-count-assert 9
:size-assert #x20
@@ -102,8 +102,8 @@
(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)
(sphere-hash-method-30 (_type_ find-nav-sphere-ids-params) none 30)
(sphere-hash-method-31 (_type_ vector int int) none 31)
(find-nav-sphere-ids (_type_ find-nav-sphere-ids-params) none 30)
(add-sphere-with-mask-and-id (_type_ vector int int) none 31)
(sphere-hash-method-32 (_type_ vector vector float int) symbol 32)
(remove-by-id (_type_ sphere int) none 33)
)
@@ -25,9 +25,11 @@
:flag-assert #x900000078
)
(define *grid-hash-work* (new 'static 'grid-hash-work))
(defmethod new grid-hash ((allocation symbol) (type-to-make type) (arg0 int) (arg1 int))
;; WARN: Return type mismatch object vs grid-hash.
(defmethod new grid-hash ((allocation symbol) (type-to-make type) (arg0 int))
(let ((gp-0 (the-as object (object-new allocation type-to-make (the-as int (-> type-to-make size))))))
(when (zero? (the-as grid-hash gp-0))
(set! gp-0 0)
+5
View File
@@ -4668,3 +4668,8 @@
(group-list "all-code"
`(,@(reverse *all-gc*))
)
(group "engine"
"$OUT/iso/KERNEL.CGO"
"$OUT/iso/GAME.CGO"
)
+1 -1
View File
@@ -234,7 +234,7 @@
(bouncer-method-24 obj)
(process-drawable-from-entity! obj arg0)
(init-skeleton! obj)
(nav-mesh-connect-from-ent (the-as entity-nav-mesh obj))
(nav-mesh-connect-from-ent obj)
(set! (-> obj spring-height) (res-lump-float arg0 'spring-height :default 45056.0))
(go (method-of-object obj idle))
(none)
@@ -5,5 +5,264 @@
;; name in dgo: hover-nav-control-h
;; dgos: FOR, DMI, FRA, STR, NEB, D3A, UNB
;; +++net-path-node-status
(defenum net-path-node-status
:bitfield #t
:type uint16
(open)
(closed))
;; ---net-path-node-status
;; NOTE - for nestb-scenes
(declare-type nav-network basic)
(define-extern *nav-network* nav-network)
;; DECOMP BEGINS
(deftype nav-network-adjacency (structure)
((index int32 :offset-assert 0)
(dist float :offset-assert 4)
)
: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)
)
: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)
)
: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)
)
: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)
)
: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)
)
: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 uint64 :offset-assert 32)
(timer uint64 :offset-assert 40)
)
: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 int32 2 :offset-assert 80)
(dist float :offset-assert 88)
(du float :offset-assert 92)
)
:method-count-assert 10
:size-assert #x60
:flag-assert #xa00000060
(:methods
(hover-nav-path-segment-method-9 (_type_ float) none 9)
)
)
(defmethod hover-nav-path-segment-method-9 hover-nav-path-segment ((obj hover-nav-path-segment) (arg0 float))
(set! (-> obj du) (/ arg0 (-> obj 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)
)
:method-count-assert 10
:size-assert #x10
:flag-assert #xa00000010
(:methods
(hover-nav-path-info-method-9 () none 9)
)
)
(deftype path-index-array (inline-array-class)
((data hover-nav-path-info :inline :dynamic :offset-assert 16)
)
: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 basic :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 uint32 :offset-assert 116)
(sphere-pool uint32 :offset-assert 120)
)
:method-count-assert 33
:size-assert #x7c
:flag-assert #x210000007c
(:methods
(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_) none 13)
(nav-network-method-14 (_type_ int) none 14)
(nav-network-method-15 (_type_) none 15)
(nav-network-method-16 (_type_) none 16)
(nav-network-method-17 (_type_) nav-network-path-node 17)
(nav-network-method-18 (_type_) none 18)
(nav-network-method-19 (_type_) none 19)
(nav-network-method-20 (_type_) none 20)
(nav-network-method-21 (_type_) none 21)
(nav-network-method-22 (_type_) none 22)
(nav-network-method-23 (_type_) none 23)
(nav-network-method-24 (_type_) none 24)
(nav-network-method-25 (_type_) none 25)
(nav-network-method-26 (_type_) none 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_) basic 30)
(nav-network-method-31 () none 31)
(nav-network-method-32 () none 32)
)
)
(defmethod get-network nav-network ((obj nav-network))
(-> obj 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)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
(deftype hover-nav-control (basic)
((root basic :offset-assert 4)
(nav basic :offset-assert 8)
(flags uint16 :offset-assert 12)
(params hover-nav-params :offset-assert 16)
(path-timer uint64 :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)
)
:method-count-assert 32
:size-assert #xd8
:flag-assert #x20000000d8
(:methods
(hover-nav-control-method-9 (_type_) none 9)
(hover-nav-control-method-10 (_type_) none 10)
(hover-nav-control-method-11 (_type_) 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_) none 15)
(hover-nav-control-method-16 (_type_) none 16)
(hover-nav-control-method-17 (_type_) none 17)
(hover-nav-control-method-18 (_type_) none 18)
(hover-nav-control-method-19 (_type_) 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_) none 26)
(hover-nav-control-method-27 (_type_) none 27)
(hover-nav-control-method-28 (_type_) none 28)
(hover-nav-control-method-29 (_type_) none 29)
(hover-nav-control-method-30 (_type_) float 30)
(hover-nav-control-method-31 (_type_) float 31)
)
)
(define *hover-nav-time-offset* 0)
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -896,7 +896,7 @@
(vector-normalize! s3-2 f28-1)
(vector+! s3-2 s3-2 s4-2)
)
(nav-state-method-41 (-> obj nav state) s3-2)
(clamp-vector-to-mesh-cross-gaps (-> obj nav state) s3-2)
(vector+! s2-0 s5-1 s3-2)
(set! (-> obj target-pos quad) (-> s2-0 quad))
)
@@ -5,5 +5,8 @@
;; name in dgo: nest-texture
;; dgos: NEB
;; NOTE - for nestb-scenes
(define-extern set-darkjak-highres-nest-texture-morph! (function int none))
;; DECOMP BEGINS
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -2351,7 +2351,7 @@
)
(logclear! (-> self draw status) (draw-control-status no-draw))
(logclear! (-> self enemy-flags) (enemy-flag victory))
(logior! (-> self root-override2 nav-flags) (nav-flags nav-flags0))
(logior! (-> self root-override2 nav-flags) (nav-flags has-root-sphere))
(none)
)
:code (the-as (function none :behavior enemy) sleep-code)
+2 -2
View File
@@ -248,10 +248,10 @@
)
(logclear! (-> self mask) (process-mask actor-pause enemy))
(when (logtest? (-> self mode) (fma-sphere-mode nav))
(let ((a0-32 (find-nearest-nav-mesh (-> self root-override trans) #x7f800000)))
(let ((a0-32 (find-nearest-nav-mesh (-> self root-override trans) (the-as float #x7f800000))))
(cond
(a0-32
(nav-mesh-method-29 a0-32 self #f)
(add-process-drawable-to-navmesh a0-32 self #f)
)
(else
(format 0 "ERROR: fma-sphere-init-by-other: failed to find nearest nav-mesh!~%")
+1 -1
View File
@@ -1966,7 +1966,7 @@
(set! (-> s5-0 actor-hash-index) -1)
(set! (-> s5-0 process) arg0)
(set! (-> s5-0 max-iteration-count) (the-as uint 1))
(set! (-> s5-0 nav-flags) (nav-flags nav-flags0))
(set! (-> s5-0 nav-flags) (nav-flags has-root-sphere))
(set! (-> s5-0 event-self) #f)
(set! (-> s5-0 event-other) #f)
(set! (-> s5-0 riders) (the-as (inline-array collide-rider) #f))
+1 -1
View File
@@ -484,7 +484,7 @@
)
(set! (-> obj timeout) (res-lump-float arg0 'timeout))
(if (not (logtest? (-> obj button-status) (button-status button-status-1)))
(nav-mesh-connect-from-ent (the-as entity-nav-mesh obj))
(nav-mesh-connect-from-ent obj)
)
(prepare-trigger-event! obj)
(basebutton-method-33 obj)
+1 -1
View File
@@ -1415,7 +1415,7 @@
)
(set! (-> obj base quad) (-> obj root-override2 trans quad))
(crate-post)
(nav-mesh-connect-from-ent (the-as entity-nav-mesh obj))
(nav-mesh-connect-from-ent obj)
(none)
)
+1 -1
View File
@@ -2861,7 +2861,7 @@
)
)
(set! (-> obj sound-id) (new-sound-id))
(nav-mesh-connect-from-ent (the-as entity-nav-mesh obj))
(nav-mesh-connect-from-ent obj)
(go (method-of-object obj idle))
(none)
)
+1
View File
@@ -1619,6 +1619,7 @@
)
;; definition for method 3 of type debug-vertex-stats
;; INFO: this function exists in multiple non-identical object files
(defmethod inspect debug-vertex-stats ((obj debug-vertex-stats))
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~Tlength: ~D~%" (-> obj length))
+1 -5
View File
@@ -1589,7 +1589,7 @@
)
0
)
(level-group-method-18 *level*)
(update-nav-meshes *level*)
(when *debug-segment*
(let ((gp-10 (-> *display* frames (-> *display* on-screen) profile-array data 0)))
(when (and *dproc* *debug-segment*)
@@ -2234,7 +2234,3 @@
(display-sync arg0)
(none)
)
+3 -3
View File
@@ -255,7 +255,7 @@
:size-assert #x38
:flag-assert #x1d00000038
(:methods
(entity-nav-mesh-method-27 (_type_) none 27)
(initialize-nav-mesh! (_type_) none 27)
(debug-draw (_type_) none 28)
)
)
@@ -289,8 +289,8 @@
(prev-actor (_type_) entity-actor 28)
(debug-print (_type_ symbol type) none 29)
(toggle-status (_type_ entity-perm-status symbol) none 30)
(entity-actor-method-31 (_type_ vector vector vector object float) nav-mesh 31)
(entity-actor-method-32 (_type_ vector vector nav-poly float) nav-poly 32)
(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)
)
)
+173 -4
View File
@@ -1,11 +1,17 @@
;;-*-Lisp-*-
(in-package goal)
;; definition for symbol *spawn-actors*, type symbol
(define *spawn-actors* #t)
;; definition for symbol *compact-actors*, type symbol
(define *compact-actors* #t)
;; definition for symbol *vis-actors*, type symbol
(define *vis-actors* #t)
;; definition for method 8 of type drawable-actor
;; WARN: Return type mismatch int vs drawable-actor.
(defmethod mem-usage drawable-actor ((obj drawable-actor) (arg0 memory-usage-block) (arg1 int))
(set! (-> arg0 length) (max 44 (-> arg0 length)))
(set! (-> arg0 data 43 name) "entity")
@@ -18,6 +24,8 @@
(the-as drawable-actor 0)
)
;; 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 ((obj 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))
@@ -32,11 +40,13 @@
(the-as drawable-inline-array-actor 0)
)
;; definition for method 2 of type entity-links
(defmethod print entity-links ((obj entity-links))
(format #t "#<entity-links :process ~A @ #x~X>" (-> obj process) obj)
obj
)
;; definition for method 2 of type entity-perm
(defmethod print entity-perm ((obj entity-perm))
(format
#t
@@ -50,6 +60,7 @@
obj
)
;; definition for method 2 of type actor-group
(defmethod print actor-group ((obj actor-group))
(format #t "#<actor-group")
(dotimes (s5-0 (-> obj length))
@@ -59,6 +70,8 @@
obj
)
;; definition for method 3 of type actor-group
;; INFO: this function exists in multiple non-identical object files
(defmethod inspect actor-group ((obj actor-group))
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~Tlength: ~D~%" (-> obj length))
@@ -70,21 +83,25 @@
obj
)
;; definition for method 22 of type entity
(defmethod birth! entity ((obj entity))
(format #t "birth ~A~%" obj)
obj
)
;; definition for method 23 of type entity
(defmethod kill! entity ((obj entity))
(format #t "kill ~A~%" obj)
obj
)
;; definition for method 2 of type entity
(defmethod print entity ((obj entity))
(format #t "#<~A :name ~S @ #x~X>" (-> obj type) (res-lump-struct obj 'name structure) obj)
obj
)
;; definition for method 26 of type entity
(defmethod get-level entity ((obj entity))
(dotimes (v1-0 (-> *level* length))
(let ((a1-3 (-> *level* level v1-0)))
@@ -100,6 +117,7 @@
(-> *level* default-level)
)
;; definition for function entity-by-name
(defun entity-by-name ((arg0 string))
(dotimes (s5-0 (-> *level* length))
(let ((s4-0 (-> *level* level s5-0)))
@@ -154,6 +172,7 @@
(the-as entity #f)
)
;; definition for function entity-by-type
(defun entity-by-type ((arg0 type))
(dotimes (s5-0 (-> *level* length))
(let ((v1-3 (-> *level* level s5-0)))
@@ -175,6 +194,7 @@
(the-as entity-actor #f)
)
;; definition for function entity-by-aid
(defun entity-by-aid ((arg0 uint))
(dotimes (v1-0 (-> *level* length))
(let ((a1-3 (-> *level* level v1-0)))
@@ -212,6 +232,8 @@
(the-as entity #f)
)
;; definition for function entity-actor-from-level-name
;; WARN: Return type mismatch entity vs entity-actor.
(defun entity-actor-from-level-name ((arg0 level))
(let ((v0-0 (the-as entity #f)))
(dotimes (s5-0 (-> *level* length))
@@ -234,7 +256,9 @@
)
)
(defmethod level-group-method-18 level-group ((obj level-group))
;; definition for method 18 of type level-group
;; WARN: Return type mismatch int vs none.
(defmethod update-nav-meshes level-group ((obj level-group))
(when (not (paused?))
(dotimes (s5-0 (-> obj length))
(let ((v1-4 (-> obj level s5-0)))
@@ -242,7 +266,7 @@
(let ((s4-0 (-> v1-4 bsp nav-meshes)))
(when (nonzero? s4-0)
(dotimes (s3-0 (-> s4-0 length))
(nav-mesh-method-26 (-> s4-0 s3-0 nav-mesh))
(update-navigation (-> s4-0 s3-0 nav-mesh))
)
)
)
@@ -254,6 +278,7 @@
(none)
)
;; definition for function entity-nav-mesh-by-aid
(defun entity-nav-mesh-by-aid ((arg0 actor-id))
(dotimes (v1-0 (-> *level* length))
(let ((a1-3 (-> *level* level v1-0)))
@@ -291,6 +316,7 @@
(the-as entity-nav-mesh #f)
)
;; definition for function nav-mesh-from-res-tag
(defun nav-mesh-from-res-tag ((arg0 entity) (arg1 symbol) (arg2 int))
(let ((v1-1 (res-lump-data arg0 arg1 pointer))
(gp-0 (the-as nav-mesh #f))
@@ -311,6 +337,7 @@
)
)
;; definition for function entity-by-meters
(defun entity-by-meters ((arg0 float) (arg1 float) (arg2 float))
(dotimes (v1-0 (-> *level* length))
(let ((a3-3 (-> *level* level v1-0)))
@@ -337,6 +364,7 @@
(the-as entity-actor #f)
)
;; definition for function process-by-ename
(defun process-by-ename ((arg0 string))
(let ((v1-0 (entity-by-name arg0)))
(if v1-0
@@ -345,6 +373,7 @@
)
)
;; definition for function entity-process-count
(defun entity-process-count ((arg0 symbol))
(let ((gp-0 0))
(dotimes (s4-0 (-> *level* length))
@@ -375,6 +404,7 @@
)
)
;; definition for function entity-count
(defun entity-count ()
(let ((v0-0 0))
(dotimes (v1-0 (-> *level* length))
@@ -393,6 +423,8 @@
)
)
;; definition for function entity-remap-names
;; WARN: Return type mismatch int vs none.
(defun entity-remap-names ((arg0 pair))
(let ((s5-0 (car arg0)))
(while (not (null? arg0))
@@ -419,6 +451,8 @@
(none)
)
;; definition (debug) for function process-status-bits
;; WARN: Return type mismatch int vs none.
(defun-debug process-status-bits ((arg0 process) (arg1 symbol))
(let* ((s5-0 arg0)
(s3-0 (if (type? s5-0 process-drawable)
@@ -480,6 +514,7 @@
(none)
)
;; definition for function process-entity-set!
(defun process-entity-set! ((arg0 process) (arg1 entity-actor))
(set! (-> arg0 entity) arg1)
(if arg1
@@ -489,10 +524,12 @@
arg1
)
;; definition for function process-task-mask
(defun process-task-mask ((arg0 process))
(-> arg0 level task-mask)
)
;; definition for method 2 of type process
(defmethod print process ((obj process))
(cond
((and (-> obj top-thread) (!= (-> obj status) 'dead))
@@ -528,6 +565,7 @@
obj
)
;; definition for method 3 of type entity
(defmethod inspect entity ((obj entity))
((the-as (function entity entity) (find-parent-method entity 3)) obj)
(format #t "~Ttrans: ~`vector`P~%" (-> obj trans))
@@ -535,6 +573,7 @@
obj
)
;; definition for method 3 of type entity-nav-mesh
(defmethod inspect entity-nav-mesh ((obj entity-nav-mesh))
((the-as (function object object) (find-parent-method entity-nav-mesh 3)) obj)
(format #t "~Tnav-mesh ~A~%" (-> obj nav-mesh))
@@ -544,6 +583,7 @@
obj
)
;; definition for method 3 of type entity-actor
(defmethod inspect entity-actor ((obj entity-actor))
((the-as (function entity entity) (find-parent-method entity-actor 3)) obj)
(format #t "~Tetype: ~A~%" (-> obj etype))
@@ -614,6 +654,8 @@
obj
)
;; definition for method 29 of type entity-actor
;; WARN: Return type mismatch entity-actor vs none.
(defmethod debug-print entity-actor ((obj entity-actor) (arg0 symbol) (arg1 type))
(let ((s4-0 (-> obj etype)))
(when (or (not arg1) (and s4-0 (valid? s4-0 type #f #f 0) (type-type? s4-0 arg1)))
@@ -686,6 +728,8 @@
(none)
)
;; definition for method 14 of type level-group
;; WARN: Return type mismatch int vs none.
(defmethod debug-print-entities level-group ((obj level-group) (arg0 symbol) (arg1 type))
(let ((t9-0 format)
(a0-1 #t)
@@ -723,6 +767,9 @@
(none)
)
;; 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 ((obj entity-actor) (arg0 level-group) (arg1 level) (arg2 actor-id))
(let ((v1-4 (-> arg1 entity data (-> arg1 entity length))))
(+! (-> arg1 entity length) 1)
@@ -794,6 +841,7 @@
(none)
)
;; definition for method 25 of type entity
(defmethod remove-from-level! entity ((obj entity) (arg0 level-group))
(let ((v1-0 (-> obj extra)))
(cond
@@ -812,6 +860,8 @@
obj
)
;; definition for function update-actor-vis-box
;; WARN: Return type mismatch int vs none.
(defun update-actor-vis-box ((arg0 process-drawable) (arg1 vector) (arg2 vector))
(when (and arg0 (nonzero? (-> arg0 draw)) (zero? (logand (-> arg0 draw status) (draw-control-status no-draw))))
(let ((v1-5 (-> arg0 draw origin))
@@ -829,6 +879,8 @@
(none)
)
;; definition for method 25 of type level-group
;; WARN: Return type mismatch int vs none.
(defmethod update-vis-volumes level-group ((obj level-group))
(local-vars (sv-16 pointer) (sv-20 pointer) (sv-24 pointer) (sv-28 process))
(dotimes (s5-0 (-> obj length))
@@ -876,6 +928,8 @@
(none)
)
;; definition for function expand-bounding-box
;; WARN: Return type mismatch int vs none.
(defun expand-bounding-box ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector))
(set! (-> arg0 x) (fmin (-> arg0 x) (-> arg2 x)))
(set! (-> arg0 y) (fmin (-> arg0 y) (-> arg2 y)))
@@ -887,6 +941,45 @@
(none)
)
;; definition for method 26 of type level-group
;; INFO: Used lq/sq
;; WARN: Stack slot offset 28 signed mismatch
;; WARN: Stack slot offset 28 signed mismatch
;; WARN: Stack slot offset 28 signed mismatch
;; WARN: Stack slot offset 32 signed mismatch
;; WARN: Stack slot offset 32 signed mismatch
;; WARN: Stack slot offset 32 signed mismatch
;; WARN: Stack slot offset 28 signed mismatch
;; WARN: Stack slot offset 28 signed mismatch
;; WARN: Stack slot offset 28 signed mismatch
;; WARN: Stack slot offset 32 signed mismatch
;; WARN: Stack slot offset 32 signed mismatch
;; WARN: Stack slot offset 32 signed mismatch
;; WARN: Stack slot offset 28 signed mismatch
;; WARN: Stack slot offset 28 signed mismatch
;; WARN: Stack slot offset 28 signed mismatch
;; WARN: Stack slot offset 32 signed mismatch
;; WARN: Stack slot offset 32 signed mismatch
;; WARN: Stack slot offset 32 signed mismatch
;; WARN: Stack slot offset 28 signed mismatch
;; WARN: Stack slot offset 28 signed mismatch
;; WARN: Stack slot offset 28 signed mismatch
;; WARN: Stack slot offset 32 signed mismatch
;; WARN: Stack slot offset 32 signed mismatch
;; WARN: Stack slot offset 32 signed mismatch
;; WARN: Stack slot offset 28 signed mismatch
;; WARN: Stack slot offset 28 signed mismatch
;; WARN: Stack slot offset 28 signed mismatch
;; WARN: Stack slot offset 32 signed mismatch
;; WARN: Stack slot offset 32 signed mismatch
;; WARN: Stack slot offset 32 signed mismatch
;; WARN: Stack slot offset 28 signed mismatch
;; WARN: Stack slot offset 28 signed mismatch
;; WARN: Stack slot offset 28 signed mismatch
;; WARN: Stack slot offset 32 signed mismatch
;; 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 ((obj level-group))
(local-vars
(sv-16 pointer)
@@ -945,7 +1038,7 @@
(when a0-25
(set! sv-96 (new 'stack-no-clear 'vector))
(set! sv-112 (new 'stack-no-clear 'vector))
(nav-mesh-method-22 a0-25 sv-96 sv-112)
(compute-bounding-box-from-vertices a0-25 sv-96 sv-112)
(expand-bounding-box sv-20 sv-24 sv-96 sv-112)
)
)
@@ -957,7 +1050,7 @@
(else
(let ((a0-28 (nav-mesh-from-res-tag sv-40 'nav-mesh-actor 0)))
(if a0-28
(nav-mesh-method-22 a0-28 sv-20 sv-24)
(compute-bounding-box-from-vertices a0-28 sv-20 sv-24)
)
)
)
@@ -984,6 +1077,15 @@
(none)
)
;; definition for method 27 of type level-group
;; INFO: Used lq/sq
;; WARN: Stack slot offset 20 signed mismatch
;; WARN: Stack slot offset 20 signed mismatch
;; WARN: Stack slot offset 20 signed mismatch
;; WARN: Stack slot offset 20 signed mismatch
;; 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 ((obj level-group))
(local-vars
(sv-16 pointer)
@@ -1064,6 +1166,8 @@
(none)
)
;; definition for function expand-vis-box-with-point
;; WARN: Return type mismatch int vs none.
(defun expand-vis-box-with-point ((arg0 entity) (arg1 vector))
(let ((v1-1 (res-lump-data arg0 'visvol (inline-array vector))))
(when v1-1
@@ -1083,6 +1187,7 @@
(none)
)
;; definition of type debug-actor-info
(deftype debug-actor-info (basic)
((name basic :offset-assert 4)
(handle handle :offset-assert 8)
@@ -1094,6 +1199,7 @@
:flag-assert #x900000018
)
;; definition for method 3 of type debug-actor-info
(defmethod inspect debug-actor-info ((obj debug-actor-info))
(when (not obj)
(set! obj obj)
@@ -1108,10 +1214,14 @@
obj
)
;; definition for symbol *debug-actor-info*, type debug-actor-info
(define *debug-actor-info* (new 'static 'debug-actor-info :name #f))
;; definition for symbol *pid-string*, type string
(define *pid-string* (new 'global 'string 128 (the-as string #f)))
;; definition (debug) for function debug-actor
;; WARN: Return type mismatch int vs none.
(defun-debug debug-actor ((arg0 string))
(let ((gp-0 *debug-actor-info*))
(set! (-> gp-0 name) #f)
@@ -1148,6 +1258,8 @@
(none)
)
;; definition (debug) for function draw-actor-marks
;; WARN: Return type mismatch int vs none.
(defun-debug draw-actor-marks ((arg0 process))
(local-vars (sv-16 entity-actor) (sv-20 (pointer int32)))
(b!
@@ -1281,6 +1393,9 @@
(none)
)
;; 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 ((obj level-group) (arg0 symbol))
(local-vars
(sv-16 symbol)
@@ -1659,16 +1774,20 @@
)
)
;; definition for method 22 of type entity-camera
(defmethod birth! entity-camera ((obj entity-camera))
(add-connection *camera-engine* *camera* nothing obj #f #f)
obj
)
;; definition for method 23 of type entity-camera
(defmethod kill! entity-camera ((obj entity-camera))
(remove-by-param1 *camera-engine* (the-as int obj))
obj
)
;; definition for function init-entity
;; WARN: Return type mismatch process vs none.
(defun init-entity ((arg0 process) (arg1 entity-actor) (arg2 process))
(activate arg0 *entity-pool* (res-lump-struct arg1 'name basic) (the-as pointer #x70004000))
(set! (-> arg0 entity) arg1)
@@ -1678,6 +1797,7 @@
(none)
)
;; definition for method 22 of type entity-actor
(defmethod birth! entity-actor ((obj entity-actor))
(let* ((s5-0 (-> obj etype))
(v1-0 (entity-info-lookup s5-0))
@@ -1708,6 +1828,8 @@
obj
)
;; definition for function entity-deactivate-handler
;; WARN: Return type mismatch symbol vs none.
(defun entity-deactivate-handler ((arg0 process) (arg1 entity-actor))
(when (= arg0 (-> arg1 extra process))
(logclear! (-> arg1 extra perm status) (entity-perm-status bit-1 no-kill))
@@ -1716,6 +1838,7 @@
(none)
)
;; definition for method 23 of type entity-actor
(defmethod kill! entity-actor ((obj entity-actor))
(let ((a0-1 (-> obj extra process)))
(if a0-1
@@ -1726,6 +1849,11 @@
obj
)
;; definition for method 17 of type bsp-header
;; INFO: Used lq/sq
;; 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 ((obj bsp-header))
(local-vars (v1-74 int) (s5-0 int) (sv-16 int))
(.mfc0 s5-0 Count)
@@ -1798,6 +1926,8 @@
(none)
)
;; definition for function check-for-rougue-process
;; WARN: Return type mismatch int vs none.
(defun check-for-rougue-process ((arg0 process) (arg1 int) (arg2 int) (arg3 level))
(cond
((-> arg0 entity)
@@ -1902,6 +2032,8 @@
(none)
)
;; definition for method 18 of type bsp-header
;; WARN: Return type mismatch bsp-header vs none.
(defmethod deactivate-entities bsp-header ((obj bsp-header))
(let ((v1-1 (-> obj level heap base))
(a0-2 (-> obj level heap top-base))
@@ -1988,6 +2120,9 @@
(none)
)
;; definition for function process-drawable-scale-from-entity!
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defun process-drawable-scale-from-entity! ((arg0 process-drawable) (arg1 entity))
(let ((v1-1 (res-lump-struct arg1 'scale structure)))
(if v1-1
@@ -1999,6 +2134,9 @@
(none)
)
;; definition for function process-drawable-from-entity!
;; INFO: Used lq/sq
;; WARN: Return type mismatch process-drawable vs none.
(defun process-drawable-from-entity! ((arg0 process-drawable) (arg1 entity-actor))
(logior! (-> arg0 mask) (process-mask actor-pause))
(set! (-> arg0 root trans quad) (-> arg1 extra trans quad))
@@ -2007,6 +2145,7 @@
(none)
)
;; definition for method 9 of type entity-perm
(defmethod update entity-perm ((obj entity-perm) (arg0 symbol) (arg1 entity-perm-status))
(cond
((= arg0 'game)
@@ -2037,6 +2176,8 @@
obj
)
;; definition for function reset-actors
;; WARN: Return type mismatch int vs none.
(defun reset-actors ((arg0 symbol))
(let* ((v1-0 arg0)
(s5-0 (cond
@@ -2121,6 +2262,8 @@
(none)
)
;; definition for function reset-cameras
;; WARN: Return type mismatch int vs none.
(defun reset-cameras ()
(remove-all *camera-engine*)
(dotimes (gp-0 (-> *level* length))
@@ -2140,6 +2283,7 @@
(none)
)
;; definition for method 12 of type process-drawable
(defmethod run-logic? process-drawable ((obj process-drawable))
(or (not (logtest? (-> obj mask) (process-mask actor-pause)))
(or (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj root pause-adjust-distance))
@@ -2151,12 +2295,21 @@
)
)
;; definition for method 9 of type entity-links
(defmethod birth? entity-links ((obj entity-links) (arg0 vector))
(and (not (logtest? (-> obj perm status) (entity-perm-status bit-0 dead)))
(< (vector-vector-distance (-> obj trans) arg0) (-> *ACTOR-bank* birth-dist))
)
)
;; definition for method 17 of type level-group
;; INFO: Used lq/sq
;; 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
;; 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: 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 ((obj level-group))
(local-vars
(sv-16 vector)
@@ -2363,6 +2516,7 @@
)
)
;; definition for function entity-birth-no-kill
(defun entity-birth-no-kill ((arg0 entity))
(let ((gp-0 (-> arg0 extra)))
(logior! (-> gp-0 perm status) (entity-perm-status no-kill))
@@ -2373,6 +2527,8 @@
)
)
;; definition for function entity-task-complete-on
;; WARN: Return type mismatch int vs none.
(defun entity-task-complete-on ((arg0 entity))
(let ((v1-0 (-> arg0 extra)))
(if (nonzero? (-> v1-0 perm task))
@@ -2383,6 +2539,8 @@
(none)
)
;; definition for function entity-task-complete-off
;; WARN: Return type mismatch int vs none.
(defun entity-task-complete-off ((arg0 entity))
(let ((v1-0 (-> arg0 extra)))
(if (!= (-> v1-0 perm task) 1)
@@ -2393,6 +2551,8 @@
(none)
)
;; definition for method 30 of type entity-actor
;; WARN: Return type mismatch entity-perm-status vs none.
(defmethod toggle-status entity-actor ((obj entity-actor) (arg0 entity-perm-status) (arg1 symbol))
(let ((v1-0 (-> obj extra)))
(if arg1
@@ -2404,6 +2564,8 @@
(none)
)
;; definition for function process-entity-status!
;; WARN: Return type mismatch int vs entity-perm-status.
(defun process-entity-status! ((arg0 process) (arg1 entity-perm-status) (arg2 symbol))
(the-as entity-perm-status (cond
((and (-> arg0 entity) arg0 (= arg0 (-> arg0 entity extra process)))
@@ -2422,6 +2584,8 @@
)
)
;; definition for function find-nearest-entity
;; WARN: Return type mismatch entity-actor vs entity.
(defun find-nearest-entity ((arg0 vector) (arg1 type))
(local-vars (v1-9 object))
(let ((gp-0 (the-as entity-actor #f)))
@@ -2461,6 +2625,8 @@
)
)
;; definition (debug) for function entity-speed-test
;; ERROR: Unsupported inline assembly instruction kind - [mfc0 s4, Count]
(defun-debug entity-speed-test ((arg0 string))
(local-vars (s4-0 int))
(let ((gp-0 (entity-by-name arg0)))
@@ -2480,6 +2646,9 @@
)
)
;; definition (debug) for function dump-entity-remap
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defun-debug dump-entity-remap ((arg0 object) (arg1 object))
(local-vars
(sv-16 symbol)
@@ -2,6 +2,7 @@
(in-package goal)
;; definition for method 3 of type sparticle-launcher
;; INFO: this function exists in multiple non-identical object files
;; WARN: Return type mismatch int vs sparticle-launcher.
(defmethod inspect sparticle-launcher ((obj sparticle-launcher))
(format #t "~X: sparticle-launcher~%" obj)
+1 -1
View File
@@ -694,7 +694,7 @@
(debug-draw-actors (_type_ symbol) none 15)
(assign-draw-indices (_type_) none 16)
(actors-update (_type_) none 17)
(level-group-method-18 (_type_) none 18)
(update-nav-meshes (_type_) none 18)
(level-update (_type_) none 19)
(level-get-target-inside (_type_) level 20)
(alloc-levels-if-needed (_type_ symbol) none 21)
+73 -1
View File
@@ -1,5 +1,7 @@
;;-*-Lisp-*-
(in-package goal)
;; definition for function lookup-level-info
(defun lookup-level-info ((arg0 symbol))
(let* ((v1-0 *level-load-list*)
(a1-0 (car v1-0))
@@ -17,6 +19,8 @@
default-level
)
;; definition for method 24 of type level-group
;; WARN: Return type mismatch object vs pair.
(defmethod alt-load-command-get-index level-group ((obj level-group) (arg0 symbol) (arg1 int))
(let ((v1-1 (-> (lookup-level-info arg0) alt-load-commands)))
(while (nonzero? arg1)
@@ -30,10 +34,12 @@
)
)
;; definition for method 29 of type level-group
(defmethod load-in-progress? level-group ((obj 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 ((obj level-group) (arg0 pointer) (arg1 symbol))
(case arg1
(('active)
@@ -66,6 +72,7 @@
(the-as level #f)
)
;; definition for function remap-level-name
(defun remap-level-name ((arg0 level-load-info))
(if (-> *level* vis?)
(-> arg0 visname)
@@ -73,6 +80,7 @@
)
)
;; definition for method 21 of type level
(defmethod get-art-group-by-name level ((obj level) (arg0 string))
(countdown (s4-0 (-> obj art-group art-group-array length))
(if (name= (-> obj art-group art-group-array s4-0 name) arg0)
@@ -82,6 +90,7 @@
(the-as art-group #f)
)
;; definition for method 13 of type level
(defmethod bsp-name level ((obj level))
(if (and (!= (-> obj status) 'inactive) (-> obj bsp) (nonzero? (-> obj bsp name)))
(-> obj bsp name)
@@ -89,6 +98,7 @@
)
)
;; definition for function add-bsp-drawable
(defun add-bsp-drawable ((arg0 bsp-header) (arg1 level) (arg2 symbol) (arg3 display-frame))
(draw arg0 arg0 arg3)
(if (nonzero? *display-strip-lines*)
@@ -97,11 +107,13 @@
(none)
)
;; definition for method 2 of type level
(defmethod print level ((obj level))
(format #t "#<~A ~A ~S @ #x~X>" (-> obj type) (-> obj status) (-> obj name) obj)
obj
)
;; definition for method 7 of type bsp-header
(defmethod relocate bsp-header ((obj bsp-header) (arg0 int))
(let ((s5-0 (-> *level* loading-level)))
(when s5-0
@@ -140,6 +152,7 @@
)
)
;; definition for method 27 of type level
(defmethod load-required-packages level ((obj level))
(when (not (or (not (-> obj bsp)) (= *kernel-boot-mode* 'debug-boot)))
(if (not (null? (-> obj info packages)))
@@ -149,6 +162,9 @@
obj
)
;; definition for method 29 of type level
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod vis-clear level ((obj level))
(countdown (v1-0 8)
(nop!)
@@ -162,6 +178,8 @@
(none)
)
;; definition for method 28 of type level
;; WARN: Return type mismatch int vs none.
(defmethod init-vis-from-bsp level ((obj level))
(when (not (or (= (-> obj status) 'inactive) (not (-> obj bsp))))
(set! (-> obj all-visible?) 'loading)
@@ -192,6 +210,7 @@
(none)
)
;; definition for method 12 of type level-group
(defmethod level-get-for-use level-group ((obj level-group) (arg0 symbol) (arg1 symbol))
(local-vars (s5-1 level))
(alloc-levels-if-needed obj #f)
@@ -239,6 +258,7 @@
s5-1
)
;; definition for method 28 of type level-group
(defmethod level-status level-group ((obj level-group) (arg0 symbol))
(let ((v1-1 (level-get *level* arg0)))
(if v1-1
@@ -247,6 +267,8 @@
)
)
;; definition for method 26 of type level
;; INFO: Used lq/sq
(defmethod level-status-update! level ((obj level) (arg0 symbol))
(case arg0
(('inactive)
@@ -315,10 +337,14 @@
obj
)
;; definition for symbol *login-state*, type login-state
(define *login-state* (new 'global 'login-state))
;; definition for symbol *print-login*, type symbol
(define *print-login* #t)
;; definition for function load-buffer-resize
;; WARN: Return type mismatch int vs none.
(defun load-buffer-resize ((arg0 level) (arg1 dgo-header))
(case (-> arg0 load-buffer-mode)
(((load-buffer-mode small-center))
@@ -341,6 +367,7 @@
(none)
)
;; definition for method 17 of type level
(defmethod load-continue level ((obj level))
(local-vars (sv-16 symbol))
(when (-> obj linking)
@@ -460,6 +487,7 @@
obj
)
;; definition for method 18 of type level
(defmethod load-begin level ((obj level))
(local-vars (bits-to-use int) (borrow-from-lev level) (found-borrow symbol))
(dotimes (v1-0 2)
@@ -738,6 +766,7 @@
obj
)
;; definition for method 19 of type level
(defmethod login-begin level ((obj level))
(set! (-> *texture-pool* allocate-func) texture-page-default-allocate)
(cond
@@ -787,6 +816,12 @@
obj
)
;; definition for function level-update-after-load
;; WARN: Found some very strange gotos. Check result carefully, this is not well tested.
;; INFO: Used lq/sq
;; ERROR: Unsupported inline assembly instruction kind - [mfc0 s5, Count]
;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count]
;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count]
(defun level-update-after-load ((lev level) (lstate login-state))
(local-vars
(current-time int)
@@ -984,7 +1019,7 @@
(+! (-> lstate state) 1)
)
(else
(entity-nav-mesh-method-27 (-> lev-bsp nav-meshes (the-as uint login-state-pos)))
(initialize-nav-mesh! (-> lev-bsp nav-meshes (the-as uint login-state-pos)))
(+! (-> lstate pos) 1)
)
)
@@ -1058,6 +1093,8 @@
lev
)
;; definition for method 25 of type level
;; INFO: Used lq/sq
(defmethod birth level ((obj level))
(local-vars (sv-96 int))
(case (-> obj status)
@@ -1130,6 +1167,8 @@
obj
)
;; definition for method 9 of type level
;; INFO: Used lq/sq
(defmethod deactivate level ((obj level))
(case (-> obj status)
(('active 'alive)
@@ -1174,6 +1213,8 @@
obj
)
;; definition for method 12 of type level
;; WARN: Using new Jak 2 rtype-of
(defmethod unload! level ((obj level))
(deactivate obj)
(when (!= (-> obj status) 'inactive)
@@ -1335,6 +1376,8 @@
obj
)
;; definition for method 10 of type level
;; ERROR: Unsupported inline assembly instruction kind - [addiu a0, a0, 56]
(defmethod is-object-visible? level ((obj level) (arg0 int))
(local-vars (a0-1 int) (a0-3 int))
(let ((v1-0 (-> obj vis-bits)))
@@ -1348,6 +1391,7 @@
)
)
;; definition for method 15 of type level
(defmethod inside-boxes-check level ((obj level) (arg0 vector))
(cond
((not (-> obj bsp))
@@ -1362,6 +1406,8 @@
)
)
;; definition for method 20 of type level
;; WARN: Return type mismatch int vs none.
(defmethod debug-print-region-splitbox level ((obj level) (arg0 vector) (arg1 object))
(cond
((or (not (-> obj bsp)) (zero? (-> obj bsp region-tree)))
@@ -1374,6 +1420,7 @@
(none)
)
;; definition for method 8 of type level
(defmethod mem-usage level ((obj level) (arg0 memory-usage-block) (arg1 int))
(when (= (-> obj status) 'active)
(set! (-> arg0 length) (max 67 (-> arg0 length)))
@@ -1428,6 +1475,8 @@
obj
)
;; definition for method 21 of type level-group
;; WARN: Return type mismatch int vs none.
(defmethod alloc-levels-if-needed level-group ((obj level-group) (arg0 symbol))
(when (zero? (-> *level* heap base))
(kmemopen global "level-heaps")
@@ -1457,6 +1506,7 @@
(none)
)
;; definition for method 10 of type level-group
(defmethod level-get-with-status level-group ((obj level-group) (arg0 symbol))
(dotimes (v1-0 (-> obj length))
(if (= (-> obj level v1-0 status) arg0)
@@ -1466,6 +1516,7 @@
(the-as level #f)
)
;; definition for method 30 of type level-group
(defmethod level-get-most-disposable level-group ((obj level-group))
(dotimes (v1-0 (-> obj length))
(case (-> obj level v1-0 status)
@@ -1504,6 +1555,7 @@
)
)
;; definition for method 9 of type level-group
(defmethod level-get level-group ((obj level-group) (arg0 symbol))
(dotimes (v1-0 (-> obj length))
(if (and (!= (-> obj level v1-0 status) 'inactive)
@@ -1515,6 +1567,7 @@
(the-as level #f)
)
;; definition for method 23 of type level-group
(defmethod art-group-get-by-name level-group ((obj level-group) (arg0 string) (arg1 (pointer uint32)))
(countdown (s4-0 7)
(let ((s3-0 (-> *level* level s4-0)))
@@ -1533,6 +1586,7 @@
(the-as art-group #f)
)
;; definition for method 13 of type level-group
(defmethod activate-levels! level-group ((obj level-group))
(dotimes (s5-0 (-> obj length))
(level-status-update! (-> obj level s5-0) 'active)
@@ -1540,6 +1594,7 @@
0
)
;; definition for method 20 of type level-group
(defmethod level-get-target-inside level-group ((obj level-group))
(let ((s5-0 (target-pos 0)))
(let ((v1-1 (-> *load-state* vis-nick)))
@@ -1609,12 +1664,15 @@
)
)
;; definition for method 22 of type level-group
;; WARN: Return type mismatch int vs none.
(defmethod load-commands-set! level-group ((obj level-group) (arg0 pair))
(set! (-> obj load-commands) arg0)
0
(none)
)
;; definition for method 8 of type level-group
(defmethod mem-usage level-group ((obj level-group) (arg0 memory-usage-block) (arg1 int))
(dotimes (s3-0 (-> obj length))
(mem-usage (-> obj level s3-0) arg0 arg1)
@@ -1622,6 +1680,9 @@
obj
)
;; definition for function bg
;; WARN: Return type mismatch int vs none.
;; WARN: Using new Jak 2 rtype-of
(defun bg ((arg0 symbol))
(set! *cheat-mode* (if *debug-segment*
'debug
@@ -1688,6 +1749,7 @@
(none)
)
;; definition for function play
(defun play ((arg0 symbol) (arg1 symbol))
(kmemopen global "level-boot")
(when *kernel-boot-level*
@@ -1772,6 +1834,8 @@
0
)
;; definition for function play-boot
;; WARN: Return type mismatch int vs none.
(defun play-boot ()
(process-spawn-function
process
@@ -1783,6 +1847,7 @@
(none)
)
;; definition for function update-sound-banks
(defun update-sound-banks ()
(local-vars (v1-21 level-load-info) (v1-28 level-load-info) (a0-24 symbol))
(if (or (nonzero? (rpc-busy? 1))
@@ -1906,6 +1971,7 @@
0
)
;; definition for method 10 of type load-state
(defmethod update! load-state ((obj load-state))
(local-vars (all-levels-inactive symbol))
(let ((discarded-level #f))
@@ -2089,6 +2155,8 @@
0
)
;; definition for method 16 of type level-group
;; WARN: Return type mismatch int vs none.
(defmethod assign-draw-indices level-group ((obj level-group))
(local-vars (t0-3 symbol))
(set! (-> obj draw-level-count) 0)
@@ -2142,6 +2210,8 @@
(none)
)
;; definition for method 19 of type level-group
;; WARN: Return type mismatch int vs none.
(defmethod level-update level-group ((obj level-group))
(local-vars (v1-101 symbol))
(camera-pos)
@@ -2421,6 +2491,7 @@
(none)
)
;; definition (debug) for function show-level
(defun-debug show-level ((arg0 symbol))
(set! (-> *setting-control* user-default border-mode) #t)
(let ((s5-0 (new 'stack-no-clear 'array 'symbol 10)))
@@ -2436,6 +2507,7 @@
0
)
;; failed to figure out what this is:
(when (zero? (-> *level* level0 art-group))
(kmemopen global "level")
(let ((gp-0 *level*))
+64 -50
View File
@@ -1,5 +1,7 @@
;;-*-Lisp-*-
(in-package goal)
;; 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)
@@ -10,6 +12,7 @@
: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 ((obj check-vector-collision-with-nav-spheres-info))
(when (not obj)
(set! obj obj)
@@ -23,6 +26,7 @@
obj
)
;; definition of type nav-gap-info
(deftype nav-gap-info (structure)
((dest vector :inline :offset-assert 0)
(poly nav-poly :offset-assert 16)
@@ -32,6 +36,7 @@
:flag-assert #x900000014
)
;; definition for method 3 of type nav-gap-info
(defmethod inspect nav-gap-info ((obj nav-gap-info))
(when (not obj)
(set! obj obj)
@@ -44,6 +49,7 @@
obj
)
;; 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)
@@ -57,6 +63,7 @@
:flag-assert #x900000058
)
;; definition for method 3 of type nav-avoid-spheres-params
(defmethod inspect nav-avoid-spheres-params ((obj nav-avoid-spheres-params))
(when (not obj)
(set! obj obj)
@@ -73,6 +80,7 @@
obj
)
;; 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)
@@ -82,6 +90,7 @@
:flag-assert #x90000002c
)
;; definition for method 3 of type nav-callback-info
(defmethod inspect nav-callback-info ((obj nav-callback-info))
(when (not obj)
(set! obj obj)
@@ -94,6 +103,7 @@
obj
)
;; definition of type nav-state
(deftype nav-state (structure)
((flags nav-state-flag :offset-assert 0)
(nav nav-control :offset-assert 4)
@@ -123,53 +133,54 @@
(:methods
(debug-draw (_type_) none 9)
(nav-state-method-10 (_type_) none 10)
(nav-state-method-11 (_type_ nav-gap-info) symbol 11)
(nav-state-method-12 (_type_ vector) vector 12)
(nav-state-method-13 (_type_ vector) vector 13)
(nav-state-method-14 (_type_ vector) vector 14)
(nav-state-method-15 (_type_ vector) vector 15)
(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)
(nav-state-method-18 (_type_ vector object vector) none 18)
(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)
(nav-state-method-24 (_type_) none 24)
(nav-state-method-25 (_type_) none 25)
(nav-state-method-26 (_type_) none 26)
(nav-state-method-27 (_type_) none 27)
(nav-state-method-28 (_type_) none 28)
(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)
(nav-state-method-31 (_type_) none 31)
(nav-state-method-32 (_type_) none 32)
(nav-state-method-33 (_type_) none 33)
(nav-state-method-34 (_type_) none 34)
(nav-state-method-35 (_type_) none 35)
(nav-state-method-36 (_type_ vector) none 36)
(nav-state-method-37 (_type_) none 37)
(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 () none 39)
(nav-state-method-40 (_type_) none 40)
(nav-state-method-41 (_type_ vector) symbol 41)
(nav-state-method-42 (_type_ vector) none 42)
(nav-state-method-43 (_type_ vector) none 43)
(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)
(nav-state-method-47 (_type_ nav-control) none 47)
(reset! (_type_ nav-control) none 47)
(nav-state-method-48 () none 48)
(nav-state-method-49 (_type_ clamp-travel-vector-to-mesh-return-info) none 49)
(navigate-using-best-dir-use-existing-avoid-spheres (_type_ nav-avoid-spheres-params) none 49)
(nav-state-method-50 (_type_) none 50)
(nav-state-method-51 () none 51)
(nav-state-method-52 (_type_) none 52)
(nav-state-method-53 (_type_) none 53)
(nav-state-method-54 (_type_) none 54)
(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)
)
)
;; definition for method 3 of type nav-state
(defmethod inspect nav-state ((obj nav-state))
(when (not obj)
(set! obj obj)
@@ -249,6 +260,7 @@
obj
)
;; definition of type nav-control
(deftype nav-control (structure)
((flags nav-control-flag :offset-assert 0)
(callback-info nav-callback-info :offset-assert 4)
@@ -278,28 +290,28 @@
:flag-assert #x2f00000120
(:methods
(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_ vector vector nav-poly) nav-poly 12)
(find-poly (_type_ vector) nav-poly 13)
(nav-control-method-14 (_type_ nav-poly vector object vector) none 14)
(nav-control-method-15 (_type_ vector) none 15)
(nav-control-method-16 (_type_ vector float) symbol 16)
(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)
(nav-control-method-18 () none 18)
(nav-control-method-19 () none 19)
(nav-control-method-20 (_type_ vector nav-poly vector float symbol symbol) none 20)
(nav-control-method-21 (_type_) none 21)
(nav-control-method-22 (_type_ vector nav-avoid-spheres-params) float 22)
(nav-control-method-23 (_type_) none 23)
(nav-control-method-24 (_type_ vector int) none 24)
(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) none 24)
(get-max-rotation-rate (_type_) float 25)
(get-sphere-mask (_type_) none 26)
(get-sphere-mask (_type_) uint 26)
(get-target-speed (_type_) meters 27)
(nav-control-method-28 (_type_) none 28)
(nav-control-method-29 (_type_) none 29)
(enable-extra-sphere! (_type_) none 28)
(disable-extra-sphere! (_type_) none 29)
(copy-extra-nav-sphere! (_type_ sphere) none 30)
(set-extra-nav-sphere! (_type_ sphere) none 31)
(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)
@@ -309,15 +321,16 @@
(set-turning-acceleration! (_type_ meters) none 38)
(set-max-rotation-rate! (_type_ float) none 39)
(set-sphere-mask! (_type_ uint) none 40)
(nav-control-method-41 (_type_) none 41)
(remove! (_type_) none 41)
(init! (_type_ collide-shape) none 42)
(display-marks? (_type_) symbol 43)
(nav-control-method-44 () none 44)
(nav-control-method-45 (_type_ vector vector vector) sphere 45)
(find-sphere (_type_ symbol) none 46)
(find-first-sphere-intersecting-ray (_type_ vector vector vector) sphere 45)
(find-sphere-ids-from-sphere-hash (_type_ symbol) none 46)
)
)
;; definition for method 3 of type nav-control
(defmethod inspect nav-control ((obj nav-control))
(when (not obj)
(set! obj obj)
@@ -384,4 +397,5 @@
obj
)
;; failed to figure out what this is:
0
File diff suppressed because it is too large Load Diff
+128 -29
View File
@@ -1,5 +1,7 @@
;;-*-Lisp-*-
(in-package goal)
;; 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)
@@ -20,6 +22,7 @@
:flag-assert #x9000001c0
)
;; definition for method 3 of type nav-mesh-work-debug
(defmethod inspect nav-mesh-work-debug ((obj nav-mesh-work-debug))
(when (not obj)
(set! obj obj)
@@ -43,6 +46,7 @@
obj
)
;; 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)
@@ -68,6 +72,7 @@
:flag-assert #x90000013c
)
;; definition for method 3 of type nav-mesh-work
(defmethod inspect nav-mesh-work ((obj nav-mesh-work))
(when (not obj)
(set! obj obj)
@@ -96,6 +101,7 @@
obj
)
;; definition of type nav-mesh-link
(deftype nav-mesh-link (structure)
((id uint32 :offset-assert 0)
(dest-mesh-id uint32 :offset-assert 4)
@@ -110,6 +116,7 @@
:flag-assert #x900000010
)
;; definition for method 3 of type nav-mesh-link
(defmethod inspect nav-mesh-link ((obj nav-mesh-link))
(when (not obj)
(set! obj obj)
@@ -127,6 +134,7 @@
obj
)
;; definition of type nav-poly
(deftype nav-poly (structure)
((data uint8 64 :offset-assert 0)
(vertex vector 4 :inline :offset 0)
@@ -151,6 +159,7 @@
:flag-assert #x900000040
)
;; definition for method 3 of type nav-poly
(defmethod inspect nav-poly ((obj nav-poly))
(when (not obj)
(set! obj obj)
@@ -178,6 +187,7 @@
obj
)
;; definition of type nav-vertex
(deftype nav-vertex (vector)
"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)"
@@ -187,6 +197,8 @@
:flag-assert #x900000010
)
;; definition for method 3 of type nav-vertex
;; INFO: Used lq/sq
(defmethod inspect nav-vertex ((obj nav-vertex))
(when (not obj)
(set! obj obj)
@@ -203,6 +215,7 @@
obj
)
;; definition of type nav-sphere
(deftype nav-sphere (structure)
((trans sphere :inline :offset-assert 0)
)
@@ -211,6 +224,7 @@
:flag-assert #x900000010
)
;; definition for method 3 of type nav-sphere
(defmethod inspect nav-sphere ((obj nav-sphere))
(when (not obj)
(set! obj obj)
@@ -222,6 +236,7 @@
obj
)
;; definition of type nav-ray
(deftype nav-ray (structure)
((current-pos vector :inline :offset-assert 0)
(dir vector :inline :offset-assert 16)
@@ -241,6 +256,7 @@
:flag-assert #x900000050
)
;; definition for method 3 of type nav-ray
(defmethod inspect nav-ray ((obj nav-ray))
(when (not obj)
(set! obj obj)
@@ -263,6 +279,7 @@
obj
)
;; 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)
@@ -273,6 +290,7 @@
:flag-assert #x900000025
)
;; definition for method 3 of type nav-route-portal
(defmethod inspect nav-route-portal ((obj nav-route-portal))
(when (not obj)
(set! obj obj)
@@ -286,6 +304,7 @@
obj
)
;; 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)
@@ -299,6 +318,7 @@
:flag-assert #x900000024
)
;; definition for method 3 of type nav-find-poly-parms
(defmethod inspect nav-find-poly-parms ((obj nav-find-poly-parms))
(when (not obj)
(set! obj obj)
@@ -315,8 +335,9 @@
obj
)
;; definition of type clamp-travel-vector-to-mesh-return-info
(deftype clamp-travel-vector-to-mesh-return-info (structure)
((found-boundary basic :offset-assert 0)
((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)
@@ -335,6 +356,7 @@
: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 ((obj clamp-travel-vector-to-mesh-return-info))
(when (not obj)
(set! obj obj)
@@ -358,6 +380,7 @@
obj
)
;; 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)
@@ -388,47 +411,48 @@
:size-assert #x70
:flag-assert #x2f00000070
(:methods
(nav-mesh-method-9 (_type_) none 9)
(debug-draw (_type_) none 9)
(nav-mesh-method-10 (_type_ vector vector nav-poly) nav-poly 10)
(nav-mesh-method-11 (_type_ nav-poly vector) vector 11)
(nav-mesh-method-12 (_type_ nav-poly vector) none 12)
(nav-mesh-method-13 (_type_ nav-poly nav-poly) nav-poly 13)
(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)
(nav-mesh-method-18 (_type_ vector nav-poly vector float symbol clamp-travel-vector-to-mesh-return-info) none 18)
(nav-mesh-method-19 (_type_) none 19)
(nav-mesh-method-20 (_type_ clamp-travel-vector-to-mesh-return-info) none 20)
(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)
(nav-mesh-method-22 (_type_ vector vector) none 22)
(nav-mesh-method-23 (_type_ entity-nav-mesh) none 23)
(nav-mesh-method-24 (_type_) none 24)
(nav-mesh-method-25 (_type_) none 25)
(nav-mesh-method-26 (_type_) none 26)
(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 int) nav-control 27)
(nav-mesh-method-28 (_type_ object) none 28)
(nav-mesh-method-29 (_type_ process-drawable symbol) nav-control 29)
(nav-mesh-method-30 (_type_ process-drawable) none 30)
(change-to (_type_ process-drawable) none 31)
(nav-mesh-method-32 (_type_ uint32) none 32)
(nav-mesh-method-33 (_type_ uint32) symbol 33)
(nav-mesh-method-34 (_type_ object vector float) none 34)
(nav-mesh-method-35 () none 35)
(nav-mesh-method-36 (_type_ nav-poly rgba) none 36)
(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 symbol) 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) none 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 object) vector 38)
(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)
(nav-mesh-method-40 (_type_ nav-poly vector object vector) none 40)
(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)
(nav-mesh-method-42 (_type_ nav-find-poly-parms) nav-poly 42)
(nav-mesh-method-43 (_type_ nav-find-poly-parms) none 43)
(nav-mesh-method-44 (_type_ vector float float) symbol 44)
(nav-mesh-method-45 (_type_ entity-perm) none 45)
(nav-mesh-method-46 (_type_ object) none 46)
(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)
)
)
;; definition for method 3 of type nav-mesh
(defmethod inspect nav-mesh ((obj nav-mesh))
(when (not obj)
(set! obj obj)
@@ -469,6 +493,7 @@
obj
)
;; definition for function vector-normalize-unity!
(defun vector-normalize-unity! ((arg0 vector))
(rlet ((acc :class vf)
(Q :class vf)
@@ -501,6 +526,8 @@
)
)
;; definition for function vector-normalize-unity-copy!
;; INFO: Used lq/sq
(defun vector-normalize-unity-copy! ((arg0 vector) (arg1 vector))
(rlet ((acc :class vf)
(Q :class vf)
@@ -534,10 +561,13 @@
)
)
;; definition (debug) for function debug-validate-current-poly
(defun-debug debug-validate-current-poly ()
#f
)
;; definition for function init-ray
;; WARN: Return type mismatch int vs none.
(defun init-ray ((arg0 nav-ray))
(rlet ((acc :class vf)
(Q :class vf)
@@ -581,6 +611,7 @@
)
)
;; definition for function point-poly-intersection?
(defun point-poly-intersection? ((arg0 nav-mesh) (arg1 vector) (arg2 int) (arg3 (inline-array vector)))
(let ((v1-1 (-> arg0 work vert0-table))
(a0-2 (-> arg0 work vert1-table))
@@ -603,6 +634,7 @@
#t
)
;; definition for method 37 of type nav-mesh
(defmethod point-in-poly? nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector))
(let* ((a3-0 obj)
(v1-0 arg1)
@@ -629,6 +661,13 @@
#t
)
;; definition for method 39 of type nav-mesh
;; INFO: Used lq/sq
;; WARN: Stack slot offset 56 signed mismatch
;; WARN: Stack slot offset 56 signed mismatch
;; 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 ((obj 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))
@@ -651,6 +690,13 @@
(none)
)
;; definition for method 41 of type nav-mesh
;; INFO: Used lq/sq
;; WARN: Stack slot offset 56 signed mismatch
;; WARN: Stack slot offset 56 signed mismatch
;; 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 ((obj nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector))
(local-vars (sv-48 vector) (sv-52 vector) (sv-56 float))
(cond
@@ -682,6 +728,57 @@
(none)
)
;; definition for method 16 of type nav-mesh
;; INFO: Used lq/sq
;; WARN: Stack slot offset 44 signed mismatch
;; WARN: Stack slot offset 48 signed mismatch
;; WARN: Stack slot offset 44 signed mismatch
;; WARN: Stack slot offset 48 signed mismatch
;; WARN: Stack slot offset 44 signed mismatch
;; WARN: Stack slot offset 60 signed mismatch
;; WARN: Stack slot offset 48 signed mismatch
;; WARN: Stack slot offset 64 signed mismatch
;; WARN: Stack slot offset 60 signed mismatch
;; WARN: Stack slot offset 64 signed mismatch
;; WARN: Stack slot offset 44 signed mismatch
;; WARN: Stack slot offset 48 signed mismatch
;; WARN: Stack slot offset 44 signed mismatch
;; WARN: Stack slot offset 48 signed mismatch
;; WARN: Stack slot offset 44 signed mismatch
;; WARN: Stack slot offset 48 signed mismatch
;; WARN: Stack slot offset 44 signed mismatch
;; WARN: Stack slot offset 60 signed mismatch
;; WARN: Stack slot offset 48 signed mismatch
;; WARN: Stack slot offset 64 signed mismatch
;; WARN: Stack slot offset 60 signed mismatch
;; WARN: Stack slot offset 64 signed mismatch
;; WARN: Stack slot offset 44 signed mismatch
;; WARN: Stack slot offset 48 signed mismatch
;; WARN: Stack slot offset 44 signed mismatch
;; WARN: Stack slot offset 48 signed mismatch
;; WARN: Stack slot offset 44 signed mismatch
;; WARN: Stack slot offset 48 signed mismatch
;; WARN: Stack slot offset 44 signed mismatch
;; WARN: Stack slot offset 60 signed mismatch
;; WARN: Stack slot offset 48 signed mismatch
;; WARN: Stack slot offset 64 signed mismatch
;; WARN: Stack slot offset 60 signed mismatch
;; WARN: Stack slot offset 64 signed mismatch
;; WARN: Stack slot offset 44 signed mismatch
;; WARN: Stack slot offset 48 signed mismatch
;; WARN: Stack slot offset 44 signed mismatch
;; WARN: Stack slot offset 48 signed mismatch
;; WARN: Stack slot offset 44 signed mismatch
;; WARN: Stack slot offset 48 signed mismatch
;; WARN: Stack slot offset 44 signed mismatch
;; WARN: Stack slot offset 60 signed mismatch
;; WARN: Stack slot offset 48 signed mismatch
;; WARN: Stack slot offset 64 signed mismatch
;; WARN: Stack slot offset 60 signed mismatch
;; WARN: Stack slot offset 64 signed mismatch
;; 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 ((obj nav-mesh) (ray nav-ray))
(local-vars
(next-poly-idx int)
@@ -766,6 +863,8 @@
(none)
)
;; definition (debug) for function nav-sphere-from-cam
;; WARN: Return type mismatch int vs none.
(defun-debug nav-sphere-from-cam ()
(let ((v1-0 (camera-pos)))
(format #t "SPHEREM(~4,,1M, ~4,,1M, ~4,,1M, 1.0)~%" (-> v1-0 x) (-> v1-0 y) (-> v1-0 z))
File diff suppressed because it is too large Load Diff
+4 -4
View File
@@ -342,16 +342,16 @@
)
)
(when s4-1
(let ((a2-3 ((method-of-type nav-control nav-control-method-11) (the-as nav-control s4-1) arg1)))
(let ((a2-3 ((method-of-type nav-control find-poly-containing-point-1) (the-as nav-control s4-1) arg1)))
(if a2-3
((method-of-type nav-control nav-control-method-20)
((method-of-type nav-control clamp-vector-to-mesh-cross-gaps)
(the-as nav-control s4-1)
arg1
(the-as nav-poly a2-3)
a2-3
arg0
2048.0
#f
#f
(the-as clamp-travel-vector-to-mesh-return-info #f)
)
(set! (-> arg0 quad) (the-as uint128 0))
)
@@ -533,7 +533,7 @@
)
(let ((a0-3 (-> obj nav)))
(if (and a0-3 (nonzero? a0-3))
(nav-control-method-41 a0-3)
(remove! a0-3)
)
)
(let* ((s5-0 (-> obj root))
@@ -152,8 +152,8 @@
(the-as (function process int symbol event-message-block object) simple-nav-sphere-event-handler)
)
(if arg2
(nav-mesh-method-29 arg2 self #f)
(nav-mesh-connect-from-ent (the-as entity-nav-mesh self))
(add-process-drawable-to-navmesh arg2 self #f)
(nav-mesh-connect-from-ent self)
)
(if (>= (-> self track-joint) 0)
(go-virtual active)
+9 -9
View File
@@ -57,7 +57,7 @@
:size-assert #x58
:flag-assert #x1900000058
(:methods
(new (symbol type int int) _type_ 0)
(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)
@@ -107,12 +107,12 @@
;; 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 uint32 :offset-assert 28)
((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)
)
:method-count-assert 9
:size-assert #x20
@@ -154,8 +154,8 @@
(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)
(sphere-hash-method-30 (_type_ find-nav-sphere-ids-params) none 30)
(sphere-hash-method-31 (_type_ vector int int) none 31)
(find-nav-sphere-ids (_type_ find-nav-sphere-ids-params) none 30)
(add-sphere-with-mask-and-id (_type_ vector int int) none 31)
(sphere-hash-method-32 (_type_ vector vector float int) symbol 32)
(remove-by-id (_type_ sphere int) none 33)
)
+1 -1
View File
@@ -47,7 +47,7 @@
;; definition for method 0 of type grid-hash
;; WARN: Return type mismatch object vs grid-hash.
(defmethod new grid-hash ((allocation symbol) (type-to-make type) (arg0 int) (arg1 int))
(defmethod new grid-hash ((allocation symbol) (type-to-make type) (arg0 int))
(let ((gp-0 (the-as object (object-new allocation type-to-make (the-as int (-> type-to-make size))))))
(when (zero? (the-as grid-hash gp-0))
(set! gp-0 0)
+1 -1
View File
@@ -254,7 +254,7 @@
(bouncer-method-24 obj)
(process-drawable-from-entity! obj arg0)
(init-skeleton! obj)
(nav-mesh-connect-from-ent (the-as entity-nav-mesh obj))
(nav-mesh-connect-from-ent obj)
(set! (-> obj spring-height) (res-lump-float arg0 'spring-height :default 45056.0))
(go (method-of-object obj idle))
(none)
@@ -0,0 +1,493 @@
;;-*-Lisp-*-
(in-package goal)
;; definition of type nav-network-adjacency
(deftype nav-network-adjacency (structure)
((index int32 :offset-assert 0)
(dist float :offset-assert 4)
)
:method-count-assert 9
:size-assert #x8
:flag-assert #x900000008
)
;; definition for method 3 of type nav-network-adjacency
(defmethod inspect nav-network-adjacency ((obj nav-network-adjacency))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj 'nav-network-adjacency)
(format #t "~1Tindex: ~D~%" (-> obj index))
(format #t "~1Tdist: ~f~%" (-> obj dist))
(label cfg-4)
obj
)
;; definition of type nav-network-adjacency-array
(deftype nav-network-adjacency-array (inline-array-class)
((data nav-network-adjacency :inline :dynamic :offset-assert 16)
)
: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 ((obj nav-network-adjacency-array))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~1Tlength: ~D~%" (-> obj length))
(format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length))
(format #t "~1Tdata[0] @ #x~X~%" (-> obj data))
(label cfg-4)
obj
)
;; failed to figure out what this is:
(set! (-> nav-network-adjacency-array heap-base) (the-as uint 16))
;; definition of type list-node
(deftype list-node (structure)
((next list-node :offset-assert 0)
(prev list-node :offset-assert 4)
)
:method-count-assert 9
:size-assert #x8
:flag-assert #x900000008
)
;; definition for method 3 of type list-node
(defmethod inspect list-node ((obj list-node))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj 'list-node)
(format #t "~1Tnext: #<list-node @ #x~X>~%" (-> obj next))
(format #t "~1Tprev: #<list-node @ #x~X>~%" (-> obj prev))
(label cfg-4)
obj
)
;; 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)
)
: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 ((obj nav-network-path-node))
(when (not obj)
(set! obj obj)
(goto cfg-8)
)
(format #t "[~8x] ~A~%" obj 'nav-network-path-node)
(format #t "~1Tnext: #<list-node @ #x~X>~%" (-> obj next))
(format #t "~1Tprev: #<list-node @ #x~X>~%" (-> obj prev))
(format #t "~1Trow-index: ~D~%" (-> obj row-index))
(format #t "~1Tstatus: #x~X : (net-path-node-status " (-> obj status))
(let ((s5-0 (-> obj status)))
(if (= (logand s5-0 (net-path-node-status closed)) (net-path-node-status closed))
(format #t "closed ")
)
(if (= (logand s5-0 (net-path-node-status open)) (net-path-node-status open))
(format #t "open ")
)
)
(format #t ")~%")
(format #t "~1Tparent: #<nav-network-path-node @ #x~X>~%" (-> obj parent))
(format #t "~1Tcost-to-start: ~f~%" (-> obj cost-to-start))
(format #t "~1Tcost-to-end: ~f~%" (-> obj cost-to-end))
(label cfg-8)
obj
)
;; 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)
)
:method-count-assert 9
:size-assert #x44
:flag-assert #x900000044
)
;; definition for method 3 of type nav-network-info
(defmethod inspect nav-network-info ((obj nav-network-info))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj 'nav-network-info)
(format #t "~1Tindex: ~D~%" (-> obj index))
(format #t "~1Tpos: #<vector @ #x~X>~%" (-> obj pos))
(format #t "~1Tpath-node: #<nav-network-path-node @ #x~X>~%" (-> obj path-node))
(format #t "~1Tcount: ~D~%" (-> obj count))
(format #t "~1Tadjacency: #x~X~%" (-> obj adjacency))
(label cfg-4)
obj
)
;; definition of type nav-network-info-array
(deftype nav-network-info-array (inline-array-class)
((data nav-network-info :inline :dynamic :offset-assert 16)
)
: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 ((obj nav-network-info-array))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~1Tlength: ~D~%" (-> obj length))
(format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length))
(format #t "~1Tdata[0] @ #x~X~%" (-> obj data))
(label cfg-4)
obj
)
;; failed to figure out what this is:
(set! (-> nav-network-info-array heap-base) (the-as uint 80))
;; definition of type hover-nav-sphere
(deftype hover-nav-sphere (list-node)
((sphere sphere :inline :offset-assert 16)
(handle uint64 :offset-assert 32)
(timer uint64 :offset-assert 40)
)
:method-count-assert 9
:size-assert #x30
:flag-assert #x900000030
)
;; definition for method 3 of type hover-nav-sphere
(defmethod inspect hover-nav-sphere ((obj hover-nav-sphere))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj 'hover-nav-sphere)
(format #t "~1Tnext: #<list-node @ #x~X>~%" (-> obj next))
(format #t "~1Tprev: #<list-node @ #x~X>~%" (-> obj prev))
(format #t "~1Tsphere: #<sphere @ #x~X>~%" (-> obj sphere))
(format #t "~1Thandle: ~D~%" (-> obj handle))
(format #t "~1Ttimer: ~D~%" (-> obj timer))
(label cfg-4)
obj
)
;; definition of type hover-nav-path-segment
(deftype hover-nav-path-segment (list-node)
((curve-matrix matrix :inline :offset-assert 16)
(pos-index int32 2 :offset-assert 80)
(dist float :offset-assert 88)
(du float :offset-assert 92)
)
:method-count-assert 10
:size-assert #x60
:flag-assert #xa00000060
(:methods
(hover-nav-path-segment-method-9 (_type_ float) none 9)
)
)
;; definition for method 3 of type hover-nav-path-segment
(defmethod inspect hover-nav-path-segment ((obj hover-nav-path-segment))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj 'hover-nav-path-segment)
(format #t "~1Tnext: #<list-node @ #x~X>~%" (-> obj next))
(format #t "~1Tprev: #<list-node @ #x~X>~%" (-> obj prev))
(format #t "~1Tcurve-matrix: #<matrix @ #x~X>~%" (-> obj curve-matrix))
(format #t "~1Tpos-index[2] @ #x~X~%" (-> obj pos-index))
(format #t "~1Tdist: ~f~%" (-> obj dist))
(format #t "~1Tdu: ~f~%" (-> obj du))
(label cfg-4)
obj
)
;; 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 ((obj hover-nav-path-segment) (arg0 float))
(set! (-> obj du) (/ arg0 (-> obj dist)))
0
(none)
)
;; 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)
)
:method-count-assert 10
:size-assert #x10
:flag-assert #xa00000010
(:methods
(hover-nav-path-info-method-9 () none 9)
)
)
;; definition for method 3 of type hover-nav-path-info
(defmethod inspect hover-nav-path-info ((obj hover-nav-path-info))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj 'hover-nav-path-info)
(format #t "~1Tsegment-list: #<hover-nav-path-segment @ #x~X>~%" (-> obj segment-list))
(format #t "~1Ttail-segment: #<hover-nav-path-segment @ #x~X>~%" (-> obj tail-segment))
(format #t "~1Tcurr-segment: #<hover-nav-path-segment @ #x~X>~%" (-> obj curr-segment))
(format #t "~1Tcurr-u: ~f~%" (-> obj curr-u))
(label cfg-4)
obj
)
;; definition of type path-index-array
(deftype path-index-array (inline-array-class)
((data hover-nav-path-info :inline :dynamic :offset-assert 16)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; definition for method 3 of type path-index-array
(defmethod inspect path-index-array ((obj path-index-array))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~1Tlength: ~D~%" (-> obj length))
(format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length))
(format #t "~1Tdata[0] @ #x~X~%" (-> obj data))
(label cfg-4)
obj
)
;; failed to figure out what this is:
(set! (-> path-index-array heap-base) (the-as uint 4))
;; definition of type nav-network
(deftype nav-network (basic)
((network basic :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 uint32 :offset-assert 116)
(sphere-pool uint32 :offset-assert 120)
)
:method-count-assert 33
:size-assert #x7c
:flag-assert #x210000007c
(:methods
(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_) none 13)
(nav-network-method-14 (_type_ int) none 14)
(nav-network-method-15 (_type_) none 15)
(nav-network-method-16 (_type_) none 16)
(nav-network-method-17 (_type_) nav-network-path-node 17)
(nav-network-method-18 (_type_) none 18)
(nav-network-method-19 (_type_) none 19)
(nav-network-method-20 (_type_) none 20)
(nav-network-method-21 (_type_) none 21)
(nav-network-method-22 (_type_) none 22)
(nav-network-method-23 (_type_) none 23)
(nav-network-method-24 (_type_) none 24)
(nav-network-method-25 (_type_) none 25)
(nav-network-method-26 (_type_) none 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_) basic 30)
(nav-network-method-31 () none 31)
(nav-network-method-32 () none 32)
)
)
;; definition for method 3 of type nav-network
(defmethod inspect nav-network ((obj nav-network))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~1Tnetwork: ~A~%" (-> obj network))
(format #t "~1Tdummy: #<nav-network-info @ #x~X>~%" (-> obj dummy))
(format #t "~1Tcontrol-handle: ~D~%" (-> obj control-handle))
(format #t "~1Tlist-table[5] @ #x~X~%" (-> obj list-table))
(format #t "~1Topen-list: #<nav-network-path-node @ #x~X>~%" (-> obj open-list))
(format #t "~1Tclosed-list: #<nav-network-path-node @ #x~X>~%" (-> obj closed-list))
(format #t "~1Tsphere-list: #<hover-nav-sphere @ #x~X>~%" (-> obj sphere-list))
(format #t "~1Tfree-segment-list: #<hover-nav-path-segment @ #x~X>~%" (-> obj free-segment-list))
(format #t "~1Tfree-sphere-list: #<hover-nav-sphere @ #x~X>~%" (-> obj free-sphere-list))
(format #t "~1Tsegment-pool: #x~X~%" (-> obj segment-pool))
(format #t "~1Tsphere-pool: #x~X~%" (-> obj sphere-pool))
(label cfg-4)
obj
)
;; definition for method 30 of type nav-network
(defmethod get-network nav-network ((obj nav-network))
(-> obj 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)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; definition for method 3 of type hover-nav-params
(defmethod inspect hover-nav-params ((obj hover-nav-params))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj 'hover-nav-params)
(format #t "~1Tmax-speed: ~f~%" (-> obj max-speed))
(format #t "~1Tmax-acceleration: ~f~%" (-> obj max-acceleration))
(format #t "~1Tfriction: ~f~%" (-> obj friction))
(format #t "~1Tnav-collide-prim-index: ~D~%" (-> obj nav-collide-prim-index))
(label cfg-4)
obj
)
;; definition of type hover-nav-control
(deftype hover-nav-control (basic)
((root basic :offset-assert 4)
(nav basic :offset-assert 8)
(flags uint16 :offset-assert 12)
(params hover-nav-params :offset-assert 16)
(path-timer uint64 :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)
)
:method-count-assert 32
:size-assert #xd8
:flag-assert #x20000000d8
(:methods
(hover-nav-control-method-9 (_type_) none 9)
(hover-nav-control-method-10 (_type_) none 10)
(hover-nav-control-method-11 (_type_) 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_) none 15)
(hover-nav-control-method-16 (_type_) none 16)
(hover-nav-control-method-17 (_type_) none 17)
(hover-nav-control-method-18 (_type_) none 18)
(hover-nav-control-method-19 (_type_) 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_) none 26)
(hover-nav-control-method-27 (_type_) none 27)
(hover-nav-control-method-28 (_type_) none 28)
(hover-nav-control-method-29 (_type_) none 29)
(hover-nav-control-method-30 (_type_) float 30)
(hover-nav-control-method-31 (_type_) float 31)
)
)
;; definition for method 3 of type hover-nav-control
(defmethod inspect hover-nav-control ((obj hover-nav-control))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~1Troot: ~A~%" (-> obj root))
(format #t "~1Tnav: ~A~%" (-> obj nav))
(format #t "~1Tflags: ~D~%" (-> obj flags))
(format #t "~1Tparams: #<hover-nav-params @ #x~X>~%" (-> obj params))
(format #t "~1Tpath-timer: ~D~%" (-> obj path-timer))
(format #t "~1Ttransvv: #<vector @ #x~X>~%" (-> obj transvv))
(format #t "~1Tdest-pos: #<vector @ #x~X>~%" (-> obj dest-pos))
(format #t "~1Tdest-vel: #<vector @ #x~X>~%" (-> obj dest-vel))
(format #t "~1Tdest-move-dir: #<vector @ #x~X>~%" (-> obj dest-move-dir))
(format #t "~1Tdest-offset: #<vector @ #x~X>~%" (-> obj dest-offset))
(format #t "~1Tmove-dir: #<vector @ #x~X>~%" (-> obj move-dir))
(format #t "~1Tnav-collide-impulse: #<vector @ #x~X>~%" (-> obj nav-collide-impulse))
(format #t "~1Tnav-collide-impulse-len: ~f~%" (-> obj nav-collide-impulse-len))
(format #t "~1Tdest-speed: ~f~%" (-> obj dest-speed))
(format #t "~1Tlocal-dist: ~f~%" (-> obj local-dist))
(format #t "~1Tspeed: ~f~%" (-> obj speed))
(format #t "~1Tmax-los-speed: ~f~%" (-> obj max-los-speed))
(format #t "~1Ttarget-speed: ~f~%" (-> obj target-speed))
(format #t "~1Ttarget-acceleration: ~f~%" (-> obj target-acceleration))
(format #t "~1Tspeed-dest: ~f~%" (-> obj speed-dest))
(format #t "~1Tpath-info: #<hover-nav-path-info @ #x~X>~%" (-> obj path-info))
(format #t "~1Tcurr-dest-pt: ~D~%" (-> obj curr-dest-pt))
(format #t "~1Tlos-obstruction-distance: ~f~%" (-> obj los-obstruction-distance))
(format #t "~1Tlos-last-clear-time: ~D~%" (-> obj los-last-clear-time))
(format #t "~1Tmax-speed-multiplier: ~f~%" (-> obj max-speed-multiplier))
(format #t "~1Tmax-acceleration-multiplier: ~f~%" (-> obj max-acceleration-multiplier))
(label cfg-4)
obj
)
;; definition for symbol *hover-nav-time-offset*, type int
(define *hover-nav-time-offset* 0)
;; failed to figure out what this is:
0
File diff suppressed because it is too large Load Diff
+1 -5
View File
@@ -941,7 +941,7 @@
(vector-normalize! s3-2 f28-1)
(vector+! s3-2 s3-2 s4-2)
)
(nav-state-method-41 (-> obj nav state) s3-2)
(clamp-vector-to-mesh-cross-gaps (-> obj nav state) s3-2)
(vector+! s2-0 s5-1 s3-2)
(set! (-> obj target-pos quad) (-> s2-0 quad))
)
@@ -1509,7 +1509,3 @@
)
(none)
)
File diff suppressed because it is too large Load Diff
+5 -1
View File
@@ -258,7 +258,11 @@
"target-board-handler", // very strange control flow
"(method 11 memory-usage-block)", "vis-cull", "vis-cull-debug", "dma-add-process-drawable",
"foreground-engine-execute",
"test-closest-pt-in-triangle", "on"
"test-closest-pt-in-triangle", "on",
"(method 42 nav-mesh)",
"(method 43 nav-mesh)",
"(method 34 nav-mesh)",
"(method 18 nav-control)"
],
"skip_compile_states": {