d/jak2: finish cty-guard-turret-button | race-h | height-map-h and a lot of rigid-body (#1957)

Also cleaned up `data_decompiler.cpp` to make it a lot less verbose to
add a special case for an array field.
This commit is contained in:
Tyler Wilding
2022-10-11 23:20:36 -04:00
committed by GitHub
parent f7e1e73809
commit e3473c1902
197 changed files with 24065 additions and 614 deletions
+1 -1
View File
@@ -51,7 +51,7 @@ if(UNIX AND CMAKE_COMPILER_IS_GNUCXX AND CODE_COVERAGE)
include(CodeCoverage)
append_coverage_compiler_flags()
setup_target_for_coverage_lcov(NAME goalc-test_coverage
EXECUTABLE goalc-test --gtest_color=yes --gtest_brief=0 --gtest_filter="-*MANUAL_TEST*"
EXECUTABLE goalc-test --gtest_color=yes --gtest_brief=0 --gtest_filter=\"-*MANUAL_TEST*\"
DEPENDENCIES goalc-test
EXCLUDE "third-party/*" "/usr/include/*")
endif()
+27 -27
View File
@@ -1332,7 +1332,7 @@
(collide-shape-method-51 () none 51)
(collide-shape-method-52 () none 52)
(collide-shape-method-53 () none 53)
(collide-shape-method-54 () none 54)
(collide-shape-method-54 (_type_) none 54)
)
)
@@ -1582,32 +1582,32 @@
;; definition of type collide-shape-moving
(deftype collide-shape-moving (collide-shape)
((rider-time time-frame :offset-assert 200)
(rider-last-move vector :inline :offset-assert 208)
(trans-old vector :inline :offset-assert 224)
(poly-pat pat-surface :offset 272)
(cur-pat pat-surface :offset-assert 276)
(ground-pat pat-surface :offset-assert 280)
(status cshape-moving-flags :offset-assert 288)
(old-status cshape-moving-flags :offset-assert 296)
(prev-status cshape-moving-flags :offset-assert 304)
(reaction-flag cshape-reaction-flags :offset-assert 312)
(reaction function :offset-assert 316)
(no-reaction function :offset-assert 320)
(local-normal vector :inline :offset-assert 336)
(surface-normal vector :inline :offset-assert 352)
(poly-normal vector :inline :offset-assert 368)
(ground-poly-normal vector :inline :offset-assert 384)
(gspot-pos vector :inline :offset-assert 400)
(gspot-normal vector :inline :offset-assert 416)
(grount-touch-point vector :inline :offset-assert 432)
(ground-impact-vel meters :offset-assert 448)
(surface-angle float :offset-assert 452)
(poly-angle float :offset-assert 456)
(touch-angle float :offset-assert 460)
(coverage float :offset-assert 464)
(dynam dynamics :offset-assert 468)
(surf surface :offset-assert 472)
((rider-time time-frame :offset-assert 200)
(rider-last-move vector :inline :offset-assert 208)
(trans-old vector :inline :offset-assert 224)
(poly-pat pat-surface :offset 272)
(cur-pat pat-surface :offset-assert 276)
(ground-pat pat-surface :offset-assert 280)
(status cshape-moving-flags :offset-assert 288)
(old-status cshape-moving-flags :offset-assert 296)
(prev-status cshape-moving-flags :offset-assert 304)
(reaction-flag cshape-reaction-flags :offset-assert 312)
(reaction (function control-info collide-query vector vector cshape-moving-flags) :offset-assert 316)
(no-reaction function :offset-assert 320)
(local-normal vector :inline :offset-assert 336)
(surface-normal vector :inline :offset-assert 352)
(poly-normal vector :inline :offset-assert 368)
(ground-poly-normal vector :inline :offset-assert 384)
(gspot-pos vector :inline :offset-assert 400)
(gspot-normal vector :inline :offset-assert 416)
(grount-touch-point vector :inline :offset-assert 432)
(ground-impact-vel meters :offset-assert 448)
(surface-angle float :offset-assert 452)
(poly-angle float :offset-assert 456)
(touch-angle float :offset-assert 460)
(coverage float :offset-assert 464)
(dynam dynamics :offset-assert 468)
(surf surface :offset-assert 472)
)
:method-count-assert 68
:size-assert #x1dc
+3 -3
View File
@@ -39,9 +39,9 @@
:size-assert #xe8
:flag-assert #xc000000e8
(:methods
(touching-prims-entry-method-9 () none 9)
(touching-prims-entry-method-10 () none 10)
(touching-prims-entry-method-11 () none 11)
(touching-prims-entry-method-9 (_type_ vector) vector 9)
(touching-prims-entry-method-10 (_type_ collide-shape touching-shapes-entry) collide-shape-prim 10)
(touching-prims-entry-method-11 (_type_ collide-shape touching-shapes-entry) collide-tri-result 11)
)
)
+1 -1
View File
@@ -452,7 +452,7 @@
(set! (-> collision-shape total-prims) (the-as uint 1))
(set! (-> collision-shape root-prim) collision-mesh)
)
((method-of-object collision-shape collide-shape-method-54))
(collide-shape-method-54 collision-shape)
(set! (-> collision-shape nav-radius) (* 0.75 (-> collision-shape root-prim local-sphere w)))
(let ((prim (-> collision-shape root-prim)))
(set! (-> collision-shape backup-collide-as) (-> prim prim-core collide-as))
+1 -1
View File
@@ -77,7 +77,7 @@
(set! (-> collision-shape total-prims) (the-as uint 1))
(set! (-> collision-shape root-prim) collision-mesh)
)
((method-of-object collision-shape collide-shape-method-54))
(collide-shape-method-54 collision-shape)
(set! (-> collision-shape nav-radius) (* 0.75 (-> collision-shape root-prim local-sphere w)))
(let ((prim (-> collision-shape root-prim)))
(set! (-> collision-shape backup-collide-as) (-> prim prim-core collide-as))
+1 -1
View File
@@ -17,7 +17,7 @@
(water water-control :offset-assert 172)
(sound ambient-sound :offset-assert 176)
(carry basic :offset-assert 180)
(rbody basic :offset-assert 184)
(rbody rigid-body-control :offset-assert 184)
(state-flags state-flags :offset-assert 188)
(state-time time-frame :offset-assert 192)
)
-4
View File
@@ -41,7 +41,3 @@
;; failed to figure out what this is:
0
+70 -70
View File
@@ -81,6 +81,7 @@
(cm-joint-x meters :offset 32)
(cm-joint-y meters :offset 36)
(cm-joint-z meters :offset 40)
(cm-joint-w float :offset 44)
(linear-damping float :offset 8)
(angular-damping float :offset 12)
(bounce-factor float :offset 16)
@@ -93,7 +94,7 @@
(gravity meters :offset 192)
(idle-distance meters :offset 196)
(attack-force-scale float :offset 200)
(name basic :offset-assert 204)
(name symbol :offset-assert 204)
)
:method-count-assert 9
:size-assert #xd0
@@ -165,32 +166,32 @@
;; definition of type rigid-body
(deftype rigid-body (structure)
((work basic :offset-assert 0)
(info rigid-body-info :offset-assert 4)
(flags rigid-body-flag :offset-assert 8)
(force-callback basic :offset-assert 12)
(blocked-by basic :offset-assert 16)
(time-remaining float :offset-assert 20)
(step-count int16 :offset-assert 24)
(position vector :inline :offset-assert 32)
(rot vector :inline :offset-assert 48)
(rotation quaternion :inline :offset 48)
(lin-momentum vector :inline :offset-assert 64)
(ang-momentum vector :inline :offset-assert 80)
(force vector :inline :offset-assert 96)
(torque vector :inline :offset-assert 112)
(lin-velocity vector :inline :offset-assert 128)
(ang-velocity vector :inline :offset-assert 144)
(matrix matrix :inline :offset-assert 160)
(inv-i-world matrix :inline :offset-assert 224)
((work rigid-body-work :offset-assert 0)
(info rigid-body-info :offset-assert 4)
(flags rigid-body-flag :offset-assert 8)
(force-callback (function object float none) :offset-assert 12)
(blocked-by basic :offset-assert 16)
(time-remaining float :offset-assert 20)
(step-count int16 :offset-assert 24)
(position vector :inline :offset-assert 32)
(rot vector :inline :offset-assert 48)
(rotation quaternion :inline :offset 48)
(lin-momentum vector :inline :offset-assert 64)
(ang-momentum vector :inline :offset-assert 80)
(force vector :inline :offset-assert 96)
(torque vector :inline :offset-assert 112)
(lin-velocity vector :inline :offset-assert 128)
(ang-velocity vector :inline :offset-assert 144)
(matrix matrix :inline :offset-assert 160)
(inv-i-world matrix :inline :offset-assert 224)
)
:method-count-assert 32
:size-assert #x120
:flag-assert #x2000000120
(:methods
(rigid-body-method-9 (_type_) none 9)
(rigid-body-method-9 (_type_ collide-shape-moving float) none 9)
(rigid-body-method-10 (_type_) none 10)
(rigid-body-method-11 (_type_) none 11)
(rigid-body-method-11 (_type_ collide-shape-moving) none 11)
(rigid-body-method-12 (_type_ float) none 12)
(rigid-body-method-13 (_type_) none 13)
(rigid-body-method-14 (_type_ float) none 14)
@@ -204,7 +205,7 @@
(rigid-body-method-22 (_type_ vector vector) vector 22)
(rigid-body-method-23 (_type_ vector) vector 23)
(rigid-body-method-24 (_type_) none 24)
(rigid-body-method-25 (_type_ rigid-body-info vector quaternion basic) none 25)
(rigid-body-method-25 (_type_ rigid-body-info vector quaternion function) none 25)
(rigid-body-method-26 (_type_ vector quaternion) none 26)
(print-physics (_type_ object) none 27)
(print-force-torque (_type_ object) none 28)
@@ -291,9 +292,10 @@
:size-assert #x130
:flag-assert #x1a00000130
(:methods
(rigid-body-control-method-9 (_type_) none 9)
(rigid-body-control-method-10 (_type_) none 10)
(rigid-body-control-method-11 (_type_) none 11)
(new (symbol type process) _type_ 0)
(rigid-body-control-method-9 (_type_ collide-shape-moving float) none 9)
(rigid-body-control-method-10 (_type_ rigid-body-object float float) object 10)
(rigid-body-control-method-11 (_type_ collide-shape-moving) none 11)
(rigid-body-control-method-12 (_type_ float) none 12)
(rigid-body-control-method-13 (_type_) none 13)
(rigid-body-control-method-14 (_type_ float) none 14)
@@ -364,20 +366,21 @@
)
;; definition for method 9 of type rigid-body-control
(defmethod rigid-body-control-method-9 rigid-body-control ((obj rigid-body-control))
(rigid-body-method-9 (-> obj state))
(defmethod rigid-body-control-method-9 rigid-body-control ((obj rigid-body-control) (arg0 collide-shape-moving) (arg1 float))
(rigid-body-method-9 (-> obj state) arg0 arg1)
(none)
)
;; definition for method 10 of type rigid-body-control
(defmethod rigid-body-control-method-10 rigid-body-control ((obj rigid-body-control))
(rigid-body-method-10 (-> obj state))
(none)
;; INFO: this function exists in multiple non-identical object files
;; WARN: Return type mismatch none vs object.
(defmethod rigid-body-control-method-10 rigid-body-control ((obj rigid-body-control) (arg0 rigid-body-object) (arg1 float) (arg2 float))
(the-as object (rigid-body-method-10 (-> obj state)))
)
;; definition for method 11 of type rigid-body-control
(defmethod rigid-body-control-method-11 rigid-body-control ((obj rigid-body-control))
(rigid-body-method-11 (-> obj state))
(defmethod rigid-body-control-method-11 rigid-body-control ((obj rigid-body-control) (arg0 collide-shape-moving))
(rigid-body-method-11 (-> obj state) arg0)
(none)
)
@@ -453,7 +456,7 @@
;; definition for method 24 of type rigid-body-control
(defmethod rigid-body-control-method-24 rigid-body-control ((obj rigid-body-control) (arg0 rigid-body-info) (arg1 vector) (arg2 quaternion) (arg3 basic))
(rigid-body-method-25 (-> obj state) arg0 arg1 arg2 arg3)
(rigid-body-method-25 (-> obj state) arg0 arg1 arg2 (the-as function arg3))
(none)
)
@@ -465,7 +468,8 @@
;; definition of type rigid-body-object
(deftype rigid-body-object (process-focusable)
((info rigid-body-object-constants :offset-assert 204)
((root-override collide-shape-moving :offset 128)
(info rigid-body-object-constants :offset-assert 204)
(flags rigid-body-object-flag :offset-assert 208)
(max-time-step float :offset-assert 216)
(incoming-attack-id uint32 :offset-assert 220)
@@ -479,32 +483,32 @@
:size-assert #x110
:flag-assert #x3500900110
(:methods
(rigid-body-object-method-27 () none 27)
(rigid-body-object-method-28 () none 28)
(rigid-body-object-method-29 () none 29)
(rigid-body-object-method-30 () none 30)
(rigid-body-object-method-31 () none 31)
(rigid-body-object-method-32 () none 32)
(rigid-body-object-method-33 () none 33)
(rigid-body-object-method-34 () none 34)
(rigid-body-object-method-35 () none 35)
(idle () _type_ :state 27)
(active () _type_ :state 28)
(rigid-body-object-method-29 (_type_) none 29)
(rigid-body-object-method-30 (_type_) none 30)
(rigid-body-object-method-31 (_type_ rigid-body-object-constants) none 31)
(rigid-body-object-method-32 (_type_) none 32)
(rigid-body-object-method-33 (_type_) none 33)
(rigid-body-object-method-34 (_type_) none 34)
(rigid-body-object-method-35 (_type_) none 35)
(rigid-body-object-method-36 () none 36)
(rigid-body-object-method-37 () none 37)
(rigid-body-object-method-38 () none 38)
(rigid-body-object-method-39 () none 39)
(rigid-body-object-method-40 () none 40)
(rigid-body-object-method-41 () none 41)
(rigid-body-object-method-42 () none 42)
(rigid-body-object-method-43 () none 43)
(rigid-body-object-method-44 () none 44)
(rigid-body-object-method-37 (_type_) none 37)
(rigid-body-object-method-38 (_type_) none 38)
(rigid-body-object-method-39 (_type_) none 39)
(rigid-body-object-method-40 (_type_) none 40)
(rigid-body-object-method-41 (_type_) none 41)
(rigid-body-object-method-42 (_type_) none :behavior rigid-body-object 42)
(rigid-body-object-method-43 (_type_) none 43)
(rigid-body-object-method-44 (_type_ float) none 44)
(rigid-body-object-method-45 () none 45)
(rigid-body-object-method-46 () none 46)
(rigid-body-object-method-47 () none 47)
(rigid-body-object-method-48 () none 48)
(rigid-body-object-method-49 () none 49)
(rigid-body-object-method-50 () none 50)
(rigid-body-object-method-51 () none 51)
(rigid-body-object-method-52 () none 52)
(rigid-body-object-method-46 (_type_ process-drawable int symbol event-message-block) none :behavior rigid-body-object 46)
(rigid-body-object-method-47 (_type_ process-drawable attack-info object penetrate) symbol 47)
(rigid-body-object-method-48 (_type_ object object) none 48)
(rigid-body-object-method-49 (_type_ matrix touching-shapes-entry) none 49)
(rigid-body-object-method-50 (_type_ float) none 50)
(rigid-body-object-method-51 (_type_) none 51)
(rigid-body-object-method-52 (_type_) none 52)
)
)
@@ -568,14 +572,14 @@
:size-assert #x408
:flag-assert #x1100000408
(:methods
(rigid-body-queue-method-9 () none 9)
(rigid-body-queue-method-10 () none 10)
(rigid-body-queue-method-11 () none 11)
(rigid-body-queue-method-12 () none 12)
(rigid-body-queue-method-13 () none 13)
(rigid-body-queue-method-14 () none 14)
(rigid-body-queue-method-15 () none 15)
(rigid-body-queue-method-16 () none 16)
(rigid-body-queue-method-9 (_type_) none 9)
(rigid-body-queue-method-10 (_type_) none 10)
(rigid-body-queue-method-11 (_type_) none 11)
(rigid-body-queue-method-12 (_type_ int int) none 12)
(rigid-body-queue-method-13 (_type_) none 13)
(rigid-body-queue-method-14 (_type_ int) none 14)
(rigid-body-queue-method-15 (_type_) none 15)
(validate (_type_) symbol 16)
)
)
@@ -594,7 +598,3 @@
;; failed to figure out what this is:
0
File diff suppressed because it is too large Load Diff
@@ -16,7 +16,7 @@
(process-focusable-method-23 (_type_) none 23)
(process-focusable-method-24 (_type_) float 24)
(process-focusable-method-25 (_type_) time-frame 25)
(process-focusable-method-26 (_type_) none 26)
(process-focusable-method-26 (_type_) float 26)
)
)
@@ -80,10 +80,8 @@
)
;; definition for method 26 of type process-focusable
;; WARN: Return type mismatch int vs none.
(defmethod process-focusable-method-26 process-focusable ((obj process-focusable))
0
(none)
0.0
)
;; definition for method 25 of type process-focusable
+4 -4
View File
@@ -11,7 +11,7 @@
(max-delay uint16 :offset-assert 8)
(delay uint16 :offset-assert 10)
(play-index int16 :offset-assert 12)
(list basic :offset-assert 16)
(list (array string) :offset-assert 16)
)
:method-count-assert 9
:size-assert #x14
@@ -128,15 +128,15 @@
;; definition of type speech-control
(deftype speech-control (structure)
((channel-array speech-channel 2 :inline :offset-assert 0)
(speech-table uint32 57 :offset-assert 224)
((channel-array speech-channel 2 :inline :offset-assert 0)
(speech-table speech-type-info 57 :offset-assert 224)
)
:method-count-assert 17
:size-assert #x1c4
:flag-assert #x11000001c4
(:methods
(speech-control-method-9 () none 9)
(speech-control-method-10 () none 10)
(speech-control-method-10 (_type_ int speech-type-info) none 10)
(speech-control-method-11 (_type_) none 11)
(speech-control-method-12 () none 12)
(speech-control-method-13 () none 13)
+62
View File
@@ -0,0 +1,62 @@
;;-*-Lisp-*-
(in-package goal)
;; definition of type xz-height-map
(deftype xz-height-map (structure)
((offset float 3 :offset-assert 0)
(x-offset float :offset 0)
(y-offset float :offset 4)
(z-offset float :offset 8)
(x-inv-spacing float :offset-assert 12)
(z-inv-spacing float :offset-assert 16)
(y-scale float :offset-assert 20)
(dim int16 2 :offset-assert 24)
(x-dim int16 :offset 24)
(z-dim int16 :offset 26)
(data (pointer int8) :offset-assert 28)
)
:method-count-assert 15
:size-assert #x20
:flag-assert #xf00000020
(:methods
(xz-height-map-method-9 (_type_ vector) float 9)
(xz-height-map-method-10 (_type_ vector) none 10)
(xz-height-map-method-11 (_type_) none 11)
(xz-height-map-method-12 (_type_ vector) none 12)
(xz-height-map-method-13 (_type_ vector) none 13)
(xz-height-map-method-14 (_type_ vector int) none 14)
)
)
;; definition for method 3 of type xz-height-map
(defmethod inspect xz-height-map ((obj xz-height-map))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj 'xz-height-map)
(format #t "~1Toffset[3] @ #x~X~%" (-> obj offset))
(format #t "~1Tx-offset: ~f~%" (-> obj x-offset))
(format #t "~1Ty-offset: ~f~%" (-> obj y-offset))
(format #t "~1Tz-offset: ~f~%" (-> obj z-offset))
(format #t "~1Tx-inv-spacing: ~f~%" (-> obj x-inv-spacing))
(format #t "~1Tz-inv-spacing: ~f~%" (-> obj z-inv-spacing))
(format #t "~1Ty-scale: ~f~%" (-> obj y-scale))
(format #t "~1Tdim[2] @ #x~X~%" (-> obj dim))
(format #t "~1Tx-dim: ~D~%" (-> obj x-dim))
(format #t "~1Tz-dim: ~D~%" (-> obj z-dim))
(format #t "~1Tdata: #x~X~%" (-> obj data))
(label cfg-4)
obj
)
;; definition for function get-traffic-height
(defun get-traffic-height ((arg0 vector))
"@returns The value of [[xz-height-map::9]] using [[*traffic-height-map*]] and the [[vector]] provided
@see [[xz-height-map::9]]"
(xz-height-map-method-9 *traffic-height-map* arg0)
)
+3 -3
View File
@@ -84,7 +84,7 @@
(nav-node-method-11 (_type_ int) none 11)
(nav-node-method-12 (_type_ vector nav-node) none 12)
(nav-node-method-13 (_type_ vector) none 13)
(nav-node-method-14 (_type_ nav-node) none 14)
(nav-node-method-14 (_type_ vector) none 14)
(nav-node-method-15 (_type_ uint) none 15)
(nav-node-method-16 (_type_ float) none 16)
(nav-node-method-17 (_type_ float) none 17)
@@ -278,7 +278,7 @@
(nav-graph-method-24 (_type_ int int) none 24)
(nav-graph-method-25 (_type_ symbol symbol) none 25)
(nav-graph-method-26 (_type_ symbol symbol) none 26)
(nav-graph-method-27 (_type_) none 27)
(nav-graph-method-27 (_type_ nav-node-flag-byte nav-node-flag-byte symbol) none 27)
(nav-graph-method-28 (_type_) none 28)
(nav-graph-method-29 (_type_ symbol) none 29)
(nav-graph-method-30 (_type_ uint) none 30)
@@ -289,7 +289,7 @@
(nav-graph-method-35 (_type_ int) none 35)
(nav-graph-method-36 (_type_ int) none 36)
(nav-graph-method-37 (_type_ vector) none 37)
(nav-graph-method-38 () none 38)
(nav-graph-method-38 (_type_) none 38)
(nav-graph-method-39 (_type_) none 39)
(nav-graph-method-40 (_type_ int) int 40)
(node-at-idx (_type_ int) nav-node 41)
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -455,9 +455,9 @@
(:methods
(vehicle-controller-method-9 () none 9)
(vehicle-controller-method-10 () none 10)
(vehicle-controller-method-11 () none 11)
(vehicle-controller-method-11 (_type_) none 11)
(vehicle-controller-method-12 () none 12)
(vehicle-controller-method-13 () none 13)
(vehicle-controller-method-13 (_type_ nav-branch vector) none 13)
(vehicle-controller-method-14 () none 14)
(vehicle-controller-method-15 () none 15)
(vehicle-controller-method-16 () none 16)
@@ -0,0 +1,189 @@
;;-*-Lisp-*-
(in-package goal)
;; failed to figure out what this is:
(let ((a0-0 (new 'static 'skeleton-group
:name "skel-cty-guard-turret-button"
:extra #f
:info #f
:art-group-name "cty-guard-turret-button"
:bounds (new 'static 'vector :w 12288.0)
:version #x7
)
)
)
(set! (-> a0-0 jgeo) 0)
(set! (-> a0-0 janim) 2)
(set! (-> a0-0 mgeo 0) 1)
(set! (-> a0-0 lod-dist 0) 4095996000.0)
(add-to-loading-level a0-0)
)
;; definition of type cty-guard-turret-button
(deftype cty-guard-turret-button (basebutton)
()
:heap-base #xa0
:method-count-assert 40
:size-assert #x120
:flag-assert #x2800a00120
(:methods
(pop-up () _type_ :state 39)
)
)
;; definition for method 3 of type cty-guard-turret-button
(defmethod inspect cty-guard-turret-button ((obj cty-guard-turret-button))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(let ((t9-0 (method-of-type basebutton inspect)))
(t9-0 obj)
)
(label cfg-4)
obj
)
;; definition for method 33 of type cty-guard-turret-button
;; WARN: Return type mismatch int vs none.
(defmethod basebutton-method-33 cty-guard-turret-button ((obj cty-guard-turret-button))
"TODO - joint stuff"
(initialize-skeleton
obj
(the-as
skeleton-group
(art-group-get-by-name *level* "skel-cty-guard-turret-button" (the-as (pointer uint32) #f))
)
(the-as pair 0)
)
(ja-channel-set! 1)
(cond
((logtest? (-> obj button-status) (button-status pressed))
(let ((s5-1 (-> obj skel root-channel 0)))
(joint-control-channel-group-eval!
s5-1
(the-as art-joint-anim (-> obj draw art-group data 2))
num-func-identity
)
(set! (-> s5-1 frame-num)
(the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 2)) frames num-frames) -1))
)
)
)
(else
(let ((s5-2 (-> obj skel root-channel 0)))
(joint-control-channel-group-eval!
s5-2
(the-as art-joint-anim (-> obj draw art-group data 2))
num-func-identity
)
(set! (-> s5-2 frame-num) 0.0)
)
)
)
(transform-post)
(none)
)
;; definition for method 34 of type cty-guard-turret-button
;; WARN: Return type mismatch collide-shape vs none.
(defmethod basebutton-method-34 cty-guard-turret-button ((obj cty-guard-turret-button))
"TODO - collision stuff"
(let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player))))
(let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0)))
(set! (-> s5-0 total-prims) (the-as uint 3))
(set! (-> s4-0 prim-core collide-as) (collide-spec pusher))
(set! (-> s4-0 prim-core collide-with) (collide-spec jak enemy hit-by-others-list player-list))
(set! (-> s4-0 prim-core action) (collide-action solid rideable))
(set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 12288.0)
(set! (-> s5-0 root-prim) s4-0)
)
(collide-shape-method-54 s5-0)
(let ((v1-10 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0))))
(set! (-> v1-10 prim-core collide-as) (collide-spec pusher))
(set! (-> v1-10 prim-core collide-with) (collide-spec jak bot enemy hit-by-others-list player-list))
(set! (-> v1-10 prim-core action) (collide-action solid rideable))
(set! (-> v1-10 transform-index) 3)
(set-vector! (-> v1-10 local-sphere) 0.0 0.0 0.0 12288.0)
)
(let ((v1-12 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0))))
(set! (-> v1-12 prim-core collide-as) (collide-spec pusher))
(set! (-> v1-12 prim-core collide-with) (collide-spec jak bot enemy hit-by-others-list player-list))
(set! (-> v1-12 prim-core action) (collide-action solid rideable))
(set! (-> v1-12 transform-index) 4)
(set-vector! (-> v1-12 local-sphere) 0.0 -2048.0 0.0 4096.0)
)
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
(let ((v1-15 (-> s5-0 root-prim)))
(set! (-> s5-0 backup-collide-as) (-> v1-15 prim-core collide-as))
(set! (-> s5-0 backup-collide-with) (-> v1-15 prim-core collide-with))
)
(set! (-> obj root) s5-0)
)
(none)
)
;; definition for method 35 of type cty-guard-turret-button
;; WARN: Return type mismatch symbol vs none.
(defmethod prepare-trigger-event! cty-guard-turret-button ((obj cty-guard-turret-button))
"Sets `event-going-down` to `'trigger`"
(logior! (-> obj button-status) (button-status button-status-4))
(set! (-> obj event-going-down) 'trigger)
(none)
)
;; failed to figure out what this is:
(defstate pop-up (cty-guard-turret-button)
:virtual #t
:code (behavior ()
(ja-no-eval :group! (-> self draw art-group data 3)
:num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) frames num-frames) -1)) 0.4)
:frame-num 0.0
)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! max 0.4))
)
(ja :group! (-> self draw art-group data 2) :num! min)
(go-virtual up-idle)
(none)
)
:post (behavior ()
(rider-post)
(none)
)
)
;; definition for method 32 of type cty-guard-turret-button
(defmethod idle-state-transition cty-guard-turret-button ((obj cty-guard-turret-button))
"If `button-status` has [[button-status:0]] set, transition to [[basebutton::27]] otherwise, [[basebutton::30]]"
(draw-control-method-12 (-> obj draw) (the-as uint 0) -1)
(cond
((logtest? (-> obj button-status) (button-status pressed))
(format #t "off~%")
(draw-control-method-12 (-> obj draw) (the-as uint 4) 0)
(draw-control-method-12 (-> obj draw) (the-as uint 1) 0)
(go (method-of-object obj down-idle))
)
(else
(format #t "on~%")
(draw-control-method-12 (-> obj draw) (the-as uint 4) 0)
(draw-control-method-12 (-> obj draw) (the-as uint 2) 0)
(go (method-of-object obj pop-up))
)
)
)
;; failed to figure out what this is:
(defstate going-down (cty-guard-turret-button)
:virtual #t
:enter (behavior ()
(sound-play "gturret-button")
(format #t "going-down off~%")
(draw-control-method-12 (-> self draw) (the-as uint 0) -1)
(draw-control-method-12 (-> self draw) (the-as uint 4) 0)
(draw-control-method-12 (-> self draw) (the-as uint 1) 0)
(press! self #t)
(none)
)
)
+357
View File
@@ -0,0 +1,357 @@
;;-*-Lisp-*-
(in-package goal)
;; definition of type race-turbo-pad
(deftype race-turbo-pad (structure)
((position vector :inline :offset-assert 0)
(handle uint64 :offset-assert 16)
)
:method-count-assert 9
:size-assert #x18
:flag-assert #x900000018
)
;; definition for method 3 of type race-turbo-pad
(defmethod inspect race-turbo-pad ((obj race-turbo-pad))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj 'race-turbo-pad)
(format #t "~1Tposition: #<vector @ #x~X>~%" (-> obj position))
(format #t "~1Thandle: ~D~%" (-> obj handle))
(label cfg-4)
obj
)
;; definition of type race-decision-point
(deftype race-decision-point (structure)
((pos float :offset-assert 0)
(decision-type uint8 :offset-assert 4)
(shortcuts uint8 :offset-assert 5)
(safe-paths uint8 :offset-assert 6)
)
:method-count-assert 9
:size-assert #x7
:flag-assert #x900000007
)
;; definition for method 3 of type race-decision-point
(defmethod inspect race-decision-point ((obj race-decision-point))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj 'race-decision-point)
(format #t "~1Tpos: ~f~%" (-> obj pos))
(format #t "~1Tdecision-type: ~D~%" (-> obj decision-type))
(format #t "~1Tshortcuts: ~D~%" (-> obj shortcuts))
(format #t "~1Tsafe-paths: ~D~%" (-> obj safe-paths))
(label cfg-4)
obj
)
;; definition of type race-racer-info
(deftype race-racer-info (structure)
((rider uint8 :offset-assert 0)
(vehicle uint8 :offset-assert 1)
(flags uint8 :offset-assert 2)
(seek-offset int8 :offset-assert 3)
)
:method-count-assert 9
:size-assert #x4
:flag-assert #x900000004
)
;; definition for method 3 of type race-racer-info
(defmethod inspect race-racer-info ((obj race-racer-info))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj 'race-racer-info)
(format #t "~1Trider: ~D~%" (-> obj rider))
(format #t "~1Tvehicle: ~D~%" (-> obj vehicle))
(format #t "~1Tflags: ~D~%" (-> obj flags))
(format #t "~1Tseek-offset: ~D~%" (-> obj seek-offset))
(label cfg-4)
obj
)
;; definition of type race-info
(deftype race-info (basic)
((race-mesh-name string :offset-assert 4)
(path-group-name string :offset-assert 8)
(task-node uint16 :offset-assert 12)
(mesh basic :offset-assert 16)
(ai-min-speed-factor float :offset-assert 20)
(ai-max-speed-factor float :offset-assert 24)
(ai-spread-factor float :offset-assert 28)
(start-sphere sphere :inline :offset-assert 32)
(start-dir vector :inline :offset-assert 48)
(finish-sphere sphere :inline :offset-assert 64)
(finish-dir vector :inline :offset-assert 80)
(player-intro-pos vector :inline :offset-assert 96)
(flags uint8 :offset-assert 112)
(score uint8 :offset-assert 113)
(lap-count int8 :offset-assert 114)
(racer-count int8 :offset-assert 115)
(turbo-pad-count int8 :offset-assert 116)
(map-index int8 :offset-assert 117)
(decision-point-count int8 :offset-assert 118)
(safe-paths uint8 :offset-assert 119)
(turbo-pad-array (inline-array race-turbo-pad) :offset-assert 120)
(racer-array (inline-array race-racer-info) :offset-assert 124)
(decision-point-array (inline-array race-decision-point) :offset-assert 128)
(level symbol :offset-assert 132)
(borrow-level symbol :offset-assert 136)
(borrow pair :offset-assert 140)
(manager uint64 :offset-assert 144)
(manager-handle-init-hack basic :offset 144)
(hatch-actor-name string :offset-assert 152)
(countdown-scene basic :offset-assert 156)
(complete-continue basic :offset-assert 160)
(start-camera string :offset-assert 164)
(go-speech uint16 :offset-assert 168)
)
:method-count-assert 10
:size-assert #xaa
:flag-assert #xa000000aa
(:methods
(race-info-method-9 (_type_) none 9)
)
)
;; definition for method 3 of type race-info
(defmethod inspect race-info ((obj race-info))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~1Trace-mesh-name: ~A~%" (-> obj race-mesh-name))
(format #t "~1Tpath-group-name: ~A~%" (-> obj path-group-name))
(format #t "~1Ttask-node: ~D~%" (-> obj task-node))
(format #t "~1Tmesh: ~A~%" (-> obj mesh))
(format #t "~1Tai-min-speed-factor: ~f~%" (-> obj ai-min-speed-factor))
(format #t "~1Tai-max-speed-factor: ~f~%" (-> obj ai-max-speed-factor))
(format #t "~1Tai-spread-factor: ~f~%" (-> obj ai-spread-factor))
(format #t "~1Tstart-sphere: #<sphere @ #x~X>~%" (-> obj start-sphere))
(format #t "~1Tstart-dir: #<vector @ #x~X>~%" (-> obj start-dir))
(format #t "~1Tfinish-sphere: #<sphere @ #x~X>~%" (-> obj finish-sphere))
(format #t "~1Tfinish-dir: #<vector @ #x~X>~%" (-> obj finish-dir))
(format #t "~1Tplayer-intro-pos: #<vector @ #x~X>~%" (-> obj player-intro-pos))
(format #t "~1Tflags: ~D~%" (-> obj flags))
(format #t "~1Tscore: ~D~%" (-> obj score))
(format #t "~1Tlap-count: ~D~%" (-> obj lap-count))
(format #t "~1Tracer-count: ~D~%" (-> obj racer-count))
(format #t "~1Tturbo-pad-count: ~D~%" (-> obj turbo-pad-count))
(format #t "~1Tmap-index: ~D~%" (-> obj map-index))
(format #t "~1Tdecision-point-count: ~D~%" (-> obj decision-point-count))
(format #t "~1Tsafe-paths: ~D~%" (-> obj safe-paths))
(format #t "~1Tturbo-pad-array: #x~X~%" (-> obj turbo-pad-array))
(format #t "~1Tracer-array: #x~X~%" (-> obj racer-array))
(format #t "~1Tdecision-point-array: #x~X~%" (-> obj decision-point-array))
(format #t "~1Tlevel: ~A~%" (-> obj level))
(format #t "~1Tborrow-level: ~A~%" (-> obj borrow-level))
(format #t "~1Tborrow: ~A~%" (-> obj borrow))
(format #t "~1Tmanager: ~D~%" (-> obj manager))
(format #t "~1Tmanager-handle-init-hack: ~A~%" (-> obj manager-handle-init-hack))
(format #t "~1Thatch-actor-name: ~A~%" (-> obj hatch-actor-name))
(format #t "~1Tcountdown-scene: ~A~%" (-> obj countdown-scene))
(format #t "~1Tcomplete-continue: ~A~%" (-> obj complete-continue))
(format #t "~1Tstart-camera: ~A~%" (-> obj start-camera))
(format #t "~1Tgo-speech: ~D~%" (-> obj go-speech))
(label cfg-4)
obj
)
;; definition of type racer-state
(deftype racer-state (structure)
((position vector :inline :offset-assert 0)
(racer uint64 :offset-assert 16)
(flags uint8 :offset-assert 24)
(rank int8 :offset-assert 25)
(finish-count int8 :offset-assert 26)
(lap-count int8 :offset-assert 27)
(lap-quadrant int8 :offset-assert 28)
(rider uint8 :offset-assert 29)
(lap-distance float :offset-assert 32)
(lap-distance-prev float :offset-assert 36)
(pos float :offset-assert 40)
(target-pos-offset float :offset-assert 44)
(speed-factor float :offset-assert 48)
(finish-time uint32 :offset-assert 52)
(lap-start uint32 :offset-assert 56)
(best-lap-time uint32 :offset-assert 60)
(lap-time-array float 5 :offset-assert 64)
(start-position vector :inline :offset-assert 96)
)
:method-count-assert 14
:size-assert #x70
:flag-assert #xe00000070
(:methods
(racer-state-method-9 () none 9)
(racer-state-method-10 () none 10)
(racer-state-method-11 () none 11)
(racer-state-method-12 () none 12)
(racer-state-method-13 () none 13)
)
)
;; definition for method 3 of type racer-state
(defmethod inspect racer-state ((obj racer-state))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj 'racer-state)
(format #t "~1Tposition: #<vector @ #x~X>~%" (-> obj position))
(format #t "~1Tracer: ~D~%" (-> obj racer))
(format #t "~1Tflags: ~D~%" (-> obj flags))
(format #t "~1Trank: ~D~%" (-> obj rank))
(format #t "~1Tfinish-count: ~D~%" (-> obj finish-count))
(format #t "~1Tlap-count: ~D~%" (-> obj lap-count))
(format #t "~1Tlap-quadrant: ~D~%" (-> obj lap-quadrant))
(format #t "~1Trider: ~D~%" (-> obj rider))
(format #t "~1Tlap-distance: ~f~%" (-> obj lap-distance))
(format #t "~1Tlap-distance-prev: ~f~%" (-> obj lap-distance-prev))
(format #t "~1Tpos: ~f~%" (-> obj pos))
(format #t "~1Ttarget-pos-offset: ~f~%" (-> obj target-pos-offset))
(format #t "~1Tspeed-factor: ~f~%" (-> obj speed-factor))
(format #t "~1Tfinish-time: ~D~%" (-> obj finish-time))
(format #t "~1Tlap-start: ~D~%" (-> obj lap-start))
(format #t "~1Tbest-lap-time: ~D~%" (-> obj best-lap-time))
(format #t "~1Tlap-time-array[5] @ #x~X~%" (-> obj lap-time-array))
(format #t "~1Tstart-position: #<vector @ #x~X>~%" (-> obj start-position))
(label cfg-4)
obj
)
;; definition of type race-state
(deftype race-state (structure)
((info basic :offset-assert 0)
(flags uint8 :offset-assert 4)
(state uint8 :offset-assert 5)
(racer-count int8 :offset-assert 6)
(finished-count int8 :offset-assert 7)
(i-player int8 :offset-assert 8)
(i-countdown int8 :offset-assert 9)
(manager uint64 :offset-assert 16)
(scene-player uint64 :offset-assert 24)
(race-signal uint64 :offset-assert 32)
(arrow uint64 :offset-assert 40)
(hud-timer uint64 :offset-assert 48)
(hud-lap-counter uint64 :offset-assert 56)
(hud-turbo-counter uint64 :offset-assert 64)
(hud-position uint64 :offset-assert 72)
(current-time uint32 :offset-assert 80)
(countdown-start-time uint32 :offset-assert 84)
(race-start-time uint32 :offset-assert 88)
(rankings int8 10 :offset-assert 92)
(target-pos float :offset-assert 104)
(suck-factor float :offset-assert 108)
(racer-array racer-state 10 :inline :offset-assert 112)
(player-intro-curve cubic-curve :inline :offset-assert 1232)
)
:method-count-assert 19
:size-assert #x510
:flag-assert #x1300000510
(:methods
(race-state-method-9 () none 9)
(race-state-method-10 () none 10)
(race-state-method-11 () none 11)
(race-state-method-12 () none 12)
(race-state-method-13 () none 13)
(race-state-method-14 () none 14)
(race-state-method-15 () none 15)
(race-state-method-16 () none 16)
(race-state-method-17 () none 17)
(race-state-method-18 () none 18)
)
)
;; definition for method 3 of type race-state
(defmethod inspect race-state ((obj race-state))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj 'race-state)
(format #t "~1Tinfo: ~A~%" (-> obj info))
(format #t "~1Tflags: ~D~%" (-> obj flags))
(format #t "~1Tstate: ~D~%" (-> obj state))
(format #t "~1Tracer-count: ~D~%" (-> obj racer-count))
(format #t "~1Tfinished-count: ~D~%" (-> obj finished-count))
(format #t "~1Ti-player: ~D~%" (-> obj i-player))
(format #t "~1Ti-countdown: ~D~%" (-> obj i-countdown))
(format #t "~1Tmanager: #x~X~%" (-> obj manager))
(format #t "~1Tscene-player: #x~X~%" (-> obj scene-player))
(format #t "~1Trace-signal: #x~X~%" (-> obj race-signal))
(format #t "~1Tarrow: #x~X~%" (-> obj arrow))
(format #t "~1Thud-timer: #x~X~%" (-> obj hud-timer))
(format #t "~1Thud-lap-counter: #x~X~%" (-> obj hud-lap-counter))
(format #t "~1Thud-turbo-counter: #x~X~%" (-> obj hud-turbo-counter))
(format #t "~1Thud-position: #x~X~%" (-> obj hud-position))
(format #t "~1Tcurrent-time: ~D~%" (-> obj current-time))
(format #t "~1Tcountdown-start-time: ~D~%" (-> obj countdown-start-time))
(format #t "~1Trace-start-time: ~D~%" (-> obj race-start-time))
(format #t "~1Trankings[10] @ #x~X~%" (-> obj rankings))
(format #t "~1Ttarget-pos: ~f~%" (-> obj target-pos))
(format #t "~1Tsuck-factor: ~f~%" (-> obj suck-factor))
(format #t "~1Tracer-array[10] @ #x~X~%" (-> obj racer-array))
(format #t "~1Tplayer-intro-curve: #<cubic-curve @ #x~X>~%" (-> obj player-intro-curve))
(label cfg-4)
obj
)
;; definition of type race-manager
(deftype race-manager (process)
((race-state race-state :offset-assert 128)
(state-time time-frame :offset-assert 136)
(player-on-track-time time-frame :offset-assert 144)
(message-id uint32 :offset-assert 152)
(finish-sound-id uint32 :offset-assert 156)
)
:heap-base #x20
:method-count-assert 28
:size-assert #xa0
:flag-assert #x1c002000a0
(:methods
(idle () _type_ :state 14)
(active () _type_ :state 15)
(fail () _type_ :state 16)
(win () _type_ :state 17)
(lose () _type_ :state 18)
(die () _type_ :state 19)
(race-manager-method-20 () none 20)
(race-manager-method-21 () none 21)
(race-manager-method-22 () none 22)
(race-manager-method-23 () none 23)
(race-manager-method-24 () none 24)
(race-manager-method-25 () none 25)
(race-manager-method-26 () none 26)
(race-manager-method-27 () none 27)
)
)
;; definition for method 3 of type race-manager
(defmethod inspect race-manager ((obj race-manager))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(let ((t9-0 (method-of-type process inspect)))
(t9-0 obj)
)
(format #t "~2Trace-state: #<race-state @ #x~X>~%" (-> obj race-state))
(format #t "~2Tstate-time: ~D~%" (-> obj state-time))
(format #t "~2Tplayer-on-track-time: ~D~%" (-> obj player-on-track-time))
(format #t "~2Tmessage-id: ~D~%" (-> obj message-id))
(format #t "~2Tfinish-sound-id: ~D~%" (-> obj finish-sound-id))
(label cfg-4)
obj
)
;; failed to figure out what this is:
0
+1 -1
View File
@@ -4,7 +4,7 @@
using namespace decompiler;
TEST_F(FormRegressionTestJak1, DraftExprIdentity) {
TEST_F(FormRegressionTestJak1, ExprIdentity) {
std::string func =
" sll r0, r0, 0\n"
" or v0, a0, r0\n"
+8 -1
View File
@@ -4,7 +4,8 @@
"CGO/ENGINE.CGO",
"CGO/COMMON.CGO",
"CGO/GAME.CGO",
"DGO/CWI.DGO"
"DGO/CWI.DGO",
"DGO/STD.DGO"
],
"skip_compile_files": [],
@@ -138,6 +139,12 @@
"(method 28 game-info)", // todo
"(method 29 game-info)", // todo
// rigid-body - CFG Failures
"(method 48 rigid-body-object)",
"(method 15 rigid-body)",
"(method 63 collide-shape-moving)",
"(method 67 collide-shape-moving)",
// mysql-nav-graph
"(method 18 mysql-nav-graph)", // asm / dead-code
"(method 10 mysql-nav-graph)",