[decomp] collide cache, other minor fixes (#2031)

This commit is contained in:
water111 2022-11-20 11:32:29 -05:00 committed by GitHub
parent e0ebc5a68e
commit 6298533eaa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
29 changed files with 4533 additions and 45 deletions

View File

@ -16054,6 +16054,7 @@
(declare-type collide-cache-prim structure)
(declare-type collide-shape-prim-group structure)
(declare-type collide-cache basic)
(deftype collide-shape-prim (basic)
((cshape collide-shape :offset-assert 4)
@ -16078,7 +16079,7 @@
(:methods
(new (symbol type collide-shape uint int) _type_ 0)
(debug-draw (_type_) none 9)
(add-fg-prim-using-box () none 10)
(add-fg-prim-using-box (_type_ collide-cache) none 10)
(add-fg-prim-using-line-sphere () none 11)
(overlaps-others-test (_type_ overlaps-others-params collide-shape-prim) symbol 12)
(overlaps-others-group (_type_ overlaps-others-params collide-shape-prim-group) symbol 13)
@ -18410,6 +18411,7 @@
(prim-index uint16 :offset 56)
(user16 uint16 :offset 58)
(user32 uint32 :offset 60)
(clear-flags uint128 :offset 48)
)
:method-count-assert 9
:size-assert #x40
@ -18471,7 +18473,7 @@
(probe-using-spheres (_type_ collide-query) symbol 17) ;; (initialize (_type_) none 17)
(fill-from-bg (_type_ (function collide-hash int collide-list collide-query int) (function collide-cache collide-list collide-query none) collide-query) none 18) ;; (probe-using-line-sphere (_type_ vector vector float collide-kind collide-tri-result pat-surface) float 18)
(fill-from-fg-boxes (_type_) none 19) ;; (probe-using-spheres (_type_ collide-using-spheres-params) symbol 19)
(fill-from-fg-line-sphere (_type_) none 20) ;; (probe-using-y-probe (_type_ vector float collide-kind collide-tri-result pat-surface) float 20)
(fill-from-fg-line-sphere (_type_ collide-query) none 20) ;; (probe-using-y-probe (_type_ vector float collide-kind collide-tri-result pat-surface) float 20)
(fill-from-water (_type_ water-control) none 21) ;; (fill-from-background (_type_ (function bsp-header int collide-list none) (function collide-cache object none)) none 21)
(collide-cache-method-22 () none 22) ;; (fill-from-foreground-using-box (_type_) none 22)
(collide-cache-method-23 () none 23) ;; (fill-from-foreground-using-line-sphere (_type_) none 23)
@ -22794,11 +22796,11 @@
(:methods
(new (symbol type int int) _type_ 0)
(add-an-object (_type_ vector hash-object-info) int 34)
(spatial-hash-method-35 (_type_) none 35)
(fill-actor-list-for-box (_type_ bounding-box (pointer collide-shape) int) int 35)
(fill-actor-list-for-sphere (_type_ sphere (pointer collide-shape) int) int 36)
(spatial-hash-method-37 (_type_) none 37)
(fill-actor-list-for-vec+r (_type_ vector (pointer collide-shape) int) none 38)
(spatial-hash-method-39 (_type_ object hash-object-info) none 39)
(fill-actor-list-for-line-sphere (_type_ vector vector float (pointer collide-shape) int int) int 37)
(fill-actor-list-for-vec+r (_type_ vector (pointer collide-shape) int) int 38)
(spatial-hash-method-39 (_type_ object hash-object-info) int 39)
(validate-objects (_type_) none 40)
)
)

View File

@ -541,7 +541,18 @@
"(method 39 spatial-hash)",
"(method 36 spatial-hash)",
"(method 37 spatial-hash)",
"(method 35 spatial-hash)"
"(method 35 spatial-hash)",
"(method 10 collide-shape-prim-mesh)",
"(method 10 collide-shape-prim-sphere)",
"(method 10 collide-shape-prim-group)",
"(method 11 collide-shape-prim-mesh)",
"(method 11 collide-shape-prim-sphere)",
"(method 11 collide-shape-prim-group)",
"(method 9 collide-cache-prim)",
"(method 10 collide-cache-prim)",
"(method 17 collide-cache)",
"(method 9 collide-puss-work)",
"(method 10 collide-puss-work)"
],
"mips2c_jump_table_functions": {},

View File

@ -1192,5 +1192,8 @@
"(enter cam-launcher-longfall)": [[16, "vector"]],
"explosion-init-by-other": [[16, "traffic-danger-info"]],
"process-drawable-shock-skel-effect": [[176, "matrix"], [256, "vector"], [272, "vector"],
[288, "vector"], [304, "quaternion"], [384, "vector"]]
[288, "vector"], [304, "quaternion"], [384, "vector"]],
"(method 20 collide-cache)": [
[16, "matrix"]
]
}

View File

@ -3138,7 +3138,7 @@
"memcard-unlocked-secrets?": [[50, "s5", "int"]],
"(method 10 progress)": [[45, "t9", "(function progress none)"]],
"load-game-text-info": [[4, "v1", "game-text-info"]],
"(method 16 camera-master)": [[[11, 15], "a2", "target"]],
"(method 16 camera-master)": [[[11, 15], "a2", "target"], [[16, 18], "v1", "int"]],
"master-choose-entity": [
["_stack_", 96, "res-tag"],
[[87, 247], "s3", "(pointer camera-slave)"]
@ -4931,5 +4931,23 @@
[642, "v1", "(pointer process)"],
[698, "v1", "(pointer process)"],
[68, "a0", "vector"]
],
"(method 21 collide-cache)": [
[[62, 86], "a3", "(inline-array collide-cache-tri)"]
],
"(method 13 collide-cache)": [
[303, "v1", "process-drawable"]
],
"(method 19 collide-cache)": [
[26, "a0", "connection"],
[27, "a0", "collide-shape"],
[105, "a0", "connection"],
[106, "a0", "collide-shape"]
],
"(method 20 collide-cache)": [
[50, "v1", "connection"],
[51, "s1", "collide-shape"],
[114, "v1", "connection"],
[115, "s1", "collide-shape"]
]
}

View File

