From 7e5541d7935ceabc5f517e9679100745be5e856f Mon Sep 17 00:00:00 2001 From: Hat Kid <6624576+Hat-Kid@users.noreply.github.com> Date: Thu, 1 Feb 2024 23:58:10 +0100 Subject: [PATCH] decomp3: more headers (#3356) - `pov-camera-h` - `sync-info-h` - `trajectory-h` - `collide-target-h` (`control-info` just padded out for now) - `water-info-h` - `process-drawable-h` - `process-focusable` - `focus` - `effect-control-h` - `process-taskable-h` - `generic-obs-h` - `target-h` --- decompiler/config/jak3/all-types.gc | 535 ++++++------ .../config/jak3/ntsc_v1/type_casts.jsonc | 13 +- .../config/jak3/ntsc_v1/var_names.jsonc | 63 ++ goal_src/jak3/engine/anim/joint-h.gc | 5 + goal_src/jak3/engine/anim/joint-mod-h.gc | 172 ++++ goal_src/jak3/engine/camera/pov-camera-h.gc | 25 + .../jak3/engine/collide/collide-shape-h.gc | 2 +- .../jak3/engine/collide/collide-target-h.gc | 4 + .../jak3/engine/common-obs/generic-obs-h.gc | 304 +++++++ .../jak3/engine/common-obs/water-info-h.gc | 59 ++ goal_src/jak3/engine/game/effect-control-h.gc | 51 ++ goal_src/jak3/engine/game/game-h.gc | 2 + .../jak3/engine/game/task/task-control-h.gc | 1 + goal_src/jak3/engine/physics/trajectory-h.gc | 120 +++ .../jak3/engine/process-drawable/focus.gc | 51 ++ .../process-drawable/process-drawable-h.gc | 307 +++++++ .../process-drawable/process-focusable.gc | 126 +++ .../process-drawable/process-taskable-h.gc | 39 + goal_src/jak3/engine/target/target-h.gc | 317 ++++++++ goal_src/jak3/engine/util/sync-info-h.gc | 140 ++++ .../reference/jak3/decompiler-macros.gc | 10 + .../reference/jak3/engine/anim/joint-h_REF.gc | 8 +- .../jak3/engine/camera/pov-camera-h_REF.gc | 57 ++ .../engine/collide/collide-shape-h_REF.gc | 10 +- .../engine/collide/collide-target-h_REF.gc | 15 + .../engine/common-obs/generic-obs-h_REF.gc | 767 ++++++++++++++++++ .../engine/common-obs/water-info-h_REF.gc | 261 ++++++ .../jak3/engine/game/effect-control-h_REF.gc | 75 ++ .../reference/jak3/engine/game/game-h_REF.gc | 6 +- .../engine/game/task/task-control-h_REF.gc | 5 +- .../jak3/engine/math/transformq-h_REF.gc | 8 +- .../jak3/engine/physics/trajectory-h_REF.gc | 249 ++++++ .../jak3/engine/process-drawable/focus_REF.gc | 77 ++ .../process-drawable-h_REF.gc | 193 +++++ .../process-drawable/process-focusable_REF.gc | 115 +++ .../process-taskable-h_REF.gc | 66 ++ .../jak3/engine/target/target-h_REF.gc | 436 ++++++++++ .../jak3/engine/util/sync-info-h_REF.gc | 321 ++++++++ 38 files changed, 4763 insertions(+), 252 deletions(-) create mode 100644 test/decompiler/reference/jak3/engine/camera/pov-camera-h_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/collide/collide-target-h_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/common-obs/generic-obs-h_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/common-obs/water-info-h_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/game/effect-control-h_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/physics/trajectory-h_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/process-drawable/focus_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/process-drawable/process-drawable-h_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/process-drawable/process-focusable_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/process-drawable/process-taskable-h_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/target/target-h_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/util/sync-info-h_REF.gc diff --git a/decompiler/config/jak3/all-types.gc b/decompiler/config/jak3/all-types.gc index 9addee2b2..ab82300f1 100644 --- a/decompiler/config/jak3/all-types.gc +++ b/decompiler/config/jak3/all-types.gc @@ -2016,7 +2016,7 @@ ) (deftype trsq (trs) - ((quat quaternion :inline :offset 32) + ((quat quaternion :inline :offset 32 :score 1) ) :method-count-assert 9 :size-assert #x40 @@ -13295,6 +13295,7 @@ (last-ambient string :offset-assert 8) ;; guessed by decompiler (last-ambient-id sound-id :offset-assert 12) ;; guessed by decompiler ) + :pack-me :method-count-assert 12 :size-assert #x10 :flag-assert #xc00000010 @@ -16542,6 +16543,7 @@ :type uint64 (push 1) (blend 2) + (eight 8) (push1 19) (stack 36) (float 42) @@ -16568,6 +16570,8 @@ (declare-type effect-control basic) (deftype joint-control-channel (structure) + "A single animation channel that controls a number of joints. + Multiple channels are used to blend animations together." ((parent joint-control :offset-assert 0) ;; guessed by decompiler (frame-group art-joint-anim :offset-assert 4) ;; guessed by decompiler (frame-num float :offset-assert 8) @@ -16620,6 +16624,7 @@ ) (deftype joint-control (basic) + "Every [[process-drawable]] has a [[joint-control]] that handles all the animation channels." ((status joint-control-status :offset-assert 4) (allocated-length uint8 :offset-assert 6) (active-channels uint8 :offset-assert 7) @@ -16661,6 +16666,7 @@ ) (deftype channel-upload-info (structure) + "Information about an upload of animation data to a single joint channel." ((fixed joint-anim-compressed-fixed :offset-assert 0) (fixed-qwc int32 :offset-assert 4) (frame joint-anim-compressed-frame :offset-assert 8) @@ -18261,6 +18267,7 @@ ) (deftype attack-dir-info (structure) + "Information about the position/direction of an attack." ((dir vector :inline :offset-assert 0) (xz-dir vector :inline :offset-assert 16) (attacker-velocity vector :inline :offset-assert 32) @@ -18302,6 +18309,7 @@ ) (deftype attack-info (structure) + "Information about an incoming attack." ((trans vector :inline :offset-assert 0) (vector vector :inline :offset-assert 16) (attacker-velocity vector :inline :offset-assert 32) @@ -18711,7 +18719,6 @@ ) ;; ---pov-camera-h:pov-camera-flags -#| (deftype pov-camera (process-drawable) ((flags pov-camera-flags :offset-assert 200) ;; pov-camera-flag (debounce-start-time time-frame :offset-assert 208) ;; time-frame @@ -18740,7 +18747,6 @@ (pov-camera-method-29 () none) ;; 29 ;; (target-released? (_type_) symbol) ) ) -|# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; smush-control-h ;; @@ -19597,13 +19603,47 @@ ;; generic-obs-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (deftype manipy (process-drawable) -;; () -;; :flag-assert #x1501000174 -;; ) +;; +++generic-obs-h:manipy-options +(defenum manipy-options + :bitfield #t + :type uint32 + (mo-0 0) + ) +;; ---generic-obs-h:manipy-options + +(deftype manipy (process-drawable) + ((root collide-shape :override) + (new-trans-hook (function none) :offset-assert 200) + (cur-trans-hook (function none) :offset-assert 204) + (cur-event-hook (function none) :offset-assert 208) + (new-joint-anim art-joint-anim :offset-assert 212) + (new-joint-anim-blend uint64 :offset-assert 216) + (new-joint-anim-frame float :offset-assert 224) + (anim-mode symbol :offset-assert 228) + (cur-grab-handle handle :offset-assert 232) + (cur-target-handle handle :offset-assert 240) + (old-grab-pos vector :inline :offset-assert 256) + (joint joint-mod 4 :offset-assert 272) + (new-post-hook (function none) :offset-assert 288) + (cur-post-hook (function none) :offset-assert 292) + (clone-copy-trans symbol :offset-assert 296) + (shadow-backup basic :offset-assert 300) + (draw? symbol :offset-assert 304) + (userdata uint64 :offset-assert 312) + (prefix basic :offset-assert 320) + (shadow-volume-joint int32 :offset-assert 324) + (speed float :offset-assert 328) + (user-uint64 uint64 4 :offset-assert 336) + (options manipy-options :offset-assert 368) + ) + :flag-assert #x1501000174 + (:state-methods + idle + ) + ) -#| (deftype part-spawner (process) + "A process that spawns a specified particle group." ((root trsqv :offset-assert 128) ;; guessed by decompiler (part sparticle-launch-control :offset-assert 132) ;; guessed by decompiler (path basic :offset-assert 136) @@ -19620,14 +19660,14 @@ :method-count-assert 16 :size-assert #xe0 :flag-assert #x10006000e0 + (:state-methods + active + ) (:methods - (part-spawner-method-14 () none) ;; 14 ;; (active () _type_ :state) (part-spawner-method-15 () none) ;; 15 ;; (is-in-view? (_type_) symbol) ) ) -|# -#| (deftype part-tracker (process) ((root trsqv :offset-assert 128) ;; guessed by decompiler (mat matrix :inline :offset-assert 144) @@ -19635,14 +19675,14 @@ (userdata uint64 :offset-assert 224) (user-time time-frame 2 :offset-assert 232) ;; guessed by decompiler (user-vector vector :inline :offset-assert 256) - (user-handle uint32 2 :offset-assert 288) ;; guessed by decompiler + (user-handle uint32 2 :offset 288) ;; guessed by decompiler (part sparticle-launch-control :offset-assert 296) ;; guessed by decompiler (callback (function part-tracker vector) :offset-assert 300) ;; guessed by decompiler (linger-callback (function part-tracker vector) :offset-assert 304) ;; guessed by decompiler - (duration uint64 :offset-assert 312) - (linger-duration uint64 :offset-assert 320) - (state-time uint64 :offset-assert 328) - (target uint64 :offset-assert 336) ;; handle + (duration time-frame :offset-assert 312) + (linger-duration time-frame :offset-assert 320) + (state-time time-frame :offset-assert 328) + (target handle :offset-assert 336) ;; handle (target-joint int32 :offset-assert 344) ) :method-count-assert 18 @@ -19656,30 +19696,26 @@ (part-tracker-method-17 () none) ;; 17 ) ) -|# -#| (deftype part-tracker-init-params (structure) - ((userdata uint64 :offset-assert 0) - (duration uint64 :offset-assert 8) - (group basic :offset-assert 16) - (callback basic :offset-assert 20) - (target basic :offset-assert 24) - (mat-joint basic :offset-assert 28) + ((userdata uint64 :offset-assert 0) + (duration time-frame :offset-assert 8) + (group sparticle-launch-group :offset-assert 16) + (callback (function part-tracker vector) :offset-assert 20) + (target basic :offset-assert 24) + (mat-joint basic :offset-assert 28) ) :method-count-assert 9 :size-assert #x20 :flag-assert #x900000020 ;; field userdata uses ~A with a 64-bit load. field mat-joint uses ~A with a signed load. ) -|# -#| (deftype part-tracker-subsampler-init-params (structure) ((userdata uint64 :offset-assert 0) - (duration uint64 :offset-assert 8) - (group basic :offset-assert 16) - (callback basic :offset-assert 20) + (duration time-frame :offset-assert 8) + (group sparticle-launch-group :offset-assert 16) + (callback (function part-tracker vector) :offset-assert 20) (target basic :offset-assert 24) (mat-joint basic :offset-assert 28) (subsample-num float :offset-assert 32) @@ -19689,9 +19725,7 @@ :flag-assert #x900000024 ;; field userdata uses ~A with a 64-bit load. field mat-joint uses ~A with a signed load. ) -|# -#| (deftype part-tracker-subsampler (part-tracker) ((subsampler basic :offset-assert 348) ) @@ -19699,26 +19733,24 @@ :size-assert #x160 :flag-assert #x1200e00160 ) -|# -#| (deftype lightning-tracker (process) ((root trsqv :offset-assert 128) ;; guessed by decompiler (lightning lightning-control :offset-assert 132) ;; guessed by decompiler (callback (function lightning-tracker none) :offset-assert 136) ;; guessed by decompiler - (duration uint64 :offset-assert 144) - (start-time uint64 :offset-assert 152) ;; time-frame + (duration time-frame :offset-assert 144) + (start-time time-frame :offset-assert 152) ;; time-frame (offset0 vector :inline :offset-assert 160) (offset1 vector :inline :offset-assert 176) - (target0 uint64 :offset-assert 192) ;; handle - (target1 uint64 :offset-assert 200) ;; handle + (target0 handle :offset-assert 192) ;; handle + (target1 handle :offset-assert 200) ;; handle (target-joint0 int32 :offset-assert 208) (target-joint1 int32 :offset-assert 212) (sound sound-id :offset-assert 216) ;; guessed by decompiler (userdata uint64 :offset-assert 224) (user-time time-frame 2 :offset-assert 232) ;; guessed by decompiler (user-vector vector :inline :offset-assert 256) - (user-handle handle 2 :offset-assert 288) ;; guessed by decompiler + (user-handle handle 2 :offset 288) ;; guessed by decompiler ) :method-count-assert 17 :size-assert #x130 @@ -19730,12 +19762,10 @@ (lightning-tracker-method-16 () none) ;; 16 ;; (update (_type_) none) ) ) -|# -#| (deftype touch-tracker (process-drawable) - ((duration uint64 :offset-assert 200) ;; time-frame - (target uint64 :offset-assert 208) ;; handle + ((duration time-frame :offset-assert 200) ;; time-frame + (target handle :offset-assert 208) ;; handle (event symbol :offset-assert 216) ;; guessed by decompiler (run-function (function object) :offset-assert 220) ;; guessed by decompiler (callback (function touch-tracker none) :offset-assert 224) ;; guessed by decompiler @@ -19748,9 +19778,7 @@ (touch-tracker-method-20 () none) ;; 20 ;; (active () _type_ :state) ) ) -|# -#| (deftype swingpole (process-drawable) ((edge-length meters :offset-assert 200) (path-pos float :offset-assert 204) @@ -19770,9 +19798,7 @@ (swingpole-method-24 () none) ;; 24 ) ) -|# -#| (deftype gui-query (structure) ((x-position int32 :offset-assert 0) (y-position int32 :offset-assert 4) @@ -19790,17 +19816,15 @@ (gui-query-method-10 () none) ;; 10 ;; (gui-query-method-10 () none) ) ) -|# -#| (deftype othercam (process) - ((hand uint64 :offset-assert 128) ;; handle + ((hand handle :offset-assert 128) ;; handle (old-global-mask process-mask :offset-assert 136) ;; guessed by decompiler (mask-to-clear process-mask :offset-assert 140) ;; guessed by decompiler (cam-joint-index int32 :offset-assert 144) (old-pos vector :inline :offset-assert 160) (old-mat-z vector :inline :offset-assert 176) - (had-valid-frame basic :offset-assert 192) + (had-valid-frame symbol :offset-assert 192) (border-value basic :offset-assert 196) (die? symbol :offset-assert 200) ;; guessed by decompiler (survive-anim-end? symbol :offset-assert 204) ;; guessed by decompiler @@ -19814,9 +19838,7 @@ othercam-running ;; associated process guessed by decompiler, old: (state othercam) ) ) -|# -#| (deftype explosion-init-params (structure) ((spawn-point vector :inline :offset-assert 0) (spawn-quat quaternion :inline :offset-assert 16) @@ -19834,13 +19856,11 @@ :size-assert #x48 :flag-assert #x900000048 ) -|# -#| (deftype explosion (process-drawable) - ((start-time uint64 :offset-assert 200) ;; time-frame - (duration uint32 :offset-assert 208) - (linger-duration uint32 :offset-assert 212) + ((start-time time-frame :offset-assert 200) ;; time-frame + (duration uint32 :offset-assert 208 :decomp-as time-frame) + (linger-duration uint32 :offset-assert 212 :decomp-as time-frame) (attack-id uint32 :offset-assert 216) (mat matrix :inline :offset-assert 224) (params explosion-init-params :inline :offset-assert 288) @@ -19854,53 +19874,19 @@ (explosion-method-22 () none) ;; 22 ;; (explosion-method-22 (_type_) none) ) ) -|# -#| (deftype process-hidden (process) - ((name string :offset-assert 0) ;; guessed by decompiler - (mask process-mask :offset-assert 4) - (clock clock :offset-assert 8) ;; guessed by decompiler - (parent (pointer process-tree) :offset-assert 12) ;; guessed by decompiler - (brother (pointer process-tree) :offset-assert 16) ;; guessed by decompiler - (child (pointer process-tree) :offset-assert 20) ;; guessed by decompiler - (ppointer (pointer process) :offset-assert 24) ;; guessed by decompiler - (self process :offset-assert 28) ;; guessed by decompiler - (pool dead-pool :offset-assert 32) ;; guessed by decompiler - (status symbol :offset-assert 36) ;; guessed by decompiler - (pid int32 :offset-assert 40) - (main-thread cpu-thread :offset-assert 44) ;; guessed by decompiler - (top-thread cpu-thread :offset-assert 48) ;; guessed by decompiler - (entity entity-actor :offset-assert 52) ;; guessed by decompiler - (level level :offset-assert 56) ;; guessed by decompiler - (state state :offset-assert 60) ;; guessed by decompiler - (prev-state basic :offset-assert 64) - (next-state state :offset-assert 68) ;; guessed by decompiler - (state-stack basic :offset-assert 72) - (trans-hook function :offset-assert 76) ;; guessed by decompiler - (post-hook function :offset-assert 80) ;; guessed by decompiler - (event-hook (function process int symbol event-message-block object) :offset-assert 84) ;; guessed by decompiler - (allocated-length int32 :offset-assert 88) - (heap-base pointer :offset-assert 92) ;; guessed by decompiler - (heap-top pointer :offset-assert 96) ;; guessed by decompiler - (heap-cur pointer :offset-assert 100) ;; guessed by decompiler - (stack-frame-top stack-frame :offset-assert 104) ;; guessed by decompiler - (heap kheap :inline :offset-assert 92) - (connection-list connectable :inline :offset-assert 108) - (stack uint8 :dynamic :offset-assert 124) ;; guessed by decompiler - ) + () :method-count-assert 15 :size-assert #x80 :flag-assert #xf00000080 - (:methods - (process-hidden-method-14 () none) ;; 14 ;; (die () _type_ :state) + (:state-methods + die ;; 14 ) ) -|# -#| (deftype simple-prim (process-drawable) - ((strip basic :offset-assert 200) + ((strip prim-strip :offset-assert 200) ) :method-count-assert 26 :size-assert #xcc @@ -19914,9 +19900,18 @@ (simple-prim-method-25 () none) ;; 25 ) ) -|# -#| +;; +++generic-obs-h:task-arrow-flags +(defenum task-arrow-flags + :type uint32 + :bitfield #t + (task-arrow-flag-00 0) + (task-arrow-flag-01 1) + (task-arrow-flag-02 2) + (task-arrow-flag-03 3) + ) +;; ---generic-obs-h:task-arrow-flags + (deftype task-arrow-params (structure) ((flags task-arrow-flags :offset-assert 0) ;; guessed by decompiler (map-icon uint16 :offset-assert 4) @@ -19927,12 +19922,10 @@ :size-assert #x30 :flag-assert #x900000030 ) -|# -#| (deftype external-camera-controller (process) - ((pause-time uint64 :offset-assert 128) - (blur basic :offset-assert 136) + ((pause-time time-frame :offset-assert 128) + (blur symbol :offset-assert 136) ) :method-count-assert 15 :size-assert #x8c @@ -19941,17 +19934,15 @@ (external-camera-controller-method-14 () none) ;; 14 ) ) -|# -;; (define-extern *simple-prim-additive* object) -;; (define-extern *simple-prim-alpha-blend* object) -;; (define-extern *simple-prim-subtractive* object) +(define-extern *simple-prim-additive* int) +(define-extern *simple-prim-alpha-blend* int) +(define-extern *simple-prim-subtractive* int) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; trajectory-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype trajectory (structure) ((initial-position vector :inline :offset-assert 0) (initial-velocity vector :inline :offset-assert 16) @@ -19973,52 +19964,44 @@ (trajectory-method-17 () none) ;; 17 ;; (debug-draw (_type_) none) ) ) -|# -#| (deftype impact-control (structure) ((process (pointer process-drawable) :offset-assert 0) ;; guessed by decompiler (radius meters :offset-assert 4) ;; float (joint int32 :offset-assert 8) (collide-with collide-spec :offset-assert 12) ;; guessed by decompiler (start-time uint64 :offset-assert 16) ;; time-frame - (trans vector 2 :offset-assert 32) ;; guessed by decompiler - (UNKNOWN UNKNOWN :offset-assert -1) ;; field could not be read. + (trans vector 2 :inline :offset-assert 32) ;; guessed by decompiler (dir vector :inline :offset-assert 64) ) :method-count-assert 12 :size-assert #x50 :flag-assert #xc00000050 (:methods - (new (symbol type) _type_) ;; 0 ;; (new (symbol type process-drawable int float collide-spec) _type_) - (impact-control-method-9 () none) ;; 9 ;; (initialize (_type_ process-drawable int float collide-spec) impact-control) + (new (symbol type process-drawable int float collide-spec) _type_) ;; 0 + (initialize (_type_ process-drawable int float collide-spec) impact-control) ;; 9 (impact-control-method-10 () none) ;; 10 ;; (update-from-cspace (_type_) none) (impact-control-method-11 () none) ;; 11 ;; (impact-control-method-11 (_type_ collide-query process pat-surface) float) ) ) -|# -#| (deftype point-tracker (structure) - ((trans vector 2 :offset-assert 0) ;; guessed by decompiler - (UNKNOWN UNKNOWN :offset-assert -1) ;; field could not be read. + ((trans vector 2 :inline :offset-assert 0) ;; guessed by decompiler ) :method-count-assert 12 :size-assert #x20 :flag-assert #xc00000020 (:methods - (new (symbol type) _type_) ;; 0 ;; (new (symbol type vector vector) _type_) - (point-tracker-method-9 () none) ;; 9 ;; (initialize (_type_ vector vector) point-tracker) + (new (symbol type vector vector) _type_) ;; 0 + (initialize (_type_ vector vector) point-tracker) ;; 9 (point-tracker-method-10 () none) ;; 10 ;; (point-tracker-method-10 (_type_ vector vector vector float) vector) (point-tracker-method-11 () none) ;; 11 ;; (point-tracker-method-11 (_type_ vector vector vector float) vector) ) ) -|# -#| (deftype combo-tracker (point-tracker) - ((target uint64 :offset-assert 32) ;; handle - (move-start-time uint64 :offset-assert 40) ;; time-frame + ((target handle :offset-assert 32) ;; handle + (move-start-time time-frame :offset-assert 40) ;; time-frame ) :method-count-assert 14 :size-assert #x30 @@ -20028,9 +20011,7 @@ (combo-tracker-method-13 () none) ;; 13 ;; (combo-tracker-method-13 (_type_ handle vector float vector float) basic) ) ) -|# -#| (deftype traj2d-params (structure) ((x float :offset-assert 0) (y float :offset-assert 4) @@ -20043,9 +20024,7 @@ :size-assert #x18 :flag-assert #x900000018 ) -|# -#| (deftype traj3d-params (structure) ((gravity float :offset-assert 0) (initial-tilt float :offset-assert 4) @@ -20060,9 +20039,7 @@ :size-assert #x50 :flag-assert #x900000050 ) -|# -#| (deftype cubic-curve (structure) ((mat matrix :inline :offset-assert 0) ) @@ -20077,17 +20054,16 @@ (cubic-curve-method-13 () none) ;; 13 ;; (debug-draw-curve (_type_) none) ) ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; collide-target-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (deftype control-info (collide-shape-moving) -;; () -;; :flag-assert #x4400001914 -;; ) +(deftype control-info (collide-shape-moving) + ((pad uint8 5944) + ) + :flag-assert #x4400001914 + ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -20370,74 +20346,120 @@ ;; process-drawable-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern cspace-by-name-no-fail function) ;; (function process-drawable string cspace) -;; (define-extern cspace-index-by-name-no-fail function) ;; (function process-drawable string int) -;; (define-extern num-func-none function) ;; (function joint-control-channel float float float float :behavior process) -;; (define-extern num-func-+! function) ;; (function joint-control-channel float float float float :behavior process) -;; (define-extern num-func--! function) ;; (function joint-control-channel float float float float :behavior process) -;; (define-extern num-func-loop! function) ;; (function joint-control-channel float float float float :behavior process) -;; (define-extern num-func-loop-speedless! function) ;; (function joint-control-channel float float float float :behavior process) -;; (define-extern num-func-loop-set! function) -;; (define-extern num-func-seek! function) ;; (function joint-control-channel float float float float :behavior process) -;; (define-extern num-func-blend-in! function) ;; (function joint-control-channel float float float float :behavior process) -;; (define-extern joint-channel-float-delete! function) ;; (function joint-control-channel none) -;; (define-extern num-func-interp-play! function) ;; (function joint-control-channel float float float float :behavior process) -;; (define-extern num-func-interp1-play! function) ;; (function joint-control-channel float float float float :behavior process) -;; (define-extern num-func-chan function) ;; (function joint-control-channel float float float float :behavior process) -;; (define-extern num-func-identity function) ;; (function joint-control-channel float float float float :behavior process) +(define-extern cspace-by-name-no-fail "Like [[cspace-by-name]], but prints an error if the [[cspace]] was not found and returns the `node-list`." (function process-drawable string cspace)) +(define-extern cspace-index-by-name-no-fail "Like [[cspace-index-by-name]], but prints an error if the [[cspace]] was not found and returns 0." (function process-drawable string int)) +(define-extern num-func-none (function joint-control-channel float float float float :behavior process)) +(define-extern num-func-+! (function joint-control-channel float float float float :behavior process)) +(define-extern num-func--! (function joint-control-channel float float float float :behavior process)) +(define-extern num-func-loop! (function joint-control-channel float float float float :behavior process)) +(define-extern num-func-loop-speedless! (function joint-control-channel float float float float :behavior process)) +(define-extern num-func-loop-set! (function joint-control-channel float float float float :behavior process)) +(define-extern num-func-seek! (function joint-control-channel float float float float :behavior process)) +(define-extern num-func-blend-in! (function joint-control-channel float float float float :behavior process)) +(define-extern joint-channel-float-delete! (function joint-control-channel none)) +(define-extern num-func-interp-play! (function joint-control-channel float float float float :behavior process)) +(define-extern num-func-interp1-play! (function joint-control-channel float float float float :behavior process)) +(define-extern num-func-chan (function joint-control-channel float float float float :behavior process)) +(define-extern num-func-identity (function joint-control-channel float float float float :behavior process)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; process-focusable ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +;; +++process-focusable:focus-status +(defenum focus-status + :type uint64 + :bitfield #t + (disable 0) ;; if set, all collide checks fail + (dead 1) ;; if set, all collide checks fail + (ignore 2) + (inactive 3) + (dangerous 4) + (in-air 5) + (hit 6) + (grabbed 7) + (in-head 8) + (touch-water 9) + (on-water 10) + (under-water 11) + (edge-grab 12) + (pole 13) + (pilot-riding 14) + (flut 15) + (tube 16) + (ice 17) + (board 18) + (gun 19) + (pilot 20) ;; also racer? + (mech 21) + (dark 22) + (rail 23) + (halfpipe 24) + (carry 25) + (super 26) + (shooting 27) + (indax 28) + (arrestable 29) + (teleporting 30) + (fs31 31) + ) +;; ---process-focusable:focus-status + (deftype process-focusable (process-drawable) - ((focus-status uint64 :offset-assert 200) ;; focus-status + ((root collide-shape :override) + (focus-status focus-status :offset-assert 200) ;; focus-status ) :method-count-assert 28 :size-assert #xd0 :flag-assert #x1c005000d0 (:methods - (process-focusable-method-20 () none) ;; 20 ;; (get-trans (_type_ int) vector) - (process-focusable-method-21 () none) ;; 21 ;; (get-quat (_type_ int) quaternion) - (process-focusable-method-22 () none) ;; 22 ;; (get-transv (_type_) vector) - (process-focusable-method-23 () none) ;; 23 ;; (time-to-apex-or-ground (_type_ int) int) - (process-focusable-method-24 () none) ;; 24 ;; (get-water-height (_type_) meters) - (process-focusable-method-25 () none) ;; 25 ;; (get-notice-time (_type_) time-frame) - (process-focusable-method-26 () none) ;; 26 ;; (get-inv-mass (_type_) float) - (process-focusable-method-27 () none) ;; 27 + (process-focusable-method-20 (_type_) int) ;; 20 + (get-trans "Get the `trans` for this process." (_type_ int) vector) ;; 21 + (get-quat "Get the quaternion for this process." (_type_) quaternion) ;; 22 + (get-transv "Get the `transv` for this process." (_type_) vector) ;; 23 + (time-to-apex-or-ground (_type_ int) int) ;; 24 + (get-water-height (_type_) meters) ;; 25 + (get-notice-time (_type_) time-frame) ;; 26 + (get-inv-mass (_type_) float) ;; 27 ) ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; process-taskable-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +;; +++process-taskable-h:process-taskable-flags +(defenum process-taskable-flags + :type uint32 + :bitfield #t + ) +;; ---process-taskable-h:process-taskable-flags + (deftype process-taskable (process-focusable) - ((flags uint32 :offset-assert 208) + "The parent class for NPCs that can be talked to." + ((flags process-taskable-flags :offset-assert 208) (task game-task-control :offset-assert 212) ;; guessed by decompiler - (ambient ambient-control :inline :offset-assert 216) + (ambient ambient-control :inline :offset 216) (neck-joint-index int32 :offset-assert 232) (talk-message text-id :offset-assert 236) ;; guessed by decompiler (talk-distance meters :offset-assert 240) (talk-height meters :offset-assert 244) - (last-talk uint64 :offset-assert 248) ;; time-frame - (want-to-say uint64 :offset-assert 256) ;; time-frame - (birth-time uint64 :offset-assert 264) ;; time-frame - (slave uint64 :offset-assert 272) ;; handle + (last-talk time-frame :offset-assert 248) ;; time-frame + (want-to-say time-frame :offset-assert 256) ;; time-frame + (birth-time time-frame :offset-assert 264) ;; time-frame + (slave handle :offset-assert 272) ;; handle ) :method-count-assert 40 :size-assert #x118 :flag-assert #x2800a00118 + (:state-methods + hide + idle + (active game-task-event) + die + (play-game game-task-event) + ) (:methods - (process-taskable-method-28 () none) ;; 28 ;; (idle () _type_ :state) - (process-taskable-method-29 () none) ;; 29 ;; (active (game-task-event) _type_ :state) - (process-taskable-method-30 () none) ;; 30 ;; (play-game (game-task-event) _type_ :state) - (process-taskable-method-31 () none) ;; 31 ;; (process-taskable-method-31 (_type_) none) - (process-taskable-method-32 () none) ;; 32 ;; (process-taskable-method-32 (_type_) none) (process-taskable-method-33 () none) ;; 33 ;; (init-art! (_type_) none) (process-taskable-method-34 () none) ;; 34 ;; (process-taskable-method-34 (_type_) symbol) (process-taskable-method-35 () none) ;; 35 ;; (get-art-elem (_type_) art-element) @@ -20447,37 +20469,43 @@ (process-taskable-method-39 () none) ;; 39 ) ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; focus ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype focus (structure) - ((handle uint64 :offset-assert 0) ;; handle + "A structure that keeps a handle to a [[process-focusable]]." + ((handle handle :offset-assert 0) ;; handle (collide-with collide-spec :offset-assert 8) ;; guessed by decompiler ) :method-count-assert 13 :size-assert #xc :flag-assert #xd0000000c (:methods - (focus-method-9 () none) ;; 9 ;; (clear-focused (_type_) none) - (focus-method-10 () none) ;; 10 ;; (collide-check? (_type_ process-focusable) object) - (focus-method-11 () none) ;; 11 ;; (reset-to-collide-spec (_type_ collide-spec) none) - (focus-method-12 () none) ;; 12 ;; (try-update-focus (_type_ process-focusable) symbol) + (clear-focused "Reset the focus' handle." (_type_) none) ;; 9 + (collide-check? + "If the focused process is not dead, + check that the [[collide-spec]] of the focus and the process match." + (_type_ process-focusable) object) ;; 10 + (reset-to-collide-spec "Reset this focus with the given [[collide-spec]]." (_type_ collide-spec) none) ;; 11 + (try-update-focus "Try to set the `handle` of this focus to the given process." (_type_ process-focusable) symbol) ;; 12 ) ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; effect-control-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +;; +++effect-control-h:effect-control-flag +(defenum effect-control-flag + :type uint32 + :bitfield #t + ) +;; ---effect-control-h:effect-control-flag + (deftype effect-control (basic) + "An effect such as a particle with sound effects that plays during an animation." ((process process-drawable :offset-assert 4) ;; guessed by decompiler (flags effect-control-flag :offset-assert 8) ;; guessed by decompiler (last-frame-group art-joint-anim :offset-assert 12) ;; guessed by decompiler @@ -20491,17 +20519,15 @@ :size-assert #x24 :flag-assert #xf00000024 (:methods - (new (symbol type) _type_) ;; 0 ;; (new (symbol type process-drawable) _type_) - (effect-control-method-9 () none) ;; 9 ;; (update-effects (_type_) none) + (new (symbol type process-drawable) _type_) ;; 0 + (effect-control-method-9 () none) ;; 9 (effect-control-method-10 () none) ;; 10 ;; (do-effect (_type_ symbol float int) none) (effect-control-method-11 () none) ;; 11 ;; (do-effect-for-surface (_type_ symbol float int basic pat-surface) none) (effect-control-method-12 () none) ;; 12 ;; (play-effect-sound (_type_ symbol float int basic sound-name) int) - (effect-control-method-13 () none) ;; 13 ;; (set-channel-offset! (_type_ int) none) + (set-channel-offset! (_type_ int) none) ;; 13 (effect-control-method-14 () none) ;; 14 ;; (play-effects-from-res-lump (_type_ float float float) none) ) ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; collide-frag-h ;; @@ -20698,13 +20724,51 @@ ;; water-info-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +;; +++water-info-h:water-flag +(defenum water-flag + :type uint32 + :bitfield #t + (active 0) + (can-wade 1) + (can-swim 2) + (swim-ground 3) + (can-ground 4) + (use-ocean 5) + (tar 6) + (mud 7) + (deadly 8) + (use-water-anim 9) + (no-grab-sound 10) + (dark-eco 11) + (lava 12) + (swamp 13) + (flow 14) + (under-water 15) + (head-under-water 16) + (bouncing 17) + (wading 18) + (swimming 19) + (touch-water 20) + (jump-out 21) + (break-surface 22) + (spawn-drip 23) + (part-splash 24) + (part-drip 25) + (part-rings 26) + (part-water 27) + (event 28) + (over-water 29) + (find-water 30) + (touch-water-good 31) + ) +;; ---water-info-h:water-flag + (deftype water-info (structure) ((trans vector :inline :offset-assert 0) (normal vector :inline :offset-assert 16) (base-height meters :offset-assert 32) (depth meters :offset-assert 36) - (handle uint64 :offset-assert 40) ;; handle + (handle handle :offset-assert 40) ;; handle (flags water-flag :offset-assert 48) ;; water-flags (prim drawable-region-prim :offset-assert 52) ;; guessed by decompiler (extra-flags uint32 :offset-assert 56) @@ -20713,9 +20777,7 @@ :size-assert #x3c :flag-assert #x90000003c ) -|# -#| (deftype water-sphere (structure) ((sphere sphere :inline :offset-assert 0) (flags water-flag :offset-assert 16) @@ -20725,8 +20787,6 @@ :size-assert #x18 :flag-assert #x900000018 ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; chain-physics-h ;; @@ -21096,12 +21156,32 @@ ;; target-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +;; +++target-h:target-flags +(defenum target-flags + :type uint32 + :bitfield #t + ) +;; ---target-h:target-flags + +(declare-type sidekick process-drawable) +(declare-type racer-info basic) +(declare-type tube-info basic) +(declare-type flut-info basic) +(declare-type board-info basic) +(declare-type pilot-info basic) +(declare-type gun-info basic) +(declare-type mech-info basic) +(declare-type turret-info basic) +(declare-type indax-info basic) +(declare-type ladder-info basic) +(declare-type darkjak-info basic) +(declare-type lightjak-info basic) + (deftype target (process-focusable) - ((control control-info :offset-assert 128) ;; guessed by decompiler + ((control control-info :offset 128 :score 1) ;; guessed by decompiler (skel2 joint-control :offset-assert 208) ;; guessed by decompiler (shadow-backup shadow-geo :offset-assert 212) ;; guessed by decompiler - (target-flags uint32 :offset-assert 188) + (target-flags target-flags :offset 188 :score 1) (game game-info :offset-assert 216) ;; guessed by decompiler (neck joint-mod :offset-assert 220) ;; guessed by decompiler (head joint-mod :offset-assert 224) ;; guessed by decompiler @@ -21112,9 +21192,9 @@ (leg-ik joint-mod-ik 2 :offset-assert 252) ;; guessed by decompiler (foot joint-mod 2 :offset-assert 260) ;; guessed by decompiler (cloth basic :offset-assert 268) - (init-time uint64 :offset-assert 272) ;; time-frame - (teleport-time uint64 :offset-assert 280) ;; time-frame - (state-hook-time uint64 :offset-assert 288) ;; time-frame + (init-time time-frame :offset-assert 272) ;; time-frame + (teleport-time time-frame :offset-assert 280) ;; time-frame + (state-hook-time time-frame :offset-assert 288) ;; time-frame (state-hook (function none :behavior target) :offset-assert 296) ;; guessed by decompiler (cam-user-mode symbol :offset-assert 300) ;; guessed by decompiler (sidekick (pointer sidekick) :offset-assert 304) ;; guessed by decompiler @@ -21122,26 +21202,26 @@ (mirror (pointer process-drawable) :offset-assert 312) ;; guessed by decompiler (attack-info attack-info :inline :offset-assert 320) (attack-info-rec attack-info :inline :offset-assert 496) - (attack-info-old attack-info 8 :offset-assert 672) ;; guessed by decompiler + (attack-info-old attack-info 8 :inline :offset-assert 672) ;; guessed by decompiler (anim-seed uint64 :offset-assert 2080) (alt-cam-pos vector :inline :offset-assert 2096) (current-level level :offset-assert 2112) ;; guessed by decompiler (saved-pos transformq :inline :offset-assert 2128) - (saved-owner uint64 :offset-assert 2176) + (saved-owner handle :offset-assert 2176) (alt-neck-pos vector :inline :offset-assert 2192) (focus-search (array collide-shape) :offset-assert 2208) ;; guessed by decompiler - (handle-search basic :offset-assert 2212) + (handle-search (array handle) :offset-assert 2212) (excitement float :offset-assert 2216) - (shock-effect-time uint64 :offset-assert 2224) ;; time-frame + (shock-effect-time time-frame :offset-assert 2224) ;; time-frame (beard? symbol :offset-assert 2232) ;; guessed by decompiler (spool-anim spool-anim :offset-assert 2236) ;; guessed by decompiler - (ambient-time uint64 :offset-assert 2240) ;; time-frame - (fp-hud uint64 :offset-assert 2248) ;; handle + (ambient-time time-frame :offset-assert 2240) ;; time-frame + (fp-hud handle :offset-assert 2248) ;; handle (no-load-wait uint64 :offset-assert 2256) (no-look-around-wait uint64 :offset-assert 2264) - (burn-proc uint64 :offset-assert 2272) ;; handle + (burn-proc handle :offset-assert 2272) ;; handle (pre-joint-hook (function none :behavior target) :offset-assert 2280) ;; guessed by decompiler - (notify uint64 :offset-assert 2288) ;; handle + (notify handle :offset-assert 2288) ;; handle (death-resetter resetter-spec :inline :offset-assert 2296) (mode-cache basic :offset-assert 2312) (mode-param1 uint64 :offset-assert 2320) ;; handle @@ -21161,8 +21241,8 @@ (tobot-recorder basic :offset-assert 2388) (target-effect uint64 :offset-assert 2392) (color-effect basic :offset-assert 2400) - (color-effect-start-time uint64 :offset-assert 2408) ;; time-frame - (color-effect-duration uint64 :offset-assert 2416) + (color-effect-start-time time-frame :offset-assert 2408) ;; time-frame + (color-effect-duration time-frame :offset-assert 2416) (racer racer-info :offset-assert 2424) ;; guessed by decompiler (tube tube-info :offset-assert 2428) ;; guessed by decompiler (flut flut-info :offset-assert 2432) ;; guessed by decompiler @@ -21172,14 +21252,14 @@ (mech mech-info :offset-assert 2448) ;; guessed by decompiler (turret turret-info :offset-assert 2452) ;; guessed by decompiler (indax indax-info :offset-assert 2456) ;; guessed by decompiler - (ladder basic :offset-assert 2460) + (ladder ladder-info :offset-assert 2460) (darkjak-interp float :offset-assert 2464) (darkjak-interp-old float :offset-assert 2468) (darkjak-giant-interp float :offset-assert 2472) (darkjak darkjak-info :offset-assert 2476) ;; guessed by decompiler (lightjak-interp float :offset-assert 2480) (lightjak-interp-old float :offset-assert 2484) - (lightjak basic :offset-assert 2488) + (lightjak lightjak-info :offset-assert 2488) (scarf-interp-targ float :offset-assert 2492) (scarf-interp float :offset-assert 2496) (scarf-interp-old float :offset-assert 2500) @@ -21187,8 +21267,8 @@ (goggles-interp float :offset-assert 2508) (goggles-interp-old float :offset-assert 2512) (invisible-interp float :offset-assert 2516) - (invisible-start-time uint64 :offset-assert 2520) - (invisible-duration uint64 :offset-assert 2528) + (invisible-start-time time-frame :offset-assert 2520) + (invisible-duration time-frame :offset-assert 2528) (invisible-shadow-dir-backup vector :inline :offset-assert 2544) ) :method-count-assert 30 @@ -21373,20 +21453,18 @@ target-board-turn-to ;; associated process guessed by decompiler, old: (state vector time-frame target) ) ) -|# -#| (deftype sidekick (process-drawable) - ((control control-info :offset-assert 128) ;; guessed by decompiler - (anim-seed uint64 :offset-assert 208) + ((control control-info :offset 128 :score 1) ;; guessed by decompiler + (anim-seed uint64 :offset 208) (shadow-in-movie? symbol :offset-assert 216) ;; guessed by decompiler - (special-anim-time uint64 :offset-assert 224) ;; time-frame + (special-anim-time time-frame :offset-assert 224) ;; time-frame (special-anim-interp float :offset-assert 232) (special-anim-frame float :offset-assert 236) (offset transformq :inline :offset-assert 240) (mirror (pointer process-drawable) :offset-assert 288) ;; guessed by decompiler - (ear UNKNOWN 2 :offset-assert 292) - (flap UNKNOWN 2 :offset-assert 300) + (ear joint-mod 2 :offset-assert 292) + (flap joint-mod 2 :offset-assert 300) ) :method-count-assert 20 :size-assert #x134 @@ -21395,10 +21473,9 @@ sidekick-clone ;; associated process guessed by decompiler, old: (state sidekick) ) ) -|# -;; (define-extern *target* object) ;; target -;; (define-extern *sidekick* object) ;; sidekick +(define-extern *target* target) +(define-extern *sidekick* sidekick) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; stats-h ;; @@ -31193,8 +31270,8 @@ ;; process-drawable ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern cspace-by-name function) ;; (function process-drawable string cspace) -;; (define-extern cspace-index-by-name function) ;; (function process-drawable string int) +(define-extern cspace-by-name "Get a process' [[cspace]] by name." (function process-drawable string cspace)) +(define-extern cspace-index-by-name "Get the index of a process' [[cspace]] by name." (function process-drawable string int)) ;; (define-extern vector<-cspace! function) ;; (function vector cspace vector) ;; (define-extern vector<-matrix! function) ;; (function vector matrix vector) ;; (define-extern vector<-cspace+vector! function) ;; (function vector cspace vector vector) @@ -31222,13 +31299,13 @@ ;; (define-extern ja-channel-set! function) ;; (function int int :behavior process-drawable) ;; (define-extern ja-channel-push! function) ;; (function int time-frame int :behavior process-drawable) ;; (define-extern ja-channel-float! function) ;; (function art-joint-anim float float float joint-control-channel :behavior process-drawable) -;; (define-extern joint-control-reset! function) ;; (function joint-control joint-control-channel none :behavior process-drawable) +(define-extern joint-control-reset! (function joint-control joint-control-channel none :behavior process-drawable)) ;; (define-extern ja-group-size function) ;; (function int :behavior process-drawable) ;; (define-extern ja-eval function) ;; (function int :behavior process-drawable) ;; (define-extern ja-blend-eval function) ;; (function int :behavior process-drawable) ;; (define-extern cloth-post function) ;; (define-extern ja-post function) ;; (function none :behavior process-drawable) -;; (define-extern sleep-code function) ;; (function symbol :behavior process) +(define-extern sleep-code (function symbol :behavior process)) ;; (define-extern transform-and-sleep function) ;; (function none :behavior process-drawable) ;; (define-extern transform-and-sleep-code function) ;; (function none :behavior process-drawable) ;; (define-extern transform-post function) ;; (function int :behavior process-drawable) diff --git a/decompiler/config/jak3/ntsc_v1/type_casts.jsonc b/decompiler/config/jak3/ntsc_v1/type_casts.jsonc index 99aa967f1..9a011485d 100644 --- a/decompiler/config/jak3/ntsc_v1/type_casts.jsonc +++ b/decompiler/config/jak3/ntsc_v1/type_casts.jsonc @@ -310,5 +310,16 @@ "joint-mod-rotate-local-callback": [ [[2, 16], "v1", "joint-mod-rotate-local"] ], - "joint-mod-rotate-world-callback": [[[0, 24], "s3", "joint-mod-rotate-world"]] + "joint-mod-rotate-world-callback": [ + [[0, 24], "s3", "joint-mod-rotate-world"] + ], + "num-func-chan": [[7, "v1", "joint-control-channel"]], + "joint-channel-float-delete!": [ + [7, "a0", "pointer"], + [7, "a1", "pointer"] + ], + "(method 21 process-focusable)": [ + [15, "gp", "collide-shape-moving"], + [35, "gp", "collide-shape-moving"] + ] } diff --git a/decompiler/config/jak3/ntsc_v1/var_names.jsonc b/decompiler/config/jak3/ntsc_v1/var_names.jsonc index f05b5e659..66030d54e 100644 --- a/decompiler/config/jak3/ntsc_v1/var_names.jsonc +++ b/decompiler/config/jak3/ntsc_v1/var_names.jsonc @@ -731,5 +731,68 @@ }, "(method 0 prim-strip)": { "args": ["allocation", "type-to-make", "num-vertices", "tex-id", "tex-name"] + }, + "num-func-loop-set!": { + "args": ["chan", "frame"] + }, + "num-func-seek!": { + "args": ["chan", "arg1", "arg2", "arg3"] + }, + "cspace-by-name-no-fail": { + "args": ["proc", "name"] + }, + "cspace-index-by-name-no-fail": { + "args": ["proc", "name"], + "vars": { + "v0-0": "idx" + } + }, + "num-func-identity": { + "args": ["chan", "arg1", "arg2", "arg3"] + }, + "num-func-loop!": { + "args": ["chan", "arg1", "arg2", "arg3"] + }, + "num-func-none": { + "args": ["chan", "arg1", "arg2", "arg3"] + }, + "num-func-+!": { + "args": ["chan", "arg1", "arg2", "arg3"] + }, + "num-func--!": { + "args": ["chan", "arg1", "arg2", "arg3"] + }, + "joint-channel-float-delete!": { + "args": ["chan"] + }, + "(method 21 process-focusable)": { + "vars": { + "gp-0": "cshape" + }, + "args": ["this", "mode"] + }, + "(method 20 process-focusable)": { + "vars": { + "v1-0": "mask" + } + }, + "(method 10 focus)": { + "args": ["this", "proc"], + "vars": { + "s5-0": "root", + "v1-2": "cshape" + } + }, + "(method 11 focus)": { + "args": ["this", "cspec"] + }, + "(method 12 focus)": { + "args": ["this", "proc"] + }, + "(method 13 effect-control)": { + "args": ["this", "offset"] + }, + "(method 0 effect-control)": { + "args": ["allocation", "type-to-make", "proc"] } } diff --git a/goal_src/jak3/engine/anim/joint-h.gc b/goal_src/jak3/engine/anim/joint-h.gc index 02ef34f29..26aec786b 100644 --- a/goal_src/jak3/engine/anim/joint-h.gc +++ b/goal_src/jak3/engine/anim/joint-h.gc @@ -11,6 +11,7 @@ :type uint64 (push 1) (blend 2) + (eight 8) (push1 19) (stack 36) (float 42) @@ -39,6 +40,8 @@ ;; DECOMP BEGINS (deftype joint-control-channel (structure) + "A single animation channel that controls a number of joints. +Multiple channels are used to blend animations together." ((parent joint-control) (frame-group art-joint-anim) (frame-num float) @@ -87,6 +90,7 @@ (deftype joint-control (basic) + "Every [[process-drawable]] has a [[joint-control]] that handles all the animation channels." ((status joint-control-status) (allocated-length uint8) (active-channels uint8) @@ -121,6 +125,7 @@ (deftype channel-upload-info (structure) + "Information about an upload of animation data to a single joint channel." ((fixed joint-anim-compressed-fixed) (fixed-qwc int32) (frame joint-anim-compressed-frame) diff --git a/goal_src/jak3/engine/anim/joint-mod-h.gc b/goal_src/jak3/engine/anim/joint-mod-h.gc index 8c90dc8f4..6c78131d0 100644 --- a/goal_src/jak3/engine/anim/joint-mod-h.gc +++ b/goal_src/jak3/engine/anim/joint-mod-h.gc @@ -5,5 +5,177 @@ ;; name in dgo: joint-mod-h ;; dgos: GAME +(defenum joint-mod-mode + :bitfield #t + :type uint32 + (flex-blend) + (look-at) + (world-look-at) + (rotate) + (joint-set) + (joint-set*) + (rotate2) ;; ?? + (reset) + (polar-look-at) + (joint-set*-world) + (gun-look-at) + (foot-rot) + (joint-set-world) + ) + +;; +++joint-mod-h:track-mode +(defenum track-mode + :bitfield #t + :type uint16 + (track-on 0) ;; 1 + (track-x 1) ;; 2 + (track-y 2) ;; 4 + (lock-on 3) ;; 8 + (no-trans 4) ;; 16 + (no-rotate 5) ;; 32 + (no-scale 6) ;; 64 + ) +;; ---joint-mod-h:track-mode + + +(defenum joint-mod-base-flags + :bitfield #t + :type uint16 + (attached 0) + ) + +(defenum joint-mod-ik-flags + :bitfield #t + :type uint32 + (enable) + (elbow-trans-neg) + (elbow-rot-neg) + ) + ;; DECOMP BEGINS +(deftype joint-mod (basic) + "Utility to modify a joint transform from code, rather than just getting it from animation. +This is used to make jak look toward an enemy, for example." + ((mode joint-mod-mode) + (process process-drawable) + (joint cspace) + (target vector :inline) + (twist vector :inline) + (twist-max vector :inline) + (extra-twist degrees :overlay-at (-> twist data 2)) + (track-mode track-mode :overlay-at (-> twist data 3)) + (look-at-count uint16 :offset 46) + (twist-range-x meters :overlay-at (-> twist-max data 2)) + (twist-range-y meters :overlay-at (-> twist-max data 3)) + (twist-speed-x float) + (twist-speed-y float) + (trans vector :inline) + (smushy-old float :overlay-at (-> trans data 0)) + (smushy-off float :overlay-at (-> trans data 1)) + (smushyv float :overlay-at (-> trans data 2)) + (quat quaternion :inline) + (scale vector :inline) + (notice-time time-frame) + (flex-blend float) + (blend float) + (old-blend float) + (max-dist meters) + (ignore-angle degrees) + (up uint8) + (nose uint8) + (ear uint8) + (base-joint uint8) + (base-nose uint8) + (shutting-down? symbol) + (parented-scale? symbol) + ) + (:methods + (new (symbol type) _type_) + (joint-mod-method-9 () none) + (joint-mod-method-10 () none) + (joint-mod-method-11 () none) + (reset-blend! (_type_) _type_) + (joint-mod-method-13 () none) + (joint-mod-method-14 () none) + (joint-mod-method-15 () none) + ) + ) + + +(deftype try-to-look-at-info (basic) + ((who handle) + (horz float) + (vert float) + ) + ) + +(deftype joint-mod-base (structure) + "Base type for most joint-mods" + ((flags joint-mod-base-flags) + (node-index int16) + (proc (pointer process-drawable)) + (callback (function cspace transformq none)) + ) + (:methods + (init (_type_ process-drawable uint joint-mod-base-flags) none) + (attach-callback (_type_) none) + (remove-callback (_type_) none) + ) + ) + + +(defmethod attach-callback ((this joint-mod-base)) + "Take control of the specified joint by modifying the cspace callback." + (let ((a1-3 (-> this proc 0 node-list data (-> this node-index)))) + (set! (-> a1-3 param0) (-> this callback)) + (set! (-> a1-3 param1) (the-as basic this)) + ) + (logior! (-> this flags) (joint-mod-base-flags attached)) + 0 + (none) + ) + +(defmethod remove-callback ((this joint-mod-base)) + "Remove this callback and set param0 to #f to use the default (animated joint)" + (set! (-> this proc 0 node-list data (-> this node-index) param0) #f) + (logclear! (-> this flags) (joint-mod-base-flags attached)) + 0 + (none) + ) + +(defmethod init ((this joint-mod-base) (arg0 process-drawable) (arg1 uint) (arg2 joint-mod-base-flags)) + "Set up this joint-mod to modify the given joint of the given process. Will attach automatically if attached flag is set." + (set! (-> this flags) arg2) + (set! (-> this node-index) (the-as int arg1)) + (set! (-> this proc) (the-as (pointer process-drawable) (process->ppointer arg0))) + (if (logtest? arg2 (joint-mod-base-flags attached)) + (attach-callback this) + ) + 0 + (none) + ) + +(deftype joint-mod-ik (basic) + ((flags joint-mod-ik-flags) + (process process-drawable) + (hand-dist float) + (handle-pos vector :inline) + (elbow-pole-vector-axis uint32) + (elbow-rotation-axis uint32) + (user-position vector :inline) + (user-normal vector :inline) + (user-blend float) + (user-float float) + (callback (function joint-mod-ik matrix matrix vector object)) + (shoulder-matrix-no-ik matrix :inline) + (elbow-matrix-no-ik matrix :inline) + (blend float) + (blend-interp float) + ) + (:methods + (new (symbol type) _type_) + (joint-mod-ik-method-9 () none) + (joint-mod-ik-method-10 () none) + ) + ) diff --git a/goal_src/jak3/engine/camera/pov-camera-h.gc b/goal_src/jak3/engine/camera/pov-camera-h.gc index 611ac0c3f..f30ca88cb 100644 --- a/goal_src/jak3/engine/camera/pov-camera-h.gc +++ b/goal_src/jak3/engine/camera/pov-camera-h.gc @@ -18,3 +18,28 @@ ;; DECOMP BEGINS +(deftype pov-camera (process-drawable) + ((flags pov-camera-flags) + (debounce-start-time time-frame) + (notify-handle handle) + (anim-name string) + (command-list pair) + (mask-to-clear process-mask) + (music-volume-movie float) + (sfx-volume-movie float) + ) + (:state-methods + pov-camera-abort + pov-camera-done-playing + pov-camera-playing + pov-camera-start-playing + pov-camera-startup + ) + (:methods + (pov-camera-method-25 () none) + (pov-camera-method-26 () none) + (pov-camera-method-27 () none) + (pov-camera-method-28 () none) + (pov-camera-method-29 () none) + ) + ) diff --git a/goal_src/jak3/engine/collide/collide-shape-h.gc b/goal_src/jak3/engine/collide/collide-shape-h.gc index 1597868ec..e0bc87adb 100644 --- a/goal_src/jak3/engine/collide/collide-shape-h.gc +++ b/goal_src/jak3/engine/collide/collide-shape-h.gc @@ -427,7 +427,7 @@ Most [[process-drawable]]s have a [[collide-shape]] that represents their root t ) ) (set! (-> s5-0 trans w) 1.0) - (quaternion-identity! (the-as quaternion (-> s5-0 rot))) + (quaternion-identity! (-> s5-0 quat)) (vector-identity! (-> s5-0 scale)) (cond ((= arg1 (collide-list-enum hit-by-player)) diff --git a/goal_src/jak3/engine/collide/collide-target-h.gc b/goal_src/jak3/engine/collide/collide-target-h.gc index 077a8db2d..d5a0ea4e4 100644 --- a/goal_src/jak3/engine/collide/collide-target-h.gc +++ b/goal_src/jak3/engine/collide/collide-target-h.gc @@ -7,3 +7,7 @@ ;; DECOMP BEGINS +(deftype control-info (collide-shape-moving) + ((pad uint8 5944) + ) + ) diff --git a/goal_src/jak3/engine/common-obs/generic-obs-h.gc b/goal_src/jak3/engine/common-obs/generic-obs-h.gc index 02257b4f5..9cdbf7658 100644 --- a/goal_src/jak3/engine/common-obs/generic-obs-h.gc +++ b/goal_src/jak3/engine/common-obs/generic-obs-h.gc @@ -5,5 +5,309 @@ ;; name in dgo: generic-obs-h ;; dgos: GAME +;; +++task-arrow-flags +(defenum task-arrow-flags + :type uint32 + :bitfield #t + (task-arrow-flag-00 0) + (task-arrow-flag-01 1) + (task-arrow-flag-02 2) + (task-arrow-flag-03 3) + ) +;; ---task-arrow-flags + + +;; +++manipy-options +(defenum manipy-options + :bitfield #t + :type uint32 + (mo-0 0) + ) +;; ---manipy-options + + +(declare-type joint-mod basic) +(declare-type sparticle-launch-group basic) ;; DECOMP BEGINS +(deftype manipy (process-drawable) + ((root collide-shape :override) + (new-trans-hook (function none)) + (cur-trans-hook (function none)) + (cur-event-hook (function none)) + (new-joint-anim art-joint-anim) + (new-joint-anim-blend uint64) + (new-joint-anim-frame float) + (anim-mode symbol) + (cur-grab-handle handle) + (cur-target-handle handle) + (old-grab-pos vector :inline) + (joint joint-mod 4) + (new-post-hook (function none)) + (cur-post-hook (function none)) + (clone-copy-trans symbol) + (shadow-backup basic) + (draw? symbol) + (userdata uint64) + (prefix basic) + (shadow-volume-joint int32) + (speed float) + (user-uint64 uint64 4) + (options manipy-options) + ) + (:state-methods + idle + ) + ) + + +(deftype part-spawner (process) + "A process that spawns a specified particle group." + ((root trsqv) + (part sparticle-launch-control) + (path basic) + (sound ambient-sound) + (sound-extra basic) + (mode (pointer sparticle-launch-group)) + (enable symbol) + (path-pos float) + (path-speed float) + (last-velocity vector :inline) + (radius meters) + (world-sphere sphere :inline) + ) + (:state-methods + active + ) + (:methods + (part-spawner-method-15 () none) + ) + ) + + +(deftype part-tracker (process) + ((root trsqv) + (mat matrix :inline) + (offset vector :inline) + (userdata uint64) + (user-time time-frame 2) + (user-vector vector :inline) + (user-handle uint32 2 :offset 288) + (part sparticle-launch-control) + (callback (function part-tracker vector)) + (linger-callback (function part-tracker vector)) + (duration time-frame) + (linger-duration time-frame) + (state-time time-frame) + (target handle) + (target-joint int32) + ) + (:methods + (part-tracker-method-14 () none) + (part-tracker-method-15 () none) + (part-tracker-method-16 () none) + (part-tracker-method-17 () none) + ) + ) + + +(deftype part-tracker-init-params (structure) + ((userdata uint64) + (duration time-frame) + (group sparticle-launch-group) + (callback (function part-tracker vector)) + (target basic) + (mat-joint basic) + ) + ) + + +(deftype part-tracker-subsampler-init-params (structure) + ((userdata uint64) + (duration time-frame) + (group sparticle-launch-group) + (callback (function part-tracker vector)) + (target basic) + (mat-joint basic) + (subsample-num float) + ) + ) + + +(deftype part-tracker-subsampler (part-tracker) + ((subsampler basic) + ) + ) + + +(deftype lightning-tracker (process) + ((root trsqv) + (lightning lightning-control) + (callback (function lightning-tracker none)) + (duration time-frame) + (start-time time-frame) + (offset0 vector :inline) + (offset1 vector :inline) + (target0 handle) + (target1 handle) + (target-joint0 int32) + (target-joint1 int32) + (sound sound-id) + (userdata uint64) + (user-time time-frame 2) + (user-vector vector :inline) + (user-handle handle 2 :offset 288) + ) + (:methods + (lightning-tracker-method-14 () none) + (lightning-tracker-method-15 () none) + (lightning-tracker-method-16 () none) + ) + ) + + +(deftype touch-tracker (process-drawable) + ((duration time-frame) + (target handle) + (event symbol) + (run-function (function object)) + (callback (function touch-tracker none)) + (event-mode basic) + ) + (:methods + (touch-tracker-method-20 () none) + ) + ) + + +(deftype swingpole (process-drawable) + ((edge-length meters) + (path-pos float) + (joint-track int32) + (speed meters) + (dir vector :inline) + (sync sync-eased :inline) + ) + (:methods + (swingpole-method-20 () none) + (swingpole-method-21 () none) + (swingpole-method-22 () none) + (swingpole-method-23 () none) + (swingpole-method-24 () none) + ) + ) + + +(deftype gui-query (structure) + ((x-position int32) + (y-position int32) + (message string) + (decision symbol) + (only-allow-cancel symbol) + (no-msg string) + (message-space int32) + ) + (:methods + (gui-query-method-9 () none) + (gui-query-method-10 () none) + ) + ) + + +(deftype othercam (process) + ((hand handle) + (old-global-mask process-mask) + (mask-to-clear process-mask) + (cam-joint-index int32) + (old-pos vector :inline) + (old-mat-z vector :inline) + (had-valid-frame symbol) + (border-value basic) + (die? symbol) + (survive-anim-end? symbol) + (spooling? symbol) + (fov float) + ) + (:states + othercam-running + ) + ) + + +(deftype explosion-init-params (structure) + ((spawn-point vector :inline) + (spawn-quat quaternion :inline) + (radius float) + (scale float) + (group sparticle-launch-group) + (collide-with collide-spec) + (damage float) + (damage-scale float) + (vehicle-damage-factor float) + (vehicle-impulse-factor float) + (ignore-proc uint64) + ) + ) + + +(deftype explosion (process-drawable) + ((start-time time-frame) + (duration uint32) + (linger-duration uint32) + (attack-id uint32) + (mat matrix :inline) + (params explosion-init-params :inline) + ) + (:methods + (explosion-method-20 () none) + (explosion-method-21 () none) + (explosion-method-22 () none) + ) + ) + + +(deftype process-hidden (process) + () + (:state-methods + die + ) + ) + + +(deftype simple-prim (process-drawable) + ((strip prim-strip) + ) + (:methods + (simple-prim-method-20 () none) + (simple-prim-method-21 () none) + (simple-prim-method-22 () none) + (simple-prim-method-23 () none) + (simple-prim-method-24 () none) + (simple-prim-method-25 () none) + ) + ) + + +(define *simple-prim-additive* 72) + +(define *simple-prim-alpha-blend* 68) + +(define *simple-prim-subtractive* 66) + +(deftype task-arrow-params (structure) + ((flags task-arrow-flags) + (map-icon uint16) + (pos vector :inline) + (quat quaternion :inline) + ) + ) + + +(deftype external-camera-controller (process) + ((pause-time time-frame) + (blur symbol) + ) + (:methods + (external-camera-controller-method-14 () none) + ) + ) diff --git a/goal_src/jak3/engine/common-obs/water-info-h.gc b/goal_src/jak3/engine/common-obs/water-info-h.gc index 853cab622..1f3bc4de4 100644 --- a/goal_src/jak3/engine/common-obs/water-info-h.gc +++ b/goal_src/jak3/engine/common-obs/water-info-h.gc @@ -5,5 +5,64 @@ ;; name in dgo: water-info-h ;; dgos: GAME +;; +++water-flag +(defenum water-flag + :type uint32 + :bitfield #t + (active 0) + (can-wade 1) + (can-swim 2) + (swim-ground 3) + (can-ground 4) + (use-ocean 5) + (tar 6) + (mud 7) + (deadly 8) + (use-water-anim 9) + (no-grab-sound 10) + (dark-eco 11) + (lava 12) + (swamp 13) + (flow 14) + (under-water 15) + (head-under-water 16) + (bouncing 17) + (wading 18) + (swimming 19) + (touch-water 20) + (jump-out 21) + (break-surface 22) + (spawn-drip 23) + (part-splash 24) + (part-drip 25) + (part-rings 26) + (part-water 27) + (event 28) + (over-water 29) + (find-water 30) + (touch-water-good 31) + ) +;; ---water-flag + + ;; DECOMP BEGINS +(deftype water-info (structure) + ((trans vector :inline) + (normal vector :inline) + (base-height meters) + (depth meters) + (handle handle) + (flags water-flag) + (prim drawable-region-prim) + (extra-flags uint32) + ) + ) + + +(deftype water-sphere (structure) + ((sphere sphere :inline) + (flags water-flag) + (user0 int32) + ) + ) diff --git a/goal_src/jak3/engine/game/effect-control-h.gc b/goal_src/jak3/engine/game/effect-control-h.gc index d9f195620..f6b1d5564 100644 --- a/goal_src/jak3/engine/game/effect-control-h.gc +++ b/goal_src/jak3/engine/game/effect-control-h.gc @@ -5,5 +5,56 @@ ;; name in dgo: effect-control-h ;; dgos: GAME +;; +++effect-control-flag +(defenum effect-control-flag + :type uint32 + :bitfield #t + ) +;; ---effect-control-flag + + ;; DECOMP BEGINS +(deftype effect-control (basic) + "An effect such as a particle with sound effects that plays during an animation." + ((process process-drawable) + (flags effect-control-flag) + (last-frame-group art-joint-anim) + (last-frame-num float) + (channel-offset int32) + (res res-lump) + (name (pointer res-tag)) + (param uint32) + ) + (:methods + (new (symbol type process-drawable) _type_) + (effect-control-method-9 () none) + (effect-control-method-10 () none) + (effect-control-method-11 () none) + (effect-control-method-12 () none) + (set-channel-offset! (_type_ int) none) + (effect-control-method-14 () none) + ) + ) + + +(defmethod new effect-control ((allocation symbol) (type-to-make type) (proc process-drawable)) + (cond + ((res-lump-struct (-> proc draw jgeo extra) 'effect-name structure) + (let ((v0-1 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-1 process) proc) + (set! (-> v0-1 last-frame-group) #f) + v0-1 + ) + ) + (else + (the-as effect-control #f) + ) + ) + ) + +(defmethod set-channel-offset! ((this effect-control) (offset int)) + (set! (-> this channel-offset) offset) + 0 + (none) + ) diff --git a/goal_src/jak3/engine/game/game-h.gc b/goal_src/jak3/engine/game/game-h.gc index a776658f9..9bef0d28e 100644 --- a/goal_src/jak3/engine/game/game-h.gc +++ b/goal_src/jak3/engine/game/game-h.gc @@ -330,6 +330,7 @@ to have a type with a large number of slots which can be turned into real method (deftype attack-dir-info (structure) + "Information about the position/direction of an attack." ((dir vector :inline) (xz-dir vector :inline) (attacker-velocity vector :inline) @@ -339,6 +340,7 @@ to have a type with a large number of slots which can be turned into real method (deftype attack-info (structure) + "Information about an incoming attack." ((trans vector :inline) (vector vector :inline) (attacker-velocity vector :inline) diff --git a/goal_src/jak3/engine/game/task/task-control-h.gc b/goal_src/jak3/engine/game/task/task-control-h.gc index ce730eef2..88bec9972 100644 --- a/goal_src/jak3/engine/game/task/task-control-h.gc +++ b/goal_src/jak3/engine/game/task/task-control-h.gc @@ -1495,6 +1495,7 @@ (last-ambient string) (last-ambient-id sound-id) ) + :pack-me (:methods (ambient-control-method-9 () none) (ambient-control-method-10 () none) diff --git a/goal_src/jak3/engine/physics/trajectory-h.gc b/goal_src/jak3/engine/physics/trajectory-h.gc index 72f1a0167..ceec57b78 100644 --- a/goal_src/jak3/engine/physics/trajectory-h.gc +++ b/goal_src/jak3/engine/physics/trajectory-h.gc @@ -7,3 +7,123 @@ ;; DECOMP BEGINS +(deftype trajectory (structure) + ((initial-position vector :inline) + (initial-velocity vector :inline) + (time float) + (gravity meters) + ) + (:methods + (trajectory-method-9 () none) + (trajectory-method-10 () none) + (trajectory-method-11 () none) + (trajectory-method-12 () none) + (trajectory-method-13 () none) + (trajectory-method-14 () none) + (trajectory-method-15 () none) + (trajectory-method-16 () none) + (trajectory-method-17 () none) + ) + ) + + +(deftype impact-control (structure) + ((process (pointer process-drawable)) + (radius meters) + (joint int32) + (collide-with collide-spec) + (start-time uint64) + (trans vector 2 :inline) + (dir vector :inline) + ) + (:methods + (new (symbol type process-drawable int float collide-spec) _type_) + (initialize (_type_ process-drawable int float collide-spec) impact-control) + (impact-control-method-10 () none) + (impact-control-method-11 () none) + ) + ) + + +(defmethod new impact-control ((allocation symbol) (type-to-make type) (arg0 process-drawable) (arg1 int) (arg2 float) (arg3 collide-spec)) + (let ((t9-0 (method-of-type structure new)) + (v1-1 type-to-make) + ) + (-> type-to-make size) + ((method-of-type impact-control initialize) + (the-as impact-control (t9-0 allocation v1-1)) + arg0 + arg1 + arg2 + arg3 + ) + ) + ) + +(deftype point-tracker (structure) + ((trans vector 2 :inline) + ) + (:methods + (new (symbol type vector vector) _type_) + (initialize (_type_ vector vector) point-tracker) + (point-tracker-method-10 () none) + (point-tracker-method-11 () none) + ) + ) + + +(defmethod new point-tracker ((allocation symbol) (type-to-make type) (arg0 vector) (arg1 vector)) + (let ((t9-0 (method-of-type structure new)) + (v1-1 type-to-make) + ) + (-> type-to-make size) + ((method-of-type point-tracker initialize) (the-as point-tracker (t9-0 allocation v1-1)) arg0 arg1) + ) + ) + +(deftype combo-tracker (point-tracker) + ((target handle) + (move-start-time time-frame) + ) + (:methods + (combo-tracker-method-12 () none) + (combo-tracker-method-13 () none) + ) + ) + + +(deftype traj2d-params (structure) + ((x float) + (y float) + (gravity float) + (initial-tilt float) + (initial-speed float) + (time float) + ) + ) + + +(deftype traj3d-params (structure) + ((gravity float) + (initial-tilt float) + (initial-speed float) + (time float) + (src vector :inline) + (dest vector :inline) + (diff vector :inline) + (initial-velocity vector :inline) + ) + ) + + +(deftype cubic-curve (structure) + ((mat matrix :inline) + ) + (:methods + (cubic-curve-method-9 () none) + (cubic-curve-method-10 () none) + (cubic-curve-method-11 () none) + (cubic-curve-method-12 () none) + (cubic-curve-method-13 () none) + ) + ) diff --git a/goal_src/jak3/engine/process-drawable/focus.gc b/goal_src/jak3/engine/process-drawable/focus.gc index 73180cc0c..ec594ec8c 100644 --- a/goal_src/jak3/engine/process-drawable/focus.gc +++ b/goal_src/jak3/engine/process-drawable/focus.gc @@ -7,3 +7,54 @@ ;; DECOMP BEGINS +(deftype focus (structure) + "A structure that keeps a handle to a [[process-focusable]]." + ((handle handle) + (collide-with collide-spec) + ) + (:methods + (clear-focused (_type_) none) + (collide-check? (_type_ process-focusable) object) + (reset-to-collide-spec (_type_ collide-spec) none) + (try-update-focus (_type_ process-focusable) symbol) + ) + ) + + +(defmethod reset-to-collide-spec ((this focus) (cspec collide-spec)) + "Reset this focus with the given [[collide-spec]]." + (set! (-> this collide-with) cspec) + (set! (-> this handle) (the-as handle #f)) + 0 + (none) + ) + +(defmethod collide-check? ((this focus) (proc process-focusable)) + "If the focused process is not dead, + check that the [[collide-spec]] of the focus and the process match." + (when (and proc (not (logtest? (-> proc focus-status) (focus-status disable dead)))) + (let* ((root (-> proc root)) + (cshape (if (type? root collide-shape) + root + ) + ) + ) + (and cshape (logtest? (-> this collide-with) (-> cshape root-prim prim-core collide-as))) + ) + ) + ) + +(defmethod try-update-focus ((this focus) (proc process-focusable)) + "Try to set the `handle` of this focus to the given process." + (when (!= (handle->process (-> this handle)) proc) + (set! (-> this handle) (process->handle proc)) + #t + ) + ) + +(defmethod clear-focused ((this focus)) + "Reset the focus' handle." + (set! (-> this handle) (the-as handle #f)) + 0 + (none) + ) diff --git a/goal_src/jak3/engine/process-drawable/process-drawable-h.gc b/goal_src/jak3/engine/process-drawable/process-drawable-h.gc index 7fbda0134..7d8f79d1a 100644 --- a/goal_src/jak3/engine/process-drawable/process-drawable-h.gc +++ b/goal_src/jak3/engine/process-drawable/process-drawable-h.gc @@ -5,5 +5,312 @@ ;; name in dgo: process-drawable-h ;; dgos: GAME +(define-extern cspace-by-name (function process-drawable string cspace)) +(define-extern cspace-index-by-name (function process-drawable string int)) +(define-extern joint-control-reset! (function joint-control joint-control-channel none :behavior process-drawable)) +(define-extern sleep-code (function symbol :behavior process)) + ;; DECOMP BEGINS +;; WARN: Return type mismatch object vs cspace. +(defun cspace-by-name-no-fail ((proc process-drawable) (name string)) + "Like [[cspace-by-name]], but prints an error if the [[cspace]] was not found and returns the `node-list`." + (let ((v0-0 (the-as object (cspace-by-name proc name)))) + (the-as cspace (cond + ((the-as cspace v0-0) + (empty) + v0-0 + ) + (else + (format 0 "no cspace (~A)~%" name) + (-> proc node-list data) + ) + ) + ) + ) + ) + +(defun cspace-index-by-name-no-fail ((proc process-drawable) (name string)) + "Like [[cspace-index-by-name]], but prints an error if the [[cspace]] was not found and returns 0." + (let ((idx (cspace-index-by-name proc name))) + (cond + ((< idx 0) + (format 0 "no cspace[ndx] (~A)~%" name) + 0 + ) + (else + (empty) + idx + ) + ) + ) + ) + +(defbehavior num-func-none process ((chan joint-control-channel) (arg1 float) (arg2 float) (arg3 float)) + (-> chan frame-num) + ) + +(defbehavior num-func-+! process ((chan joint-control-channel) (arg1 float) (arg2 float) (arg3 float)) + (set! (-> chan frame-num) + (+ (-> chan frame-num) (* arg1 (* (-> chan frame-group speed) (-> self clock time-adjust-ratio)))) + ) + ) + +(defbehavior num-func--! process ((chan joint-control-channel) (arg1 float) (arg2 float) (arg3 float)) + (set! (-> chan frame-num) + (- (-> chan frame-num) (* arg1 (* (-> chan frame-group speed) (-> self clock time-adjust-ratio)))) + ) + ) + +(defbehavior num-func-loop! process ((chan joint-control-channel) (arg1 float) (arg2 float) (arg3 float)) + (let* ((f0-1 (the float (+ (-> chan frame-group frames num-frames) -1))) + (f1-2 (+ (-> chan frame-num) f0-1 (* arg1 (* (-> chan frame-group speed) (-> self clock time-adjust-ratio))))) + ) + (set! (-> chan frame-num) (- f1-2 (* (the float (the int (/ f1-2 f0-1))) f0-1))) + ) + ) + +(defbehavior num-func-loop-speedless! process ((arg0 joint-control-channel) (arg1 float) (arg2 float) (arg3 float)) + (let* ((f0-1 (the float (+ (-> arg0 frame-group frames num-frames) -1))) + (f1-2 (+ (-> arg0 frame-num) f0-1 arg1)) + ) + (set! (-> arg0 frame-num) (- f1-2 (* (the float (the int (/ f1-2 f0-1))) f0-1))) + ) + ) + +(defbehavior num-func-loop-set! process ((chan joint-control-channel) (frame float) (arg2 float) (arg3 float)) + (set! (-> chan frame-num) frame) + frame + ) + +(defbehavior num-func-seek! process ((chan joint-control-channel) (arg1 float) (arg2 float) (arg3 float)) + (set! (-> chan frame-num) + (seek (-> chan frame-num) arg1 (* arg2 (* (-> chan frame-group speed) (-> self clock time-adjust-ratio)))) + ) + ) + +(defbehavior num-func-blend-in! process ((arg0 joint-control-channel) (arg1 float) (arg2 float) (arg3 float)) + (let ((f30-0 (seek (-> arg0 frame-interp 0) 1.0 (* arg1 (-> self clock time-adjust-ratio))))) + (set! (-> arg0 frame-interp 0) f30-0) + (set! (-> arg0 frame-interp 1) f30-0) + (if (= f30-0 1.0) + (joint-control-reset! (-> arg0 parent) arg0) + ) + f30-0 + ) + ) + +(defun joint-channel-float-delete! ((chan joint-control-channel)) + (let ((v1-0 (-> chan parent))) + (+! (-> v1-0 float-channels) -1) + (when (nonzero? (-> v1-0 float-channels)) + (let ((a1-5 (/ (&- (the-as pointer chan) (the-as uint (the-as pointer (-> v1-0 channel)))) 64))) + (if (< a1-5 (the-as int (+ (-> v1-0 active-channels) (-> v1-0 float-channels)))) + (qmem-copy<-! + (the-as pointer (+ (+ (* a1-5 64) 60) (the-as int v1-0))) + (the-as pointer (+ (+ (* (+ a1-5 1) 64) 60) (the-as int v1-0))) + (the-as int (* (-> v1-0 float-channels) 64)) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defbehavior num-func-interp-play! process ((arg0 joint-control-channel) (arg1 float) (arg2 float) (arg3 float)) + (let ((f30-0 (the float (+ (-> arg0 frame-group frames num-frames) -1))) + (f28-0 (* arg3 (-> arg0 frame-group speed))) + ) + (seek! (-> arg0 frame-num) f30-0 (* arg1 (* (-> arg0 frame-group speed) (-> self clock time-adjust-ratio)))) + (cond + ((< (-> arg0 frame-num) f28-0) + (set! (-> arg0 frame-interp 0) (/ (* (-> arg0 frame-num) arg2) f28-0)) + ) + ((< (- f30-0 f28-0) (-> arg0 frame-num)) + (set! (-> arg0 frame-interp 0) (/ (* (- f30-0 (-> arg0 frame-num)) arg2) f28-0)) + (when (and (= (-> arg0 frame-num) f30-0) (logtest? (-> arg0 command) (joint-control-command eight))) + (joint-channel-float-delete! arg0) + (return 0.0) + ) + ) + (else + (set! (-> arg0 frame-interp 0) arg2) + ) + ) + ) + (set! (-> arg0 frame-interp 1) (-> arg0 frame-interp 0)) + (-> arg0 frame-num) + ) + +(defbehavior num-func-interp1-play! process ((arg0 joint-control-channel) (arg1 float) (arg2 float) (arg3 float)) + (let ((f30-0 (the float (+ (-> arg0 frame-group frames num-frames) -1))) + (f28-0 (* arg3 (-> arg0 frame-group speed))) + ) + (seek! (-> arg0 frame-num) f30-0 (* arg1 (* (-> arg0 frame-group speed) (-> self clock time-adjust-ratio)))) + (cond + ((< (-> arg0 frame-num) f28-0) + (set! (-> arg0 frame-interp 1) (/ (* (-> arg0 frame-num) arg2) f28-0)) + ) + ((< (- f30-0 f28-0) (-> arg0 frame-num)) + (set! (-> arg0 frame-interp 1) (/ (* (- f30-0 (-> arg0 frame-num)) arg2) f28-0)) + (when (and (= (-> arg0 frame-num) f30-0) (logtest? (-> arg0 command) (joint-control-command eight))) + (joint-channel-float-delete! arg0) + (return 0.0) + ) + ) + (else + (set! (-> arg0 frame-interp 1) arg2) + ) + ) + ) + (-> arg0 frame-num) + ) + +(defbehavior num-func-chan process ((arg0 joint-control-channel) (arg1 float) (arg2 float) (arg3 float)) + (set! (-> arg0 frame-num) + (-> (the-as joint-control-channel (+ (the-as uint arg0) (* (- (the int arg1) (-> arg0 group-sub-index)) 64))) + frame-num + ) + ) + ) + +(defbehavior num-func-identity process ((chan joint-control-channel) (arg1 float) (arg2 float) (arg3 float)) + (-> chan frame-num) + ) + +;; these are mostly the same as jak 1? +(defmacro ja-group (&key (chan 0)) + "get the frame group for self. default channel is 0, the base channel. returns #f if no frame group." + `(if (> (-> self skel active-channels) ,chan) + (-> self skel root-channel ,chan frame-group)) + ) + +(defmacro ja-group? (group &key (chan 0)) + "is self in this frame group on this channel? default is channel 0, which is the base channel." + `(= (ja-group) ,group) + ) + +(defmacro ja (&key (chan 0) + &key (group! #f) + &key (num! #f) + &key (param0 #f) + &key (param1 #f) + &key (num-func #f) + &key (frame-num #f) + &key (frame-interp #f) + &key (dist #f) + &key (eval? #t) + ) + "set various joint anim parameters for self and eval them. + you can use this for playing animations! + chan = the channel to modify. defaults to 0 (base channel). this is usually what you want. + group! = when not #f, set this as the new frame-group. defaults to #f + num! = set the frame playback function. this is what determines what frame an animation is at. funcs below. + #f = no func will be set, and there wont be a frame eval. + num-func = sets the num-func field for the channel. this lets you change the function with eval'ing. + param0 = 1st parameter for the playback function. ONLY USE THESE WITH num-func !! + param1 = 2nd parameter for the playback function. ONLY USE THESE WITH num-func !! + frame-num = set the frame-num field. + frame-interp = set the frame-interp field. + dist = set the dist field. + available num! functions: + - (+!) = advance anim. + - (-!) = reverse anim. + - (identity num) = play 'num' frame. + - (seek! target speed) = animate towards frame target at a speed. + speed is optional and defaults to 1.0 when not provided. + target is optional and defaults to the last frame of the animation. + if you want to set the speed, you therefore must also set the target. + target can be max (no quote), which is just the same as the default value. + - (loop! speed) = loop animation at a speed. default speed is 1.0 when not provided. + - (chan channel) = copy frame from another channel. + - min = the start of the animation. + - max = the end of the animation. + - zero = frame zero. + " + + (let* ((num-args (if (pair? num!) (cdr num!) '())) + (num! (if (pair? num!) (car num!) num!)) + (nf (cond + ((or (eq? num! 'identity) + (eq? num! 'min) + (eq? num! 'max) + (eq? num! 'zero)) + 'num-func-identity) + ((eq? num! 'none) 'num-func-none) + ((eq? num! '+!) 'num-func-+!) + ((eq? num! '-!) 'num-func--!) + ((eq? num! 'seek!) 'num-func-seek!) + ((eq? num! 'loop!) 'num-func-loop!) + ((eq? num! 'blend-in!) 'num-func-blend-in!) + ((eq? num! 'chan) 'num-func-chan) + )) + (p0 (if param0 param0 + (cond + ((eq? num! 'chan) `(the float ,(car num-args))) + ((eq? num! '+!) (if (null? num-args) 1.0 (car num-args))) + ((eq? num! '-!) (if (null? num-args) 1.0 (car num-args))) + ((eq? num! 'loop!) (if (null? num-args) 1.0 (if (eq? 'max (car num-args)) + (if group! + `(the float (1- (-> (the art-joint-anim ,group!) frames num-frames))) + `(the float (1- (-> ja-ch frame-group frames num-frames))) + ) + (car num-args)))) + ((eq? num! 'seek!) (if (or (null? num-args) (eq? (car num-args) 'max)) + (if group! + `(the float (1- (-> (the art-joint-anim ,group!) frames num-frames))) + `(the float (1- (-> ja-ch frame-group frames num-frames))) + ) + (car num-args))) + ))) + (p1 (if param1 param1 + (cond + ((eq? num! 'seek!) (if (or (null? num-args) (null? (cdr num-args))) 1.0 (cadr num-args))) + ))) + (frame-num (cond + ((eq? 'max frame-num) (if group! + `(the float (1- (-> (the art-joint-anim ,group!) frames num-frames))) + `(the float (1- (-> ja-ch frame-group frames num-frames))) + )) + ((eq? 'zero frame-num) 0) + (#t frame-num))) + (frame-group (if (or p0 p1 frame-num (not nf)) group! #f)) + ) + `(let ((ja-ch (-> self skel root-channel ,chan))) + ,(if frame-interp `(set! (-> ja-ch frame-interp) ,frame-interp) `(none)) + ,(if dist `(set! (-> ja-ch dist) ,dist) `(none)) + ,(if frame-group `(set! (-> ja-ch frame-group) (the art-joint-anim ,frame-group)) `(none)) + ,(if p0 `(set! (-> ja-ch param 0) ,p0) `(none)) + ,(if p1 `(set! (-> ja-ch param 1) ,p1) `(none)) + ,(if num-func `(set! (-> ja-ch num-func) ,num-func) `(none)) + ,(if frame-num `(set! (-> ja-ch frame-num) ,frame-num) `(none)) + ,(if nf + `(,(if eval? 'joint-control-channel-group-eval! 'joint-control-channel-group!) + ja-ch (the art-joint-anim ,group!) ,nf) + `(none)) + ,(cond + ((eq? num! 'min) `(set! (-> ja-ch frame-num) 0.0)) + ((eq? num! 'max) (if group! + `(set! (-> ja-ch frame-num) (the float (1- (-> (the art-joint-anim ,group!) frames num-frames)))) + `(set! (-> ja-ch frame-num) (the float (1- (-> ja-ch frame-group frames num-frames)))) + )) + ((eq? num! 'identity) `(set! (-> ja-ch frame-num) ,(car num-args))) + (#t `(none)) + ) + )) + ) + +(defmacro ja-no-eval (&key (chan 0) + &key (group! #f) + &key (num! #f) + &key (param0 #f) + &key (param1 #f) + &key (num-func #f) + &key (frame-num #f) + &key (frame-interp #f) + &key (dist #f) + ) + `(ja :eval? #f :chan ,chan :group! ,group! :num! ,num! :param0 ,param0 :param1 ,param1 :num-func ,num-func :frame-num ,frame-num :frame-interp ,frame-interp :dist ,dist) + ) \ No newline at end of file diff --git a/goal_src/jak3/engine/process-drawable/process-focusable.gc b/goal_src/jak3/engine/process-drawable/process-focusable.gc index e6b2ee118..64864e250 100644 --- a/goal_src/jak3/engine/process-drawable/process-focusable.gc +++ b/goal_src/jak3/engine/process-drawable/process-focusable.gc @@ -5,5 +5,131 @@ ;; name in dgo: process-focusable ;; dgos: GAME +;; +++focus-status +(defenum focus-status + :type uint64 + :bitfield #t + (disable 0) ;; if set, all collide checks fail + (dead 1) ;; if set, all collide checks fail + (ignore 2) + (inactive 3) + (dangerous 4) + (in-air 5) + (hit 6) + (grabbed 7) + (in-head 8) + (touch-water 9) + (on-water 10) + (under-water 11) + (edge-grab 12) + (pole 13) + (pilot-riding 14) + (flut 15) + (tube 16) + (ice 17) + (board 18) + (gun 19) + (pilot 20) ;; also racer? + (mech 21) + (dark 22) + (rail 23) + (halfpipe 24) + (carry 25) + (super 26) + (shooting 27) + (indax 28) + (arrestable 29) + (teleporting 30) + (fs31 31) + ) +;; ---focus-status + + +(defmacro focus-test? (pfoc &rest status) + `(logtest? (-> (the process-focusable ,pfoc) focus-status) (focus-status ,@status))) + ;; DECOMP BEGINS +(deftype process-focusable (process-drawable) + ((root collide-shape :override) + (focus-status focus-status) + ) + (:methods + (process-focusable-method-20 (_type_) int) + (get-trans (_type_ int) vector) + (get-quat (_type_) quaternion) + (get-transv (_type_) vector) + (time-to-apex-or-ground (_type_ int) int) + (get-water-height (_type_) meters) + (get-notice-time (_type_) time-frame) + (get-inv-mass (_type_) float) + ) + ) + + +(defmethod process-focusable-method-20 ((this process-focusable)) + (let ((v0-0 0)) + (let ((mask (-> this mask))) + (if (logtest? (process-mask crate) mask) + (set! v0-0 (logior v0-0 2)) + ) + (if (logtest? (process-mask guard) mask) + (set! v0-0 (logior v0-0 4)) + ) + (if (logtest? (process-mask enemy) mask) + (set! v0-0 (logior v0-0 16)) + ) + ) + v0-0 + ) + ) + +;; WARN: Return type mismatch structure vs vector. +(defmethod get-trans ((this process-focusable) (mode int)) + "Get the `trans` for this process." + (let ((cshape (-> this root))) + (the-as vector (cond + ((zero? mode) + (-> cshape trans) + ) + ((and (= mode 1) (type? cshape collide-shape-moving)) + (-> (the-as collide-shape-moving cshape) gspot-pos) + ) + ((and (or (= mode 2) (= mode 3) (= mode 10)) (type? cshape collide-shape)) + (-> (the-as collide-shape-moving cshape) root-prim prim-core) + ) + (else + (-> cshape trans) + ) + ) + ) + ) + ) + +(defmethod get-transv ((this process-focusable)) + "Get the `transv` for this process." + (-> this root transv) + ) + +(defmethod get-quat ((this process-focusable)) + "Get the quaternion for this process." + (-> this root quat) + ) + +(defmethod time-to-apex-or-ground ((this process-focusable) (arg0 int)) + 0 + ) + +;; WARN: Return type mismatch int vs meters. +(defmethod get-water-height ((this process-focusable)) + (the-as meters 0) + ) + +(defmethod get-inv-mass ((this process-focusable)) + 0.0 + ) + +;; WARN: Return type mismatch int vs time-frame. +(defmethod get-notice-time ((this process-focusable)) + (the-as time-frame 0) + ) diff --git a/goal_src/jak3/engine/process-drawable/process-taskable-h.gc b/goal_src/jak3/engine/process-drawable/process-taskable-h.gc index 42f910d5c..ff725e296 100644 --- a/goal_src/jak3/engine/process-drawable/process-taskable-h.gc +++ b/goal_src/jak3/engine/process-drawable/process-taskable-h.gc @@ -5,5 +5,44 @@ ;; name in dgo: process-taskable-h ;; dgos: GAME +;; +++process-taskable-flags +(defenum process-taskable-flags + :type uint32 + :bitfield #t + ) +;; ---process-taskable-flags + + ;; DECOMP BEGINS +(deftype process-taskable (process-focusable) + "The parent class for NPCs that can be talked to." + ((flags process-taskable-flags) + (task game-task-control) + (ambient ambient-control :inline :offset 216) + (neck-joint-index int32) + (talk-message text-id) + (talk-distance meters) + (talk-height meters) + (last-talk time-frame) + (want-to-say time-frame) + (birth-time time-frame) + (slave handle) + ) + (:state-methods + hide + idle + (active game-task-event) + die + (play-game game-task-event) + ) + (:methods + (process-taskable-method-33 () none) + (process-taskable-method-34 () none) + (process-taskable-method-35 () none) + (process-taskable-method-36 () none) + (process-taskable-method-37 () none) + (process-taskable-method-38 () none) + (process-taskable-method-39 () none) + ) + ) diff --git a/goal_src/jak3/engine/target/target-h.gc b/goal_src/jak3/engine/target/target-h.gc index 2f319c5a1..8fe60c06e 100644 --- a/goal_src/jak3/engine/target/target-h.gc +++ b/goal_src/jak3/engine/target/target-h.gc @@ -5,5 +5,322 @@ ;; name in dgo: target-h ;; dgos: GAME +;; +++target-flags +(defenum target-flags + :type uint32 + :bitfield #t + ) +;; ---target-flags + + +(declare-type sidekick process-drawable) +(declare-type racer-info basic) +(declare-type tube-info basic) +(declare-type flut-info basic) +(declare-type board-info basic) +(declare-type pilot-info basic) +(declare-type gun-info basic) +(declare-type mech-info basic) +(declare-type turret-info basic) +(declare-type indax-info basic) +(declare-type ladder-info basic) +(declare-type darkjak-info basic) +(declare-type lightjak-info basic) + ;; DECOMP BEGINS +(deftype target (process-focusable) + ((control control-info :overlay-at root) + (skel2 joint-control) + (shadow-backup shadow-geo) + (target-flags target-flags :overlay-at state-flags) + (game game-info) + (neck joint-mod) + (head joint-mod) + (upper-body joint-mod) + (horns joint-mod) + (hair joint-mod 2) + (arm-ik joint-mod-ik 2) + (leg-ik joint-mod-ik 2) + (foot joint-mod 2) + (cloth basic) + (init-time time-frame) + (teleport-time time-frame) + (state-hook-time time-frame) + (state-hook (function none :behavior target)) + (cam-user-mode symbol) + (sidekick (pointer sidekick)) + (manipy (pointer manipy)) + (mirror (pointer process-drawable)) + (attack-info attack-info :inline) + (attack-info-rec attack-info :inline) + (attack-info-old attack-info 8 :inline) + (anim-seed uint64) + (alt-cam-pos vector :inline) + (current-level level) + (saved-pos transformq :inline) + (saved-owner handle) + (alt-neck-pos vector :inline) + (focus-search (array collide-shape)) + (handle-search (array handle)) + (excitement float) + (shock-effect-time time-frame) + (beard? symbol) + (spool-anim spool-anim) + (ambient-time time-frame) + (fp-hud handle) + (no-load-wait uint64) + (no-look-around-wait uint64) + (burn-proc handle) + (pre-joint-hook (function none :behavior target)) + (notify handle) + (death-resetter resetter-spec :inline) + (mode-cache basic) + (mode-param1 uint64) + (mode-param2 uint64) + (mode-param3 uint64) + (major-mode-exit-hook basic) + (major-mode-event-hook basic) + (sub-mode-exit-hook basic) + (ext-geo-control basic) + (pending-ext-geo int32) + (ext-geo int32) + (ext-anim-control basic) + (pending-ext-anim int32) + (ext-anim int32) + (tobot-state state) + (tobot? symbol) + (tobot-recorder basic) + (target-effect uint64) + (color-effect basic) + (color-effect-start-time time-frame) + (color-effect-duration time-frame) + (racer racer-info) + (tube tube-info) + (flut flut-info) + (board board-info) + (pilot pilot-info) + (gun gun-info) + (mech mech-info) + (turret turret-info) + (indax indax-info) + (ladder ladder-info) + (darkjak-interp float) + (darkjak-interp-old float) + (darkjak-giant-interp float) + (darkjak darkjak-info) + (lightjak-interp float) + (lightjak-interp-old float) + (lightjak lightjak-info) + (scarf-interp-targ float) + (scarf-interp float) + (scarf-interp-old float) + (goggles-interp-targ float) + (goggles-interp float) + (goggles-interp-old float) + (invisible-interp float) + (invisible-start-time time-frame) + (invisible-duration time-frame) + (invisible-shadow-dir-backup vector :inline) + ) + (:methods + (target-method-28 () none) + (target-method-29 () none) + ) + (:states + target-attack + target-attack-air + target-attack-uppercut + target-attack-uppercut-jump + target-blast-recover + target-board-clone-anim + target-board-duck-stance + target-board-falling + target-board-flip + target-board-get-off + target-board-get-on + target-board-grab + target-board-grenade + target-board-halfpipe + target-board-hit + target-board-hit-ground + target-board-hold + target-board-jump + target-board-jump-kick + target-board-ride-edge + target-board-stance + target-board-start + target-board-trickx + target-board-tricky + target-board-turn-around + target-board-turn-to + target-board-wall-kick + target-clone-anim + target-continue + target-credits + target-darkjak-bomb0 + target-darkjak-bomb1 + target-darkjak-get-off + target-darkjak-get-on + target-darkjak-running-attack + target-darkjak-smack + target-darkjak-smack-charge + target-death + target-double-jump + target-duck-high-jump + target-duck-high-jump-jump + target-duck-stance + target-duck-walk + target-eco-powerup + target-edge-grab + target-edge-grab-jump + target-edge-grab-off + target-falling + target-float + target-flop + target-flop-hit-ground + target-flut-air-attack + target-flut-air-attack-hit-ground + target-flut-clone-anim + target-flut-death + target-flut-double-jump + target-flut-eject + target-flut-falling + target-flut-get-off + target-flut-get-off-jump + target-flut-get-on + target-flut-grab + target-flut-hit + target-flut-hit-ground + target-flut-jump + target-flut-kanga-catch + target-flut-running-attack + target-flut-stance + target-flut-start + target-flut-walk + target-grab + target-grab-ride + target-gun-stance + target-gun-walk + target-hide + target-high-jump + target-hit + target-hit-ground + target-hit-ground-hard + target-indax-attack + target-indax-attack-air + target-indax-death + target-indax-double-jump + target-indax-falling + target-indax-get-off + target-indax-grab + target-indax-hang + target-indax-hit + target-indax-hit-ground + target-indax-jump + target-indax-running-attack + target-indax-stance + target-indax-start + target-indax-trip + target-indax-walk + target-invisible-get-on + target-jump + target-jump-forward + target-ladder + target-launch + target-launch-dir + target-lightjak-freeze + target-lightjak-get-off + target-lightjak-get-on + target-lightjak-regen + target-lightjak-shield + target-lightjak-swoop + target-lightjak-swoop-again + target-lightjak-swoop-falling + target-load-wait + target-look-around + target-mech-carry-drag + target-mech-carry-drop + target-mech-carry-falling + target-mech-carry-hit-ground + target-mech-carry-jump + target-mech-carry-pickup + target-mech-carry-stance + target-mech-carry-throw + target-mech-carry-walk + target-mech-clone-anim + target-mech-death + target-mech-falling + target-mech-get-off + target-mech-get-on + target-mech-get-up + target-mech-grab + target-mech-hit + target-mech-hit-ground + target-mech-jump + target-mech-punch + target-mech-shield + target-mech-stance + target-mech-start + target-mech-walk + target-pilot-clone-anim + target-pilot-daxter-perch + target-pilot-death + target-pilot-edge-grab + target-pilot-get-off + target-pilot-get-on + target-pilot-grab + target-pilot-hit + target-pilot-impact + target-pilot-stance + target-pilot-start + target-play-anim + target-pole-cycle + target-pole-flip-forward + target-pole-flip-forward-jump + target-pole-flip-up + target-pole-flip-up-jump + target-powerjak-get-on + target-roll + target-roll-flip + target-running-attack + target-slide-down + target-slide-down-to-ground + target-stance + target-stance-ambient + target-stance-look-around + target-swim + target-swim-jump + target-title + target-tube + target-turn-around + target-wade-stance + target-wade-walk + target-walk + target-warp-in + target-warp-out + ) + ) + + +(define-perm *target* target #f) + +(deftype sidekick (process-drawable) + ((control control-info :overlay-at root) + (anim-seed uint64 :offset 208) + (shadow-in-movie? symbol) + (special-anim-time time-frame) + (special-anim-interp float) + (special-anim-frame float) + (offset transformq :inline) + (mirror (pointer process-drawable)) + (ear joint-mod 2) + (flap joint-mod 2) + ) + (:states + sidekick-clone + ) + ) + + +(define-perm *sidekick* sidekick #f) diff --git a/goal_src/jak3/engine/util/sync-info-h.gc b/goal_src/jak3/engine/util/sync-info-h.gc index ebc28da79..79b5b3d83 100644 --- a/goal_src/jak3/engine/util/sync-info-h.gc +++ b/goal_src/jak3/engine/util/sync-info-h.gc @@ -16,3 +16,143 @@ ;; DECOMP BEGINS +(deftype sync-info-params (structure) + "Parameters used to set up a [[sync-info]]." + ((sync-type symbol) + (sync-flags sync-flags) + (entity basic) + (period uint32) + (percent float) + (ease-in float) + (ease-out float) + (pause-in float) + (pause-out float) + ) + ) + + +(deftype sync-info (structure) + ((sync-flags sync-flags) + (offset float) + (period uint32) + ) + (:methods + (sync-info-method-9 () none) + (sync-info-method-10 () none) + (sync-info-method-11 () none) + (sync-info-method-12 () none) + (sync-info-method-13 () none) + (sync-info-method-14 () none) + (sync-info-method-15 () none) + ) + ) + + +(deftype sync-linear (sync-info) + () + :pack-me + ) + + +(deftype sync-eased (sync-info) + ((tlo float) + (thi float) + (ylo float) + (m2 float) + (yend float) + (pause-in float) + (pause-out float) + ) + :pack-me + ) + + +(deftype sync-paused (sync-info) + ((pause-in float) + (pause-out float) + ) + ) + + +(deftype delayed-rand-float (structure) + ((min-time int32) + (max-time int32) + (max-val float) + (timer int32) + (start-time time-frame) + (value float) + ) + :pack-me + (:methods + (delayed-rand-float-method-9 () none) + (delayed-rand-float-method-10 () none) + (delayed-rand-float-method-11 () none) + (delayed-rand-float-method-12 () none) + ) + ) + + +(deftype oscillating-float (structure) + ((value float) + (target float) + (vel float) + (max-vel float) + (damping float) + (accel float) + ) + :allow-misaligned + (:methods + (oscillating-float-method-9 () none) + (oscillating-float-method-10 () none) + ) + ) + + +(deftype bouncing-float (structure) + ((osc oscillating-float :inline) + (max-value float) + (min-value float) + (elasticity float) + (state int32) + ) + :allow-misaligned + (:methods + (bouncing-float-method-9 () none) + (bouncing-float-method-10 () none) + (bouncing-float-method-11 () none) + (bouncing-float-method-12 () none) + ) + ) + + +(deftype delayed-rand-vector (structure) + ((min-time int32) + (max-time int32) + (xz-max float) + (y-max float) + (timer int32) + (start-time time-frame) + (value vector :inline) + ) + (:methods + (delayed-rand-vector-method-9 () none) + (delayed-rand-vector-method-10 () none) + (delayed-rand-vector-method-11 () none) + (delayed-rand-vector-method-12 () none) + ) + ) + + +(deftype oscillating-vector (structure) + ((value vector :inline) + (target vector :inline) + (vel vector :inline) + (max-vel float) + (damping float) + (accel float) + ) + (:methods + (oscillating-vector-method-9 () none) + (oscillating-vector-method-10 () none) + ) + ) diff --git a/test/decompiler/reference/jak3/decompiler-macros.gc b/test/decompiler/reference/jak3/decompiler-macros.gc index a33e93543..292dee746 100644 --- a/test/decompiler/reference/jak3/decompiler-macros.gc +++ b/test/decompiler/reference/jak3/decompiler-macros.gc @@ -107,6 +107,16 @@ ) ) +(defmacro ppointer->handle (pproc) + `(let ((the-process (the-as (pointer process) ,pproc))) + (new 'static 'handle :process the-process :pid (-> the-process 0 pid)) + ) + ) + +(defmacro process->handle (proc) + "convert a process to a handle. if proc is #f, returns a #f handle." + `(ppointer->handle (process->ppointer (the-as process ,proc))) + ) ;; use a compile-time list to keep track of the type of an anonymous behavior. (seval (define *defstate-type-stack* '())) diff --git a/test/decompiler/reference/jak3/engine/anim/joint-h_REF.gc b/test/decompiler/reference/jak3/engine/anim/joint-h_REF.gc index 3a46953e9..3b514d410 100644 --- a/test/decompiler/reference/jak3/engine/anim/joint-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/anim/joint-h_REF.gc @@ -3,6 +3,8 @@ ;; definition of type joint-control-channel (deftype joint-control-channel (structure) + "A single animation channel that controls a number of joints. +Multiple channels are used to blend animations together." ((parent joint-control) (frame-group art-joint-anim) (frame-num float) @@ -140,6 +142,7 @@ ;; definition of type joint-control (deftype joint-control (basic) + "Every [[process-drawable]] has a [[joint-control]] that handles all the animation channels." ((status joint-control-status) (allocated-length uint8) (active-channels uint8) @@ -257,6 +260,7 @@ ;; definition of type channel-upload-info (deftype channel-upload-info (structure) + "Information about an upload of animation data to a single joint channel." ((fixed joint-anim-compressed-fixed) (fixed-qwc int32) (frame joint-anim-compressed-frame) @@ -330,7 +334,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/engine/camera/pov-camera-h_REF.gc b/test/decompiler/reference/jak3/engine/camera/pov-camera-h_REF.gc new file mode 100644 index 000000000..8f84a0f8d --- /dev/null +++ b/test/decompiler/reference/jak3/engine/camera/pov-camera-h_REF.gc @@ -0,0 +1,57 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type pov-camera +(deftype pov-camera (process-drawable) + ((flags pov-camera-flags) + (debounce-start-time time-frame) + (notify-handle handle) + (anim-name string) + (command-list pair) + (mask-to-clear process-mask) + (music-volume-movie float) + (sfx-volume-movie float) + ) + (:state-methods + pov-camera-abort + pov-camera-done-playing + pov-camera-playing + pov-camera-start-playing + pov-camera-startup + ) + (:methods + (pov-camera-method-25 () none) + (pov-camera-method-26 () none) + (pov-camera-method-27 () none) + (pov-camera-method-28 () none) + (pov-camera-method-29 () none) + ) + ) + +;; definition for method 3 of type pov-camera +(defmethod inspect ((this pov-camera)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tflags: ~D~%" (-> this flags)) + (format #t "~2Tdebounce-start-time: ~D~%" (-> this debounce-start-time)) + (format #t "~2Tnotify-handle: ~D~%" (-> this notify-handle)) + (format #t "~2Tanim-name: ~A~%" (-> this anim-name)) + (format #t "~2Tcommand-list: ~A~%" (-> this command-list)) + (format #t "~2Tmask-to-clear: ~D~%" (-> this mask-to-clear)) + (format #t "~2Tmusic-volume-movie: ~f~%" (-> this music-volume-movie)) + (format #t "~2Tsfx-volume-movie: ~f~%" (-> this sfx-volume-movie)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/engine/collide/collide-shape-h_REF.gc b/test/decompiler/reference/jak3/engine/collide/collide-shape-h_REF.gc index 5028253e6..afc175c7a 100644 --- a/test/decompiler/reference/jak3/engine/collide/collide-shape-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/collide/collide-shape-h_REF.gc @@ -1438,9 +1438,9 @@ Most [[process-drawable]]s have a [[collide-shape]] that represents their root t ) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~1Ttrans: ~`vector`P~%" (-> this trans)) - (format #t "~1Trot: ~`vector`P~%" (-> this rot)) + (format #t "~1Trot: ~`vector`P~%" (-> this quat)) (format #t "~1Tscale: ~`vector`P~%" (-> this scale)) - (format #t "~1Tquat: #~%" (-> this rot)) + (format #t "~1Tquat: #~%" (-> this quat)) (format #t "~1Tpause-adjust-distance: (meters ~m)~%" (-> this pause-adjust-distance)) (format #t "~1Tnav-radius: (meters ~m)~%" (-> this nav-radius)) (format #t "~1Ttransv: ~`vector`P~%" (-> this transv)) @@ -1524,9 +1524,9 @@ Most [[process-drawable]]s have a [[collide-shape]] that represents their root t ) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~1Ttrans: ~`vector`P~%" (-> this trans)) - (format #t "~1Trot: ~`vector`P~%" (-> this rot)) + (format #t "~1Trot: ~`vector`P~%" (-> this quat)) (format #t "~1Tscale: ~`vector`P~%" (-> this scale)) - (format #t "~1Tquat: #~%" (-> this rot)) + (format #t "~1Tquat: #~%" (-> this quat)) (format #t "~1Tpause-adjust-distance: (meters ~m)~%" (-> this pause-adjust-distance)) (format #t "~1Tnav-radius: (meters ~m)~%" (-> this nav-radius)) (format #t "~1Ttransv: ~`vector`P~%" (-> this transv)) @@ -1667,7 +1667,7 @@ Most [[process-drawable]]s have a [[collide-shape]] that represents their root t ) ) (set! (-> s5-0 trans w) 1.0) - (quaternion-identity! (the-as quaternion (-> s5-0 rot))) + (quaternion-identity! (-> s5-0 quat)) (vector-identity! (-> s5-0 scale)) (cond ((= arg1 (collide-list-enum hit-by-player)) diff --git a/test/decompiler/reference/jak3/engine/collide/collide-target-h_REF.gc b/test/decompiler/reference/jak3/engine/collide/collide-target-h_REF.gc new file mode 100644 index 000000000..4b44a2cc2 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/collide/collide-target-h_REF.gc @@ -0,0 +1,15 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type control-info +(deftype control-info (collide-shape-moving) + ((pad uint8 5944) + ) + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/engine/common-obs/generic-obs-h_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/generic-obs-h_REF.gc new file mode 100644 index 000000000..922836854 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/common-obs/generic-obs-h_REF.gc @@ -0,0 +1,767 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type manipy +(deftype manipy (process-drawable) + ((root collide-shape :override) + (new-trans-hook (function none)) + (cur-trans-hook (function none)) + (cur-event-hook (function none)) + (new-joint-anim art-joint-anim) + (new-joint-anim-blend uint64) + (new-joint-anim-frame float) + (anim-mode symbol) + (cur-grab-handle handle) + (cur-target-handle handle) + (old-grab-pos vector :inline) + (joint joint-mod 4) + (new-post-hook (function none)) + (cur-post-hook (function none)) + (clone-copy-trans symbol) + (shadow-backup basic) + (draw? symbol) + (userdata uint64) + (prefix basic) + (shadow-volume-joint int32) + (speed float) + (user-uint64 uint64 4) + (options manipy-options) + ) + (:state-methods + idle + ) + ) + +;; definition for method 3 of type manipy +(defmethod inspect ((this manipy)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tnew-trans-hook: ~A~%" (-> this new-trans-hook)) + (format #t "~2Tcur-trans-hook: ~A~%" (-> this cur-trans-hook)) + (format #t "~2Tcur-event-hook: ~A~%" (-> this cur-event-hook)) + (format #t "~2Tnew-joint-anim: ~A~%" (-> this new-joint-anim)) + (format #t "~2Tnew-joint-anim-blend: ~D~%" (-> this new-joint-anim-blend)) + (format #t "~2Tnew-joint-anim-frame: ~f~%" (-> this new-joint-anim-frame)) + (format #t "~2Tanim-mode: ~A~%" (-> this anim-mode)) + (format #t "~2Tcur-grab-handle: ~D~%" (-> this cur-grab-handle)) + (format #t "~2Tcur-target-handle: ~D~%" (-> this cur-target-handle)) + (format #t "~2Told-grab-pos: ~`vector`P~%" (-> this old-grab-pos)) + (format #t "~2Tjoint[4] @ #x~X~%" (-> this joint)) + (format #t "~2Tnew-post-hook: ~A~%" (-> this new-post-hook)) + (format #t "~2Tcur-post-hook: ~A~%" (-> this cur-post-hook)) + (format #t "~2Tclone-copy-trans: ~A~%" (-> this clone-copy-trans)) + (format #t "~2Tshadow-backup: ~A~%" (-> this shadow-backup)) + (format #t "~2Tdraw?: ~A~%" (-> this draw?)) + (format #t "~2Tuserdata: ~A~%" (-> this userdata)) + (format #t "~2Tprefix: ~A~%" (-> this prefix)) + (format #t "~2Tshadow-volume-joint: ~D~%" (-> this shadow-volume-joint)) + (format #t "~2Tspeed: ~f~%" (-> this speed)) + (format #t "~2Tuser-uint64[4] @ #x~X~%" (-> this user-uint64)) + (format #t "~2Toptions: ~D~%" (-> this options)) + (label cfg-4) + this + ) + +;; definition of type part-spawner +(deftype part-spawner (process) + "A process that spawns a specified particle group." + ((root trsqv) + (part sparticle-launch-control) + (path basic) + (sound ambient-sound) + (sound-extra basic) + (mode (pointer sparticle-launch-group)) + (enable symbol) + (path-pos float) + (path-speed float) + (last-velocity vector :inline) + (radius meters) + (world-sphere sphere :inline) + ) + (:state-methods + active + ) + (:methods + (part-spawner-method-15 () none) + ) + ) + +;; definition for method 3 of type part-spawner +(defmethod inspect ((this part-spawner)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 this) + ) + (format #t "~2Troot: ~A~%" (-> this root)) + (format #t "~2Tpart: ~A~%" (-> this part)) + (format #t "~2Tpath: ~A~%" (-> this path)) + (format #t "~2Tsound: ~A~%" (-> this sound)) + (format #t "~2Tsound-extra: ~A~%" (-> this sound-extra)) + (format #t "~2Tmode: #x~X~%" (-> this mode)) + (format #t "~2Tenable: ~A~%" (-> this enable)) + (format #t "~2Tpath-pos: ~f~%" (-> this path-pos)) + (format #t "~2Tpath-speed: ~f~%" (-> this path-speed)) + (format #t "~2Tlast-velocity: #~%" (-> this last-velocity)) + (format #t "~2Tradius: (meters ~m)~%" (-> this radius)) + (format #t "~2Tworld-sphere: #~%" (-> this world-sphere)) + (label cfg-4) + this + ) + +;; definition of type part-tracker +(deftype part-tracker (process) + ((root trsqv) + (mat matrix :inline) + (offset vector :inline) + (userdata uint64) + (user-time time-frame 2) + (user-vector vector :inline) + (user-handle uint32 2 :offset 288) + (part sparticle-launch-control) + (callback (function part-tracker vector)) + (linger-callback (function part-tracker vector)) + (duration time-frame) + (linger-duration time-frame) + (state-time time-frame) + (target handle) + (target-joint int32) + ) + (:methods + (part-tracker-method-14 () none) + (part-tracker-method-15 () none) + (part-tracker-method-16 () none) + (part-tracker-method-17 () none) + ) + ) + +;; definition for method 3 of type part-tracker +(defmethod inspect ((this part-tracker)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 this) + ) + (format #t "~2Troot: ~A~%" (-> this root)) + (format #t "~2Tmat: #~%" (-> this mat)) + (format #t "~2Toffset: ~`vector`P~%" (-> this offset)) + (format #t "~2Tuserdata: ~A~%" (-> this userdata)) + (format #t "~2Tuser-time[2] @ #x~X~%" (-> this user-time)) + (format #t "~2Tuser-vector: ~`vector`P~%" (-> this user-vector)) + (format #t "~2Tuser-handle[2] @ #x~X~%" (-> this user-handle)) + (format #t "~2Tpart: ~A~%" (-> this part)) + (format #t "~2Tcallback: ~A~%" (-> this callback)) + (format #t "~2Tlinger-callback: ~A~%" (-> this linger-callback)) + (format #t "~2Tduration: ~D~%" (-> this duration)) + (format #t "~2Tlinger-duration: ~D~%" (-> this linger-duration)) + (format #t "~2Tstate-time: ~D~%" (-> this state-time)) + (format #t "~2Ttarget: ~D~%" (-> this target)) + (format #t "~2Ttarget-joint: ~D~%" (-> this target-joint)) + (label cfg-4) + this + ) + +;; definition of type part-tracker-init-params +(deftype part-tracker-init-params (structure) + ((userdata uint64) + (duration time-frame) + (group sparticle-launch-group) + (callback (function part-tracker vector)) + (target basic) + (mat-joint basic) + ) + ) + +;; definition for method 3 of type part-tracker-init-params +(defmethod inspect ((this part-tracker-init-params)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'part-tracker-init-params) + (format #t "~1Tuserdata: ~A~%" (-> this userdata)) + (format #t "~1Tduration: ~D~%" (-> this duration)) + (format #t "~1Tgroup: ~A~%" (-> this group)) + (format #t "~1Tcallback: ~A~%" (-> this callback)) + (format #t "~1Ttarget: ~A~%" (-> this target)) + (format #t "~1Tmat-joint: ~A~%" (-> this mat-joint)) + (label cfg-4) + this + ) + +;; definition of type part-tracker-subsampler-init-params +(deftype part-tracker-subsampler-init-params (structure) + ((userdata uint64) + (duration time-frame) + (group sparticle-launch-group) + (callback (function part-tracker vector)) + (target basic) + (mat-joint basic) + (subsample-num float) + ) + ) + +;; definition for method 3 of type part-tracker-subsampler-init-params +(defmethod inspect ((this part-tracker-subsampler-init-params)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'part-tracker-subsampler-init-params) + (format #t "~1Tuserdata: ~A~%" (-> this userdata)) + (format #t "~1Tduration: ~D~%" (-> this duration)) + (format #t "~1Tgroup: ~A~%" (-> this group)) + (format #t "~1Tcallback: ~A~%" (-> this callback)) + (format #t "~1Ttarget: ~A~%" (-> this target)) + (format #t "~1Tmat-joint: ~A~%" (-> this mat-joint)) + (format #t "~1Tsubsample-num: ~f~%" (-> this subsample-num)) + (label cfg-4) + this + ) + +;; definition of type part-tracker-subsampler +(deftype part-tracker-subsampler (part-tracker) + ((subsampler basic) + ) + ) + +;; definition for method 3 of type part-tracker-subsampler +(defmethod inspect ((this part-tracker-subsampler)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type part-tracker inspect))) + (t9-0 this) + ) + (format #t "~2Tsubsampler: ~A~%" (-> this subsampler)) + (label cfg-4) + this + ) + +;; definition of type lightning-tracker +(deftype lightning-tracker (process) + ((root trsqv) + (lightning lightning-control) + (callback (function lightning-tracker none)) + (duration time-frame) + (start-time time-frame) + (offset0 vector :inline) + (offset1 vector :inline) + (target0 handle) + (target1 handle) + (target-joint0 int32) + (target-joint1 int32) + (sound sound-id) + (userdata uint64) + (user-time time-frame 2) + (user-vector vector :inline) + (user-handle handle 2 :offset 288) + ) + (:methods + (lightning-tracker-method-14 () none) + (lightning-tracker-method-15 () none) + (lightning-tracker-method-16 () none) + ) + ) + +;; definition for method 3 of type lightning-tracker +(defmethod inspect ((this lightning-tracker)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 this) + ) + (format #t "~2Troot: ~A~%" (-> this root)) + (format #t "~2Tlightning: ~A~%" (-> this lightning)) + (format #t "~2Tcallback: ~A~%" (-> this callback)) + (format #t "~2Tduration: ~D~%" (-> this duration)) + (format #t "~2Tstart-time: ~D~%" (-> this start-time)) + (format #t "~2Toffset0: ~`vector`P~%" (-> this offset0)) + (format #t "~2Toffset1: ~`vector`P~%" (-> this offset1)) + (format #t "~2Ttarget0: ~D~%" (-> this target0)) + (format #t "~2Ttarget1: ~D~%" (-> this target1)) + (format #t "~2Ttarget-joint0: ~D~%" (-> this target-joint0)) + (format #t "~2Ttarget-joint1: ~D~%" (-> this target-joint1)) + (format #t "~2Tsound: ~D~%" (-> this sound)) + (format #t "~2Tuserdata: ~A~%" (-> this userdata)) + (format #t "~2Tuser-time[2] @ #x~X~%" (-> this user-time)) + (format #t "~2Tuser-vector: ~`vector`P~%" (-> this user-vector)) + (format #t "~2Tuser-handle[2] @ #x~X~%" (-> this user-handle)) + (label cfg-4) + this + ) + +;; definition of type touch-tracker +(deftype touch-tracker (process-drawable) + ((duration time-frame) + (target handle) + (event symbol) + (run-function (function object)) + (callback (function touch-tracker none)) + (event-mode basic) + ) + (:methods + (touch-tracker-method-20 () none) + ) + ) + +;; definition for method 3 of type touch-tracker +(defmethod inspect ((this touch-tracker)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tduration: ~D~%" (-> this duration)) + (format #t "~2Ttarget: ~D~%" (-> this target)) + (format #t "~2Tevent: ~A~%" (-> this event)) + (format #t "~2Trun-function: ~A~%" (-> this run-function)) + (format #t "~2Tcallback: ~A~%" (-> this callback)) + (format #t "~2Tevent-mode: ~A~%" (-> this event-mode)) + (label cfg-4) + this + ) + +;; definition of type swingpole +(deftype swingpole (process-drawable) + ((edge-length meters) + (path-pos float) + (joint-track int32) + (speed meters) + (dir vector :inline) + (sync sync-eased :inline) + ) + (:methods + (swingpole-method-20 () none) + (swingpole-method-21 () none) + (swingpole-method-22 () none) + (swingpole-method-23 () none) + (swingpole-method-24 () none) + ) + ) + +;; definition for method 3 of type swingpole +(defmethod inspect ((this swingpole)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tedge-length: (meters ~m)~%" (-> this edge-length)) + (format #t "~2Tpath-pos: ~f~%" (-> this path-pos)) + (format #t "~2Tjoint-track: ~D~%" (-> this joint-track)) + (format #t "~2Tspeed: (meters ~m)~%" (-> this speed)) + (format #t "~2Tdir: ~`vector`P~%" (-> this dir)) + (format #t "~2Tsync: #~%" (-> this sync)) + (label cfg-4) + this + ) + +;; definition of type gui-query +(deftype gui-query (structure) + ((x-position int32) + (y-position int32) + (message string) + (decision symbol) + (only-allow-cancel symbol) + (no-msg string) + (message-space int32) + ) + (:methods + (gui-query-method-9 () none) + (gui-query-method-10 () none) + ) + ) + +;; definition for method 3 of type gui-query +(defmethod inspect ((this gui-query)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'gui-query) + (format #t "~1Tx-position: ~D~%" (-> this x-position)) + (format #t "~1Ty-position: ~D~%" (-> this y-position)) + (format #t "~1Tmessage: ~A~%" (-> this message)) + (format #t "~1Tdecision: ~A~%" (-> this decision)) + (format #t "~1Tonly-allow-cancel: ~A~%" (-> this only-allow-cancel)) + (format #t "~1Tno-msg: ~A~%" (-> this no-msg)) + (format #t "~1Tmessage-space: ~D~%" (-> this message-space)) + (label cfg-4) + this + ) + +;; definition of type othercam +(deftype othercam (process) + ((hand handle) + (old-global-mask process-mask) + (mask-to-clear process-mask) + (cam-joint-index int32) + (old-pos vector :inline) + (old-mat-z vector :inline) + (had-valid-frame symbol) + (border-value basic) + (die? symbol) + (survive-anim-end? symbol) + (spooling? symbol) + (fov float) + ) + (:states + othercam-running + ) + ) + +;; definition for method 3 of type othercam +(defmethod inspect ((this othercam)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 this) + ) + (format #t "~2Thand: ~D~%" (-> this hand)) + (format #t "~2Told-global-mask: ~D~%" (-> this old-global-mask)) + (format #t "~2Tmask-to-clear: ~D~%" (-> this mask-to-clear)) + (format #t "~2Tcam-joint-index: ~D~%" (-> this cam-joint-index)) + (format #t "~2Told-pos: #~%" (-> this old-pos)) + (format #t "~2Told-mat-z: #~%" (-> this old-mat-z)) + (format #t "~2Thad-valid-frame: ~A~%" (-> this had-valid-frame)) + (format #t "~2Tborder-value: ~A~%" (-> this border-value)) + (format #t "~2Tdie?: ~A~%" (-> this die?)) + (format #t "~2Tsurvive-anim-end?: ~A~%" (-> this survive-anim-end?)) + (format #t "~2Tspooling?: ~A~%" (-> this spooling?)) + (format #t "~2Tfov: ~f~%" (-> this fov)) + (label cfg-4) + this + ) + +;; definition of type explosion-init-params +(deftype explosion-init-params (structure) + ((spawn-point vector :inline) + (spawn-quat quaternion :inline) + (radius float) + (scale float) + (group sparticle-launch-group) + (collide-with collide-spec) + (damage float) + (damage-scale float) + (vehicle-damage-factor float) + (vehicle-impulse-factor float) + (ignore-proc uint64) + ) + ) + +;; definition for method 3 of type explosion-init-params +(defmethod inspect ((this explosion-init-params)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'explosion-init-params) + (format #t "~1Tspawn-point: #~%" (-> this spawn-point)) + (format #t "~1Tspawn-quat: #~%" (-> this spawn-quat)) + (format #t "~1Tradius: ~f~%" (-> this radius)) + (format #t "~1Tscale: ~f~%" (-> this scale)) + (format #t "~1Tgroup: ~A~%" (-> this group)) + (format #t "~1Tcollide-with: ~D~%" (-> this collide-with)) + (format #t "~1Tdamage: ~f~%" (-> this damage)) + (format #t "~1Tdamage-scale: ~f~%" (-> this damage-scale)) + (format #t "~1Tvehicle-damage-factor: ~f~%" (-> this vehicle-damage-factor)) + (format #t "~1Tvehicle-impulse-factor: ~f~%" (-> this vehicle-impulse-factor)) + (format #t "~1Tignore-proc: ~D~%" (-> this ignore-proc)) + (label cfg-4) + this + ) + +;; definition of type explosion +(deftype explosion (process-drawable) + ((start-time time-frame) + (duration uint32) + (linger-duration uint32) + (attack-id uint32) + (mat matrix :inline) + (params explosion-init-params :inline) + ) + (:methods + (explosion-method-20 () none) + (explosion-method-21 () none) + (explosion-method-22 () none) + ) + ) + +;; definition for method 3 of type explosion +(defmethod inspect ((this explosion)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tstart-time: ~D~%" (-> this start-time)) + (format #t "~2Tduration: ~D~%" (-> this duration)) + (format #t "~2Tlinger-duration: ~D~%" (-> this linger-duration)) + (format #t "~2Tattack-id: ~D~%" (-> this attack-id)) + (format #t "~2Tmat: #~%" (-> this mat)) + (format #t "~2Tparams: #~%" (-> this params)) + (label cfg-4) + this + ) + +;; definition of type process-hidden +(deftype process-hidden (process) + () + (:state-methods + die + ) + ) + +;; definition for method 3 of type process-hidden +(defmethod inspect ((this process-hidden)) + (when (not this) + (set! this this) + (goto cfg-68) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tmask: #x~X : (process-mask " (-> this mask)) + (let ((s5-0 (-> this mask))) + (if (= (logand s5-0 (process-mask process-tree)) (process-mask process-tree)) + (format #t "process-tree ") + ) + (if (= (logand s5-0 (process-mask target)) (process-mask target)) + (format #t "target ") + ) + (if (= (logand (process-mask collectable) s5-0) (process-mask collectable)) + (format #t "collectable ") + ) + (if (= (logand (process-mask projectile) s5-0) (process-mask projectile)) + (format #t "projectile ") + ) + (if (= (logand s5-0 (process-mask sleep-code)) (process-mask sleep-code)) + (format #t "sleep-code ") + ) + (if (= (logand s5-0 (process-mask actor-pause)) (process-mask actor-pause)) + (format #t "actor-pause ") + ) + (if (= (logand (process-mask metalhead) s5-0) (shl #x8000 16)) + (format #t "metalhead ") + ) + (if (= (logand (process-mask bot) s5-0) (process-mask bot)) + (format #t "bot ") + ) + (if (= (logand (process-mask vehicle) s5-0) (process-mask vehicle)) + (format #t "vehicle ") + ) + (if (= (logand (process-mask enemy) s5-0) (process-mask enemy)) + (format #t "enemy ") + ) + (if (= (logand (process-mask entity) s5-0) (process-mask entity)) + (format #t "entity ") + ) + (if (= (logand s5-0 (process-mask heap-shrunk)) (process-mask heap-shrunk)) + (format #t "heap-shrunk ") + ) + (if (= (logand (process-mask sidekick) s5-0) (process-mask sidekick)) + (format #t "sidekick ") + ) + (if (= (logand s5-0 (process-mask going)) (process-mask going)) + (format #t "going ") + ) + (if (= (logand s5-0 (process-mask execute)) (process-mask execute)) + (format #t "execute ") + ) + (if (= (logand (process-mask civilian) s5-0) (process-mask civilian)) + (format #t "civilian ") + ) + (if (= (logand (process-mask death) s5-0) (process-mask death)) + (format #t "death ") + ) + (if (= (logand (process-mask guard) s5-0) (process-mask guard)) + (format #t "guard ") + ) + (if (= (logand s5-0 (process-mask no-kill)) (process-mask no-kill)) + (format #t "no-kill ") + ) + (if (= (logand (process-mask kg-robot) s5-0) (process-mask kg-robot)) + (format #t "kg-robot ") + ) + (if (= (logand (process-mask platform) s5-0) (process-mask platform)) + (format #t "platform ") + ) + (if (= (logand s5-0 (process-mask freeze)) (process-mask freeze)) + (format #t "freeze ") + ) + (if (= (logand s5-0 (process-mask sleep)) (process-mask sleep)) + (format #t "sleep ") + ) + (if (= (logand s5-0 (process-mask progress)) (process-mask progress)) + (format #t "progress ") + ) + (if (= (logand s5-0 (process-mask menu)) (process-mask menu)) + (format #t "menu ") + ) + (if (= (logand (process-mask camera) s5-0) (process-mask camera)) + (format #t "camera ") + ) + (if (= (logand (process-mask ambient) s5-0) (process-mask ambient)) + (format #t "ambient ") + ) + (if (= (logand s5-0 (process-mask dark-effect)) (process-mask dark-effect)) + (format #t "dark-effect ") + ) + (if (= (logand (process-mask crate) s5-0) (process-mask crate)) + (format #t "crate ") + ) + (if (= (logand s5-0 (process-mask kernel-run)) (process-mask kernel-run)) + (format #t "kernel-run ") + ) + (if (= (logand s5-0 (process-mask movie)) (process-mask movie)) + (format #t "movie ") + ) + (if (= (logand s5-0 (process-mask pause)) (process-mask pause)) + (format #t "pause ") + ) + ) + (format #t ")~%") + (format #t "~1Tclock: ~A~%" (-> this clock)) + (format #t "~1Tparent: #x~X~%" (-> this parent)) + (format #t "~1Tbrother: #x~X~%" (-> this brother)) + (format #t "~1Tchild: #x~X~%" (-> this child)) + (format #t "~1Tppointer: #x~X~%" (-> this ppointer)) + (format #t "~1Tself: ~A~%" (-> this self)) + (format #t "~1Tpool: ~A~%" (-> this pool)) + (format #t "~1Tstatus: ~A~%" (-> this status)) + (format #t "~1Tpid: ~D~%" (-> this pid)) + (format #t "~1Tmain-thread: ~A~%" (-> this main-thread)) + (format #t "~1Ttop-thread: ~A~%" (-> this top-thread)) + (format #t "~1Tentity: ~A~%" (-> this entity)) + (format #t "~1Tlevel: ~A~%" (-> this level)) + (format #t "~1Tstate: ~A~%" (-> this state)) + (format #t "~1Tprev-state: ~A~%" (-> this prev-state)) + (format #t "~1Tnext-state: ~A~%" (-> this next-state)) + (format #t "~1Tstate-stack: ~A~%" (-> this state-stack)) + (format #t "~1Ttrans-hook: ~A~%" (-> this trans-hook)) + (format #t "~1Tpost-hook: ~A~%" (-> this post-hook)) + (format #t "~1Tevent-hook: ~A~%" (-> this event-hook)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Theap-base: #x~X~%" (-> this heap-base)) + (format #t "~1Theap-top: #x~X~%" (-> this heap-top)) + (format #t "~1Theap-cur: #x~X~%" (-> this heap-cur)) + (format #t "~1Tstack-frame-top: ~A~%" (-> this stack-frame-top)) + (format #t "~1Theap: #~%" (&-> this heap-base)) + (format #t "~1Tconnection-list: ~`connectable`P~%" (-> this connection-list)) + (format #t "~1Tstack[0] @ #x~X~%" (-> this stack)) + (label cfg-68) + this + ) + +;; definition of type simple-prim +(deftype simple-prim (process-drawable) + ((strip prim-strip) + ) + (:methods + (simple-prim-method-20 () none) + (simple-prim-method-21 () none) + (simple-prim-method-22 () none) + (simple-prim-method-23 () none) + (simple-prim-method-24 () none) + (simple-prim-method-25 () none) + ) + ) + +;; definition for method 3 of type simple-prim +(defmethod inspect ((this simple-prim)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tstrip: ~A~%" (-> this strip)) + (label cfg-4) + this + ) + +;; definition for symbol *simple-prim-additive*, type int +(define *simple-prim-additive* 72) + +;; definition for symbol *simple-prim-alpha-blend*, type int +(define *simple-prim-alpha-blend* 68) + +;; definition for symbol *simple-prim-subtractive*, type int +(define *simple-prim-subtractive* 66) + +;; definition of type task-arrow-params +(deftype task-arrow-params (structure) + ((flags task-arrow-flags) + (map-icon uint16) + (pos vector :inline) + (quat quaternion :inline) + ) + ) + +;; definition for method 3 of type task-arrow-params +(defmethod inspect ((this task-arrow-params)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'task-arrow-params) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tmap-icon: ~D~%" (-> this map-icon)) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tquat: #~%" (-> this quat)) + (label cfg-4) + this + ) + +;; definition of type external-camera-controller +(deftype external-camera-controller (process) + ((pause-time time-frame) + (blur symbol) + ) + (:methods + (external-camera-controller-method-14 () none) + ) + ) + +;; definition for method 3 of type external-camera-controller +(defmethod inspect ((this external-camera-controller)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 this) + ) + (format #t "~2Tpause-time: ~D~%" (-> this pause-time)) + (format #t "~2Tblur: ~A~%" (-> this blur)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/engine/common-obs/water-info-h_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/water-info-h_REF.gc new file mode 100644 index 000000000..0f05ea7bc --- /dev/null +++ b/test/decompiler/reference/jak3/engine/common-obs/water-info-h_REF.gc @@ -0,0 +1,261 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type water-info +(deftype water-info (structure) + ((trans vector :inline) + (normal vector :inline) + (base-height meters) + (depth meters) + (handle handle) + (flags water-flag) + (prim drawable-region-prim) + (extra-flags uint32) + ) + ) + +;; definition for method 3 of type water-info +(defmethod inspect ((this water-info)) + (when (not this) + (set! this this) + (goto cfg-68) + ) + (format #t "[~8x] ~A~%" this 'water-info) + (format #t "~1Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~1Tnormal: ~`vector`P~%" (-> this normal)) + (format #t "~1Tbase-height: (meters ~m)~%" (-> this base-height)) + (format #t "~1Tdepth: (meters ~m)~%" (-> this depth)) + (format #t "~1Thandle: ~D~%" (-> this handle)) + (format #t "~1Tflags: #x~X : (water-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) + (if (= (logand s5-0 (water-flag active)) (water-flag active)) + (format #t "active ") + ) + (if (= (logand s5-0 (water-flag deadly)) (water-flag deadly)) + (format #t "deadly ") + ) + (if (= (logand (water-flag touch-water-good) s5-0) (shl #x8000 16)) + (format #t "touch-water-good ") + ) + (if (= (logand s5-0 (water-flag lava)) (water-flag lava)) + (format #t "lava ") + ) + (if (= (logand (water-flag jump-out) s5-0) (water-flag jump-out)) + (format #t "jump-out ") + ) + (if (= (logand (water-flag head-under-water) s5-0) (water-flag head-under-water)) + (format #t "head-under-water ") + ) + (if (= (logand s5-0 (water-flag under-water)) (water-flag under-water)) + (format #t "under-water ") + ) + (if (= (logand s5-0 (water-flag swamp)) (water-flag swamp)) + (format #t "swamp ") + ) + (if (= (logand s5-0 (water-flag dark-eco)) (water-flag dark-eco)) + (format #t "dark-eco ") + ) + (if (= (logand (water-flag part-water) s5-0) (water-flag part-water)) + (format #t "part-water ") + ) + (if (= (logand (water-flag break-surface) s5-0) (water-flag break-surface)) + (format #t "break-surface ") + ) + (if (= (logand (water-flag over-water) s5-0) (water-flag over-water)) + (format #t "over-water ") + ) + (if (= (logand s5-0 (water-flag use-ocean)) (water-flag use-ocean)) + (format #t "use-ocean ") + ) + (if (= (logand s5-0 (water-flag flow)) (water-flag flow)) + (format #t "flow ") + ) + (if (= (logand (water-flag wading) s5-0) (water-flag wading)) + (format #t "wading ") + ) + (if (= (logand (water-flag part-rings) s5-0) (water-flag part-rings)) + (format #t "part-rings ") + ) + (if (= (logand (water-flag part-drip) s5-0) (water-flag part-drip)) + (format #t "part-drip ") + ) + (if (= (logand (water-flag part-splash) s5-0) (water-flag part-splash)) + (format #t "part-splash ") + ) + (if (= (logand s5-0 (water-flag swim-ground)) (water-flag swim-ground)) + (format #t "swim-ground ") + ) + (if (= (logand s5-0 (water-flag tar)) (water-flag tar)) + (format #t "tar ") + ) + (if (= (logand (water-flag swimming) s5-0) (water-flag swimming)) + (format #t "swimming ") + ) + (if (= (logand s5-0 (water-flag mud)) (water-flag mud)) + (format #t "mud ") + ) + (if (= (logand (water-flag event) s5-0) (water-flag event)) + (format #t "event ") + ) + (if (= (logand (water-flag bouncing) s5-0) (water-flag bouncing)) + (format #t "bouncing ") + ) + (if (= (logand s5-0 (water-flag use-water-anim)) (water-flag use-water-anim)) + (format #t "use-water-anim ") + ) + (if (= (logand (water-flag spawn-drip) s5-0) (water-flag spawn-drip)) + (format #t "spawn-drip ") + ) + (if (= (logand s5-0 (water-flag can-swim)) (water-flag can-swim)) + (format #t "can-swim ") + ) + (if (= (logand (water-flag touch-water) s5-0) (water-flag touch-water)) + (format #t "touch-water ") + ) + (if (= (logand s5-0 (water-flag no-grab-sound)) (water-flag no-grab-sound)) + (format #t "no-grab-ground ") + ) + (if (= (logand s5-0 (water-flag can-wade)) (water-flag can-wade)) + (format #t "can-wade ") + ) + (if (= (logand (water-flag find-water) s5-0) (water-flag find-water)) + (format #t "find-water ") + ) + (if (= (logand s5-0 (water-flag can-ground)) (water-flag can-ground)) + (format #t "can-ground ") + ) + ) + (format #t ")~%") + (format #t "~1Tprim: ~A~%" (-> this prim)) + (format #t "~1Textra-flags: ~D~%" (-> this extra-flags)) + (label cfg-68) + this + ) + +;; definition of type water-sphere +(deftype water-sphere (structure) + ((sphere sphere :inline) + (flags water-flag) + (user0 int32) + ) + ) + +;; definition for method 3 of type water-sphere +(defmethod inspect ((this water-sphere)) + (when (not this) + (set! this this) + (goto cfg-68) + ) + (format #t "[~8x] ~A~%" this 'water-sphere) + (format #t "~1Tsphere: #~%" (-> this sphere)) + (format #t "~1Tflags: #x~X : (water-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) + (if (= (logand s5-0 (water-flag active)) (water-flag active)) + (format #t "active ") + ) + (if (= (logand s5-0 (water-flag deadly)) (water-flag deadly)) + (format #t "deadly ") + ) + (if (= (logand (water-flag touch-water-good) s5-0) (shl #x8000 16)) + (format #t "touch-water-good ") + ) + (if (= (logand s5-0 (water-flag lava)) (water-flag lava)) + (format #t "lava ") + ) + (if (= (logand (water-flag jump-out) s5-0) (water-flag jump-out)) + (format #t "jump-out ") + ) + (if (= (logand (water-flag head-under-water) s5-0) (water-flag head-under-water)) + (format #t "head-under-water ") + ) + (if (= (logand s5-0 (water-flag under-water)) (water-flag under-water)) + (format #t "under-water ") + ) + (if (= (logand s5-0 (water-flag swamp)) (water-flag swamp)) + (format #t "swamp ") + ) + (if (= (logand s5-0 (water-flag dark-eco)) (water-flag dark-eco)) + (format #t "dark-eco ") + ) + (if (= (logand (water-flag part-water) s5-0) (water-flag part-water)) + (format #t "part-water ") + ) + (if (= (logand (water-flag break-surface) s5-0) (water-flag break-surface)) + (format #t "break-surface ") + ) + (if (= (logand (water-flag over-water) s5-0) (water-flag over-water)) + (format #t "over-water ") + ) + (if (= (logand s5-0 (water-flag use-ocean)) (water-flag use-ocean)) + (format #t "use-ocean ") + ) + (if (= (logand s5-0 (water-flag flow)) (water-flag flow)) + (format #t "flow ") + ) + (if (= (logand (water-flag wading) s5-0) (water-flag wading)) + (format #t "wading ") + ) + (if (= (logand (water-flag part-rings) s5-0) (water-flag part-rings)) + (format #t "part-rings ") + ) + (if (= (logand (water-flag part-drip) s5-0) (water-flag part-drip)) + (format #t "part-drip ") + ) + (if (= (logand (water-flag part-splash) s5-0) (water-flag part-splash)) + (format #t "part-splash ") + ) + (if (= (logand s5-0 (water-flag swim-ground)) (water-flag swim-ground)) + (format #t "swim-ground ") + ) + (if (= (logand s5-0 (water-flag tar)) (water-flag tar)) + (format #t "tar ") + ) + (if (= (logand (water-flag swimming) s5-0) (water-flag swimming)) + (format #t "swimming ") + ) + (if (= (logand s5-0 (water-flag mud)) (water-flag mud)) + (format #t "mud ") + ) + (if (= (logand (water-flag event) s5-0) (water-flag event)) + (format #t "event ") + ) + (if (= (logand (water-flag bouncing) s5-0) (water-flag bouncing)) + (format #t "bouncing ") + ) + (if (= (logand s5-0 (water-flag use-water-anim)) (water-flag use-water-anim)) + (format #t "use-water-anim ") + ) + (if (= (logand (water-flag spawn-drip) s5-0) (water-flag spawn-drip)) + (format #t "spawn-drip ") + ) + (if (= (logand s5-0 (water-flag can-swim)) (water-flag can-swim)) + (format #t "can-swim ") + ) + (if (= (logand (water-flag touch-water) s5-0) (water-flag touch-water)) + (format #t "touch-water ") + ) + (if (= (logand s5-0 (water-flag no-grab-sound)) (water-flag no-grab-sound)) + (format #t "no-grab-ground ") + ) + (if (= (logand s5-0 (water-flag can-wade)) (water-flag can-wade)) + (format #t "can-wade ") + ) + (if (= (logand (water-flag find-water) s5-0) (water-flag find-water)) + (format #t "find-water ") + ) + (if (= (logand s5-0 (water-flag can-ground)) (water-flag can-ground)) + (format #t "can-ground ") + ) + ) + (format #t ")~%") + (format #t "~1Tuser0: ~D~%" (-> this user0)) + (label cfg-68) + this + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/engine/game/effect-control-h_REF.gc b/test/decompiler/reference/jak3/engine/game/effect-control-h_REF.gc new file mode 100644 index 000000000..05db30f00 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/game/effect-control-h_REF.gc @@ -0,0 +1,75 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type effect-control +(deftype effect-control (basic) + "An effect such as a particle with sound effects that plays during an animation." + ((process process-drawable) + (flags effect-control-flag) + (last-frame-group art-joint-anim) + (last-frame-num float) + (channel-offset int32) + (res res-lump) + (name (pointer res-tag)) + (param uint32) + ) + (:methods + (new (symbol type process-drawable) _type_) + (effect-control-method-9 () none) + (effect-control-method-10 () none) + (effect-control-method-11 () none) + (effect-control-method-12 () none) + (set-channel-offset! (_type_ int) none) + (effect-control-method-14 () none) + ) + ) + +;; definition for method 3 of type effect-control +(defmethod inspect ((this effect-control)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprocess: ~A~%" (-> this process)) + (format #t "~1Tflags: #x~X~%" (-> this flags)) + (format #t "~1Tlast-frame-group: ~A~%" (-> this last-frame-group)) + (format #t "~1Tlast-frame-num: ~f~%" (-> this last-frame-num)) + (format #t "~1Tchannel-offset: ~D~%" (-> this channel-offset)) + (format #t "~1Tres: ~A~%" (-> this res)) + (format #t "~1Tname: #x~X~%" (-> this name)) + (format #t "~1Tparam: #x~X~%" (-> this param)) + (label cfg-4) + this + ) + +;; definition for method 0 of type effect-control +(defmethod new effect-control ((allocation symbol) (type-to-make type) (proc process-drawable)) + (cond + ((res-lump-struct (-> proc draw jgeo extra) 'effect-name structure) + (let ((v0-1 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-1 process) proc) + (set! (-> v0-1 last-frame-group) #f) + v0-1 + ) + ) + (else + (the-as effect-control #f) + ) + ) + ) + +;; definition for method 13 of type effect-control +;; WARN: Return type mismatch int vs none. +(defmethod set-channel-offset! ((this effect-control) (offset int)) + (set! (-> this channel-offset) offset) + 0 + (none) + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/engine/game/game-h_REF.gc b/test/decompiler/reference/jak3/engine/game/game-h_REF.gc index b99696724..f33e59466 100644 --- a/test/decompiler/reference/jak3/engine/game/game-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/game/game-h_REF.gc @@ -292,6 +292,7 @@ to have a type with a large number of slots which can be turned into real method ;; definition of type attack-dir-info (deftype attack-dir-info (structure) + "Information about the position/direction of an attack." ((dir vector :inline) (xz-dir vector :inline) (attacker-velocity vector :inline) @@ -316,6 +317,7 @@ to have a type with a large number of slots which can be turned into real method ;; definition of type attack-info (deftype attack-info (structure) + "Information about an incoming attack." ((trans vector :inline) (vector vector :inline) (attacker-velocity vector :inline) @@ -489,7 +491,3 @@ to have a type with a large number of slots which can be turned into real method ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/engine/game/task/task-control-h_REF.gc b/test/decompiler/reference/jak3/engine/game/task/task-control-h_REF.gc index bfb3c2fbb..b4276c446 100644 --- a/test/decompiler/reference/jak3/engine/game/task/task-control-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/game/task/task-control-h_REF.gc @@ -1779,6 +1779,7 @@ (last-ambient string) (last-ambient-id sound-id) ) + :pack-me (:methods (ambient-control-method-9 () none) (ambient-control-method-10 () none) @@ -1805,7 +1806,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/engine/math/transformq-h_REF.gc b/test/decompiler/reference/jak3/engine/math/transformq-h_REF.gc index 834b1dec3..78181ef0e 100644 --- a/test/decompiler/reference/jak3/engine/math/transformq-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/math/transformq-h_REF.gc @@ -36,9 +36,9 @@ ) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~1Ttrans: ~`vector`P~%" (-> this trans)) - (format #t "~1Trot: ~`vector`P~%" (-> this rot)) + (format #t "~1Trot: ~`vector`P~%" (-> this quat)) (format #t "~1Tscale: ~`vector`P~%" (-> this scale)) - (format #t "~1Tquat: #~%" (-> this rot)) + (format #t "~1Tquat: #~%" (-> this quat)) (label cfg-4) this ) @@ -94,9 +94,9 @@ As a result, this type has a lot of weird methods and extra stuff hidden in it." ) (format #t "[~8x] ~A~%" this (-> this type)) (format #t "~1Ttrans: ~`vector`P~%" (-> this trans)) - (format #t "~1Trot: ~`vector`P~%" (-> this rot)) + (format #t "~1Trot: ~`vector`P~%" (-> this quat)) (format #t "~1Tscale: ~`vector`P~%" (-> this scale)) - (format #t "~1Tquat: #~%" (-> this rot)) + (format #t "~1Tquat: #~%" (-> this quat)) (format #t "~1Tpause-adjust-distance: (meters ~m)~%" (-> this pause-adjust-distance)) (format #t "~1Tnav-radius: (meters ~m)~%" (-> this nav-radius)) (format #t "~1Ttransv: ~`vector`P~%" (-> this transv)) diff --git a/test/decompiler/reference/jak3/engine/physics/trajectory-h_REF.gc b/test/decompiler/reference/jak3/engine/physics/trajectory-h_REF.gc new file mode 100644 index 000000000..553c4e2aa --- /dev/null +++ b/test/decompiler/reference/jak3/engine/physics/trajectory-h_REF.gc @@ -0,0 +1,249 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type trajectory +(deftype trajectory (structure) + ((initial-position vector :inline) + (initial-velocity vector :inline) + (time float) + (gravity meters) + ) + (:methods + (trajectory-method-9 () none) + (trajectory-method-10 () none) + (trajectory-method-11 () none) + (trajectory-method-12 () none) + (trajectory-method-13 () none) + (trajectory-method-14 () none) + (trajectory-method-15 () none) + (trajectory-method-16 () none) + (trajectory-method-17 () none) + ) + ) + +;; definition for method 3 of type trajectory +(defmethod inspect ((this trajectory)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'trajectory) + (format #t "~1Tinitial-position: ~`vector`P~%" (-> this initial-position)) + (format #t "~1Tinitial-velocity: ~`vector`P~%" (-> this initial-velocity)) + (format #t "~1Ttime: ~f~%" (-> this time)) + (format #t "~1Tgravity: (meters ~m)~%" (-> this gravity)) + (label cfg-4) + this + ) + +;; definition of type impact-control +(deftype impact-control (structure) + ((process (pointer process-drawable)) + (radius meters) + (joint int32) + (collide-with collide-spec) + (start-time uint64) + (trans vector 2 :inline) + (dir vector :inline) + ) + (:methods + (new (symbol type process-drawable int float collide-spec) _type_) + (initialize (_type_ process-drawable int float collide-spec) impact-control) + (impact-control-method-10 () none) + (impact-control-method-11 () none) + ) + ) + +;; definition for method 3 of type impact-control +(defmethod inspect ((this impact-control)) + (when (not this) + (set! this this) + (goto cfg-7) + ) + (format #t "[~8x] ~A~%" this 'impact-control) + (format #t "~1Tprocess: #x~X~%" (-> this process)) + (format #t "~1Tradius: (meters ~m)~%" (-> this radius)) + (format #t "~1Tjoint: ~D~%" (-> this joint)) + (format #t "~1Tcollide-with: ~D~%" (-> this collide-with)) + (format #t "~1Tstart-time: ~D~%" (-> this start-time)) + (format #t "~1Ttrans[2] @ #x~X~%" (-> this trans)) + (dotimes (s5-0 2) + (format #t "~T [~D]~1Ttrans: ~`vector`P~%" s5-0 (-> this trans s5-0)) + ) + (format #t "~1Tdir: ~`vector`P~%" (-> this dir)) + (label cfg-7) + this + ) + +;; definition for method 0 of type impact-control +(defmethod new impact-control ((allocation symbol) (type-to-make type) (arg0 process-drawable) (arg1 int) (arg2 float) (arg3 collide-spec)) + (let ((t9-0 (method-of-type structure new)) + (v1-1 type-to-make) + ) + (-> type-to-make size) + ((method-of-type impact-control initialize) + (the-as impact-control (t9-0 allocation v1-1)) + arg0 + arg1 + arg2 + arg3 + ) + ) + ) + +;; definition of type point-tracker +(deftype point-tracker (structure) + ((trans vector 2 :inline) + ) + (:methods + (new (symbol type vector vector) _type_) + (initialize (_type_ vector vector) point-tracker) + (point-tracker-method-10 () none) + (point-tracker-method-11 () none) + ) + ) + +;; definition for method 3 of type point-tracker +(defmethod inspect ((this point-tracker)) + (when (not this) + (set! this this) + (goto cfg-7) + ) + (format #t "[~8x] ~A~%" this 'point-tracker) + (format #t "~1Ttrans[2] @ #x~X~%" (-> this trans)) + (dotimes (s5-0 2) + (format #t "~T [~D]~1Ttrans: ~`vector`P~%" s5-0 (-> this trans s5-0)) + ) + (label cfg-7) + this + ) + +;; definition for method 0 of type point-tracker +(defmethod new point-tracker ((allocation symbol) (type-to-make type) (arg0 vector) (arg1 vector)) + (let ((t9-0 (method-of-type structure new)) + (v1-1 type-to-make) + ) + (-> type-to-make size) + ((method-of-type point-tracker initialize) (the-as point-tracker (t9-0 allocation v1-1)) arg0 arg1) + ) + ) + +;; definition of type combo-tracker +(deftype combo-tracker (point-tracker) + ((target handle) + (move-start-time time-frame) + ) + (:methods + (combo-tracker-method-12 () none) + (combo-tracker-method-13 () none) + ) + ) + +;; definition for method 3 of type combo-tracker +(defmethod inspect ((this combo-tracker)) + (when (not this) + (set! this this) + (goto cfg-7) + ) + (format #t "[~8x] ~A~%" this 'combo-tracker) + (format #t "~1Ttrans[2] @ #x~X~%" (-> this trans)) + (dotimes (s5-0 2) + (format #t "~T [~D]~1Ttrans: ~`vector`P~%" s5-0 (-> this trans s5-0)) + ) + (format #t "~1Ttarget: ~D~%" (-> this target)) + (format #t "~1Tmove-start-time: ~D~%" (-> this move-start-time)) + (label cfg-7) + this + ) + +;; definition of type traj2d-params +(deftype traj2d-params (structure) + ((x float) + (y float) + (gravity float) + (initial-tilt float) + (initial-speed float) + (time float) + ) + ) + +;; definition for method 3 of type traj2d-params +(defmethod inspect ((this traj2d-params)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'traj2d-params) + (format #t "~1Tx: ~f~%" (-> this x)) + (format #t "~1Ty: ~f~%" (-> this y)) + (format #t "~1Tgravity: ~f~%" (-> this gravity)) + (format #t "~1Tinitial-tilt: ~f~%" (-> this initial-tilt)) + (format #t "~1Tinitial-speed: ~f~%" (-> this initial-speed)) + (format #t "~1Ttime: ~f~%" (-> this time)) + (label cfg-4) + this + ) + +;; definition of type traj3d-params +(deftype traj3d-params (structure) + ((gravity float) + (initial-tilt float) + (initial-speed float) + (time float) + (src vector :inline) + (dest vector :inline) + (diff vector :inline) + (initial-velocity vector :inline) + ) + ) + +;; definition for method 3 of type traj3d-params +(defmethod inspect ((this traj3d-params)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'traj3d-params) + (format #t "~1Tgravity: ~f~%" (-> this gravity)) + (format #t "~1Tinitial-tilt: ~f~%" (-> this initial-tilt)) + (format #t "~1Tinitial-speed: ~f~%" (-> this initial-speed)) + (format #t "~1Ttime: ~f~%" (-> this time)) + (format #t "~1Tsrc: #~%" (-> this src)) + (format #t "~1Tdest: #~%" (-> this dest)) + (format #t "~1Tdiff: #~%" (-> this diff)) + (format #t "~1Tinitial-velocity: #~%" (-> this initial-velocity)) + (label cfg-4) + this + ) + +;; definition of type cubic-curve +(deftype cubic-curve (structure) + ((mat matrix :inline) + ) + (:methods + (cubic-curve-method-9 () none) + (cubic-curve-method-10 () none) + (cubic-curve-method-11 () none) + (cubic-curve-method-12 () none) + (cubic-curve-method-13 () none) + ) + ) + +;; definition for method 3 of type cubic-curve +(defmethod inspect ((this cubic-curve)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'cubic-curve) + (format #t "~1Tmat: #~%" (-> this mat)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/engine/process-drawable/focus_REF.gc b/test/decompiler/reference/jak3/engine/process-drawable/focus_REF.gc new file mode 100644 index 000000000..b1e130d3f --- /dev/null +++ b/test/decompiler/reference/jak3/engine/process-drawable/focus_REF.gc @@ -0,0 +1,77 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type focus +(deftype focus (structure) + "A structure that keeps a handle to a [[process-focusable]]." + ((handle handle) + (collide-with collide-spec) + ) + (:methods + (clear-focused (_type_) none) + (collide-check? (_type_ process-focusable) object) + (reset-to-collide-spec (_type_ collide-spec) none) + (try-update-focus (_type_ process-focusable) symbol) + ) + ) + +;; definition for method 3 of type focus +(defmethod inspect ((this focus)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'focus) + (format #t "~1Thandle: ~D~%" (-> this handle)) + (format #t "~1Tcollide-with: ~D~%" (-> this collide-with)) + (label cfg-4) + this + ) + +;; definition for method 11 of type focus +;; WARN: Return type mismatch int vs none. +(defmethod reset-to-collide-spec ((this focus) (cspec collide-spec)) + "Reset this focus with the given [[collide-spec]]." + (set! (-> this collide-with) cspec) + (set! (-> this handle) (the-as handle #f)) + 0 + (none) + ) + +;; definition for method 10 of type focus +(defmethod collide-check? ((this focus) (proc process-focusable)) + "If the focused process is not dead, + check that the [[collide-spec]] of the focus and the process match." + (when (and proc (not (logtest? (-> proc focus-status) (focus-status disable dead)))) + (let* ((root (-> proc root)) + (cshape (if (type? root collide-shape) + root + ) + ) + ) + (and cshape (logtest? (-> this collide-with) (-> cshape root-prim prim-core collide-as))) + ) + ) + ) + +;; definition for method 12 of type focus +(defmethod try-update-focus ((this focus) (proc process-focusable)) + "Try to set the `handle` of this focus to the given process." + (when (!= (handle->process (-> this handle)) proc) + (set! (-> this handle) (process->handle proc)) + #t + ) + ) + +;; definition for method 9 of type focus +;; WARN: Return type mismatch int vs none. +(defmethod clear-focused ((this focus)) + "Reset the focus' handle." + (set! (-> this handle) (the-as handle #f)) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/process-drawable/process-drawable-h_REF.gc b/test/decompiler/reference/jak3/engine/process-drawable/process-drawable-h_REF.gc new file mode 100644 index 000000000..595410954 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/process-drawable/process-drawable-h_REF.gc @@ -0,0 +1,193 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function cspace-by-name-no-fail +;; WARN: Return type mismatch object vs cspace. +(defun cspace-by-name-no-fail ((proc process-drawable) (name string)) + "Like [[cspace-by-name]], but prints an error if the [[cspace]] was not found and returns the `node-list`." + (let ((v0-0 (the-as object (cspace-by-name proc name)))) + (the-as cspace (cond + ((the-as cspace v0-0) + (empty) + v0-0 + ) + (else + (format 0 "no cspace (~A)~%" name) + (-> proc node-list data) + ) + ) + ) + ) + ) + +;; definition for function cspace-index-by-name-no-fail +(defun cspace-index-by-name-no-fail ((proc process-drawable) (name string)) + "Like [[cspace-index-by-name]], but prints an error if the [[cspace]] was not found and returns 0." + (let ((idx (cspace-index-by-name proc name))) + (cond + ((< idx 0) + (format 0 "no cspace[ndx] (~A)~%" name) + 0 + ) + (else + (empty) + idx + ) + ) + ) + ) + +;; definition for function num-func-none +(defbehavior num-func-none process ((chan joint-control-channel) (arg1 float) (arg2 float) (arg3 float)) + (-> chan frame-num) + ) + +;; definition for function num-func-+! +(defbehavior num-func-+! process ((chan joint-control-channel) (arg1 float) (arg2 float) (arg3 float)) + (set! (-> chan frame-num) + (+ (-> chan frame-num) (* arg1 (* (-> chan frame-group speed) (-> self clock time-adjust-ratio)))) + ) + ) + +;; definition for function num-func--! +(defbehavior num-func--! process ((chan joint-control-channel) (arg1 float) (arg2 float) (arg3 float)) + (set! (-> chan frame-num) + (- (-> chan frame-num) (* arg1 (* (-> chan frame-group speed) (-> self clock time-adjust-ratio)))) + ) + ) + +;; definition for function num-func-loop! +(defbehavior num-func-loop! process ((chan joint-control-channel) (arg1 float) (arg2 float) (arg3 float)) + (let* ((f0-1 (the float (+ (-> chan frame-group frames num-frames) -1))) + (f1-2 (+ (-> chan frame-num) f0-1 (* arg1 (* (-> chan frame-group speed) (-> self clock time-adjust-ratio))))) + ) + (set! (-> chan frame-num) (- f1-2 (* (the float (the int (/ f1-2 f0-1))) f0-1))) + ) + ) + +;; definition for function num-func-loop-speedless! +(defbehavior num-func-loop-speedless! process ((arg0 joint-control-channel) (arg1 float) (arg2 float) (arg3 float)) + (let* ((f0-1 (the float (+ (-> arg0 frame-group frames num-frames) -1))) + (f1-2 (+ (-> arg0 frame-num) f0-1 arg1)) + ) + (set! (-> arg0 frame-num) (- f1-2 (* (the float (the int (/ f1-2 f0-1))) f0-1))) + ) + ) + +;; definition for function num-func-loop-set! +(defbehavior num-func-loop-set! process ((chan joint-control-channel) (frame float) (arg2 float) (arg3 float)) + (set! (-> chan frame-num) frame) + frame + ) + +;; definition for function num-func-seek! +(defbehavior num-func-seek! process ((chan joint-control-channel) (arg1 float) (arg2 float) (arg3 float)) + (set! (-> chan frame-num) + (seek (-> chan frame-num) arg1 (* arg2 (* (-> chan frame-group speed) (-> self clock time-adjust-ratio)))) + ) + ) + +;; definition for function num-func-blend-in! +(defbehavior num-func-blend-in! process ((arg0 joint-control-channel) (arg1 float) (arg2 float) (arg3 float)) + (let ((f30-0 (seek (-> arg0 frame-interp 0) 1.0 (* arg1 (-> self clock time-adjust-ratio))))) + (set! (-> arg0 frame-interp 0) f30-0) + (set! (-> arg0 frame-interp 1) f30-0) + (if (= f30-0 1.0) + (joint-control-reset! (-> arg0 parent) arg0) + ) + f30-0 + ) + ) + +;; definition for function joint-channel-float-delete! +;; WARN: Return type mismatch int vs none. +(defun joint-channel-float-delete! ((chan joint-control-channel)) + (let ((v1-0 (-> chan parent))) + (+! (-> v1-0 float-channels) -1) + (when (nonzero? (-> v1-0 float-channels)) + (let ((a1-5 (/ (&- (the-as pointer chan) (the-as uint (the-as pointer (-> v1-0 channel)))) 64))) + (if (< a1-5 (the-as int (+ (-> v1-0 active-channels) (-> v1-0 float-channels)))) + (qmem-copy<-! + (the-as pointer (+ (+ (* a1-5 64) 60) (the-as int v1-0))) + (the-as pointer (+ (+ (* (+ a1-5 1) 64) 60) (the-as int v1-0))) + (the-as int (* (-> v1-0 float-channels) 64)) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function num-func-interp-play! +(defbehavior num-func-interp-play! process ((arg0 joint-control-channel) (arg1 float) (arg2 float) (arg3 float)) + (let ((f30-0 (the float (+ (-> arg0 frame-group frames num-frames) -1))) + (f28-0 (* arg3 (-> arg0 frame-group speed))) + ) + (seek! (-> arg0 frame-num) f30-0 (* arg1 (* (-> arg0 frame-group speed) (-> self clock time-adjust-ratio)))) + (cond + ((< (-> arg0 frame-num) f28-0) + (set! (-> arg0 frame-interp 0) (/ (* (-> arg0 frame-num) arg2) f28-0)) + ) + ((< (- f30-0 f28-0) (-> arg0 frame-num)) + (set! (-> arg0 frame-interp 0) (/ (* (- f30-0 (-> arg0 frame-num)) arg2) f28-0)) + (when (and (= (-> arg0 frame-num) f30-0) (logtest? (-> arg0 command) (joint-control-command eight))) + (joint-channel-float-delete! arg0) + (return 0.0) + ) + ) + (else + (set! (-> arg0 frame-interp 0) arg2) + ) + ) + ) + (set! (-> arg0 frame-interp 1) (-> arg0 frame-interp 0)) + (-> arg0 frame-num) + ) + +;; definition for function num-func-interp1-play! +(defbehavior num-func-interp1-play! process ((arg0 joint-control-channel) (arg1 float) (arg2 float) (arg3 float)) + (let ((f30-0 (the float (+ (-> arg0 frame-group frames num-frames) -1))) + (f28-0 (* arg3 (-> arg0 frame-group speed))) + ) + (seek! (-> arg0 frame-num) f30-0 (* arg1 (* (-> arg0 frame-group speed) (-> self clock time-adjust-ratio)))) + (cond + ((< (-> arg0 frame-num) f28-0) + (set! (-> arg0 frame-interp 1) (/ (* (-> arg0 frame-num) arg2) f28-0)) + ) + ((< (- f30-0 f28-0) (-> arg0 frame-num)) + (set! (-> arg0 frame-interp 1) (/ (* (- f30-0 (-> arg0 frame-num)) arg2) f28-0)) + (when (and (= (-> arg0 frame-num) f30-0) (logtest? (-> arg0 command) (joint-control-command eight))) + (joint-channel-float-delete! arg0) + (return 0.0) + ) + ) + (else + (set! (-> arg0 frame-interp 1) arg2) + ) + ) + ) + (-> arg0 frame-num) + ) + +;; definition for function num-func-chan +(defbehavior num-func-chan process ((arg0 joint-control-channel) (arg1 float) (arg2 float) (arg3 float)) + (set! (-> arg0 frame-num) + (-> (the-as joint-control-channel (+ (the-as uint arg0) (* (- (the int arg1) (-> arg0 group-sub-index)) 64))) + frame-num + ) + ) + ) + +;; definition for function num-func-identity +(defbehavior num-func-identity process ((chan joint-control-channel) (arg1 float) (arg2 float) (arg3 float)) + (-> chan frame-num) + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/engine/process-drawable/process-focusable_REF.gc b/test/decompiler/reference/jak3/engine/process-drawable/process-focusable_REF.gc new file mode 100644 index 000000000..05b4d5d47 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/process-drawable/process-focusable_REF.gc @@ -0,0 +1,115 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type process-focusable +(deftype process-focusable (process-drawable) + ((root collide-shape :override) + (focus-status focus-status) + ) + (:methods + (process-focusable-method-20 (_type_) int) + (get-trans (_type_ int) vector) + (get-quat (_type_) quaternion) + (get-transv (_type_) vector) + (time-to-apex-or-ground (_type_ int) int) + (get-water-height (_type_) meters) + (get-notice-time (_type_) time-frame) + (get-inv-mass (_type_) float) + ) + ) + +;; definition for method 3 of type process-focusable +(defmethod inspect ((this process-focusable)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tfocus-status: ~D~%" (-> this focus-status)) + (label cfg-4) + this + ) + +;; definition for method 20 of type process-focusable +(defmethod process-focusable-method-20 ((this process-focusable)) + (let ((v0-0 0)) + (let ((mask (-> this mask))) + (if (logtest? (process-mask crate) mask) + (set! v0-0 (logior v0-0 2)) + ) + (if (logtest? (process-mask guard) mask) + (set! v0-0 (logior v0-0 4)) + ) + (if (logtest? (process-mask enemy) mask) + (set! v0-0 (logior v0-0 16)) + ) + ) + v0-0 + ) + ) + +;; definition for method 21 of type process-focusable +;; WARN: Return type mismatch structure vs vector. +(defmethod get-trans ((this process-focusable) (mode int)) + "Get the `trans` for this process." + (let ((cshape (-> this root))) + (the-as vector (cond + ((zero? mode) + (-> cshape trans) + ) + ((and (= mode 1) (type? cshape collide-shape-moving)) + (-> (the-as collide-shape-moving cshape) gspot-pos) + ) + ((and (or (= mode 2) (= mode 3) (= mode 10)) (type? cshape collide-shape)) + (-> (the-as collide-shape-moving cshape) root-prim prim-core) + ) + (else + (-> cshape trans) + ) + ) + ) + ) + ) + +;; definition for method 23 of type process-focusable +(defmethod get-transv ((this process-focusable)) + "Get the `transv` for this process." + (-> this root transv) + ) + +;; definition for method 22 of type process-focusable +(defmethod get-quat ((this process-focusable)) + "Get the quaternion for this process." + (-> this root quat) + ) + +;; definition for method 24 of type process-focusable +(defmethod time-to-apex-or-ground ((this process-focusable) (arg0 int)) + 0 + ) + +;; definition for method 25 of type process-focusable +;; WARN: Return type mismatch int vs meters. +(defmethod get-water-height ((this process-focusable)) + (the-as meters 0) + ) + +;; definition for method 27 of type process-focusable +(defmethod get-inv-mass ((this process-focusable)) + 0.0 + ) + +;; definition for method 26 of type process-focusable +;; WARN: Return type mismatch int vs time-frame. +(defmethod get-notice-time ((this process-focusable)) + (the-as time-frame 0) + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/engine/process-drawable/process-taskable-h_REF.gc b/test/decompiler/reference/jak3/engine/process-drawable/process-taskable-h_REF.gc new file mode 100644 index 000000000..8c6776adf --- /dev/null +++ b/test/decompiler/reference/jak3/engine/process-drawable/process-taskable-h_REF.gc @@ -0,0 +1,66 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type process-taskable +(deftype process-taskable (process-focusable) + "The parent class for NPCs that can be talked to." + ((flags process-taskable-flags) + (task game-task-control) + (ambient ambient-control :inline :offset 216) + (neck-joint-index int32) + (talk-message text-id) + (talk-distance meters) + (talk-height meters) + (last-talk time-frame) + (want-to-say time-frame) + (birth-time time-frame) + (slave handle) + ) + (:state-methods + hide + idle + (active game-task-event) + die + (play-game game-task-event) + ) + (:methods + (process-taskable-method-33 () none) + (process-taskable-method-34 () none) + (process-taskable-method-35 () none) + (process-taskable-method-36 () none) + (process-taskable-method-37 () none) + (process-taskable-method-38 () none) + (process-taskable-method-39 () none) + ) + ) + +;; definition for method 3 of type process-taskable +(defmethod inspect ((this process-taskable)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 this) + ) + (format #t "~2Tflags: ~D~%" (-> this flags)) + (format #t "~2Ttask: ~A~%" (-> this task)) + (format #t "~2Tambient: #~%" (-> this ambient)) + (format #t "~2Tneck-joint-index: ~D~%" (-> this neck-joint-index)) + (format #t "~2Ttalk-message: ~D~%" (-> this talk-message)) + (format #t "~2Ttalk-distance: (meters ~m)~%" (-> this talk-distance)) + (format #t "~2Ttalk-height: (meters ~m)~%" (-> this talk-height)) + (format #t "~2Tlast-talk: ~D~%" (-> this last-talk)) + (format #t "~2Twant-to-say: ~D~%" (-> this want-to-say)) + (format #t "~2Tbirth-time: ~D~%" (-> this birth-time)) + (format #t "~2Tslave: ~D~%" (-> this slave)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/engine/target/target-h_REF.gc b/test/decompiler/reference/jak3/engine/target/target-h_REF.gc new file mode 100644 index 000000000..7ba7ee67a --- /dev/null +++ b/test/decompiler/reference/jak3/engine/target/target-h_REF.gc @@ -0,0 +1,436 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type target +(deftype target (process-focusable) + ((control control-info :overlay-at root) + (skel2 joint-control) + (shadow-backup shadow-geo) + (target-flags target-flags :overlay-at state-flags) + (game game-info) + (neck joint-mod) + (head joint-mod) + (upper-body joint-mod) + (horns joint-mod) + (hair joint-mod 2) + (arm-ik joint-mod-ik 2) + (leg-ik joint-mod-ik 2) + (foot joint-mod 2) + (cloth basic) + (init-time time-frame) + (teleport-time time-frame) + (state-hook-time time-frame) + (state-hook (function none :behavior target)) + (cam-user-mode symbol) + (sidekick (pointer sidekick)) + (manipy (pointer manipy)) + (mirror (pointer process-drawable)) + (attack-info attack-info :inline) + (attack-info-rec attack-info :inline) + (attack-info-old attack-info 8 :inline) + (anim-seed uint64) + (alt-cam-pos vector :inline) + (current-level level) + (saved-pos transformq :inline) + (saved-owner handle) + (alt-neck-pos vector :inline) + (focus-search (array collide-shape)) + (handle-search (array handle)) + (excitement float) + (shock-effect-time time-frame) + (beard? symbol) + (spool-anim spool-anim) + (ambient-time time-frame) + (fp-hud handle) + (no-load-wait uint64) + (no-look-around-wait uint64) + (burn-proc handle) + (pre-joint-hook (function none :behavior target)) + (notify handle) + (death-resetter resetter-spec :inline) + (mode-cache basic) + (mode-param1 uint64) + (mode-param2 uint64) + (mode-param3 uint64) + (major-mode-exit-hook basic) + (major-mode-event-hook basic) + (sub-mode-exit-hook basic) + (ext-geo-control basic) + (pending-ext-geo int32) + (ext-geo int32) + (ext-anim-control basic) + (pending-ext-anim int32) + (ext-anim int32) + (tobot-state state) + (tobot? symbol) + (tobot-recorder basic) + (target-effect uint64) + (color-effect basic) + (color-effect-start-time time-frame) + (color-effect-duration time-frame) + (racer racer-info) + (tube tube-info) + (flut flut-info) + (board board-info) + (pilot pilot-info) + (gun gun-info) + (mech mech-info) + (turret turret-info) + (indax indax-info) + (ladder ladder-info) + (darkjak-interp float) + (darkjak-interp-old float) + (darkjak-giant-interp float) + (darkjak darkjak-info) + (lightjak-interp float) + (lightjak-interp-old float) + (lightjak lightjak-info) + (scarf-interp-targ float) + (scarf-interp float) + (scarf-interp-old float) + (goggles-interp-targ float) + (goggles-interp float) + (goggles-interp-old float) + (invisible-interp float) + (invisible-start-time time-frame) + (invisible-duration time-frame) + (invisible-shadow-dir-backup vector :inline) + ) + (:methods + (target-method-28 () none) + (target-method-29 () none) + ) + (:states + target-attack + target-attack-air + target-attack-uppercut + target-attack-uppercut-jump + target-blast-recover + target-board-clone-anim + target-board-duck-stance + target-board-falling + target-board-flip + target-board-get-off + target-board-get-on + target-board-grab + target-board-grenade + target-board-halfpipe + target-board-hit + target-board-hit-ground + target-board-hold + target-board-jump + target-board-jump-kick + target-board-ride-edge + target-board-stance + target-board-start + target-board-trickx + target-board-tricky + target-board-turn-around + target-board-turn-to + target-board-wall-kick + target-clone-anim + target-continue + target-credits + target-darkjak-bomb0 + target-darkjak-bomb1 + target-darkjak-get-off + target-darkjak-get-on + target-darkjak-running-attack + target-darkjak-smack + target-darkjak-smack-charge + target-death + target-double-jump + target-duck-high-jump + target-duck-high-jump-jump + target-duck-stance + target-duck-walk + target-eco-powerup + target-edge-grab + target-edge-grab-jump + target-edge-grab-off + target-falling + target-float + target-flop + target-flop-hit-ground + target-flut-air-attack + target-flut-air-attack-hit-ground + target-flut-clone-anim + target-flut-death + target-flut-double-jump + target-flut-eject + target-flut-falling + target-flut-get-off + target-flut-get-off-jump + target-flut-get-on + target-flut-grab + target-flut-hit + target-flut-hit-ground + target-flut-jump + target-flut-kanga-catch + target-flut-running-attack + target-flut-stance + target-flut-start + target-flut-walk + target-grab + target-grab-ride + target-gun-stance + target-gun-walk + target-hide + target-high-jump + target-hit + target-hit-ground + target-hit-ground-hard + target-indax-attack + target-indax-attack-air + target-indax-death + target-indax-double-jump + target-indax-falling + target-indax-get-off + target-indax-grab + target-indax-hang + target-indax-hit + target-indax-hit-ground + target-indax-jump + target-indax-running-attack + target-indax-stance + target-indax-start + target-indax-trip + target-indax-walk + target-invisible-get-on + target-jump + target-jump-forward + target-ladder + target-launch + target-launch-dir + target-lightjak-freeze + target-lightjak-get-off + target-lightjak-get-on + target-lightjak-regen + target-lightjak-shield + target-lightjak-swoop + target-lightjak-swoop-again + target-lightjak-swoop-falling + target-load-wait + target-look-around + target-mech-carry-drag + target-mech-carry-drop + target-mech-carry-falling + target-mech-carry-hit-ground + target-mech-carry-jump + target-mech-carry-pickup + target-mech-carry-stance + target-mech-carry-throw + target-mech-carry-walk + target-mech-clone-anim + target-mech-death + target-mech-falling + target-mech-get-off + target-mech-get-on + target-mech-get-up + target-mech-grab + target-mech-hit + target-mech-hit-ground + target-mech-jump + target-mech-punch + target-mech-shield + target-mech-stance + target-mech-start + target-mech-walk + target-pilot-clone-anim + target-pilot-daxter-perch + target-pilot-death + target-pilot-edge-grab + target-pilot-get-off + target-pilot-get-on + target-pilot-grab + target-pilot-hit + target-pilot-impact + target-pilot-stance + target-pilot-start + target-play-anim + target-pole-cycle + target-pole-flip-forward + target-pole-flip-forward-jump + target-pole-flip-up + target-pole-flip-up-jump + target-powerjak-get-on + target-roll + target-roll-flip + target-running-attack + target-slide-down + target-slide-down-to-ground + target-stance + target-stance-ambient + target-stance-look-around + target-swim + target-swim-jump + target-title + target-tube + target-turn-around + target-wade-stance + target-wade-walk + target-walk + target-warp-in + target-warp-out + ) + ) + +;; definition for method 3 of type target +(defmethod inspect ((this target)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 this) + ) + (format #t "~2Tcontrol: ~A~%" (-> this control)) + (format #t "~2Tskel2: ~A~%" (-> this skel2)) + (format #t "~2Tshadow-backup: ~A~%" (-> this shadow-backup)) + (format #t "~2Ttarget-flags: ~D~%" (-> this target-flags)) + (format #t "~2Tgame: ~A~%" (-> this game)) + (format #t "~2Tneck: ~A~%" (-> this neck)) + (format #t "~2Thead: ~A~%" (-> this head)) + (format #t "~2Tupper-body: ~A~%" (-> this upper-body)) + (format #t "~2Thorns: ~A~%" (-> this horns)) + (format #t "~2Thair[2] @ #x~X~%" (-> this hair)) + (format #t "~2Tarm-ik[2] @ #x~X~%" (-> this arm-ik)) + (format #t "~2Tleg-ik[2] @ #x~X~%" (-> this leg-ik)) + (format #t "~2Tfoot[2] @ #x~X~%" (-> this foot)) + (format #t "~2Tcloth: ~A~%" (-> this cloth)) + (format #t "~2Tinit-time: ~D~%" (-> this init-time)) + (format #t "~2Tteleport-time: ~D~%" (-> this teleport-time)) + (format #t "~2Tstate-hook-time: ~D~%" (-> this state-hook-time)) + (format #t "~2Tstate-hook: ~A~%" (-> this state-hook)) + (format #t "~2Tcam-user-mode: ~A~%" (-> this cam-user-mode)) + (format #t "~2Tsidekick: #x~X~%" (-> this sidekick)) + (format #t "~2Tmanipy: #x~X~%" (-> this manipy)) + (format #t "~2Tmirror: #x~X~%" (-> this mirror)) + (format #t "~2Tattack-info: #~%" (-> this attack-info)) + (format #t "~2Tattack-info-rec: #~%" (-> this attack-info-rec)) + (format #t "~2Tattack-info-old[8] @ #x~X~%" (-> this attack-info-old)) + (format #t "~2Tanim-seed: ~D~%" (-> this anim-seed)) + (format #t "~2Talt-cam-pos: ~`vector`P~%" (-> this alt-cam-pos)) + (format #t "~2Tcurrent-level: ~A~%" (-> this current-level)) + (format #t "~2Tsaved-pos: #~%" (-> this saved-pos)) + (format #t "~2Tsaved-owner: ~D~%" (-> this saved-owner)) + (format #t "~2Talt-neck-pos: ~`vector`P~%" (-> this alt-neck-pos)) + (format #t "~2Tfocus-search: ~A~%" (-> this focus-search)) + (format #t "~2Thandle-search: ~A~%" (-> this handle-search)) + (format #t "~2Texcitement: ~f~%" (-> this excitement)) + (format #t "~2Tshock-effect-time: ~D~%" (-> this shock-effect-time)) + (format #t "~2Tbeard?: ~A~%" (-> this beard?)) + (format #t "~2Tspool-anim: ~A~%" (-> this spool-anim)) + (format #t "~2Tambient-time: ~D~%" (-> this ambient-time)) + (format #t "~2Tfp-hud: ~D~%" (-> this fp-hud)) + (format #t "~2Tno-load-wait: ~D~%" (-> this no-load-wait)) + (format #t "~2Tno-look-around-wait: ~D~%" (-> this no-look-around-wait)) + (format #t "~2Tburn-proc: ~D~%" (-> this burn-proc)) + (format #t "~2Tpre-joint-hook: ~A~%" (-> this pre-joint-hook)) + (format #t "~2Tnotify: ~D~%" (-> this notify)) + (format #t "~2Tdeath-resetter: #~%" (-> this death-resetter)) + (format #t "~2Tmode-cache: ~A~%" (-> this mode-cache)) + (format #t "~2Tmode-param1: ~D~%" (-> this mode-param1)) + (format #t "~2Tmode-param2: ~A~%" (-> this mode-param2)) + (format #t "~2Tmode-param3: ~A~%" (-> this mode-param3)) + (format #t "~2Tmajor-mode-exit-hook: ~A~%" (-> this major-mode-exit-hook)) + (format #t "~2Tmajor-mode-event-hook: ~A~%" (-> this major-mode-event-hook)) + (format #t "~2Tsub-mode-exit-hook: ~A~%" (-> this sub-mode-exit-hook)) + (format #t "~2Text-geo-control: ~A~%" (-> this ext-geo-control)) + (format #t "~2Tpending-ext-geo: ~D~%" (-> this pending-ext-geo)) + (format #t "~2Text-geo: ~D~%" (-> this ext-geo)) + (format #t "~2Text-anim-control: ~A~%" (-> this ext-anim-control)) + (format #t "~2Tpending-ext-anim: ~D~%" (-> this pending-ext-anim)) + (format #t "~2Text-anim: ~D~%" (-> this ext-anim)) + (format #t "~2Ttobot-state: ~A~%" (-> this tobot-state)) + (format #t "~2Ttobot?: ~A~%" (-> this tobot?)) + (format #t "~2Ttobot-recorder: ~A~%" (-> this tobot-recorder)) + (format #t "~2Ttarget-effect: ~D~%" (-> this target-effect)) + (format #t "~2Tcolor-effect: ~A~%" (-> this color-effect)) + (format #t "~2Tcolor-effect-start-time: ~D~%" (-> this color-effect-start-time)) + (format #t "~2Tcolor-effect-duration: ~D~%" (-> this color-effect-duration)) + (format #t "~2Tracer: ~A~%" (-> this racer)) + (format #t "~2Ttube: ~A~%" (-> this tube)) + (format #t "~2Tflut: ~A~%" (-> this flut)) + (format #t "~2Tboard: ~A~%" (-> this board)) + (format #t "~2Tpilot: ~A~%" (-> this pilot)) + (format #t "~2Tgun: ~A~%" (-> this gun)) + (format #t "~2Tmech: ~A~%" (-> this mech)) + (format #t "~2Tturret: ~A~%" (-> this turret)) + (format #t "~2Tindax: ~A~%" (-> this indax)) + (format #t "~2Tladder: ~A~%" (-> this ladder)) + (format #t "~2Tdarkjak-interp: ~f~%" (-> this darkjak-interp)) + (format #t "~2Tdarkjak-interp-old: ~f~%" (-> this darkjak-interp-old)) + (format #t "~2Tdarkjak-giant-interp: ~f~%" (-> this darkjak-giant-interp)) + (format #t "~2Tdarkjak: ~A~%" (-> this darkjak)) + (format #t "~2Tlightjak-interp: ~f~%" (-> this lightjak-interp)) + (format #t "~2Tlightjak-interp-old: ~f~%" (-> this lightjak-interp-old)) + (format #t "~2Tlightjak: ~A~%" (-> this lightjak)) + (format #t "~2Tscarf-interp-targ: ~f~%" (-> this scarf-interp-targ)) + (format #t "~2Tscarf-interp: ~f~%" (-> this scarf-interp)) + (format #t "~2Tscarf-interp-old: ~f~%" (-> this scarf-interp-old)) + (format #t "~2Tgoggles-interp-targ: ~f~%" (-> this goggles-interp-targ)) + (format #t "~2Tgoggles-interp: ~f~%" (-> this goggles-interp)) + (format #t "~2Tgoggles-interp-old: ~f~%" (-> this goggles-interp-old)) + (format #t "~2Tinvisible-interp: ~f~%" (-> this invisible-interp)) + (format #t "~2Tinvisible-start-time: ~D~%" (-> this invisible-start-time)) + (format #t "~2Tinvisible-duration: ~D~%" (-> this invisible-duration)) + (format #t "~2Tinvisible-shadow-dir-backup: #~%" (-> this invisible-shadow-dir-backup)) + (label cfg-4) + this + ) + +;; definition (perm) for symbol *target*, type target +(define-perm *target* target #f) + +;; definition of type sidekick +(deftype sidekick (process-drawable) + ((control control-info :overlay-at root) + (anim-seed uint64 :offset 208) + (shadow-in-movie? symbol) + (special-anim-time time-frame) + (special-anim-interp float) + (special-anim-frame float) + (offset transformq :inline) + (mirror (pointer process-drawable)) + (ear joint-mod 2) + (flap joint-mod 2) + ) + (:states + sidekick-clone + ) + ) + +;; definition for method 3 of type sidekick +(defmethod inspect ((this sidekick)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tcontrol: ~A~%" (-> this control)) + (format #t "~2Tstate-time: ~D~%" (-> this state-time)) + (format #t "~2Tanim-seed: ~D~%" (-> this anim-seed)) + (format #t "~2Tshadow-in-movie?: ~A~%" (-> this shadow-in-movie?)) + (format #t "~2Tspecial-anim-time: ~D~%" (-> this special-anim-time)) + (format #t "~2Tspecial-anim-interp: ~f~%" (-> this special-anim-interp)) + (format #t "~2Tspecial-anim-frame: ~f~%" (-> this special-anim-frame)) + (format #t "~2Toffset: #~%" (-> this offset)) + (format #t "~2Tmirror: #x~X~%" (-> this mirror)) + (format #t "~2Tear[2] @ #x~X~%" (-> this ear)) + (format #t "~2Tflap[2] @ #x~X~%" (-> this flap)) + (label cfg-4) + this + ) + +;; definition (perm) for symbol *sidekick*, type sidekick +(define-perm *sidekick* sidekick #f) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/engine/util/sync-info-h_REF.gc b/test/decompiler/reference/jak3/engine/util/sync-info-h_REF.gc new file mode 100644 index 000000000..3392d6730 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/util/sync-info-h_REF.gc @@ -0,0 +1,321 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type sync-info-params +(deftype sync-info-params (structure) + "Parameters used to set up a [[sync-info]]." + ((sync-type symbol) + (sync-flags sync-flags) + (entity basic) + (period uint32) + (percent float) + (ease-in float) + (ease-out float) + (pause-in float) + (pause-out float) + ) + ) + +;; definition for method 3 of type sync-info-params +(defmethod inspect ((this sync-info-params)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'sync-info-params) + (format #t "~1Tsync-type: ~A~%" (-> this sync-type)) + (format #t "~1Tsync-flags: ~D~%" (-> this sync-flags)) + (format #t "~1Tentity: ~A~%" (-> this entity)) + (format #t "~1Tperiod: ~D~%" (-> this period)) + (format #t "~1Tpercent: ~f~%" (-> this percent)) + (format #t "~1Tease-in: ~f~%" (-> this ease-in)) + (format #t "~1Tease-out: ~f~%" (-> this ease-out)) + (format #t "~1Tpause-in: ~f~%" (-> this pause-in)) + (format #t "~1Tpause-out: ~f~%" (-> this pause-out)) + (label cfg-4) + this + ) + +;; definition of type sync-info +(deftype sync-info (structure) + ((sync-flags sync-flags) + (offset float) + (period uint32) + ) + (:methods + (sync-info-method-9 () none) + (sync-info-method-10 () none) + (sync-info-method-11 () none) + (sync-info-method-12 () none) + (sync-info-method-13 () none) + (sync-info-method-14 () none) + (sync-info-method-15 () none) + ) + ) + +;; definition for method 3 of type sync-info +(defmethod inspect ((this sync-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'sync-info) + (format #t "~1Tsync-flags: ~D~%" (-> this sync-flags)) + (format #t "~1Toffset: ~f~%" (-> this offset)) + (format #t "~1Tperiod: ~D~%" (-> this period)) + (label cfg-4) + this + ) + +;; definition of type sync-linear +(deftype sync-linear (sync-info) + () + :pack-me + ) + +;; definition for method 3 of type sync-linear +(defmethod inspect ((this sync-linear)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'sync-linear) + (format #t "~1Tsync-flags: ~D~%" (-> this sync-flags)) + (format #t "~1Toffset: ~f~%" (-> this offset)) + (format #t "~1Tperiod: ~D~%" (-> this period)) + (label cfg-4) + this + ) + +;; definition of type sync-eased +(deftype sync-eased (sync-info) + ((tlo float) + (thi float) + (ylo float) + (m2 float) + (yend float) + (pause-in float) + (pause-out float) + ) + :pack-me + ) + +;; definition for method 3 of type sync-eased +(defmethod inspect ((this sync-eased)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'sync-eased) + (format #t "~1Tsync-flags: ~D~%" (-> this sync-flags)) + (format #t "~1Toffset: ~f~%" (-> this offset)) + (format #t "~1Tperiod: ~D~%" (-> this period)) + (format #t "~1Ttlo: ~f~%" (-> this tlo)) + (format #t "~1Tthi: ~f~%" (-> this thi)) + (format #t "~1Tylo: ~f~%" (-> this ylo)) + (format #t "~1Tm2: ~f~%" (-> this m2)) + (format #t "~1Tyend: ~f~%" (-> this yend)) + (format #t "~1Tpause-in: ~f~%" (-> this pause-in)) + (format #t "~1Tpause-out: ~f~%" (-> this pause-out)) + (label cfg-4) + this + ) + +;; definition of type sync-paused +(deftype sync-paused (sync-info) + ((pause-in float) + (pause-out float) + ) + ) + +;; definition for method 3 of type sync-paused +(defmethod inspect ((this sync-paused)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'sync-paused) + (format #t "~1Tsync-flags: ~D~%" (-> this sync-flags)) + (format #t "~1Toffset: ~f~%" (-> this offset)) + (format #t "~1Tperiod: ~D~%" (-> this period)) + (format #t "~1Tpause-in: ~f~%" (-> this pause-in)) + (format #t "~1Tpause-out: ~f~%" (-> this pause-out)) + (label cfg-4) + this + ) + +;; definition of type delayed-rand-float +(deftype delayed-rand-float (structure) + ((min-time int32) + (max-time int32) + (max-val float) + (timer int32) + (start-time time-frame) + (value float) + ) + :pack-me + (:methods + (delayed-rand-float-method-9 () none) + (delayed-rand-float-method-10 () none) + (delayed-rand-float-method-11 () none) + (delayed-rand-float-method-12 () none) + ) + ) + +;; definition for method 3 of type delayed-rand-float +(defmethod inspect ((this delayed-rand-float)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'delayed-rand-float) + (format #t "~1Tmin-time: ~D~%" (-> this min-time)) + (format #t "~1Tmax-time: ~D~%" (-> this max-time)) + (format #t "~1Tmax-val: ~f~%" (-> this max-val)) + (format #t "~1Ttimer: ~D~%" (-> this timer)) + (format #t "~1Tstart-time: ~D~%" (-> this start-time)) + (format #t "~1Tvalue: ~f~%" (-> this value)) + (label cfg-4) + this + ) + +;; definition of type oscillating-float +(deftype oscillating-float (structure) + ((value float) + (target float) + (vel float) + (max-vel float) + (damping float) + (accel float) + ) + :allow-misaligned + (:methods + (oscillating-float-method-9 () none) + (oscillating-float-method-10 () none) + ) + ) + +;; definition for method 3 of type oscillating-float +(defmethod inspect ((this oscillating-float)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'oscillating-float) + (format #t "~1Tvalue: ~f~%" (-> this value)) + (format #t "~1Ttarget: ~f~%" (-> this target)) + (format #t "~1Tvel: ~f~%" (-> this vel)) + (format #t "~1Tmax-vel: ~f~%" (-> this max-vel)) + (format #t "~1Tdamping: ~f~%" (-> this damping)) + (format #t "~1Taccel: ~f~%" (-> this accel)) + (label cfg-4) + this + ) + +;; definition of type bouncing-float +(deftype bouncing-float (structure) + ((osc oscillating-float :inline) + (max-value float) + (min-value float) + (elasticity float) + (state int32) + ) + :allow-misaligned + (:methods + (bouncing-float-method-9 () none) + (bouncing-float-method-10 () none) + (bouncing-float-method-11 () none) + (bouncing-float-method-12 () none) + ) + ) + +;; definition for method 3 of type bouncing-float +(defmethod inspect ((this bouncing-float)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'bouncing-float) + (format #t "~1Tosc: #~%" (-> this osc)) + (format #t "~1Tmax-value: ~f~%" (-> this max-value)) + (format #t "~1Tmin-value: ~f~%" (-> this min-value)) + (format #t "~1Telasticity: ~f~%" (-> this elasticity)) + (format #t "~1Tstate: ~D~%" (-> this state)) + (label cfg-4) + this + ) + +;; definition of type delayed-rand-vector +(deftype delayed-rand-vector (structure) + ((min-time int32) + (max-time int32) + (xz-max float) + (y-max float) + (timer int32) + (start-time time-frame) + (value vector :inline) + ) + (:methods + (delayed-rand-vector-method-9 () none) + (delayed-rand-vector-method-10 () none) + (delayed-rand-vector-method-11 () none) + (delayed-rand-vector-method-12 () none) + ) + ) + +;; definition for method 3 of type delayed-rand-vector +(defmethod inspect ((this delayed-rand-vector)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'delayed-rand-vector) + (format #t "~1Tmin-time: ~D~%" (-> this min-time)) + (format #t "~1Tmax-time: ~D~%" (-> this max-time)) + (format #t "~1Txz-max: ~f~%" (-> this xz-max)) + (format #t "~1Ty-max: ~f~%" (-> this y-max)) + (format #t "~1Ttimer: ~D~%" (-> this timer)) + (format #t "~1Tstart-time: ~D~%" (-> this start-time)) + (format #t "~1Tvalue: #~%" (-> this value)) + (label cfg-4) + this + ) + +;; definition of type oscillating-vector +(deftype oscillating-vector (structure) + ((value vector :inline) + (target vector :inline) + (vel vector :inline) + (max-vel float) + (damping float) + (accel float) + ) + (:methods + (oscillating-vector-method-9 () none) + (oscillating-vector-method-10 () none) + ) + ) + +;; definition for method 3 of type oscillating-vector +(defmethod inspect ((this oscillating-vector)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'oscillating-vector) + (format #t "~1Tvalue: #~%" (-> this value)) + (format #t "~1Ttarget: #~%" (-> this target)) + (format #t "~1Tvel: #~%" (-> this vel)) + (format #t "~1Tmax-vel: ~f~%" (-> this max-vel)) + (format #t "~1Tdamping: ~f~%" (-> this damping)) + (format #t "~1Taccel: ~f~%" (-> this accel)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +0 + + + +