mirror of
https://github.com/open-goal/jak-project
synced 2026-08-08 02:31:30 -04:00
93afb02cf4
This includes all the collision stuff needed to spawn `target`, decompiles the sparticle code and adds some of the PC hacks needed for merc to run (it doesn't work quite right and looks bad, likely due to a combination of code copied from Jak 2 and the time of day hacks). There are a bunch of temporary hacks (see commits) in place to prevent the game from crashing quite as much, but it is still extremely prone to doing so due to lots of missing functions/potentially bad decomp. --------- Co-authored-by: water <awaterford111445@gmail.com>
354 lines
15 KiB
Common Lisp
Vendored
Generated
354 lines
15 KiB
Common Lisp
Vendored
Generated
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; definition of type pilot-edge-grab-info
|
|
(deftype pilot-edge-grab-info (structure)
|
|
"Info for edge grabs on zoomers."
|
|
((local-pos vector :inline)
|
|
(local-dir vector :inline)
|
|
(handle handle)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type pilot-edge-grab-info
|
|
(defmethod inspect ((this pilot-edge-grab-info))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(format #t "[~8x] ~A~%" this 'pilot-edge-grab-info)
|
|
(format #t "~1Tlocal-pos: #<vector @ #x~X>~%" (-> this local-pos))
|
|
(format #t "~1Tlocal-dir: #<vector @ #x~X>~%" (-> this local-dir))
|
|
(format #t "~1Thandle: ~D~%" (-> this handle))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; definition of type edge-grab-info
|
|
(deftype edge-grab-info (structure)
|
|
((world-vertex vector 8 :inline)
|
|
(local-vertex vector 8 :inline)
|
|
(status uint64)
|
|
(actor-cshape-prim-offset int32)
|
|
(actor-handle handle)
|
|
(hanging-matrix matrix :inline)
|
|
(edge-vertex vector 2 :inline :overlay-at (-> world-vertex 0))
|
|
(center-hold vector :inline :overlay-at (-> world-vertex 2))
|
|
(tri-vertex vector 3 :inline :overlay-at (-> world-vertex 3))
|
|
(adjacent-edge-left-vertex vector :inline :overlay-at (-> world-vertex 6))
|
|
(adjacent-edge-right-vertex vector :inline :overlay-at (-> world-vertex 7))
|
|
(left-hand-hold vector :inline)
|
|
(right-hand-hold vector :inline)
|
|
(center-hold-old vector :inline)
|
|
(edge-tri-pat pat-surface)
|
|
(found-edge? symbol)
|
|
(pilot-edge-grab? symbol)
|
|
(pilot-edge-grab pilot-edge-grab-info :inline)
|
|
(pilot-start-grab-pos vector :inline)
|
|
(pilot-grab-interp float)
|
|
)
|
|
(:methods
|
|
(edge-grab-info-method-9 (_type_) symbol)
|
|
(edge-grab-info-method-10 (_type_) none)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type edge-grab-info
|
|
(defmethod inspect ((this edge-grab-info))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(format #t "[~8x] ~A~%" this 'edge-grab-info)
|
|
(format #t "~1Tworld-vertex[8] @ #x~X~%" (-> this world-vertex))
|
|
(format #t "~1Tlocal-vertex[8] @ #x~X~%" (-> this local-vertex))
|
|
(format #t "~1Tstatus: ~D~%" (-> this status))
|
|
(format #t "~1Tactor-cshape-prim-offset: ~D~%" (-> this actor-cshape-prim-offset))
|
|
(format #t "~1Tactor-handle: ~D~%" (-> this actor-handle))
|
|
(format #t "~1Thanging-matrix: #<matrix @ #x~X>~%" (-> this hanging-matrix))
|
|
(format #t "~1Tedge-vertex[2] @ #x~X~%" (-> this world-vertex))
|
|
(format #t "~1Tcenter-hold: ~`vector`P~%" (-> this center-hold))
|
|
(format #t "~1Ttri-vertex[3] @ #x~X~%" (-> this tri-vertex))
|
|
(format #t "~1Tadjacent-edge-left-vertex: #<vector @ #x~X>~%" (-> this adjacent-edge-left-vertex))
|
|
(format #t "~1Tadjacent-edge-right-vertex: #<vector @ #x~X>~%" (-> this adjacent-edge-right-vertex))
|
|
(format #t "~1Tleft-hand-hold: #<vector @ #x~X>~%" (-> this left-hand-hold))
|
|
(format #t "~1Tright-hand-hold: #<vector @ #x~X>~%" (-> this right-hand-hold))
|
|
(format #t "~1Tcenter-hold-old: ~`vector`P~%" (-> this center-hold-old))
|
|
(format #t "~1Tedge-tri-pat: ~D~%" (-> this edge-tri-pat))
|
|
(format #t "~1Tfound-edge?: ~A~%" (-> this found-edge?))
|
|
(format #t "~1Tpilot-edge-grab?: ~A~%" (-> this pilot-edge-grab?))
|
|
(format #t "~1Tpilot-edge-grab: #<pilot-edge-grab-info @ #x~X>~%" (-> this pilot-edge-grab))
|
|
(format #t "~1Tpilot-start-grab-pos: #<vector @ #x~X>~%" (-> this pilot-start-grab-pos))
|
|
(format #t "~1Tpilot-grab-interp: ~f~%" (-> this pilot-grab-interp))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; definition of type collide-edge-tri
|
|
(deftype collide-edge-tri (structure)
|
|
"A triangle involved in edge grab collision."
|
|
((ctri collide-cache-tri)
|
|
(normal vector :inline)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type collide-edge-tri
|
|
(defmethod inspect ((this collide-edge-tri))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(format #t "[~8x] ~A~%" this 'collide-edge-tri)
|
|
(format #t "~1Tctri: ~A~%" (-> this ctri))
|
|
(format #t "~1Tnormal: #<vector @ #x~X>~%" (-> this normal))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; definition of type collide-edge-edge
|
|
(deftype collide-edge-edge (structure)
|
|
((ignore symbol)
|
|
(etri collide-edge-tri)
|
|
(vertex-ptr (inline-array vector) 2)
|
|
(outward vector :inline)
|
|
(edge-vec-norm vector :inline)
|
|
)
|
|
(:methods
|
|
(no-collision-at-edge (_type_ collide-edge-work edge-grab-info) symbol)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type collide-edge-edge
|
|
(defmethod inspect ((this collide-edge-edge))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(format #t "[~8x] ~A~%" this 'collide-edge-edge)
|
|
(format #t "~1Tignore: ~A~%" (-> this ignore))
|
|
(format #t "~1Tetri: #<collide-edge-tri @ #x~X>~%" (-> this etri))
|
|
(format #t "~1Tvertex-ptr[2] @ #x~X~%" (-> this vertex-ptr))
|
|
(format #t "~1Toutward: #<vector @ #x~X>~%" (-> this outward))
|
|
(format #t "~1Tedge-vec-norm: #<vector @ #x~X>~%" (-> this edge-vec-norm))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; definition of type collide-edge-hold-item
|
|
(deftype collide-edge-hold-item (structure)
|
|
((next collide-edge-hold-item)
|
|
(rating float)
|
|
(split int8)
|
|
(edge collide-edge-edge)
|
|
(center-pt vector :inline)
|
|
(outward-pt vector :inline)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type collide-edge-hold-item
|
|
(defmethod inspect ((this collide-edge-hold-item))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(format #t "[~8x] ~A~%" this 'collide-edge-hold-item)
|
|
(format #t "~1Tnext: #<collide-edge-hold-item @ #x~X>~%" (-> this next))
|
|
(format #t "~1Trating: ~f~%" (-> this rating))
|
|
(format #t "~1Tsplit: ~D~%" (-> this split))
|
|
(format #t "~1Tedge: #<collide-edge-edge @ #x~X>~%" (-> this edge))
|
|
(format #t "~1Tcenter-pt: #<vector @ #x~X>~%" (-> this center-pt))
|
|
(format #t "~1Toutward-pt: #<vector @ #x~X>~%" (-> this outward-pt))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; definition of type collide-edge-hold-list
|
|
(deftype collide-edge-hold-list (structure)
|
|
((num-allocs uint32)
|
|
(num-attempts uint32)
|
|
(head collide-edge-hold-item)
|
|
(items collide-edge-hold-item 32 :inline)
|
|
(attempts qword 32 :inline)
|
|
)
|
|
(:methods
|
|
(debug-draw (_type_) object)
|
|
(add-to-list! (_type_ collide-edge-hold-item) none)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type collide-edge-hold-list
|
|
(defmethod inspect ((this collide-edge-hold-list))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(format #t "[~8x] ~A~%" this 'collide-edge-hold-list)
|
|
(format #t "~1Tnum-allocs: ~D~%" (-> this num-allocs))
|
|
(format #t "~1Tnum-attempts: ~D~%" (-> this num-attempts))
|
|
(format #t "~1Thead: #<collide-edge-hold-item @ #x~X>~%" (-> this head))
|
|
(format #t "~1Titems[32] @ #x~X~%" (-> this items))
|
|
(format #t "~1Tattempts[32] @ #x~X~%" (-> this attempts))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; definition of type collide-edge-spec
|
|
(deftype collide-edge-spec (structure)
|
|
((split-dists float 2)
|
|
(outward-offset vector :inline)
|
|
(flags collide-edge-spec-flags)
|
|
(ignore-pat pat-surface)
|
|
(max-dist-sqrd-to-outward-pt float)
|
|
(max-dir-cosa-delta float)
|
|
(max-dir-cosa-player float)
|
|
(touching-segment symbol)
|
|
(local-cache-fill-box bounding-box :inline)
|
|
(local-within-reach-box bounding-box :inline)
|
|
(local-player-spheres sphere 12 :inline :offset 128)
|
|
(local-player-hanging-spheres sphere 6 :inline :overlay-at (-> local-player-spheres 0))
|
|
(local-player-leap-up-spheres sphere 6 :inline :overlay-at (-> local-player-spheres 6))
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type collide-edge-spec
|
|
(defmethod inspect ((this collide-edge-spec))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(format #t "[~8x] ~A~%" this 'collide-edge-spec)
|
|
(format #t "~1Tsplit-dists[2] @ #x~X~%" (-> this split-dists))
|
|
(format #t "~1Toutward-offset: #<vector @ #x~X>~%" (-> this outward-offset))
|
|
(format #t "~1Tflags: ~D~%" (-> this flags))
|
|
(format #t "~1Tignore-pat: ~D~%" (-> this ignore-pat))
|
|
(format #t "~1Tmax-dist-sqrd-to-outward-pt: ~f~%" (-> this max-dist-sqrd-to-outward-pt))
|
|
(format #t "~1Tmax-dir-cosa-delta: ~f~%" (-> this max-dir-cosa-delta))
|
|
(format #t "~1Tmax-dir-cosa-player: ~f~%" (-> this max-dir-cosa-player))
|
|
(format #t "~1Ttouching-segment: #x~X~%" (-> this touching-segment))
|
|
(format #t "~1Tlocal-cache-fill-box: #<bounding-box @ #x~X>~%" (-> this local-cache-fill-box))
|
|
(format #t "~1Tlocal-within-reach-box: #<bounding-box @ #x~X>~%" (-> this local-within-reach-box))
|
|
(format #t "~1Tlocal-player-spheres[12] @ #x~X~%" (-> this local-player-spheres))
|
|
(format #t "~1Tlocal-player-hanging-spheres[6] @ #x~X~%" (-> this local-player-spheres))
|
|
(format #t "~1Tlocal-player-leap-up-spheres[6] @ #x~X~%" (-> this local-player-leap-up-spheres))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; definition of type collide-edge-work
|
|
(deftype collide-edge-work (structure)
|
|
((ccache collide-cache)
|
|
(cshape collide-shape)
|
|
(num-verts uint32)
|
|
(num-edges uint32)
|
|
(num-tris uint32)
|
|
(cache-fill-box bounding-box :inline)
|
|
(within-reach-box bounding-box :inline)
|
|
(within-reach-box4w bounding-box4w :inline)
|
|
(search-pt vector :inline)
|
|
(search-dir-vec vector :inline)
|
|
(world-player-spheres sphere 12 :inline)
|
|
(world-player-hanging-spheres sphere 6 :inline :overlay-at (-> world-player-spheres 0))
|
|
(world-player-leap-up-spheres sphere 6 :inline :overlay-at (-> world-player-spheres 6))
|
|
(spec collide-edge-spec :inline)
|
|
(process (pointer process-drawable))
|
|
(verts vector 64 :inline)
|
|
(edges collide-edge-edge 96 :inline)
|
|
(tris collide-edge-tri 48 :inline)
|
|
(hold-list collide-edge-hold-list :inline)
|
|
)
|
|
(:methods
|
|
(search-for-edges (_type_ collide-edge-hold-list) none)
|
|
(debug-draw-edges (_type_) object)
|
|
(debug-draw-tris (_type_) none)
|
|
(debug-draw-sphere (_type_) none)
|
|
(find-adjacent-edge (_type_ collide-edge-hold-item edge-grab-info) none)
|
|
(compute-center-point! (_type_ collide-edge-edge vector) float)
|
|
(get-best-hand-point (_type_ vector vector int) float)
|
|
(find-grabbable-edges (_type_) none)
|
|
(find-grabbable-tris (_type_) none)
|
|
(should-add-to-list? (_type_ collide-edge-hold-item collide-edge-edge) symbol)
|
|
(find-best-grab! (_type_ collide-edge-hold-list edge-grab-info) symbol)
|
|
(check-grab-for-collisions (_type_ collide-edge-hold-item edge-grab-info) symbol)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type collide-edge-work
|
|
(defmethod inspect ((this collide-edge-work))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(format #t "[~8x] ~A~%" this 'collide-edge-work)
|
|
(format #t "~1Tccache: ~A~%" (-> this ccache))
|
|
(format #t "~1Tcshape: ~A~%" (-> this cshape))
|
|
(format #t "~1Tnum-verts: ~D~%" (-> this num-verts))
|
|
(format #t "~1Tnum-edges: ~D~%" (-> this num-edges))
|
|
(format #t "~1Tnum-tris: ~D~%" (-> this num-tris))
|
|
(format #t "~1Tcache-fill-box: #<bounding-box @ #x~X>~%" (-> this cache-fill-box))
|
|
(format #t "~1Twithin-reach-box: #<bounding-box @ #x~X>~%" (-> this within-reach-box))
|
|
(format #t "~1Twithin-reach-box4w: #<bounding-box4w @ #x~X>~%" (-> this within-reach-box4w))
|
|
(format #t "~1Tsearch-pt: #<vector @ #x~X>~%" (-> this search-pt))
|
|
(format #t "~1Tsearch-dir-vec: #<vector @ #x~X>~%" (-> this search-dir-vec))
|
|
(format #t "~1Tworld-player-spheres[12] @ #x~X~%" (-> this world-player-spheres))
|
|
(format #t "~1Tworld-player-hanging-spheres[6] @ #x~X~%" (-> this world-player-spheres))
|
|
(format #t "~1Tworld-player-leap-up-spheres[6] @ #x~X~%" (-> this world-player-leap-up-spheres))
|
|
(format #t "~1Tspec: #<collide-edge-spec @ #x~X>~%" (-> this spec))
|
|
(format #t "~1Tprocess: #x~X~%" (-> this process))
|
|
(format #t "~1Tverts[64] @ #x~X~%" (-> this verts))
|
|
(format #t "~1Tedges[96] @ #x~X~%" (-> this edges))
|
|
(format #t "~1Ttris[48] @ #x~X~%" (-> this tris))
|
|
(format #t "~1Thold-list: #<collide-edge-hold-list @ #x~X>~%" (-> this hold-list))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; definition for symbol *collide-edge-spec*, type collide-edge-spec
|
|
(define *collide-edge-spec*
|
|
(new 'static 'collide-edge-spec
|
|
:split-dists (new 'static 'array float 2 1024.0 1433.6)
|
|
:outward-offset (new 'static 'vector :x 708.608 :y 13312.0 :w 1.0)
|
|
:flags (collide-edge-spec-flags send-event)
|
|
:ignore-pat (new 'static 'pat-surface :noentity #x1 :noedge #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1)
|
|
:max-dist-sqrd-to-outward-pt 37748736.0
|
|
:max-dir-cosa-delta 0.6
|
|
:touching-segment #f
|
|
:local-cache-fill-box (new 'static 'bounding-box
|
|
:min (new 'static 'vector :x -8192.0 :y -11059.2 :z -8192.0 :w 1.0)
|
|
:max (new 'static 'vector :x 8192.0 :y 24576.0 :z 8192.0 :w 1.0)
|
|
)
|
|
:local-within-reach-box (new 'static 'bounding-box
|
|
:min (new 'static 'vector :x -6144.0 :y 5324.8 :z -6144.0 :w 1.0)
|
|
:max (new 'static 'vector :x 6144.0 :y 11059.2 :z 6144.0 :w 1.0)
|
|
)
|
|
:local-player-spheres (new 'static 'inline-array sphere 12
|
|
(new 'static 'sphere :x 1720.32 :y -819.2 :r 1433.6)
|
|
(new 'static 'sphere :x 2293.76 :y -3276.8 :r 1884.16)
|
|
(new 'static 'sphere :x 1966.08 :y -6144.0 :r 1556.48)
|
|
(new 'static 'sphere :x 1966.08 :y -8601.6 :r 1556.48)
|
|
(new 'static 'sphere :x 1761.28 :y -11059.2 :r 1351.68)
|
|
(new 'static 'sphere :x 1679.36 :y -13312.0 :r 1269.76)
|
|
(new 'static 'sphere :x -737.28 :y 4096.0 :r 3072.0)
|
|
(new 'static 'sphere :x -737.28 :y 6553.6 :r 3072.0)
|
|
(new 'static 'sphere :x -737.28 :y 9420.8 :r 3072.0)
|
|
(new 'static 'sphere :x 1720.32 :y 3686.4 :r 2949.12)
|
|
(new 'static 'sphere :x 1720.32 :y 5734.4 :r 2949.12)
|
|
(new 'static 'sphere :x 1720.32 :y 8601.6 :r 2949.12)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(kmemopen global "collide-edge-work")
|
|
|
|
;; definition for symbol *collide-edge-work*, type collide-edge-work
|
|
(define *collide-edge-work* (new 'global 'collide-edge-work))
|
|
|
|
;; failed to figure out what this is:
|
|
(mem-copy! (the-as pointer (-> *collide-edge-work* spec)) (the-as pointer *collide-edge-spec*) 320)
|
|
|
|
;; definition (perm) for symbol *edge-grab-info*, type edge-grab-info
|
|
(define-perm *edge-grab-info* edge-grab-info (new 'global 'edge-grab-info))
|
|
|
|
;; failed to figure out what this is:
|
|
(kmemclose)
|