@ -82,6 +82,7 @@ set(RUNTIME_SOURCE
mips2c/jak1_functions/tfrag.cpp
mips2c/jak1_functions/tie_methods.cpp
mips2c/jak1_functions/time_of_day.cpp
mips2c/jak2_functions/collide_cache.cpp
mips2c/jak2_functions/collide_edge_grab.cpp
mips2c/jak2_functions/collide_func.cpp
mips2c/jak2_functions/collide_hash.cpp

View File

@ -95,6 +95,13 @@ struct alignas(16) Vf {
data[3] = 0;
}
void set_u32s(u32 xx, u32 yy, u32 zz, u32 ww) {
memcpy(&data[0], &xx, 4);
memcpy(&data[1], &yy, 4);
memcpy(&data[2], &zz, 4);
memcpy(&data[3], &ww, 4);
}
u16 x_as_u16() const {
u16 result;
memcpy(&result, &data[0], 2);

View File

@ -1769,9 +1769,11 @@ u64 loadc(const char* /*file_name*/, kheapinfo* /*heap*/, u32 /*flags*/) {
return 0;
}
u64 loado(u32 /*file_name_in*/, u32 /*heap_in*/) {
ASSERT(false);
return 0;
u64 loado(u32 file_name_in, u32 /*heap_in*/) {
// ASSERT(false);
Ptr<String> file_name(file_name_in);
printf("****** CALL TO loado(%s) ******\n", file_name->data());
return s7.offset;
}
/*!

File diff suppressed because it is too large Load Diff

View File

@ -181,7 +181,17 @@ namespace method_39_spatial_hash { extern void link(); }
namespace method_36_spatial_hash { extern void link(); }
namespace method_37_spatial_hash { extern void link(); }
namespace method_35_spatial_hash { extern void link(); }
namespace method_10_collide_shape_prim_mesh { extern void link(); }
namespace method_10_collide_shape_prim_sphere { extern void link(); }
namespace method_10_collide_shape_prim_group { extern void link(); }
namespace method_11_collide_shape_prim_mesh { extern void link(); }
namespace method_11_collide_shape_prim_sphere { extern void link(); }
namespace method_11_collide_shape_prim_group { extern void link(); }
namespace method_9_collide_cache_prim { extern void link(); }
namespace method_10_collide_cache_prim { extern void link(); }
namespace method_17_collide_cache { extern void link(); }
namespace method_9_collide_puss_work { extern void link(); }
namespace method_10_collide_puss_work { extern void link(); }
}
// clang-format on
@ -300,7 +310,16 @@ PerGameVersion<std::unordered_map<std::string, std::vector<void (*)()>>> gMips2C
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}}},
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}}},
};
void LinkedFunctionTable::reg(const std::string& name, u64 (*exec)(void*), u32 stack_size) {

View File

@ -6,10 +6,23 @@
;; dgos: ENGINE, GAME
;;og:ignore-form:camera-master-method-16
;; DECOMP BEGINS
(defmethod camera-master-method-16 camera-master ((obj camera-master) (arg0 symbol))
(let ((a2-0 (the-as target (handle->process (-> obj focus handle))))
(v1-4 0)
)
(if a2-0
(set! v1-4 (logand (the-as int (-> a2-0 control pat-ignore-mask)) 112))
)
(logior (if arg0
#x9010002
#x9000002
)
v1-4
)
)
)
(defbehavior reset-follow camera-master ()
(let ((a0-1 (handle->process (-> self focus handle))))

View File

@ -46,6 +46,7 @@
(prim-index uint16 :offset 56)
(user16 uint16 :offset 58)
(user32 uint32 :offset 60)
(clear-flags uint128 :offset 48)
)
:method-count-assert 9
:size-assert #x40
@ -105,7 +106,7 @@
(probe-using-spheres (_type_ collide-query) symbol 17)
(fill-from-bg (_type_ (function collide-hash int collide-list collide-query int) (function collide-cache collide-list collide-query none) collide-query) none 18)
(fill-from-fg-boxes (_type_) none 19)
(fill-from-fg-line-sphere (_type_) none 20)
(fill-from-fg-line-sphere (_type_ collide-query) none 20)
(fill-from-water (_type_ water-control) none 21)
(collide-cache-method-22 () none 22)
(collide-cache-method-23 () none 23)

View File

@ -7,3 +7,879 @@
;; DECOMP BEGINS
(defmethod reset collide-cache ((obj collide-cache))
(set! (-> obj num-tris) 0)
(set! (-> obj num-prims) 0)
(set! (-> obj ignore-processes 0) #f)
(set! (-> obj ignore-processes 1) #f)
(set! *already-printed-exeeded-max-cache-tris* #f)
0
(none)
)
(defmethod fill-from-bg collide-cache ((obj collide-cache)
(arg0 (function collide-hash int collide-list collide-query int))
(arg1 (function collide-cache collide-list collide-query none))
(arg2 collide-query)
)
(set! *already-printed-exeeded-max-cache-tris* #f)
(set! (-> *collide-list* num-items) 0)
(if *collide-list-boxes*
(add-debug-box
#t
(bucket-id debug2)
(the-as vector (-> arg2 bbox))
(-> arg2 bbox max)
(new 'static 'rgba :g #xff :b #xff :a #x80)
)
)
(dotimes (s2-0 (-> *level* length))
(let ((v1-7 (-> *level* level s2-0)))
(if (= (-> v1-7 status) 'active)
(arg0 (-> v1-7 bsp collide-hash) 0 *collide-list* arg2)
)
)
)
(when (> (-> *collide-list* num-items) 0)
(arg1 *collide-cache* *collide-list* arg2)
(let ((a0-8 (-> obj num-tris)))
(when (> a0-8 0)
(let ((v1-16 (-> obj prims))
(a1-6 *collide-shape-prim-backgnd*)
)
(set! (-> v1-16 0 num-tris) (the-as uint a0-8))
(set! (-> v1-16 0 prim) a1-6)
(set! (-> obj num-prims) 1)
(set! (-> v1-16 0 first-tri) (the-as uint 0))
(set! (-> v1-16 0 ccache) obj)
(set! (-> v1-16 0 prim-core world-sphere quad) (-> a1-6 prim-core world-sphere quad))
(set! (-> v1-16 0 prim-core quad 1) (-> a1-6 prim-core quad 1))
)
)
)
)
0
(none)
)
(defmethod fill-from-water collide-cache ((obj collide-cache) (arg0 water-control))
(rlet ((vf0 :class vf)
(vf1 :class vf)
(vf2 :class vf)
(vf3 :class vf)
(vf4 :class vf)
(vf5 :class vf)
)
(init-vf0-vector)
(when (= (-> obj num-prims) 100)
(if (= *cheat-mode* 'debug)
(format 0 "ERROR: Exceeded max number of collide-cache prims!~%")
)
(return #f)
)
(when (< 460 (+ (-> obj num-tris) 2))
(if (= *cheat-mode* 'debug)
(print-exceeded-max-cache-tris)
)
(return #f)
)
(if (not (and (logtest? (-> arg0 flags) (water-flags active))
(logtest? (-> arg0 flags) (water-flags can-ground))
(logtest? (-> arg0 flags) (water-flags swim-ground under-water))
(logtest? (water-flags over-water) (-> arg0 flags))
(zero? (logand (water-flags jump-out) (-> arg0 flags)))
)
)
(return #f)
)
(let ((v1-24 (-> arg0 collide-height)))
(.lvf vf1 (&-> obj collide-box min quad))
(.lvf vf3 (&-> obj collide-box max quad))
(let ((a2-6 (-> obj num-prims-u32))
(a3-4 (the-as (inline-array collide-cache-tri) (-> obj tris (-> obj num-tris))))
)
(.mov vf5 v1-24)
(.add.x.vf vf1 vf0 vf5 :mask #b10)
(set! (-> a3-4 0 clear-flags) (the-as uint128 0))
(set! (-> a3-4 0 prim-index) a2-6)
(.add.x.vf vf3 vf0 vf5 :mask #b10)
(set! (-> a3-4 1 clear-flags) (the-as uint128 0))
(set! (-> a3-4 1 prim-index) a2-6)
(.mov.vf vf2 vf1)
(.mov.vf vf4 vf1)
(.add.z.vf vf2 vf0 vf3 :mask #b100)
(.add.x.vf vf4 vf0 vf3 :mask #b1)
(.svf (&-> a3-4 0 vertex 0 quad) vf1)
(.svf (&-> a3-4 0 vertex 1 quad) vf2)
(.svf (&-> a3-4 0 vertex 2 quad) vf3)
(set! (-> a3-4 0 pat) (new 'static 'pat-surface :material (pat-material waterbottom)))
(set! (-> a3-4 0 collide-ptr) arg0)
(.svf (&-> a3-4 1 vertex 0 quad) vf1)
(.svf (&-> a3-4 1 vertex 1 quad) vf3)
(.svf (&-> a3-4 1 vertex 2 quad) vf4)
(set! (-> a3-4 1 pat) (new 'static 'pat-surface :material (pat-material waterbottom)))
(set! (-> a3-4 1 collide-ptr) arg0)
)
)
(let ((v1-27 *collide-shape-prim-water*)
(a1-5 (-> obj prims (-> obj num-prims)))
)
(set! (-> a1-5 first-tri) (the-as uint (-> obj num-tris)))
(set! (-> a1-5 num-tris) (the-as uint 2))
(set! (-> a1-5 prim) v1-27)
(set! (-> a1-5 ccache) obj)
(set! (-> a1-5 prim-core world-sphere quad) (-> v1-27 prim-core world-sphere quad))
(set! (-> a1-5 prim-core quad 1) (-> v1-27 prim-core quad 1))
)
(+! (-> obj num-prims) 1)
(+! (-> obj num-tris) 2)
0
(none)
)
)
(defmethod fill-using-bounding-box collide-cache ((obj collide-cache) (arg0 collide-query))
(rlet ((vf0 :class vf)
(vf1 :class vf)
(vf2 :class vf)
(vf3 :class vf)
(vf4 :class vf)
)
(init-vf0-vector)
(+! (-> *collide-stats* calls) 1)
(new 'static 'vector :x 0.5)
(nop!)
(nop!)
(let ((v1-4 (-> arg0 collide-with-s32)))
(nop!)
(let ((a0-2 (-> arg0 ignore-process0)))
(nop!)
(let ((a1-1 (-> arg0 ignore-process1)))
(nop!)
(let ((a2-0 (-> arg0 ignore-pat-s32)))
(nop!)
(.lvf vf1 (&-> arg0 bbox min quad))
(nop!)
(.lvf vf2 (&-> arg0 bbox max quad))
(nop!)
(set! (-> obj ignore-processes 0) (the-as process a0-2))
(nop!)
(set! (-> obj ignore-processes 1) (the-as process a1-1))
(.mov.vf vf1 vf0 :mask #b1000)
(nop!)
(.mov.vf vf2 vf0 :mask #b1000)
(set! (-> obj ignore-mask) (the-as pat-surface a2-0))
)
)
)
(.ftoi.vf vf3 vf1)
(nop!)
(.ftoi.vf vf4 vf2)
(set! (-> obj num-tris) 0)
(nop!)
(.svf (&-> obj collide-box min quad) vf1)
(nop!)
(.svf (&-> obj collide-box max quad) vf2)
(nop!)
(.svf (&-> obj collide-box4w min quad) vf3)
(nop!)
(.svf (&-> obj collide-box4w max quad) vf4)
(nop!)
(.svf (&-> arg0 bbox4w min quad) vf3)
(nop!)
(.svf (&-> arg0 bbox4w max quad) vf4)
(nop!)
(set! (-> obj num-prims) 0)
(nop!)
(set! (-> obj collide-with) (the-as collide-spec v1-4))
)
0
(when (logtest? (-> arg0 collide-with) (collide-spec backgnd))
(fill-from-bg
obj
(method-of-type collide-hash fill-collide-list-from-box)
collide-list-fill-bg-using-box
arg0
)
(+! (-> *collide-stats* output) (-> obj num-tris))
)
(when (logtest? (-> arg0 collide-with) (collide-spec water))
(let ((v1-18 (-> arg0 ignore-process0)))
(if v1-18
(fill-from-water obj (-> (the-as process-drawable v1-18) water))
)
)
)
(if (logtest? (-> arg0 collide-with) (collide-spec hit-by-player-list hit-by-others-list player-list))
(fill-from-fg-boxes obj)
)
0
(none)
)
)
(defmethod fill-using-line-sphere collide-cache ((obj collide-cache) (arg0 collide-query))
(local-vars (v1-11 uint) (v1-20 float))
(rlet ((acc :class vf)
(Q :class vf)
(vf0 :class vf)
(vf1 :class vf)
(vf10 :class vf)
(vf11 :class vf)
(vf12 :class vf)
(vf13 :class vf)
(vf14 :class vf)
(vf15 :class vf)
(vf16 :class vf)
(vf17 :class vf)
(vf18 :class vf)
(vf19 :class vf)
(vf2 :class vf)
(vf20 :class vf)
(vf22 :class vf)
(vf23 :class vf)
(vf3 :class vf)
(vf4 :class vf)
(vf5 :class vf)
(vf6 :class vf)
(vf7 :class vf)
(vf8 :class vf)
(vf9 :class vf)
)
(init-vf0-vector)
(+! (-> *collide-stats* calls) 1)
(let ((v1-3 0))
(if (< (fabs (-> arg0 move-dist x)) 4096.0)
(+! v1-3 1)
)
(if (< (fabs (-> arg0 move-dist y)) 4096.0)
(+! v1-3 1)
)
(if (< (fabs (-> arg0 move-dist z)) 4096.0)
(+! v1-3 1)
)
(when (< 1 v1-3)
(set-from-point-offset-pad! (-> arg0 bbox) (-> arg0 start-pos) (-> arg0 move-dist) (-> arg0 radius))
(fill-using-bounding-box obj arg0)
(b! #t cfg-47 :delay (nop!))
(the-as none 0)
(nop!)
)
)
(nop!)
(let ((v1-10 (-> arg0 ignore-pat-s32)))
(nop!)
(let ((a0-14 (-> arg0 ignore-process0)))
(nop!)
(let ((a1-3 (-> arg0 ignore-process1)))
(nop!)
(let ((a2-1 (-> arg0 collide-with-s32)))
(nop!)
(.lvf vf9 (&-> arg0 exit-planes 0 quad))
(nop!)
(.lvf vf3 (&-> arg0 move-dist quad))
(nop!)
(.mov.vf vf13 vf0)
(nop!)
(.lvf vf1 (&-> arg0 start-pos quad))
(.mul.vf vf8 vf3 vf3)
(nop!)
(.add.vf vf2 vf1 vf3)
(set! (-> obj ignore-mask) (the-as pat-surface v1-10))
(.add.y.vf vf8 vf8 vf8 :mask #b1)
(set! (-> obj num-tris) 0)
(.min.vf vf4 vf1 vf2)
(set! (-> obj num-prims) 0)
(.max.vf vf5 vf1 vf2)
(set! (-> obj collide-with) (the-as collide-spec a2-1))
)
(.sub.w.vf vf10 vf0 vf9 :mask #b111)
(set! (-> obj ignore-processes 0) (the-as process a0-14))
(.add.z.vf vf8 vf8 vf8 :mask #b1)
(set! (-> obj ignore-processes 1) (the-as process a1-3))
)
)
)
(.sub.w.vf vf4 vf4 vf9 :mask #b111)
(nop!)
(.add.w.vf vf5 vf5 vf9 :mask #b111)
(nop!)
(.ftoi.vf vf15 vf10)
(nop!)
(.isqrt.vf Q vf0 vf8 :fsf #b11 :ftf #b0)
(nop!)
(.add.w.vf vf11 vf0 vf9 :mask #b111)
(nop!)
(nop!)
(nop!)
(nop!)
(.svf (&-> arg0 local-box4w min quad) vf15)
(.ftoi.vf vf6 vf4)
(.svf (&-> obj collide-box min quad) vf4)
(.ftoi.vf vf7 vf5)
(.svf (&-> obj collide-box max quad) vf5)
(nop!)
(.svf (&-> arg0 bbox min quad) vf4)
(nop!)
(.svf (&-> arg0 bbox max quad) vf5)
(nop!)
(.svf (&-> obj collide-box4w min quad) vf6)
(nop!)
(.svf (&-> obj collide-box4w max quad) vf7)
(nop!)
(.svf (&-> arg0 bbox4w min quad) vf6)
(nop!)
(.svf (&-> arg0 bbox4w max quad) vf7)
(.wait.vf)
(nop!)
(.add.vf vf8 vf0 Q :mask #b1)
(nop!)
(.mul.x.vf vf12 vf3 vf8)
(nop!)
(.nop.vf)
(nop!)
(.div.vf Q vf0 vf8 :fsf #b11 :ftf #b0)
(nop!)
(.mul.vf vf22 vf12 vf12)
(nop!)
(.abs.vf vf23 vf12)
(nop!)
(.add.y.vf vf22 vf22 vf22 :mask #b1)
(.mov v1-11 vf23)
(.wait.vf)
(nop!)
(.add.vf vf8 vf0 Q :mask #b1)
(nop!)
(b! (zero? v1-11) cfg-12 :likely-delay (.add.z.vf vf13 vf0 vf12 :mask #b1))
(.sub.y.vf vf13 vf0 vf12 :mask #b1)
(nop!)
(.isqrt.vf Q vf0 vf22 :fsf #b11 :ftf #b0)
(nop!)
(.add.x.vf vf13 vf0 vf12 :mask #b10)
(nop!)
(.wait.vf)
(nop!)
(.mul.vf vf13 vf13 Q :mask #b11)
(nop!)
(label cfg-12)
(.outer.product.a.vf acc vf12 vf13)
(nop!)
(.add.x.vf vf11 vf11 vf8 :mask #b1)
(nop!)
(.outer.product.b.vf vf14 vf13 vf12 acc)
(nop!)
(.ftoi.vf vf16 vf11)
(nop!)
(.mov.vf vf17 vf12)
(nop!)
(.mov.vf vf18 vf13)
(nop!)
(.mov.vf vf19 vf14)
(nop!)
(.mov.vf vf17 vf0 :mask #b1110)
(.svf (&-> arg0 local-box4w max quad) vf16)
(.mov.vf vf18 vf0 :mask #b1101)
(nop!)
(.mov.vf vf19 vf0 :mask #b1011)
(nop!)
(.add.x.vf vf17 vf17 vf13 :mask #b10)
(nop!)
(.add.y.vf vf18 vf18 vf12 :mask #b1)
(nop!)
(.add.z.vf vf19 vf19 vf12 :mask #b1)
(nop!)
(.add.x.vf vf17 vf17 vf14 :mask #b100)
(nop!)
(.add.y.vf vf18 vf18 vf14 :mask #b100)
(nop!)
(.add.z.vf vf19 vf19 vf13 :mask #b10)
(nop!)
(.mul.x.vf acc vf17 vf1)
(nop!)
(.add.mul.y.vf acc vf18 vf1 acc)
(.svf (&-> arg0 inv-mat quad 0) vf17)
(.add.mul.z.vf vf20 vf19 vf1 acc)
(.svf (&-> arg0 inv-mat quad 1) vf18)
(.sub.vf vf20 vf0 vf20)
(.svf (&-> arg0 inv-mat quad 2) vf19)
(nop!)
(.svf (&-> arg0 inv-mat trans quad) vf20)
(set! (-> arg0 rlength x) (if (= (-> arg0 move-dist x) 0.0)
0.0
(/ 1.0 (-> arg0 move-dist x))
)
)
(set! (-> arg0 rlength y) (if (= (-> arg0 move-dist y) 0.0)
0.0
(/ 1.0 (-> arg0 move-dist y))
)
)
(set! (-> arg0 rlength z) (if (= (-> arg0 move-dist z) 0.0)
0.0
(/ 1.0 (-> arg0 move-dist z))
)
)
(let ((f0-19 1.0))
(.lvf vf1 (&-> (-> arg0 move-dist) quad))
(.add.w.vf vf2 vf0 vf0 :mask #b1)
(.mul.vf vf1 vf1 vf1)
(.mul.x.vf acc vf2 vf1 :mask #b1)
(.add.mul.y.vf acc vf2 vf1 acc :mask #b1)
(.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1)
(.mov v1-20 vf1)
(set! (-> arg0 rlength w) (/ f0-19 v1-20))
)
(set! (-> arg0 exit-planes 0 x) (if (< 0.0 (-> arg0 move-dist x))
0.0
100000000000000000000000000000000000000.0
)
)
(set! (-> arg0 exit-planes 0 y) (if (< 0.0 (-> arg0 move-dist y))
0.0
100000000000000000000000000000000000000.0
)
)
(set! (-> arg0 exit-planes 0 z) (if (< 0.0 (-> arg0 move-dist z))
0.0
100000000000000000000000000000000000000.0
)
)
(set! (-> arg0 exit-planes 1 x) (if (< (-> arg0 move-dist x) 0.0)
0.0
100000000000000000000000000000000000000.0
)
)
(set! (-> arg0 exit-planes 1 y) (if (< (-> arg0 move-dist y) 0.0)
0.0
100000000000000000000000000000000000000.0
)
)
(set! (-> arg0 exit-planes 1 z) (if (< (-> arg0 move-dist z) 0.0)
0.0
100000000000000000000000000000000000000.0
)
)
(when (logtest? (-> arg0 collide-with) (collide-spec backgnd))
(fill-from-bg
obj
(method-of-type collide-hash fill-collide-list-from-line-sphere)
collide-list-fill-bg-using-line-sphere
arg0
)
(+! (-> *collide-stats* output) (-> obj num-tris))
)
(when (logtest? (-> arg0 collide-with) (collide-spec water))
(let ((a1-5 (-> (the-as process-drawable (-> arg0 ignore-process0)) water)))
(if (nonzero? a1-5)
(fill-from-water obj a1-5)
)
)
)
(if (logtest? (-> arg0 collide-with) (collide-spec hit-by-player-list hit-by-others-list player-list))
(fill-from-fg-line-sphere obj arg0)
)
0
(label cfg-47)
(none)
)
)
;; definition for method 19 of type collide-cache
;; WARN: Return type mismatch int vs none.
(defmethod fill-from-fg-boxes collide-cache ((obj collide-cache))
(let ((s5-0 (-> obj collide-with)))
(set! *actor-list-length* 0)
(if (logtest? s5-0 (collide-spec hit-by-others-list))
(set! *actor-list-length* (fill-actor-list-for-box *actor-hash* (-> obj collide-box) *actor-list* 256))
)
(when (logtest? s5-0 (collide-spec player-list))
(let ((a0-2 (-> *collide-player-list* alive-list next0)))
*collide-player-list*
(let ((v1-13 (-> a0-2 next0)))
(while (!= a0-2 (-> *collide-player-list* alive-list-end))
(let* ((a0-3 (-> (the-as connection a0-2) param1))
(a1-1 (-> (the-as collide-shape a0-3) root-prim))
)
(when (logtest? s5-0 (-> a1-1 prim-core collide-as))
(let ((a1-2 (-> a1-1 prim-core)))
(when (and (>= (+ (-> a1-2 world-sphere x) (-> a1-2 world-sphere w)) (-> obj collide-box min x))
(>= (-> obj collide-box max x) (- (-> a1-2 world-sphere x) (-> a1-2 world-sphere w)))
(>= (+ (-> a1-2 world-sphere y) (-> a1-2 world-sphere w)) (-> obj collide-box min y))
(>= (-> obj collide-box max y) (- (-> a1-2 world-sphere y) (-> a1-2 world-sphere w)))
(>= (+ (-> a1-2 world-sphere z) (-> a1-2 world-sphere w)) (-> obj collide-box min z))
(>= (-> obj collide-box max z) (- (-> a1-2 world-sphere z) (-> a1-2 world-sphere w)))
)
(when (< *actor-list-length* 256)
(set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-3))
(set! *actor-list-length* (+ *actor-list-length* 1))
)
)
)
)
)
(set! a0-2 v1-13)
*collide-player-list*
(set! v1-13 (-> v1-13 next0))
)
)
)
)
(when (logtest? s5-0 (collide-spec hit-by-player-list))
(let ((a0-5 (-> *collide-hit-by-player-list* alive-list next0)))
*collide-hit-by-player-list*
(let ((v1-21 (-> a0-5 next0)))
(while (!= a0-5 (-> *collide-hit-by-player-list* alive-list-end))
(let* ((a0-6 (-> (the-as connection a0-5) param1))
(a1-13 (-> (the-as collide-shape a0-6) root-prim))
)
(when (logtest? s5-0 (-> a1-13 prim-core collide-as))
(let ((a1-14 (-> a1-13 prim-core)))
(when (and (>= (+ (-> a1-14 world-sphere x) (-> a1-14 world-sphere w)) (-> obj collide-box min x))
(>= (-> obj collide-box max x) (- (-> a1-14 world-sphere x) (-> a1-14 world-sphere w)))
(>= (+ (-> a1-14 world-sphere y) (-> a1-14 world-sphere w)) (-> obj collide-box min y))
(>= (-> obj collide-box max y) (- (-> a1-14 world-sphere y) (-> a1-14 world-sphere w)))
(>= (+ (-> a1-14 world-sphere z) (-> a1-14 world-sphere w)) (-> obj collide-box min z))
(>= (-> obj collide-box max z) (- (-> a1-14 world-sphere z) (-> a1-14 world-sphere w)))
)
(when (< *actor-list-length* 256)
(set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-6))
(set! *actor-list-length* (+ *actor-list-length* 1))
)
)
)
)
)
(set! a0-5 v1-21)
*collide-hit-by-player-list*
(set! v1-21 (-> v1-21 next0))
)
)
)
)
(dotimes (s4-0 *actor-list-length*)
(let ((v1-26 (-> *actor-list* s4-0)))
(when (logtest? s5-0 (-> v1-26 root-prim prim-core collide-as))
(let ((a0-13 (-> v1-26 process)))
(if (not (or (= a0-13 (-> obj ignore-processes 0)) (= a0-13 (-> obj ignore-processes 1))))
(add-fg-prim-using-box (-> v1-26 root-prim) obj)
)
)
)
)
)
)
0
(none)
)
;; definition for method 10 of type collide-shape-prim
;; WARN: Return type mismatch object vs none.
(defmethod add-fg-prim-using-box collide-shape-prim ((obj collide-shape-prim) (arg0 collide-cache))
(format 0 "ERROR: Illegal collide-shape-prim type passed to collide-shape-prim::add-fg-prim-using-box!~%")
(none)
)
;; definition for method 10 of type collide-shape-prim-mesh
;; ERROR: function was not converted to expressions. Cannot decompile.
(defmethod-mips2c "(method 10 collide-shape-prim-mesh)" 10 collide-shape-prim-mesh)
;; definition for method 10 of type collide-shape-prim-sphere
;; ERROR: function was not converted to expressions. Cannot decompile.
(defmethod-mips2c "(method 10 collide-shape-prim-sphere)" 10 collide-shape-prim-sphere)
;; definition for method 10 of type collide-shape-prim-group
;; ERROR: function was not converted to expressions. Cannot decompile.
(defmethod-mips2c "(method 10 collide-shape-prim-group)" 10 collide-shape-prim-group)
;; definition for method 20 of type collide-cache
;; WARN: Return type mismatch int vs none.
(defmethod fill-from-fg-line-sphere collide-cache ((obj collide-cache) (arg0 collide-query))
(local-vars (v1-9 float))
(rlet ((acc :class vf)
(vf0 :class vf)
(vf1 :class vf)
(vf2 :class vf)
)
(init-vf0-vector)
(let ((s4-0 (-> arg0 collide-with)))
(set! *actor-list-length* 0)
(if (logtest? s4-0 (collide-spec hit-by-others-list))
(set! *actor-list-length* (fill-actor-list-for-line-sphere
*actor-hash*
(-> arg0 start-pos)
(-> arg0 move-dist)
(-> arg0 radius)
*actor-list*
256
-1
)
)
)
(let ((f30-0 0.0)
(s3-0 (new 'stack-no-clear 'matrix))
)
(.lvf vf1 (&-> (-> arg0 move-dist) quad))
(.add.w.vf vf2 vf0 vf0 :mask #b1)
(.mul.vf vf1 vf1 vf1)
(.mul.x.vf acc vf2 vf1 :mask #b1)
(.add.mul.y.vf acc vf2 vf1 acc :mask #b1)
(.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1)
(.mov v1-9 vf1)
(let ((f0-1 v1-9))
(if (< 0.0 f0-1)
(set! f30-0 (/ 1.0 f0-1))
)
)
(when (logtest? s4-0 (collide-spec player-list))
(let ((v1-17 (-> *collide-player-list* alive-list next0)))
*collide-player-list*
(let ((s2-0 (-> v1-17 next0)))
(while (!= v1-17 (-> *collide-player-list* alive-list-end))
(let* ((s1-0 (-> (the-as connection v1-17) param1))
(v1-18 (-> (the-as collide-shape s1-0) root-prim))
)
(when (logtest? s4-0 (-> v1-18 prim-core collide-as))
(let ((s0-0 (-> v1-18 prim-core)))
(vector-! (-> s3-0 vector 1) (the-as vector s0-0) (-> arg0 start-pos))
(let* ((f1-2 (* (vector-dot (-> arg0 move-dist) (-> s3-0 vector 1)) f30-0))
(f0-6 (fmax 0.0 (fmin 1.0 f1-2)))
)
(vector+float*! (the-as vector (-> s3-0 vector)) (-> arg0 start-pos) (-> arg0 move-dist) f0-6)
)
(let ((f0-7 (vector-vector-distance-squared (the-as vector (-> s3-0 vector)) (the-as vector s0-0)))
(f1-5 (+ (-> arg0 radius) (-> s0-0 world-sphere w)))
)
(when (< f0-7 (* f1-5 f1-5))
(when (< *actor-list-length* 256)
(set! (-> *actor-list* *actor-list-length*) (the-as collide-shape s1-0))
(set! *actor-list-length* (+ *actor-list-length* 1))
)
)
)
)
)
)
(set! v1-17 s2-0)
*collide-player-list*
(set! s2-0 (-> s2-0 next0))
)
)
)
)
(when (logtest? s4-0 (collide-spec hit-by-player-list))
(let ((v1-38 (-> *collide-hit-by-player-list* alive-list next0)))
*collide-hit-by-player-list*
(let ((s2-1 (-> v1-38 next0)))
(while (!= v1-38 (-> *collide-hit-by-player-list* alive-list-end))
(let* ((s1-1 (-> (the-as connection v1-38) param1))
(v1-39 (-> (the-as collide-shape s1-1) root-prim))
)
(when (logtest? s4-0 (-> v1-39 prim-core collide-as))
(let ((s0-1 (-> v1-39 prim-core)))
(vector-! (-> s3-0 vector 1) (the-as vector s0-1) (-> arg0 start-pos))
(let* ((f1-8 (* (vector-dot (-> arg0 move-dist) (-> s3-0 vector 1)) f30-0))
(f0-11 (fmax 0.0 (fmin 1.0 f1-8)))
)
(vector+float*! (the-as vector (-> s3-0 vector)) (-> arg0 start-pos) (-> arg0 move-dist) f0-11)
)
(let ((f0-12 (vector-vector-distance-squared (the-as vector (-> s3-0 vector)) (the-as vector s0-1)))
(f1-11 (+ (-> arg0 radius) (-> s0-1 world-sphere w)))
)
(when (< f0-12 (* f1-11 f1-11))
(when (< *actor-list-length* 256)
(set! (-> *actor-list* *actor-list-length*) (the-as collide-shape s1-1))
(set! *actor-list-length* (+ *actor-list-length* 1))
)
)
)
)
)
)
(set! v1-38 s2-1)
*collide-hit-by-player-list*
(set! s2-1 (-> s2-1 next0))
)
)
)
)
)
(dotimes (s3-1 *actor-list-length*)
(let ((v1-58 (-> *actor-list* s3-1)))
(when (logtest? s4-0 (-> v1-58 root-prim prim-core collide-as))
(let ((a0-37 (-> v1-58 process)))
(if (not (or (= a0-37 (-> obj ignore-processes 0)) (= a0-37 (-> obj ignore-processes 1))))
((method-of-object (-> v1-58 root-prim) add-fg-prim-using-line-sphere))
)
)
)
)
)
)
0
(none)
)
)
;; definition for method 11 of type collide-shape-prim
;; WARN: Return type mismatch object vs none.
(defmethod add-fg-prim-using-line-sphere collide-shape-prim ()
(format
0
"ERROR: Illegal collide-shape-prim type passed to collide-shape-prim::add-fg-prim-using-line-sphere!~%"
)
(none)
)
;; definition for method 11 of type collide-shape-prim-mesh
;; ERROR: function was not converted to expressions. Cannot decompile.
(defmethod-mips2c "(method 11 collide-shape-prim-mesh)" 11 collide-shape-prim-mesh)
;; definition for method 11 of type collide-shape-prim-sphere
;; ERROR: function was not converted to expressions. Cannot decompile.
(defmethod-mips2c "(method 11 collide-shape-prim-sphere)" 11 collide-shape-prim-sphere)
;; definition for method 11 of type collide-shape-prim-group
;; ERROR: function was not converted to expressions. Cannot decompile.
(defmethod-mips2c "(method 11 collide-shape-prim-group)" 11 collide-shape-prim-group)
;; definition for method 10 of type collide-cache
(defmethod fill-and-probe-using-line-sphere collide-cache ((obj collide-cache) (arg0 collide-query))
(fill-using-line-sphere obj arg0)
(probe-using-line-sphere obj arg0)
)
;; definition of type collide-puls-work
(deftype collide-puls-work (structure)
((ignore-pat pat-surface :offset-assert 0)
(bsphere sphere :inline :offset-assert 16)
(move-dist vector :inline :offset-assert 32)
)
:method-count-assert 9
:size-assert #x30
:flag-assert #x900000030
)
;; definition for method 16 of type collide-cache
(defmethod probe-using-line-sphere collide-cache ((obj collide-cache) (arg0 collide-query))
(rlet ((vf0 :class vf)
(vf2 :class vf)
(vf3 :class vf)
(vf4 :class vf)
)
(init-vf0-vector)
(let ((s5-0 (new 'stack-no-clear 'collide-cache-tri)))
(.lvf vf4 (&-> arg0 exit-planes 0 quad))
(.lvf vf3 (&-> arg0 start-pos quad))
(.lvf vf2 (&-> arg0 move-dist quad))
(set! (-> s5-0 vertex 0 x) (the-as float (-> arg0 ignore-pat)))
(.mul.w.vf vf3 vf0 vf4 :mask #b1000)
(.svf (&-> s5-0 vertex 2 quad) vf2)
(.svf (&-> s5-0 vertex 1 quad) vf3)
(let ((s4-0 (the-as object (-> obj prims)))
(f30-0 -100000000.0)
)
(countdown (s3-0 (-> obj num-prims))
(when (and (logtest? (-> arg0 collide-with) (-> (the-as collide-cache-prim s4-0) prim-core collide-as))
(logtest? (-> arg0 action-mask) (-> (the-as collide-cache-prim s4-0) prim-core action))
)
(cond
((>= (the-as int (-> (the-as collide-cache-prim s4-0) prim-core prim-type)) 0)
(let ((f0-0 ((method-of-type collide-cache-prim resolve-moving-sphere-tri)
(the-as collide-cache-prim s4-0)
(the-as collide-tri-result arg0)
(the-as collide-prim-core (-> s5-0 vertex 1))
(-> s5-0 vertex 2)
f30-0
(collide-action solid)
)
)
)
(if (>= f0-0 0.0)
(set! f30-0 f0-0)
)
)
)
(else
(when (not (logtest? (-> arg0 ignore-pat)
(-> (the-as collide-shape-prim-sphere (-> (the-as collide-cache-prim s4-0) prim)) pat)
)
)
(let ((f0-1 ((method-of-type collide-cache-prim resolve-moving-sphere-sphere)
(the-as collide-cache-prim s4-0)
(the-as collide-tri-result arg0)
(the-as collide-prim-core (-> s5-0 vertex 1))
(-> s5-0 vertex 2)
f30-0
(collide-action solid)
)
)
)
(if (>= f0-1 0.0)
(set! f30-0 f0-1)
)
)
)
)
)
)
(set! s4-0 (-> (the-as (inline-array collide-cache-prim) s4-0) 1))
)
f30-0
)
)
)
)
;; definition of type lsmi-work
(deftype lsmi-work (structure)
((best-u float :offset-assert 0)
(orig-best-u float :offset-assert 4)
(action uint32 :offset-assert 8)
(cquery collide-query :inline :offset-assert 16)
)
:method-count-assert 9
:size-assert #x22c
:flag-assert #x90000022c
)
;; definition for method 9 of type collide-cache-prim
;; ERROR: function was not converted to expressions. Cannot decompile.
(defmethod-mips2c "(method 9 collide-cache-prim)" 9 collide-cache-prim)
;; definition for method 10 of type collide-cache-prim
;; ERROR: function was not converted to expressions. Cannot decompile.
(defmethod-mips2c "(method 10 collide-cache-prim)" 10 collide-cache-prim)
;; definition for method 11 of type collide-cache
(defmethod fill-and-probe-using-spheres collide-cache ((obj collide-cache) (arg0 collide-query))
(fill-using-spheres obj arg0)
(probe-using-spheres obj arg0)
)
;; definition for method 14 of type collide-cache
(defmethod fill-using-spheres collide-cache ((obj collide-cache) (arg0 collide-query))
(new 'stack-no-clear 'bounding-box)
(set-from-spheres!
(-> arg0 bbox)
(the-as (inline-array sphere) (-> arg0 best-dist))
(the-as int (-> arg0 num-spheres))
)
(fill-using-bounding-box obj arg0)
(none)
)
;; definition for method 17 of type collide-cache
;; ERROR: function was not converted to expressions. Cannot decompile.
(defmethod-mips2c "(method 17 collide-cache)" 17 collide-cache)
;; definition for method 9 of type collide-puss-work
;; ERROR: function was not converted to expressions. Cannot decompile.
(defmethod-mips2c "(method 9 collide-puss-work)" 9 collide-puss-work)
;; definition for method 10 of type collide-puss-work
;; ERROR: function was not converted to expressions. Cannot decompile.
(defmethod-mips2c "(method 10 collide-puss-work)" 10 collide-puss-work)

View File

@ -14,6 +14,7 @@
(declare-type collide-shape-prim-group basic)
(declare-type collide-cache-prim structure)
(declare-type collide-shape-prim basic)
(declare-type collide-cache basic)
(defenum penetrate
:bitfield #t
@ -405,7 +406,7 @@
(:methods
(new (symbol type collide-shape uint int) _type_ 0)
(debug-draw (_type_) none 9)
(add-fg-prim-using-box () none 10)
(add-fg-prim-using-box (_type_ collide-cache) none 10)
(add-fg-prim-using-line-sphere () none 11)
(overlaps-others-test (_type_ overlaps-others-params collide-shape-prim) symbol 12)
(overlaps-others-group (_type_ overlaps-others-params collide-shape-prim-group) symbol 13)

View File

@ -7,3 +7,9 @@
;; DECOMP BEGINS
(defbehavior target-powerup-process target ()
(none))
(defbehavior target-land-effect target ()
(none)
)

View File

@ -468,7 +468,8 @@
)
)
)
(initialize *bigmap*)
(format 0 "SKIP initialize bigmap~%")
;(initialize *bigmap*)
)
)
(case arg0

View File

@ -8,4 +8,5 @@
;; DECOMP BEGINS
;; this is wrong, just a placeholder
(define *default-shadow-settings* (new 'static 'shadow-settings))
(define *default-shadow-settings* (new 'static 'shadow-settings))
(define *foreground-draw-engine* (new 'global 'engine 'draw 768 connection))

View File

@ -7,6 +7,20 @@
(declare-type fuel-cell basic) ;; TODO!!
(defun-debug draw-bone-lines ((obj process-drawable))
"Added in PC port to debug bones"
(dotimes (i (-> obj node-list length))
(let ((parent (-> obj node-list data i parent)))
(when (and parent (nonzero? parent) (-> parent joint) (-> parent parent))
(let ((child (vector<-cspace! (new-stack-vector0) (-> obj node-list data i)))
)
(add-debug-line #t (bucket-id debug2) child (vector<-cspace! (new-stack-vector0) parent) (new 'static 'rgba :g #xff :a #x40) #f (the rgba -1))
)
)
)
)
)
;; DECOMP BEGINS
(defmethod add-to-loading-level skeleton-group ((obj skeleton-group))
@ -444,6 +458,7 @@
)
)
)
(draw-bone-lines (-> obj process))
0
(none)
)
@ -1299,7 +1314,8 @@
(label cfg-45)
(let ((a0-26 (-> gp-0 effect)))
(if a0-26
(effect-control-method-9 a0-26)
(format 0 "skip effect control~%")
;(effect-control-method-9 a0-26)
)
)
)

View File

@ -694,6 +694,7 @@
(when (-> obj params)
;; ADDED - the function after this has been removed in jak 2, and calling it will crash.
(format 0 "bad case in update! ambient-sound~%")
(return (the-as int #f))
pp
(effect-param->sound-spec s5-1 (-> obj params) (-> obj param-count))
)

View File

@ -130,11 +130,11 @@
(:methods
(new (symbol type int int) _type_ 0)
(add-an-object (_type_ vector hash-object-info) int 34)
(spatial-hash-method-35 (_type_) none 35)
(fill-actor-list-for-box (_type_ bounding-box (pointer collide-shape) int) int 35)
(fill-actor-list-for-sphere (_type_ sphere (pointer collide-shape) int) int 36)
(spatial-hash-method-37 (_type_) none 37)
(fill-actor-list-for-vec+r (_type_ vector (pointer collide-shape) int) none 38)
(spatial-hash-method-39 (_type_ object hash-object-info) none 39)
(fill-actor-list-for-line-sphere (_type_ vector vector float (pointer collide-shape) int int) int 37)
(fill-actor-list-for-vec+r (_type_ vector (pointer collide-shape) int) int 38)
(spatial-hash-method-39 (_type_ object hash-object-info) int 39)
(validate-objects (_type_) none 40)
)
)

View File

@ -885,7 +885,6 @@
(set! (-> v1-0 r) 0.0)
(fill-actor-list-for-sphere obj v1-0 arg1 arg2)
)
(none)
)
;; definition for method 40 of type spatial-hash

File diff suppressed because it is too large Load Diff

View File

@ -7,16 +7,39 @@
;; DECOMP BEGINS
(defskelgroup skel-jchar jakb jakb-lod0-jg -1
((jakb-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 3.2)
; (defskelgroup skel-jchar jakb jakb-lod0-jg -1
; ((jakb-lod0-mg (meters 999999)))
; :bounds (static-spherem 0 0 0 3.2)
; :longest-edge (meters 1)
; :shadow jakb-shadow-mg
; :texture-level 6
; :sort 1
; :origin-joint-index 3
; :shadow-joint-index 3
; )
(let ((a0-0 (new 'static 'skeleton-group
:name "skel-jchar"
:extra #f
:info #f
:art-group-name "jakb"
:bounds (new 'static 'vector :w 13107.2)
:longest-edge (meters 1)
:shadow jakb-shadow-mg
:texture-level 6
:texture-level #x6
:version #x7
:shadow 2
:sort 1
:origin-joint-index 3
:shadow-joint-index 3
)
)
)
(set! (-> a0-0 jgeo) 0)
(set! (-> a0-0 janim) -1)
(set! (-> a0-0 mgeo 0) 1)
(set! (-> a0-0 lod-dist 0) 4095996000.0)
(add-to-loading-level a0-0)
)
(define *target-shadow-control*
(new 'static 'shadow-control :settings (new 'static 'shadow-settings

View File

@ -7,3 +7,7 @@
;; DECOMP BEGINS
(defun activate-hud ((arg0 target))
(format 0 "no hud~%")
(none)
)

View File

@ -489,7 +489,7 @@
(defmacro ppointer->handle (pproc)
"convert a ppointer to a handle. assumes the ppointer is valid."
`(let ((the-process (the-as (pointer process) ,pproc)))
(new 'static 'handle :process the-process :pid (-> the-process 0 pid))
(new 'static 'handle :process the-process :pid (if the-process (-> the-process 0 pid)))
)
)

View File

@ -7,7 +7,7 @@
(v1-4 0)
)
(if a2-0
(set! v1-4 (the-as int (incomplete-bitfield-access (-> a2-0 control pat-ignore-mask))))
(set! v1-4 (logand (the-as int (-> a2-0 control pat-ignore-mask)) 112))
)
(logior (if arg0
#x9010002

View File

@ -66,6 +66,7 @@
(prim-index uint16 :offset 56)
(user16 uint16 :offset 58)
(user32 uint32 :offset 60)
(clear-flags uint128 :offset 48)
)
:method-count-assert 9
:size-assert #x40
@ -165,7 +166,7 @@
(probe-using-spheres (_type_ collide-query) symbol 17)
(fill-from-bg (_type_ (function collide-hash int collide-list collide-query int) (function collide-cache collide-list collide-query none) collide-query) none 18)
(fill-from-fg-boxes (_type_) none 19)
(fill-from-fg-line-sphere (_type_) none 20)
(fill-from-fg-line-sphere (_type_ collide-query) none 20)
(fill-from-water (_type_ water-control) none 21)
(collide-cache-method-22 () none 22)
(collide-cache-method-23 () none 23)

View File

@ -233,7 +233,7 @@
(:methods
(new (symbol type collide-shape uint int) _type_ 0)
(debug-draw (_type_) none 9)
(add-fg-prim-using-box () none 10)
(add-fg-prim-using-box (_type_ collide-cache) none 10)
(add-fg-prim-using-line-sphere () none 11)
(overlaps-others-test (_type_ overlaps-others-params collide-shape-prim) symbol 12)
(overlaps-others-group (_type_ overlaps-others-params collide-shape-prim-group) symbol 13)

View File

@ -227,11 +227,11 @@
(:methods
(new (symbol type int int) _type_ 0)
(add-an-object (_type_ vector hash-object-info) int 34)
(spatial-hash-method-35 (_type_) none 35)
(fill-actor-list-for-box (_type_ bounding-box (pointer collide-shape) int) int 35)
(fill-actor-list-for-sphere (_type_ sphere (pointer collide-shape) int) int 36)
(spatial-hash-method-37 (_type_) none 37)
(fill-actor-list-for-vec+r (_type_ vector (pointer collide-shape) int) none 38)
(spatial-hash-method-39 (_type_ object hash-object-info) none 39)
(fill-actor-list-for-line-sphere (_type_ vector vector float (pointer collide-shape) int int) int 37)
(fill-actor-list-for-vec+r (_type_ vector (pointer collide-shape) int) int 38)
(spatial-hash-method-39 (_type_ object hash-object-info) int 39)
(validate-objects (_type_) none 40)
)
)

View File

@ -921,14 +921,12 @@
;; definition for method 38 of type spatial-hash
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod fill-actor-list-for-vec+r spatial-hash ((obj spatial-hash) (arg0 vector) (arg1 (pointer collide-shape)) (arg2 int))
(let ((v1-0 (new 'stack-no-clear 'sphere)))
(set! (-> v1-0 quad) (-> arg0 quad))
(set! (-> v1-0 r) 0.0)
(fill-actor-list-for-sphere obj v1-0 arg1 arg2)
)
(none)
)
;; definition for method 40 of type spatial-hash
@ -945,7 +943,3 @@
0
(none)
)