From 1cccfbbf7880615b1090b3041d4bf3708d7bd7e1 Mon Sep 17 00:00:00 2001 From: water111 <48171810+water111@users.noreply.github.com> Date: Wed, 31 Jan 2024 19:05:12 -0500 Subject: [PATCH] [jak3] More headers! (#3351) Decomp aligner-h, joint-h, prim-h, debug-h, game-h, penetrate-h, bones-h, foreground-h, scene-h, script-h. Also, has a little bit of the joint-mod-h file, but it's not finished yet. --- decompiler/config/jak3/all-types.gc | 1087 +++++++++-------- .../config/jak3/ntsc_v1/type_casts.jsonc | 9 +- .../config/jak3/ntsc_v1/var_names.jsonc | 3 + goal_src/jak3/engine/anim/aligner-h.gc | 44 + goal_src/jak3/engine/anim/joint-h.gc | 142 +++ goal_src/jak3/engine/anim/mspace-h.gc | 2 +- .../jak3/engine/collide/collide-shape-h.gc | 49 +- goal_src/jak3/engine/common-obs/prim-h.gc | 147 +++ goal_src/jak3/engine/debug/debug-h.gc | 69 ++ goal_src/jak3/engine/game/game-h.gc | 373 ++++++ goal_src/jak3/engine/game/penetrate-h.gc | 308 ++++- .../jak3/engine/gfx/foreground/bones-h.gc | 97 ++ .../engine/gfx/foreground/foreground-h.gc | 149 +++ goal_src/jak3/engine/gfx/vu1-user-h.gc | 2 +- goal_src/jak3/engine/scene/scene-h.gc | 110 ++ goal_src/jak3/engine/util/script-h.gc | 54 + .../reference/jak3/decompiler-macros.gc | 2 +- .../jak3/engine/anim/aligner-h_REF.gc | 61 + .../reference/jak3/engine/anim/joint-h_REF.gc | 336 +++++ .../jak3/engine/anim/mspace-h_REF.gc | 6 +- .../engine/collide/collide-shape-h_REF.gc | 53 +- .../jak3/engine/common_objs/prim-h_REF.gc | 236 ++++ .../jak3/engine/debug/debug-h_REF.gc | 145 +++ .../reference/jak3/engine/game/game-h_REF.gc | 495 ++++++++ .../jak3/engine/game/penetrate-h_REF.gc | 271 ++++ .../jak3/engine/gfx/foreground/bones-h_REF.gc | 213 ++++ .../engine/gfx/foreground/foreground-h_REF.gc | 344 ++++++ .../reference/jak3/engine/math/matrix_REF.gc | 4 +- .../jak3/engine/math/transformq-h_REF.gc | 4 +- .../jak3/engine/scene/scene-h_REF.gc | 229 ++++ .../jak3/engine/util/script-h_REF.gc | 101 ++ test/offline/config/jak3/config.jsonc | 4 +- 32 files changed, 4619 insertions(+), 530 deletions(-) create mode 100644 test/decompiler/reference/jak3/engine/anim/aligner-h_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/anim/joint-h_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/common_objs/prim-h_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/debug/debug-h_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/game/game-h_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/game/penetrate-h_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/gfx/foreground/bones-h_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/gfx/foreground/foreground-h_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/scene/scene-h_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/util/script-h_REF.gc diff --git a/decompiler/config/jak3/all-types.gc b/decompiler/config/jak3/all-types.gc index 57d8493cf5..9addee2b2f 100644 --- a/decompiler/config/jak3/all-types.gc +++ b/decompiler/config/jak3/all-types.gc @@ -2008,7 +2008,7 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (deftype transformq (transform) - ((quat quaternion :inline :offset 16) + ((quat quaternion :inline :offset 16 :score 1) ) :method-count-assert 9 :size-assert #x30 @@ -3967,7 +3967,7 @@ (bucket563 563) (bucket564 564) (bucket565 565) - (bucket566 566) + (bucket566 566) ;; default for prim (bucket567 567) (bucket568 568) (bucket569 569) @@ -11707,7 +11707,7 @@ ) (deftype cspace-array (inline-array-class) - ((data cspace :dynamic :offset-assert 16) ;; guessed by decompiler + ((data cspace :dynamic :inline :offset-assert 16) ;; guessed by decompiler ) :method-count-assert 14 :size-assert #x10 @@ -15319,21 +15319,23 @@ ;; prim-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +(define-extern process-drawable-art-error (state string process-drawable)) + (deftype prim-vertex (structure) + "Vertex for the prim renderer. These vertices are generated by + some special effect code, then sent to the prim renderer to be drawn." ((stq vector :inline :offset-assert 0) - (nokick uint32 :offset-assert 8) - (col uint32 :offset-assert 12) + (nokick uint32 :offset-assert 8 :overlay-at (-> stq z)) + (col rgba :offset-assert 12 :overlay-at (-> stq w) :score 1) (pos vector :inline :offset-assert 16) ) :method-count-assert 9 :size-assert #x20 :flag-assert #x900000020 ) -|# -#| (deftype prim-base (basic) + "Base class for prim-strip." () :method-count-assert 10 :size-assert #x4 @@ -15342,52 +15344,62 @@ (prim-base-method-9 () none) ;; 9 ) ) -|# -#| +(defenum prim-flags + :type uint32 + :bitfield #t + (pf0 0) ;; set by default + (pf1 1) ;; set by default + (pf2 2) + (pf3 3) + (pf4 4) + (no-texture-name 5) ;; only has the ID. + ) + (deftype prim-strip (prim-base) - ((flags uint32 :offset-assert 4) + "A collection of vertices, all with the same texture and draw settings. + These are owned by the thing submitting to prim, not the prim renderer itself." + ((flags prim-flags :offset-assert 4) (tex-name basic :offset-assert 8) (num-verts uint16 :offset-assert 12) (allocated-num-verts uint16 :offset-assert 14) - (tex-id uint32 :offset-assert 16) - (adnops UNKNOWN 2 :offset-assert 32) - (data0 uint64 :offset-assert 32) - (reg0 uint64 :offset-assert 40) - (data1 uint64 :offset-assert 48) - (reg1 uint64 :offset-assert 56) - (clamp uint64 :offset-assert 64) - (alpha uint64 :offset-assert 72) - (bucket int32 :offset-assert 80) + (tex-id texture-id :offset-assert 16) + (adnops gs-adcmd 2 :inline :offset-assert 32) + (data0 uint64 :offset 32) + (reg0 uint64 :offset 40) + (data1 uint64 :offset 48) + (reg1 uint64 :offset 56) + (clamp gs-clamp :offset-assert 64) + (alpha gs-alpha :offset-assert 72) + (bucket bucket-id :offset-assert 80) (sink uint32 :offset-assert 84) (level basic :offset-assert 88) (texture-index uint32 :offset-assert 92) - (data UNKNOWN :dynamic :offset-assert 96) + (data prim-vertex :inline :dynamic :offset-assert 96) ) :method-count-assert 11 :size-assert #x60 :flag-assert #xb00000060 (:methods + (new "Allocate a new prim-strip and room for vertices. The texture can be specified by name or ID." + (symbol type int texture-id string) _type_) (prim-strip-method-10 () none) ;; 10 ) ) -|# -#| (deftype prim-sink (structure) ((vertex-count uint8 :offset-assert 0) (control-count uint8 :offset-assert 1) ) + :allow-misaligned :method-count-assert 9 :size-assert #x2 :flag-assert #x900000002 ) -|# -#| (deftype prim-work (structure) - ((vertex-tmpl UNKNOWN 3 :offset-assert 0) - (control-tmpl UNKNOWN 2 :offset-assert 48) + ((vertex-tmpl dma-packet 3 :inline :offset-assert 0) + (control-tmpl dma-packet 2 :inline :offset-assert 48) (giftag generic-gif-tag :inline :offset-assert 80) (call-scissor dma-packet :inline :offset-assert 96) (call-noclip dma-packet :inline :offset-assert 112) @@ -15396,7 +15408,7 @@ (in-verts int32 :offset-assert 224) (num-verts int32 :offset-assert 228) (vert-ptr prim-vertex :offset-assert 232) - (sinks UNKNOWN 68 :offset-assert 236) + (sinks prim-sink 68 :inline :offset-assert 236) ) :method-count-assert 10 :size-assert #x52c @@ -15405,7 +15417,7 @@ (prim-work-method-9 () none) ;; 9 ) ) -|# + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -16524,7 +16536,37 @@ ;; joint-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +(declare-type joint-control basic) + +(defenum joint-control-command + :type uint64 + (push 1) + (blend 2) + (push1 19) + (stack 36) + (float 42) + (stack1 52) + ) + +(defenum joint-control-status + :type uint16 + :bitfield #t + + (sync-math 0) ;; 1 + (spooling 1) ;; 2 + (spooling-not-last-block 2) ;; 4 + (blend-shape 3) ;; 8 + (math-when-off-screen 4) ;; 16 + (valid-spooled-frame 5) ;; 32 + (blend-shape-valid 6) ;; 64 + (eye-anim-valid 7) ;; 128 + (eye-anim 8) ;; 256 + (force-math 9) + (no-joint-callbacks 10) + ) + +(declare-type effect-control basic) + (deftype joint-control-channel (structure) ((parent joint-control :offset-assert 0) ;; guessed by decompiler (frame-group art-joint-anim :offset-assert 4) ;; guessed by decompiler @@ -16532,11 +16574,9 @@ (dist meters :offset-assert 12) (num-func (function joint-control-channel float float float float) :offset-assert 16) ;; guessed by decompiler (param float 3 :offset-assert 20) ;; guessed by decompiler - (UNKNOWN UNKNOWN :offset-assert -1) ;; field could not be read. (frame-interp float 2 :offset-assert 32) ;; guessed by decompiler - (UNKNOWN UNKNOWN :offset-assert -1) ;; field could not be read. (inspector-amount uint8 :offset-assert 40) - (command uint64 :offset-assert 48) ;; joint-control-command + (command joint-control-command :offset-assert 48) ;; joint-control-command (group-sub-index int8 :offset-assert 56) (group-size int8 :offset-assert 57) (eval-time uint32 :offset-assert 60) @@ -16545,9 +16585,7 @@ :size-assert #x40 :flag-assert #x900000040 ) -|# -#| (deftype top-anim-joint-control (basic) ((process (pointer process-drawable) :offset-assert 4) ;; guessed by decompiler (interp-select uint64 2 :offset-assert 8) ;; guessed by decompiler @@ -16565,9 +16603,9 @@ (frame-start float :offset-assert 68) (frame-post-blend float :offset-assert 72) (frame-post-end float :offset-assert 76) - (frame-push-time uint64 :offset-assert 80) ;; time-frame + (frame-push-time time-frame :offset-assert 80) ;; (frame-post-put-away basic :offset-assert 88) - (update-time uint64 :offset-assert 96) ;; time-frame + (update-time time-frame :offset-assert 96) ;; time-frame ) :method-count-assert 13 :size-assert #x68 @@ -16580,14 +16618,12 @@ (top-anim-joint-control-method-12 () none) ;; 12 ;; (push-anim-to-targ (_type_ art-joint-anim float int int float float symbol) none) ) ) -|# -#| (deftype joint-control (basic) ((status joint-control-status :offset-assert 4) (allocated-length uint8 :offset-assert 6) (active-channels uint8 :offset-assert 7) - (root-channel (inline-array joint-control-channel) :offset-assert 16) ;; guessed by decompiler + (root-channel (inline-array joint-control-channel) :offset 16) ;; guessed by decompiler (blend-index uint8 :offset-assert 20) (active-frame-interp uint8 :offset-assert 21) (float-channels uint8 :offset-assert 22) @@ -16596,11 +16632,11 @@ (postbind-function (function draw-control cspace-array joint-control none) :offset-assert 32) ;; guessed by decompiler (effect effect-control :offset-assert 36) ;; guessed by decompiler (interp-select int64 2 :offset-assert 40) ;; guessed by decompiler - (UNKNOWN UNKNOWN :offset-assert -1) ;; field could not be read. + ;(UNKNOWN UNKNOWN :offset-assert -1) ;; field could not be read. (top-anim top-anim-joint-control :offset-assert 56) ;; guessed by decompiler (override (array float) :offset-assert 60) ;; guessed by decompiler (channel joint-control-channel :dynamic :offset-assert 64) ;; guessed by decompiler - (UNKNOWN UNKNOWN :offset-assert -1) ;; field could not be read. + ;(UNKNOWN UNKNOWN :offset-assert -1) ;; field could not be read. ) :method-count-assert 13 :size-assert #x40 @@ -16614,20 +16650,16 @@ (joint-control-method-12 () none) ;; 12 ) ) -|# -#| (deftype matrix-stack (structure) ((top matrix :offset-assert 0) - (data matrix 24 :offset-assert 16) ;; guessed by decompiler + (data matrix 24 :inline :offset-assert 16) ;; guessed by decompiler ) :method-count-assert 9 :size-assert #x610 :flag-assert #x900000610 ) -|# -#| (deftype channel-upload-info (structure) ((fixed joint-anim-compressed-fixed :offset-assert 0) (fixed-qwc int32 :offset-assert 4) @@ -16636,69 +16668,83 @@ (amount float :offset-assert 16) (interp float :offset-assert 20) ) + :pack-me :method-count-assert 9 :size-assert #x18 :flag-assert #x900000018 ) -|# -#| (deftype joint-work (structure) ((temp-mtx matrix :inline :offset-assert 0) (joint-stack matrix-stack :inline :offset-assert 64) (fix-jmp-table (function none) 16 :offset-assert 1616) ;; guessed by decompiler (frm-jmp-table (function none) 16 :offset-assert 1680) ;; guessed by decompiler (pair-jmp-table (function none) 16 :offset-assert 1744) ;; guessed by decompiler - (uploads channel-upload-info 24 :offset-assert 1808) ;; guessed by decompiler + (uploads channel-upload-info 24 :inline :offset-assert 1808) ;; guessed by decompiler (num-uploads int32 :offset-assert 2384) - (mtx-acc matrix 2 :offset-assert 2400) ;; guessed by decompiler - (tq-acc transformq 100 :offset-assert 2528) ;; guessed by decompiler + (mtx-acc matrix 2 :inline :offset-assert 2400) ;; guessed by decompiler + (tq-acc transformq 100 :inline :offset-assert 2528) ;; guessed by decompiler (jacp-hdr joint-anim-compressed-hdr :inline :offset-assert 7328) (fixed-data joint-anim-compressed-fixed :inline :offset-assert 7392) - (frame-data joint-anim-compressed-frame 2 :offset-assert 9600) ;; guessed by decompiler - (flatten-array float 576 :offset-assert 2400) ;; guessed by decompiler - (flattened vector 24 :offset-assert 2400) ;; guessed by decompiler + (frame-data joint-anim-compressed-frame 2 :inline :offset-assert 9600) ;; guessed by decompiler + (flatten-array float 576 :offset 2400) ;; guessed by decompiler + (flattened vector 24 :inline :offset 2400) ;; guessed by decompiler ) :method-count-assert 9 :size-assert #x3640 :flag-assert #x900003640 ) -|# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; bones-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +(defenum bone-calc-flags + :type uint16 + :bitfield #t + (write-ripple-data 0) + (no-cam-rot 1) + (bncfl02 2) + (bncfl03 3) + (bncfl04 4) + (bncfl05 5) + (bncfl06 6) + (bncfl07 7) + (bncfl08 8) + (bncfl09 9) + (bncfl10 10) + (bncfl11 11) + (bncfl12 12) + (bncfl13 13) + (bncfl14 14) + (bncfl15 15) + ) + (deftype bone-buffer (structure) - ((joint matrix 16 :offset-assert 0) ;; guessed by decompiler - (bone bone 16 :offset-assert 1024) ;; guessed by decompiler - (output pris-mtx 16 :offset-assert 2304) ;; guessed by decompiler + ((joint matrix 16 :inline :offset-assert 0) ;; guessed by decompiler + (bone bone 16 :inline :offset-assert 1024) ;; guessed by decompiler + (output pris-mtx 16 :inline :offset-assert 2304) ;; guessed by decompiler ) :method-count-assert 9 :size-assert #x1100 :flag-assert #x900001100 ) -|# -#| (deftype bone-layout (structure) ((data uint16 8 :offset-assert 0) ;; guessed by decompiler - (joint (inline-array matrix) 2 :offset-assert 0) ;; guessed by decompiler - (bone (inline-array bone) 2 :offset-assert 8) ;; guessed by decompiler - (output (inline-array pris-mtx) 2 :offset-assert 16) ;; guessed by decompiler - (unused uint32 2 :offset-assert 24) ;; guessed by decompiler + (joint (inline-array matrix) 2 :offset 0) ;; guessed by decompiler + (bone (inline-array bone) 2 :offset 8) ;; guessed by decompiler + (output (inline-array pris-mtx) 2 :offset 16) ;; guessed by decompiler + (unused uint32 2 :offset 24) ;; guessed by decompiler ) :method-count-assert 9 :size-assert #x20 :flag-assert #x900000020 ) -|# -#| (deftype bone-regs (structure) - ((dma-buf basic :offset-assert 0) + ((dma-buf dma-buffer :offset-assert 0) (wait-count uint32 :offset-assert 4) (in-count uint32 :offset-assert 8) (sp-size uint32 :offset-assert 12) @@ -16712,9 +16758,7 @@ :size-assert #x24 :flag-assert #x900000024 ) -|# -#| (deftype bone-work (structure) ((layout bone-layout :inline :offset-assert 0) (regs bone-regs :inline :offset-assert 32) @@ -16723,9 +16767,7 @@ :size-assert #x44 :flag-assert #x900000044 ) -|# -#| (deftype bone-debug (structure) ((time-ctr uint32 :offset-assert 0) (timing uint32 360 :offset-assert 4) ;; guessed by decompiler @@ -16734,22 +16776,18 @@ :size-assert #x5a4 :flag-assert #x9000005a4 ) -|# -#| (deftype bone-memory (structure) ((work bone-work :inline :offset-assert 0) - (buffer bone-buffer 2 :offset-assert 80) ;; guessed by decompiler + (buffer bone-buffer 2 :inline :offset-assert 80) ;; guessed by decompiler ) :method-count-assert 9 :size-assert #x2250 :flag-assert #x900002250 ) -|# -#| (deftype bone-calculation (structure) - ((flags uint16 :offset-assert 0) ;; bone-calc-flags + ((flags bone-calc-flags :offset-assert 0) ;; bone-calc-flags (num-bones uint16 :offset-assert 2) (matrix-area (inline-array pris-mtx) :offset-assert 4) ;; guessed by decompiler (joints (inline-array joint) :offset-assert 8) ;; guessed by decompiler @@ -16767,9 +16805,7 @@ :size-assert #x30 :flag-assert #x900000030 ) -|# -#| (deftype bone-calculation-list (structure) ((first bone-calculation :offset-assert 0) (next bone-calculation :offset-assert 4) @@ -16778,40 +16814,43 @@ :size-assert #x8 :flag-assert #x900000008 ) -|# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; foreground-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +(declare-type merc-effect structure) + (deftype mercneric-chain (structure) + "A DMA chain for drawing with mercneric, and metadata needed to append. + This chain is assumed to run with a specific tpage from a specific level available." ((first uint32 :offset-assert 0) (next uint32 :offset-assert 4) (state generic-bucket-state :inline :offset-assert 8) - (vu1-bucket int32 :offset-assert 16) ;; bucket-id + (vu1-bucket bucket-id :offset-assert 16) ) + :pack-me :method-count-assert 9 :size-assert #x14 :flag-assert #x900000014 ) -|# -#| (deftype merc-chain (structure) + "A DMA chain for drawing with merc. + This chain is assumed to run with a specific tpage from a specific level available." ((first dma-packet :offset-assert 0) (patch dma-packet :offset-assert 4) - (vu1-bucket int32 :offset-assert 8) ;; bucket-id + (vu1-bucket bucket-id :offset-assert 8) ) + :pack-me :method-count-assert 9 :size-assert #xc :flag-assert #x90000000c ) -|# -#| (deftype foreground-bucket (structure) + "A foreground bucket is merc, emerc, and mercneric chain for a given texture mode." ((merc merc-chain :inline :offset-assert 0) (emerc merc-chain :inline :offset-assert 12) (mercneric mercneric-chain :inline :offset-assert 24) @@ -16820,31 +16859,31 @@ :size-assert #x2c :flag-assert #x90000002c ) -|# -#| (deftype foreground-level-buckets (structure) - ((data foreground-bucket 7 :offset-assert 0) ;; guessed by decompiler + "Collection of buckets for a single level. + Each bucket has a different texture. The order is: + tfrag, pris, shrub, alpha, water, pris, pris2" + ((data foreground-bucket 7 :inline :offset-assert 0) ;; guessed by decompiler ) :method-count-assert 9 :size-assert #x150 :flag-assert #x900000150 ) -|# -#| (deftype foreground-bucket-grid (structure) - ((level-buckets foreground-level-buckets 11 :offset-assert 0) ;; guessed by decompiler + "Array of buckets for each level, plus the single warp chain shared between everybody." + ((level-buckets foreground-level-buckets 11 :inline :offset-assert 0) ;; guessed by decompiler (warp-chain mercneric-chain :inline :offset-assert 3696) ) :method-count-assert 9 :size-assert #xe84 :flag-assert #x900000e84 ) -|# -#| (deftype foreground-regs (structure) + "Frequently accessed foreground values. These are in scratchpad for fast access + during foreground processing." ((dist float :offset-assert 0) (merc-used uint32 :offset-assert 4) (emerc-used uint32 :offset-assert 8) @@ -16864,12 +16903,13 @@ :size-assert #x38 :flag-assert #x900000038 ) -|# -#| (deftype foreground-work (structure) + "Memory map for scratchpad during foreground processing. + This is not used by the renderers, bone matrix, or joint code - just the code + that assigns stuff to buckets and prepares DMA for merc (or requests for generic merc)." ((regs foreground-regs :inline :offset-assert 0) - (draw-index-map uint8 11 :offset-assert 64) ;; guessed by decompiler + (draw-index-map uint8 11 :offset 64) ;; guessed by decompiler (grid foreground-bucket-grid :inline :offset-assert 80) (bounds sphere :inline :offset-assert 3808) (lights vu-lights :inline :offset-assert 3824) @@ -16880,10 +16920,9 @@ :size-assert #xf80 :flag-assert #x900000f80 ) -|# -#| (deftype texscroll-globals (structure) + "List of all merc-effects that need texscroll applied." ((requests int32 :offset-assert 0) (effects merc-effect 32 :offset-assert 4) ;; guessed by decompiler ) @@ -16891,38 +16930,37 @@ :size-assert #x84 :flag-assert #x900000084 ) -|# -#| (deftype merc-effect-bucket-info (structure) + "Scratch info computed per-merc-effect by the foreground code, then later read by merc + DMA generation. This is only for the currently-processing merc model's effects." ((color-fade rgba :offset-assert 0) ;; guessed by decompiler (merc-path uint8 :offset-assert 4) (ignore-alpha uint8 :offset-assert 5) (disable-draw uint8 :offset-assert 6) (disable-envmap uint8 :offset-assert 7) ) + :pack-me :method-count-assert 9 :size-assert #x8 :flag-assert #x900000008 ) -|# -#| (deftype merc-bucket-info (structure) + "Scratch info for the current merc-ctrl. Written by the foreground code, read by merc DMA generation." ((light vu-lights :inline :offset-assert 0) (needs-clip int32 :offset-assert 112) (need-mercprime-if-merc int32 :offset-assert 116) (must-use-mercneric-for-clip int32 :offset-assert 120) - (effect merc-effect-bucket-info 64 :offset-assert 124) ;; guessed by decompiler + (effect merc-effect-bucket-info 64 :inline :offset-assert 124) ;; guessed by decompiler ) :method-count-assert 9 :size-assert #x27c :flag-assert #x90000027c ) -|# -#| (deftype foreground-globals (structure) + "The foreground renderer state: all DMA chains, settings for the current merc-ctrl, texscroll list." ((foreground-grid foreground-bucket-grid :inline :offset-assert 0) (merc-bucket-info merc-bucket-info :inline :offset-assert 3728) (texscroll texscroll-globals :inline :offset-assert 4368) @@ -16931,10 +16969,9 @@ :size-assert #x1194 :flag-assert #x900001194 ) -|# -#| (deftype shadow-dma-packet (structure) + "DMA tag for submitting shadow data." ((tag generic-merc-tag :inline :offset-assert 0) (settings shadow-settings :inline :offset-assert 16) (geo-ref dma-packet :inline :offset-assert 96) @@ -16945,9 +16982,9 @@ :size-assert #x90 :flag-assert #x900000090 ) -|# -;; (define-extern invalidate-cache-line function) ;; (function pointer int) +(define-extern invalidate-cache-line (function pointer int)) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; engines ;; @@ -17819,23 +17856,33 @@ ;; aligner-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +(defenum align-flags + :bitfield #t + :type uint32 + (disabled) ;; keep object velocity + (af01) + (af02) + (af03) + (af04) + (af05) + ) + (deftype align-control (basic) ((flags align-flags :offset-assert 4) ;; guessed by decompiler (process process-drawable :offset-assert 8) ;; guessed by decompiler (frame-group art-joint-anim :offset-assert 12) ;; guessed by decompiler (frame-num float :offset-assert 16) - (matrix matrix 2 :offset-assert 32) ;; guessed by decompiler - (transform transform 2 :offset-assert 160) ;; guessed by decompiler + (matrix matrix 2 :inline :offset-assert 32) ;; guessed by decompiler + (transform transform 2 :inline :offset-assert 160) ;; guessed by decompiler (delta transformq :inline :offset-assert 256) (last-speed meters :offset-assert 304) - (align transformq :inline :offset-assert 160) + (align transformq :inline :offset 160) ) :method-count-assert 14 :size-assert #x134 :flag-assert #xe00000134 (:methods - (new (symbol type) _type_) ;; 0 ;; (new (symbol type process) _type_) + (new (symbol type process) _type_) ;; 0 (align-control-method-9 () none) ;; 9 ;; (compute-alignment! (_type_) transformq) (align-control-method-10 () none) ;; 10 ;; (align! (_type_ align-opts float float float) trsqv) (align-control-method-11 () none) ;; 11 ;; (align-vel-and-quat-only! (_type_ align-opts vector int float float) trsqv) @@ -17843,14 +17890,29 @@ (align-control-method-13 () none) ;; 13 ;; (second-transform (_type_) transform) ) ) -|# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; penetrate-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; +++penetrate-h:penetrate +;; +++game-h:knocked-type +(defenum knocked-type + :type uint8 + (knocked-type-0 0) + (knocked-type-1 1) + (knocked-type-2 2) + (knocked-type-3 3) + (knocked-type-4 4) ;; what the heck is this! (its on gator, and cant trigger it for the life of me) + (knocked-type-5 5) + (knocked-type-6 6) + (knocked-type-7 7) + (knocked-type-8 8) + (knocked-type-9 9) + (knocked-type-10 10) + ) +;; ---game-h:knocked-type + (defenum penetrate :type uint64 :bitfield #t @@ -17892,46 +17954,67 @@ (jak-dark-nuke 35) (jak-dark-blackhole 36) (emp-blast 37) - (penetrate-38 38) - (penetrate-39 39) - (penetrate-40 40) - (penetrate-41 41) - (penetrate-42 42) - (penetrate-43 43) - (penetrate-44 44) - (penetrate-45 45) - (penetrate-46 46) - (penetrate-47 47) - (penetrate-48 48) - (penetrate-49 49) - (penetrate-50 50) - (penetrate-51 51) - (penetrate-52 52) - (penetrate-53 53) - (penetrate-54 54) - (penetrate-55 55) - (penetrate-56 56) - (penetrate-57 57) - (penetrate-58 58) - (penetrate-59 59) - (penetrate-60 60) - (penetrate-61 61) - (penetrate-62 62) - (penetrate-63 63) ) -;; ---penetrate-h:penetrate - -(define-extern penetrate->string (function penetrate none)) -;; (define-extern penetrate-using->damage function) ;; (function penetrate int) -;; (define-extern penetrated-by-all&hit-points->penetrated-by function) ;; (function penetrate int penetrate) -;; (define-extern pu->knocked-type function) ;; (function penetrate knocked-type) +(define-extern penetrate->string (function penetrate string)) +(define-extern penetrate-using->damage (function penetrate float)) +(define-extern penetrated-by-all&hit-points->penetrated-by (function penetrate int penetrate)) +(define-extern pu->knocked-type (function penetrate knocked-type)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; game-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +(declare-type nav-control basic) +(declare-type path-control basic) +(declare-type vol-control basic) +(declare-type fact-info basic) +(declare-type actor-link-info basic) +(declare-type water-control basic) +(declare-type carry-info basic) +(declare-type rigid-body-control basic) + +(defenum state-flags + :bitfield #t + :type uint32 + (sf0 0) + (sf1 1) + (sf2 2) + (sf3 3) + (sf4 4) + (sf5 5) + (sf6 6) + (sf7 7) + (sf8 8) + (sf9 9) + (sf10 10) + (sf11 11) + (sf12 12) + (sf13 13) + (sf14 14) + (sf15 15) + (sf16 16) + (sf17 17) + (sf18 18) + (sf19 19) + (sf20 20) + (sf21 21) + (sf22 22) + (sf23 23) + (sf24 24) + (sf25 25) + (sf26 26) + (sf27 27) + (sf28 28) + (sf29 29) + (sf30 30) + (sf31 31) + ) + (deftype process-drawable (process) + "This is the main base class for in-game objects. + This handles drawing, collision, animation, navigation, particles, sounds, physics, etc. + The actual child classes will add most of the functionality, and this just serves as a common + container for references to the `-control` objects for this object." ((root trsqv :offset-assert 128) ;; guessed by decompiler (node-list cspace-array :offset-assert 132) ;; guessed by decompiler (draw draw-control :offset-assert 136) ;; guessed by decompiler @@ -17948,7 +18031,7 @@ (carry carry-info :offset-assert 180) ;; guessed by decompiler (rbody rigid-body-control :offset-assert 184) ;; guessed by decompiler (state-flags state-flags :offset-assert 188) ;; guessed by decompiler - (state-time uint64 :offset-assert 192) ;; time-frame + (state-time time-frame :offset-assert 192) ;; time-frame ) :method-count-assert 20 :size-assert #xc8 @@ -17963,221 +18046,220 @@ ) (:states process-drawable-idle ;; associated process guessed by decompiler, old: (state process-drawable) - process-drawable-art-error ;; associated process guessed by decompiler, old: (state string process-drawable) + (process-drawable-art-error string) ;; associated process guessed by decompiler, old: (state string process-drawable) ) ) -|# -#| (deftype process-drawable-reserved (process-drawable) + "A process drawable with a lot of unused method slots. + GOAL cannot increase the number of methods at runtime, so, for interactive development, it is useful + to have a type with a large number of slots which can be turned into real methods without needed to reboot the PS2." () :method-count-assert 218 :size-assert #xc8 :flag-assert #xda005000c8 (:methods - (process-drawable-reserved-method-20 () none) ;; 20 ;; (process-drawable-reserved-method-20 () none) - (process-drawable-reserved-method-21 () none) ;; 21 ;; (process-drawable-reserved-method-21 () none) - (process-drawable-reserved-method-22 () none) ;; 22 ;; (process-drawable-reserved-method-22 () none) - (process-drawable-reserved-method-23 () none) ;; 23 ;; (process-drawable-reserved-method-23 () none) - (process-drawable-reserved-method-24 () none) ;; 24 ;; (process-drawable-reserved-method-24 () none) - (process-drawable-reserved-method-25 () none) ;; 25 ;; (process-drawable-reserved-method-25 () none) - (process-drawable-reserved-method-26 () none) ;; 26 ;; (process-drawable-reserved-method-26 () none) - (process-drawable-reserved-method-27 () none) ;; 27 ;; (process-drawable-reserved-method-27 () none) - (process-drawable-reserved-method-28 () none) ;; 28 ;; (process-drawable-reserved-method-28 () none) - (process-drawable-reserved-method-29 () none) ;; 29 ;; (process-drawable-reserved-method-29 () none) - (process-drawable-reserved-method-30 () none) ;; 30 ;; (process-drawable-reserved-method-30 () none) - (process-drawable-reserved-method-31 () none) ;; 31 ;; (process-drawable-reserved-method-31 () none) - (process-drawable-reserved-method-32 () none) ;; 32 ;; (process-drawable-reserved-method-32 () none) - (process-drawable-reserved-method-33 () none) ;; 33 ;; (process-drawable-reserved-method-33 () none) - (process-drawable-reserved-method-34 () none) ;; 34 ;; (process-drawable-reserved-method-34 () none) - (process-drawable-reserved-method-35 () none) ;; 35 ;; (process-drawable-reserved-method-35 () none) - (process-drawable-reserved-method-36 () none) ;; 36 ;; (process-drawable-reserved-method-36 () none) - (process-drawable-reserved-method-37 () none) ;; 37 ;; (process-drawable-reserved-method-37 () none) - (process-drawable-reserved-method-38 () none) ;; 38 ;; (process-drawable-reserved-method-38 () none) - (process-drawable-reserved-method-39 () none) ;; 39 ;; (process-drawable-reserved-method-39 () none) - (process-drawable-reserved-method-40 () none) ;; 40 ;; (process-drawable-reserved-method-40 () none) - (process-drawable-reserved-method-41 () none) ;; 41 ;; (process-drawable-reserved-method-41 () none) - (process-drawable-reserved-method-42 () none) ;; 42 ;; (process-drawable-reserved-method-42 () none) - (process-drawable-reserved-method-43 () none) ;; 43 ;; (process-drawable-reserved-method-43 () none) - (process-drawable-reserved-method-44 () none) ;; 44 ;; (process-drawable-reserved-method-44 () none) - (process-drawable-reserved-method-45 () none) ;; 45 ;; (process-drawable-reserved-method-45 () none) - (process-drawable-reserved-method-46 () none) ;; 46 ;; (process-drawable-reserved-method-46 () none) - (process-drawable-reserved-method-47 () none) ;; 47 ;; (process-drawable-reserved-method-47 () none) - (process-drawable-reserved-method-48 () none) ;; 48 ;; (process-drawable-reserved-method-48 () none) - (process-drawable-reserved-method-49 () none) ;; 49 ;; (process-drawable-reserved-method-49 () none) - (process-drawable-reserved-method-50 () none) ;; 50 ;; (process-drawable-reserved-method-50 () none) - (process-drawable-reserved-method-51 () none) ;; 51 ;; (process-drawable-reserved-method-51 () none) - (process-drawable-reserved-method-52 () none) ;; 52 ;; (process-drawable-reserved-method-52 () none) - (process-drawable-reserved-method-53 () none) ;; 53 ;; (process-drawable-reserved-method-53 () none) - (process-drawable-reserved-method-54 () none) ;; 54 ;; (process-drawable-reserved-method-54 () none) - (process-drawable-reserved-method-55 () none) ;; 55 ;; (process-drawable-reserved-method-55 () none) - (process-drawable-reserved-method-56 () none) ;; 56 ;; (process-drawable-reserved-method-56 () none) - (process-drawable-reserved-method-57 () none) ;; 57 ;; (process-drawable-reserved-method-57 () none) - (process-drawable-reserved-method-58 () none) ;; 58 ;; (process-drawable-reserved-method-58 () none) - (process-drawable-reserved-method-59 () none) ;; 59 ;; (process-drawable-reserved-method-59 () none) - (process-drawable-reserved-method-60 () none) ;; 60 ;; (process-drawable-reserved-method-60 () none) - (process-drawable-reserved-method-61 () none) ;; 61 ;; (process-drawable-reserved-method-61 () none) - (process-drawable-reserved-method-62 () none) ;; 62 ;; (process-drawable-reserved-method-62 () none) - (process-drawable-reserved-method-63 () none) ;; 63 ;; (process-drawable-reserved-method-63 () none) - (process-drawable-reserved-method-64 () none) ;; 64 ;; (process-drawable-reserved-method-64 () none) - (process-drawable-reserved-method-65 () none) ;; 65 ;; (process-drawable-reserved-method-65 () none) - (process-drawable-reserved-method-66 () none) ;; 66 ;; (process-drawable-reserved-method-66 () none) - (process-drawable-reserved-method-67 () none) ;; 67 ;; (process-drawable-reserved-method-67 () none) - (process-drawable-reserved-method-68 () none) ;; 68 ;; (process-drawable-reserved-method-68 () none) - (process-drawable-reserved-method-69 () none) ;; 69 ;; (process-drawable-reserved-method-69 () none) - (process-drawable-reserved-method-70 () none) ;; 70 ;; (process-drawable-reserved-method-70 () none) - (process-drawable-reserved-method-71 () none) ;; 71 ;; (process-drawable-reserved-method-71 () none) - (process-drawable-reserved-method-72 () none) ;; 72 ;; (process-drawable-reserved-method-72 () none) - (process-drawable-reserved-method-73 () none) ;; 73 ;; (process-drawable-reserved-method-73 () none) - (process-drawable-reserved-method-74 () none) ;; 74 ;; (process-drawable-reserved-method-74 () none) - (process-drawable-reserved-method-75 () none) ;; 75 ;; (process-drawable-reserved-method-75 () none) - (process-drawable-reserved-method-76 () none) ;; 76 ;; (process-drawable-reserved-method-76 () none) - (process-drawable-reserved-method-77 () none) ;; 77 ;; (process-drawable-reserved-method-77 () none) - (process-drawable-reserved-method-78 () none) ;; 78 ;; (process-drawable-reserved-method-78 () none) - (process-drawable-reserved-method-79 () none) ;; 79 ;; (process-drawable-reserved-method-79 () none) - (process-drawable-reserved-method-80 () none) ;; 80 ;; (process-drawable-reserved-method-80 () none) - (process-drawable-reserved-method-81 () none) ;; 81 ;; (process-drawable-reserved-method-81 () none) - (process-drawable-reserved-method-82 () none) ;; 82 ;; (process-drawable-reserved-method-82 () none) - (process-drawable-reserved-method-83 () none) ;; 83 ;; (process-drawable-reserved-method-83 () none) - (process-drawable-reserved-method-84 () none) ;; 84 ;; (process-drawable-reserved-method-84 () none) - (process-drawable-reserved-method-85 () none) ;; 85 ;; (process-drawable-reserved-method-85 () none) - (process-drawable-reserved-method-86 () none) ;; 86 ;; (process-drawable-reserved-method-86 () none) - (process-drawable-reserved-method-87 () none) ;; 87 ;; (process-drawable-reserved-method-87 () none) - (process-drawable-reserved-method-88 () none) ;; 88 ;; (process-drawable-reserved-method-88 () none) - (process-drawable-reserved-method-89 () none) ;; 89 ;; (process-drawable-reserved-method-89 () none) - (process-drawable-reserved-method-90 () none) ;; 90 ;; (process-drawable-reserved-method-90 () none) - (process-drawable-reserved-method-91 () none) ;; 91 ;; (process-drawable-reserved-method-91 () none) - (process-drawable-reserved-method-92 () none) ;; 92 ;; (process-drawable-reserved-method-92 () none) - (process-drawable-reserved-method-93 () none) ;; 93 ;; (process-drawable-reserved-method-93 () none) - (process-drawable-reserved-method-94 () none) ;; 94 ;; (process-drawable-reserved-method-94 () none) - (process-drawable-reserved-method-95 () none) ;; 95 ;; (process-drawable-reserved-method-95 () none) - (process-drawable-reserved-method-96 () none) ;; 96 ;; (process-drawable-reserved-method-96 () none) - (process-drawable-reserved-method-97 () none) ;; 97 ;; (process-drawable-reserved-method-97 () none) - (process-drawable-reserved-method-98 () none) ;; 98 ;; (process-drawable-reserved-method-98 () none) - (process-drawable-reserved-method-99 () none) ;; 99 ;; (process-drawable-reserved-method-99 () none) - (process-drawable-reserved-method-100 () none) ;; 100 ;; (process-drawable-reserved-method-100 () none) - (process-drawable-reserved-method-101 () none) ;; 101 ;; (process-drawable-reserved-method-101 () none) - (process-drawable-reserved-method-102 () none) ;; 102 ;; (process-drawable-reserved-method-102 () none) - (process-drawable-reserved-method-103 () none) ;; 103 ;; (process-drawable-reserved-method-103 () none) - (process-drawable-reserved-method-104 () none) ;; 104 ;; (process-drawable-reserved-method-104 () none) - (process-drawable-reserved-method-105 () none) ;; 105 ;; (process-drawable-reserved-method-105 () none) - (process-drawable-reserved-method-106 () none) ;; 106 ;; (process-drawable-reserved-method-106 () none) - (process-drawable-reserved-method-107 () none) ;; 107 ;; (process-drawable-reserved-method-107 () none) - (process-drawable-reserved-method-108 () none) ;; 108 ;; (process-drawable-reserved-method-108 () none) - (process-drawable-reserved-method-109 () none) ;; 109 ;; (process-drawable-reserved-method-109 () none) - (process-drawable-reserved-method-110 () none) ;; 110 ;; (process-drawable-reserved-method-110 () none) - (process-drawable-reserved-method-111 () none) ;; 111 ;; (process-drawable-reserved-method-111 () none) - (process-drawable-reserved-method-112 () none) ;; 112 ;; (process-drawable-reserved-method-112 () none) - (process-drawable-reserved-method-113 () none) ;; 113 ;; (process-drawable-reserved-method-113 () none) - (process-drawable-reserved-method-114 () none) ;; 114 ;; (process-drawable-reserved-method-114 () none) - (process-drawable-reserved-method-115 () none) ;; 115 ;; (process-drawable-reserved-method-115 () none) - (process-drawable-reserved-method-116 () none) ;; 116 ;; (process-drawable-reserved-method-116 () none) - (process-drawable-reserved-method-117 () none) ;; 117 ;; (process-drawable-reserved-method-117 () none) - (process-drawable-reserved-method-118 () none) ;; 118 ;; (process-drawable-reserved-method-118 () none) - (process-drawable-reserved-method-119 () none) ;; 119 ;; (process-drawable-reserved-method-119 () none) - (process-drawable-reserved-method-120 () none) ;; 120 ;; (process-drawable-reserved-method-120 () none) - (process-drawable-reserved-method-121 () none) ;; 121 ;; (process-drawable-reserved-method-121 () none) - (process-drawable-reserved-method-122 () none) ;; 122 ;; (process-drawable-reserved-method-122 () none) - (process-drawable-reserved-method-123 () none) ;; 123 ;; (process-drawable-reserved-method-123 () none) - (process-drawable-reserved-method-124 () none) ;; 124 ;; (process-drawable-reserved-method-124 () none) - (process-drawable-reserved-method-125 () none) ;; 125 ;; (process-drawable-reserved-method-125 () none) - (process-drawable-reserved-method-126 () none) ;; 126 ;; (process-drawable-reserved-method-126 () none) - (process-drawable-reserved-method-127 () none) ;; 127 ;; (process-drawable-reserved-method-127 () none) - (process-drawable-reserved-method-128 () none) ;; 128 ;; (process-drawable-reserved-method-128 () none) - (process-drawable-reserved-method-129 () none) ;; 129 ;; (process-drawable-reserved-method-129 () none) - (process-drawable-reserved-method-130 () none) ;; 130 ;; (process-drawable-reserved-method-130 () none) - (process-drawable-reserved-method-131 () none) ;; 131 ;; (process-drawable-reserved-method-131 () none) - (process-drawable-reserved-method-132 () none) ;; 132 ;; (process-drawable-reserved-method-132 () none) - (process-drawable-reserved-method-133 () none) ;; 133 ;; (process-drawable-reserved-method-133 () none) - (process-drawable-reserved-method-134 () none) ;; 134 ;; (process-drawable-reserved-method-134 () none) - (process-drawable-reserved-method-135 () none) ;; 135 ;; (process-drawable-reserved-method-135 () none) - (process-drawable-reserved-method-136 () none) ;; 136 ;; (process-drawable-reserved-method-136 () none) - (process-drawable-reserved-method-137 () none) ;; 137 ;; (process-drawable-reserved-method-137 () none) - (process-drawable-reserved-method-138 () none) ;; 138 ;; (process-drawable-reserved-method-138 () none) - (process-drawable-reserved-method-139 () none) ;; 139 ;; (process-drawable-reserved-method-139 () none) - (process-drawable-reserved-method-140 () none) ;; 140 ;; (process-drawable-reserved-method-140 () none) - (process-drawable-reserved-method-141 () none) ;; 141 ;; (process-drawable-reserved-method-141 () none) - (process-drawable-reserved-method-142 () none) ;; 142 ;; (process-drawable-reserved-method-142 () none) - (process-drawable-reserved-method-143 () none) ;; 143 ;; (process-drawable-reserved-method-143 () none) - (process-drawable-reserved-method-144 () none) ;; 144 ;; (process-drawable-reserved-method-144 () none) - (process-drawable-reserved-method-145 () none) ;; 145 ;; (process-drawable-reserved-method-145 () none) - (process-drawable-reserved-method-146 () none) ;; 146 ;; (process-drawable-reserved-method-146 () none) - (process-drawable-reserved-method-147 () none) ;; 147 ;; (process-drawable-reserved-method-147 () none) - (process-drawable-reserved-method-148 () none) ;; 148 ;; (process-drawable-reserved-method-148 () none) - (process-drawable-reserved-method-149 () none) ;; 149 ;; (process-drawable-reserved-method-149 () none) - (process-drawable-reserved-method-150 () none) ;; 150 ;; (process-drawable-reserved-method-150 () none) - (process-drawable-reserved-method-151 () none) ;; 151 ;; (process-drawable-reserved-method-151 () none) - (process-drawable-reserved-method-152 () none) ;; 152 ;; (process-drawable-reserved-method-152 () none) - (process-drawable-reserved-method-153 () none) ;; 153 ;; (process-drawable-reserved-method-153 () none) - (process-drawable-reserved-method-154 () none) ;; 154 ;; (process-drawable-reserved-method-154 () none) - (process-drawable-reserved-method-155 () none) ;; 155 ;; (process-drawable-reserved-method-155 () none) - (process-drawable-reserved-method-156 () none) ;; 156 ;; (process-drawable-reserved-method-156 () none) - (process-drawable-reserved-method-157 () none) ;; 157 ;; (process-drawable-reserved-method-157 () none) - (process-drawable-reserved-method-158 () none) ;; 158 ;; (process-drawable-reserved-method-158 () none) - (process-drawable-reserved-method-159 () none) ;; 159 ;; (process-drawable-reserved-method-159 () none) - (process-drawable-reserved-method-160 () none) ;; 160 ;; (process-drawable-reserved-method-160 () none) - (process-drawable-reserved-method-161 () none) ;; 161 ;; (process-drawable-reserved-method-161 () none) - (process-drawable-reserved-method-162 () none) ;; 162 ;; (process-drawable-reserved-method-162 () none) - (process-drawable-reserved-method-163 () none) ;; 163 ;; (process-drawable-reserved-method-163 () none) - (process-drawable-reserved-method-164 () none) ;; 164 ;; (process-drawable-reserved-method-164 () none) - (process-drawable-reserved-method-165 () none) ;; 165 ;; (process-drawable-reserved-method-165 () none) - (process-drawable-reserved-method-166 () none) ;; 166 ;; (process-drawable-reserved-method-166 () none) - (process-drawable-reserved-method-167 () none) ;; 167 ;; (process-drawable-reserved-method-167 () none) - (process-drawable-reserved-method-168 () none) ;; 168 ;; (process-drawable-reserved-method-168 () none) - (process-drawable-reserved-method-169 () none) ;; 169 ;; (process-drawable-reserved-method-169 () none) - (process-drawable-reserved-method-170 () none) ;; 170 ;; (process-drawable-reserved-method-170 () none) - (process-drawable-reserved-method-171 () none) ;; 171 ;; (process-drawable-reserved-method-171 () none) - (process-drawable-reserved-method-172 () none) ;; 172 ;; (process-drawable-reserved-method-172 () none) - (process-drawable-reserved-method-173 () none) ;; 173 ;; (process-drawable-reserved-method-173 () none) - (process-drawable-reserved-method-174 () none) ;; 174 ;; (process-drawable-reserved-method-174 () none) - (process-drawable-reserved-method-175 () none) ;; 175 ;; (process-drawable-reserved-method-175 () none) - (process-drawable-reserved-method-176 () none) ;; 176 ;; (process-drawable-reserved-method-176 () none) - (process-drawable-reserved-method-177 () none) ;; 177 ;; (process-drawable-reserved-method-177 () none) - (process-drawable-reserved-method-178 () none) ;; 178 - (process-drawable-reserved-method-179 () none) ;; 179 - (process-drawable-reserved-method-180 () none) ;; 180 - (process-drawable-reserved-method-181 () none) ;; 181 - (process-drawable-reserved-method-182 () none) ;; 182 - (process-drawable-reserved-method-183 () none) ;; 183 - (process-drawable-reserved-method-184 () none) ;; 184 - (process-drawable-reserved-method-185 () none) ;; 185 - (process-drawable-reserved-method-186 () none) ;; 186 - (process-drawable-reserved-method-187 () none) ;; 187 - (process-drawable-reserved-method-188 () none) ;; 188 - (process-drawable-reserved-method-189 () none) ;; 189 - (process-drawable-reserved-method-190 () none) ;; 190 - (process-drawable-reserved-method-191 () none) ;; 191 - (process-drawable-reserved-method-192 () none) ;; 192 - (process-drawable-reserved-method-193 () none) ;; 193 - (process-drawable-reserved-method-194 () none) ;; 194 - (process-drawable-reserved-method-195 () none) ;; 195 - (process-drawable-reserved-method-196 () none) ;; 196 - (process-drawable-reserved-method-197 () none) ;; 197 - (process-drawable-reserved-method-198 () none) ;; 198 - (process-drawable-reserved-method-199 () none) ;; 199 - (process-drawable-reserved-method-200 () none) ;; 200 - (process-drawable-reserved-method-201 () none) ;; 201 - (process-drawable-reserved-method-202 () none) ;; 202 - (process-drawable-reserved-method-203 () none) ;; 203 - (process-drawable-reserved-method-204 () none) ;; 204 - (process-drawable-reserved-method-205 () none) ;; 205 - (process-drawable-reserved-method-206 () none) ;; 206 - (process-drawable-reserved-method-207 () none) ;; 207 - (process-drawable-reserved-method-208 () none) ;; 208 - (process-drawable-reserved-method-209 () none) ;; 209 - (process-drawable-reserved-method-210 () none) ;; 210 - (process-drawable-reserved-method-211 () none) ;; 211 - (process-drawable-reserved-method-212 () none) ;; 212 - (process-drawable-reserved-method-213 () none) ;; 213 - (process-drawable-reserved-method-214 () none) ;; 214 - (process-drawable-reserved-method-215 () none) ;; 215 - (process-drawable-reserved-method-216 () none) ;; 216 - (process-drawable-reserved-method-217 () none) ;; 217 + (process-drawable-reserved-method-20 () none) + (process-drawable-reserved-method-21 () none) + (process-drawable-reserved-method-22 () none) + (process-drawable-reserved-method-23 () none) + (process-drawable-reserved-method-24 () none) + (process-drawable-reserved-method-25 () none) + (process-drawable-reserved-method-26 () none) + (process-drawable-reserved-method-27 () none) + (process-drawable-reserved-method-28 () none) + (process-drawable-reserved-method-29 () none) + (process-drawable-reserved-method-30 () none) + (process-drawable-reserved-method-31 () none) + (process-drawable-reserved-method-32 () none) + (process-drawable-reserved-method-33 () none) + (process-drawable-reserved-method-34 () none) + (process-drawable-reserved-method-35 () none) + (process-drawable-reserved-method-36 () none) + (process-drawable-reserved-method-37 () none) + (process-drawable-reserved-method-38 () none) + (process-drawable-reserved-method-39 () none) + (process-drawable-reserved-method-40 () none) + (process-drawable-reserved-method-41 () none) + (process-drawable-reserved-method-42 () none) + (process-drawable-reserved-method-43 () none) + (process-drawable-reserved-method-44 () none) + (process-drawable-reserved-method-45 () none) + (process-drawable-reserved-method-46 () none) + (process-drawable-reserved-method-47 () none) + (process-drawable-reserved-method-48 () none) + (process-drawable-reserved-method-49 () none) + (process-drawable-reserved-method-50 () none) + (process-drawable-reserved-method-51 () none) + (process-drawable-reserved-method-52 () none) + (process-drawable-reserved-method-53 () none) + (process-drawable-reserved-method-54 () none) + (process-drawable-reserved-method-55 () none) + (process-drawable-reserved-method-56 () none) + (process-drawable-reserved-method-57 () none) + (process-drawable-reserved-method-58 () none) + (process-drawable-reserved-method-59 () none) + (process-drawable-reserved-method-60 () none) + (process-drawable-reserved-method-61 () none) + (process-drawable-reserved-method-62 () none) + (process-drawable-reserved-method-63 () none) + (process-drawable-reserved-method-64 () none) + (process-drawable-reserved-method-65 () none) + (process-drawable-reserved-method-66 () none) + (process-drawable-reserved-method-67 () none) + (process-drawable-reserved-method-68 () none) + (process-drawable-reserved-method-69 () none) + (process-drawable-reserved-method-70 () none) + (process-drawable-reserved-method-71 () none) + (process-drawable-reserved-method-72 () none) + (process-drawable-reserved-method-73 () none) + (process-drawable-reserved-method-74 () none) + (process-drawable-reserved-method-75 () none) + (process-drawable-reserved-method-76 () none) + (process-drawable-reserved-method-77 () none) + (process-drawable-reserved-method-78 () none) + (process-drawable-reserved-method-79 () none) + (process-drawable-reserved-method-80 () none) + (process-drawable-reserved-method-81 () none) + (process-drawable-reserved-method-82 () none) + (process-drawable-reserved-method-83 () none) + (process-drawable-reserved-method-84 () none) + (process-drawable-reserved-method-85 () none) + (process-drawable-reserved-method-86 () none) + (process-drawable-reserved-method-87 () none) + (process-drawable-reserved-method-88 () none) + (process-drawable-reserved-method-89 () none) + (process-drawable-reserved-method-90 () none) + (process-drawable-reserved-method-91 () none) + (process-drawable-reserved-method-92 () none) + (process-drawable-reserved-method-93 () none) + (process-drawable-reserved-method-94 () none) + (process-drawable-reserved-method-95 () none) + (process-drawable-reserved-method-96 () none) + (process-drawable-reserved-method-97 () none) + (process-drawable-reserved-method-98 () none) + (process-drawable-reserved-method-99 () none) + (process-drawable-reserved-method-100 () none) + (process-drawable-reserved-method-101 () none) + (process-drawable-reserved-method-102 () none) + (process-drawable-reserved-method-103 () none) + (process-drawable-reserved-method-104 () none) + (process-drawable-reserved-method-105 () none) + (process-drawable-reserved-method-106 () none) + (process-drawable-reserved-method-107 () none) + (process-drawable-reserved-method-108 () none) + (process-drawable-reserved-method-109 () none) + (process-drawable-reserved-method-110 () none) + (process-drawable-reserved-method-111 () none) + (process-drawable-reserved-method-112 () none) + (process-drawable-reserved-method-113 () none) + (process-drawable-reserved-method-114 () none) + (process-drawable-reserved-method-115 () none) + (process-drawable-reserved-method-116 () none) + (process-drawable-reserved-method-117 () none) + (process-drawable-reserved-method-118 () none) + (process-drawable-reserved-method-119 () none) + (process-drawable-reserved-method-120 () none) + (process-drawable-reserved-method-121 () none) + (process-drawable-reserved-method-122 () none) + (process-drawable-reserved-method-123 () none) + (process-drawable-reserved-method-124 () none) + (process-drawable-reserved-method-125 () none) + (process-drawable-reserved-method-126 () none) + (process-drawable-reserved-method-127 () none) + (process-drawable-reserved-method-128 () none) + (process-drawable-reserved-method-129 () none) + (process-drawable-reserved-method-130 () none) + (process-drawable-reserved-method-131 () none) + (process-drawable-reserved-method-132 () none) + (process-drawable-reserved-method-133 () none) + (process-drawable-reserved-method-134 () none) + (process-drawable-reserved-method-135 () none) + (process-drawable-reserved-method-136 () none) + (process-drawable-reserved-method-137 () none) + (process-drawable-reserved-method-138 () none) + (process-drawable-reserved-method-139 () none) + (process-drawable-reserved-method-140 () none) + (process-drawable-reserved-method-141 () none) + (process-drawable-reserved-method-142 () none) + (process-drawable-reserved-method-143 () none) + (process-drawable-reserved-method-144 () none) + (process-drawable-reserved-method-145 () none) + (process-drawable-reserved-method-146 () none) + (process-drawable-reserved-method-147 () none) + (process-drawable-reserved-method-148 () none) + (process-drawable-reserved-method-149 () none) + (process-drawable-reserved-method-150 () none) + (process-drawable-reserved-method-151 () none) + (process-drawable-reserved-method-152 () none) + (process-drawable-reserved-method-153 () none) + (process-drawable-reserved-method-154 () none) + (process-drawable-reserved-method-155 () none) + (process-drawable-reserved-method-156 () none) + (process-drawable-reserved-method-157 () none) + (process-drawable-reserved-method-158 () none) + (process-drawable-reserved-method-159 () none) + (process-drawable-reserved-method-160 () none) + (process-drawable-reserved-method-161 () none) + (process-drawable-reserved-method-162 () none) + (process-drawable-reserved-method-163 () none) + (process-drawable-reserved-method-164 () none) + (process-drawable-reserved-method-165 () none) + (process-drawable-reserved-method-166 () none) + (process-drawable-reserved-method-167 () none) + (process-drawable-reserved-method-168 () none) + (process-drawable-reserved-method-169 () none) + (process-drawable-reserved-method-170 () none) + (process-drawable-reserved-method-171 () none) + (process-drawable-reserved-method-172 () none) + (process-drawable-reserved-method-173 () none) + (process-drawable-reserved-method-174 () none) + (process-drawable-reserved-method-175 () none) + (process-drawable-reserved-method-176 () none) + (process-drawable-reserved-method-177 () none) + (process-drawable-reserved-method-178 () none) + (process-drawable-reserved-method-179 () none) + (process-drawable-reserved-method-180 () none) + (process-drawable-reserved-method-181 () none) + (process-drawable-reserved-method-182 () none) + (process-drawable-reserved-method-183 () none) + (process-drawable-reserved-method-184 () none) + (process-drawable-reserved-method-185 () none) + (process-drawable-reserved-method-186 () none) + (process-drawable-reserved-method-187 () none) + (process-drawable-reserved-method-188 () none) + (process-drawable-reserved-method-189 () none) + (process-drawable-reserved-method-190 () none) + (process-drawable-reserved-method-191 () none) + (process-drawable-reserved-method-192 () none) + (process-drawable-reserved-method-193 () none) + (process-drawable-reserved-method-194 () none) + (process-drawable-reserved-method-195 () none) + (process-drawable-reserved-method-196 () none) + (process-drawable-reserved-method-197 () none) + (process-drawable-reserved-method-198 () none) + (process-drawable-reserved-method-199 () none) + (process-drawable-reserved-method-200 () none) + (process-drawable-reserved-method-201 () none) + (process-drawable-reserved-method-202 () none) + (process-drawable-reserved-method-203 () none) + (process-drawable-reserved-method-204 () none) + (process-drawable-reserved-method-205 () none) + (process-drawable-reserved-method-206 () none) + (process-drawable-reserved-method-207 () none) + (process-drawable-reserved-method-208 () none) + (process-drawable-reserved-method-209 () none) + (process-drawable-reserved-method-210 () none) + (process-drawable-reserved-method-211 () none) + (process-drawable-reserved-method-212 () none) + (process-drawable-reserved-method-213 () none) + (process-drawable-reserved-method-214 () none) + (process-drawable-reserved-method-215 () none) + (process-drawable-reserved-method-216 () none) + (process-drawable-reserved-method-217 () none) ) ) -|# -#| (deftype attack-dir-info (structure) ((dir vector :inline :offset-assert 0) (xz-dir vector :inline :offset-assert 16) @@ -18188,18 +18270,46 @@ :size-assert #x40 :flag-assert #x900000040 ) -|# -#| +(defenum attack-mask + :bitfield #t + :type uint32 + (trans 0) ;; 1 + (vector 1) ;; 2 + (intersection 2) ;; 4 + (attacker 3) ;; 8 + (attack-time 4) ;; 16 + (invinc-time 5) ;; 32 + (mode 6) ;; 64 + (shove-back 7) ;; 128 + (shove-up 8) ;; 256 + (speed 9) ;; 512 + (dist 10) ;; 1024 + (control 11) ;; 2048 + (angle 12) ;; 4096 + (rotate-to 13) ;; 8192 + (prev-state 14) ;; 16384 + (id 15) ;; 32768 + (count 16) ;; hi 1 + (penetrate-using 17) ;; hi 2 + (attacker-velocity 18);; hi 4 + (damage 19) ;; hi 8 + (shield-damage 20) ;; hi16 + (vehicle-damage-factor 21) ;; hi 32 + (vehicle-impulse-factor 22) ;; hi 64 + (knock 23) + (test 24) + ) + (deftype attack-info (structure) ((trans vector :inline :offset-assert 0) (vector vector :inline :offset-assert 16) (attacker-velocity vector :inline :offset-assert 32) (intersection vector :inline :offset-assert 48) (attacker handle :offset-assert 64) - (attack-time uint64 :offset-assert 72) ;; time-frame - (invinc-time uint64 :offset-assert 80) ;; time-frame - (mask attack-info-mask :offset-assert 88) ;; attack-mask + (attack-time time-frame :offset-assert 72) ;; time-frame + (invinc-time time-frame :offset-assert 80) ;; time-frame + (mask attack-mask :offset-assert 88) ;; attack-mask (mode symbol :offset-assert 92) ;; guessed by decompiler (shove-back meters :offset-assert 96) (shove-up meters :offset-assert 100) @@ -18207,16 +18317,16 @@ (dist meters :offset-assert 108) (control float :offset-assert 112) (angle symbol :offset-assert 116) ;; guessed by decompiler - (rotate-to deg :offset-assert 120) ;; degrees + (rotate-to degrees :offset-assert 120) ;; degrees (prev-state state :offset-assert 124) ;; guessed by decompiler (id uint32 :offset-assert 128) (count uint32 :offset-assert 132) - (penetrate-using uint64 :offset-assert 136) ;; penetrate + (penetrate-using penetrate :offset-assert 136) ;; penetrate (damage float :offset-assert 144) (shield-damage float :offset-assert 148) (vehicle-damage-factor float :offset-assert 152) (vehicle-impulse-factor float :offset-assert 156) - (knock uint8 :offset-assert 160) ;; knocked-type + (knock knocked-type :offset-assert 160) ;; knocked-type (test symbol :offset-assert 164) ;; guessed by decompiler ) :method-count-assert 12 @@ -18229,9 +18339,7 @@ (attack-info-method-11 () none) ;; 11 ;; (combine! (_type_ attack-info process-drawable) attack-info) ) ) -|# -#| (deftype ground-tween-info (structure) ((chan uint8 3 :offset-assert 0) ;; guessed by decompiler (blend float 3 :offset-assert 4) ;; guessed by decompiler @@ -18241,14 +18349,16 @@ :size-assert #x24 :flag-assert #x900000024 ) -|# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; script-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +(declare-type script-context structure) +(declare-type load-state structure) +(define-extern *load-state* load-state) + (deftype script-form (structure) ((name symbol :offset-assert 0) ;; guessed by decompiler (spec pair :offset-assert 4) ;; guessed by decompiler @@ -18261,9 +18371,7 @@ (script-form-method-9 () none) ;; 9 ;; (script-form-method-9 () none) ) ) -|# -#| (deftype script-context (structure) ((load-state load-state :offset-assert 0) ;; guessed by decompiler (key object :offset-assert 4) ;; guessed by decompiler @@ -18274,29 +18382,29 @@ (expr pair :offset-assert 24) ;; guessed by decompiler (param-count int32 :offset-assert 28) (param object 16 :offset-assert 32) ;; guessed by decompiler - (UNKNOWN UNKNOWN :offset-assert -1) ;; field could not be read. + ;(UNKNOWN UNKNOWN :offset-assert -1) ;; field could not be read. (param-type object 16 :offset-assert 96) ;; guessed by decompiler - (UNKNOWN UNKNOWN :offset-assert -1) ;; field could not be read. + ;(UNKNOWN UNKNOWN :offset-assert -1) ;; field could not be read. ) :method-count-assert 12 :size-assert #xa0 :flag-assert #xc000000a0 ;; field key uses ~A with a signed load. field expr uses ~A with a signed load. (:methods - (new (symbol type) _type_) ;; 0 ;; (new (symbol type object process vector) _type_) + (new (symbol type object process vector) _type_) ;; 0 (script-context-method-9 () none) ;; 9 ;; (eval! (_type_ pair) object) (script-context-method-10 () none) ;; 10 ;; (script-context-method-10 (_type_ object pair) object) (script-context-method-11 () none) ;; 11 ;; (script-context-method-11 (_type_ pair pair symbol) symbol) ) ) -|# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; scene-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +(declare-type continue-point basic) + (deftype scene-actor (basic) ((name string :offset-assert 4) ;; guessed by decompiler (level symbol :offset-assert 8) ;; guessed by decompiler @@ -18327,16 +18435,14 @@ (scene-actor-method-9 () none) ;; 9 ;; (scene-actor-method-9 (_type_ scene-player) (pointer process)) ) ) -|# -#| +(defenum scene-flags + :bitfield #t + :type uint32 + ) + (deftype scene (art-group) - ((name string :offset-assert 8) ;; guessed by decompiler - (length int32 :offset-assert 12) - (extra res-lump :offset-assert 16) ;; guessed by decompiler - (info file-info :offset-assert 4) ;; guessed by decompiler - (data art-element :dynamic :offset-assert 32) ;; guessed by decompiler - (scene-flags uint32 :offset-assert 32) + ((scene-flags scene-flags :offset-assert 32) (mask-to-clear process-mask :offset-assert 36) ;; guessed by decompiler (entity string :offset-assert 40) ;; guessed by decompiler (art-group string :offset-assert 44) ;; guessed by decompiler @@ -18344,9 +18450,9 @@ (parts int32 :offset-assert 52) (command-list pair :offset-assert 56) ;; guessed by decompiler (cut-list pair :offset-assert 60) ;; guessed by decompiler - (wait-max-time uint64 :offset-assert 64) ;; time-frame - (wait-air-time uint64 :offset-assert 72) ;; time-frame - (wait-ground-time uint64 :offset-assert 80) ;; time-frame + (wait-max-time time-frame :offset-assert 64) ;; time-frame + (wait-air-time time-frame :offset-assert 72) ;; time-frame + (wait-ground-time time-frame :offset-assert 80) ;; time-frame (actor (array scene-actor) :offset-assert 88) ;; guessed by decompiler (load-point continue-point :offset-assert 92) ;; guessed by decompiler (end-point continue-point :offset-assert 96) ;; guessed by decompiler @@ -18368,16 +18474,14 @@ (scene-method-17 () none) ;; 17 ) ) -|# -#| (deftype scene-player (process-drawable) ((scene-list (array scene) :offset-assert 200) ;; guessed by decompiler (scene scene :offset-assert 204) ;; guessed by decompiler (scene-index int32 :offset-assert 208) (anim spool-anim :offset-assert 212) ;; guessed by decompiler (next-anim spool-anim :offset-assert 216) ;; guessed by decompiler - (camera uint64 :offset-assert 224) ;; handle + (camera handle :offset-assert 224) ;; handle (main-entity entity-actor :offset-assert 232) ;; guessed by decompiler (wait symbol :offset-assert 236) ;; guessed by decompiler (old-target-pos transformq :inline :offset-assert 240) @@ -18387,13 +18491,13 @@ (dma-max uint32 :offset-assert 300) (gui-id sound-id :offset-assert 304) ;; guessed by decompiler (aborted? symbol :offset-assert 308) ;; guessed by decompiler - (scene-start-time uint64 :offset-assert 312) ;; time-frame + (scene-start-time time-frame :offset-assert 312) ;; time-frame (targ-speed float :offset-assert 320) (cur-speed float :offset-assert 324) - (speed-change-time uint64 :offset-assert 328) ;; time-frame - (speed-press-time uint64 :offset-assert 336) ;; time-frame + (speed-change-time time-frame :offset-assert 328) ;; time-frame + (speed-press-time time-frame :offset-assert 336) ;; time-frame (speed-change-speed float :offset-assert 344) - (subtitle-change-time uint64 :offset-assert 352) ;; time-frame + (subtitle-change-time time-frame :offset-assert 352) ;; time-frame (user-sound sound-id 4 :offset-assert 360) ;; guessed by decompiler (last-frame float :offset-assert 376) (end-point basic :offset-assert 380) @@ -18415,10 +18519,9 @@ (scene-player-method-25 () none) ;; 25 ;; (scene-player-method-25 (_type_ float) none) ) ) -|# -;; (define-extern *scene-player* object) ;; (pointer scene-player) -;; (define-extern *debug-menu-scene-play* object) +(define-extern *scene-player* (pointer scene-player)) +(define-extern *debug-menu-scene-play* object) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; sync-info-h ;; @@ -18671,7 +18774,6 @@ ;; debug-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype pos-history (structure) ((points (inline-array vector) :offset-assert 0) ;; guessed by decompiler (num-points int32 :offset-assert 4) @@ -18682,9 +18784,7 @@ :size-assert #x10 :flag-assert #x900000010 ) -|# -#| (deftype debug-vertex (structure) ((trans vector4w :inline :offset-assert 0) (normal vector3h :inline :offset-assert 16) @@ -18695,74 +18795,112 @@ :size-assert #x20 :flag-assert #x900000020 ) -|# -#| (deftype debug-vertex-stats (basic) ((length int32 :offset-assert 4) (pos-count int32 :offset-assert 8) - (vertex debug-vertex 600 :offset-assert 16) ;; guessed by decompiler + (vertex debug-vertex 600 :inline :offset-assert 16) ;; guessed by decompiler ) :method-count-assert 9 :size-assert #x4b10 :flag-assert #x900004b10 ) -|# -;; (define-extern *color-black* object) ;; rgba -;; (define-extern *color-white* object) ;; rgba -;; (define-extern *color-gray* object) ;; rgba -;; (define-extern *color-red* object) ;; rgba -;; (define-extern *color-green* object) ;; rgba -;; (define-extern *color-blue* object) ;; rgba -;; (define-extern *color-cyan* object) ;; rgba -;; (define-extern *color-magenta* object) ;; rgba -;; (define-extern *color-yellow* object) ;; rgba -;; (define-extern *color-light-red* object) ;; rgba -;; (define-extern *color-light-green* object) ;; rgba -;; (define-extern *color-light-blue* object) ;; rgba -;; (define-extern *color-light-cyan* object) ;; rgba -;; (define-extern *color-light-magenta* object) ;; rgba -;; (define-extern *color-light-yellow* object) ;; rgba -;; (define-extern *color-dark-red* object) ;; rgba -;; (define-extern *color-dark-green* object) ;; rgba -;; (define-extern *color-dark-blue* object) ;; rgba -;; (define-extern *color-dark-cyan* object) ;; rgba -;; (define-extern *color-dark-magenta* object) ;; rgba -;; (define-extern *color-dark-yellow* object) ;; rgba -;; (define-extern *color-orange* object) ;; rgba +(define-extern *color-black* rgba) +(define-extern *color-white* rgba) +(define-extern *color-gray* rgba) +(define-extern *color-red* rgba) +(define-extern *color-green* rgba) +(define-extern *color-blue* rgba) +(define-extern *color-cyan* rgba) +(define-extern *color-magenta* rgba) +(define-extern *color-yellow* rgba) +(define-extern *color-light-red* rgba) +(define-extern *color-light-green* rgba) +(define-extern *color-light-blue* rgba) +(define-extern *color-light-cyan* rgba) +(define-extern *color-light-magenta* rgba) +(define-extern *color-light-yellow* rgba) +(define-extern *color-dark-red* rgba) +(define-extern *color-dark-green* rgba) +(define-extern *color-dark-blue* rgba) +(define-extern *color-dark-cyan* rgba) +(define-extern *color-dark-magenta* rgba) +(define-extern *color-dark-yellow* rgba) +(define-extern *color-orange* rgba) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; joint-mod-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +(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-ik-flags + :bitfield #t + :type uint32 + (enable) + (elbow-trans-neg) + (elbow-rot-neg) + ) + (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 :offset-assert 4) ;; guessed by decompiler (process process-drawable :offset-assert 8) ;; guessed by decompiler (joint cspace :offset-assert 12) (target vector :inline :offset-assert 16) (twist vector :inline :offset-assert 32) (twist-max vector :inline :offset-assert 48) - (extra-twist deg :offset-assert 40) ;; degrees - (track-mode track-mode :offset-assert 44) - (look-at-count uint16 :offset-assert 46) - (twist-range-x meters :offset-assert 56) - (twist-range-y meters :offset-assert 60) + (extra-twist degrees :offset-assert 40 :overlay-at (-> twist z)) ;; degrees + (track-mode track-mode :offset-assert 44 :overlay-at (-> twist w)) + (look-at-count uint16 :offset 46) + (twist-range-x meters :offset 56) + (twist-range-y meters :offset 60) (twist-speed-x float :offset-assert 64) (twist-speed-y float :offset-assert 68) (trans vector :inline :offset-assert 80) - (smushy-old float :offset-assert 80) - (smushy-off float :offset-assert 84) - (smushyv float :offset-assert 88) + (smushy-old float :offset 80) + (smushy-off float :offset 84) + (smushyv float :offset 88) (quat quaternion :inline :offset-assert 96) (scale vector :inline :offset-assert 112) - (notice-time uint64 :offset-assert 128) ;; time-frame + (notice-time time-frame :offset-assert 128) ;; time-frame (flex-blend float :offset-assert 136) (blend float :offset-assert 140) (old-blend float :offset-assert 144) (max-dist meters :offset-assert 148) - (ignore-angle deg :offset-assert 152) ;; degrees + (ignore-angle degrees :offset-assert 152) ;; degrees (up uint8 :offset-assert 156) (nose uint8 :offset-assert 157) (ear uint8 :offset-assert 158) @@ -18780,17 +18918,15 @@ (joint-mod-method-9 () none) ;; 9 ;; (mode-set! (_type_ joint-mod-mode) none) (joint-mod-method-10 () none) ;; 10 ;; (target-set! (_type_ vector) none) (joint-mod-method-11 () none) ;; 11 ;; (look-at! (_type_ vector symbol process) none) - (joint-mod-method-12 () none) ;; 12 ;; (reset-blend! (_type_) _type_) + (reset-blend! "Set the blend to 0." (_type_) _type_) ;; 12 (joint-mod-method-13 () none) ;; 13 ;; (twist-set! (_type_ float float float) vector) (joint-mod-method-14 () none) ;; 14 ;; (trs-set! (_type_ vector quaternion vector) none) (joint-mod-method-15 () none) ;; 15 ;; (shut-down (_type_) none) ) ) -|# -#| (deftype try-to-look-at-info (basic) - ((who uint64 :offset-assert 8) ;; handle + ((who handle :offset-assert 8) (horz float :offset-assert 16) (vert float :offset-assert 20) ) @@ -18798,10 +18934,9 @@ :size-assert #x18 :flag-assert #x900000018 ) -|# -#| (deftype joint-mod-spinner (basic) + "Control a joint by just spinning it around an axis." ((spin-axis vector :inline :offset-assert 16) (angle float :offset-assert 32) (spin-rate float :offset-assert 36) @@ -18810,28 +18945,34 @@ :method-count-assert 9 :size-assert #x2c :flag-assert #x90000002c + (:methods + (new (symbol type process-drawable int vector float) _type_) + ) + ) + +(defenum joint-mod-base-flags + :bitfield #t + :type uint16 + (attached 0) ) -|# -#| (deftype joint-mod-base (structure) - ((flags uint16 :offset-assert 0) + "Base type for most joint-mods" + ((flags joint-mod-base-flags :offset-assert 0) (node-index int16 :offset-assert 2) - (proc uint32 :offset-assert 4) - (callback basic :offset-assert 8) + (proc (pointer process-drawable) :offset-assert 4) + (callback (function cspace transformq none) :offset-assert 8) ) :method-count-assert 12 :size-assert #xc :flag-assert #xc0000000c (:methods - (joint-mod-base-method-9 () none) ;; 9 - (joint-mod-base-method-10 () none) ;; 10 - (joint-mod-base-method-11 () none) ;; 11 + (init "Set up this joint-mod to modify the given joint of the given process. Will attach automatically if attached flag is set." (_type_ process-drawable uint joint-mod-base-flags) none) ;; 9 + (attach-callback "Take control of the specified joint by modifying the cspace callback." (_type_) none) ;; 10 + (remove-callback "Remove this callback and set param0 to #f to use the default (animated joint)" (_type_) none) ;; 11 ) ) -|# -#| (deftype joint-mod-rotate-local (joint-mod-base) ((rotation quaternion :inline :offset-assert 16) ) @@ -18842,9 +18983,7 @@ (new (symbol type) _type_) ;; 0 ;; (new (symbol type process-drawable int symbol) _type_) ) ) -|# -#| (deftype joint-mod-rotate-world (joint-mod-base) ((rotation quaternion :inline :offset-assert 16) ) @@ -18852,9 +18991,7 @@ :size-assert #x20 :flag-assert #xc00000020 ) -|# -#| (deftype joint-mod-set-local (joint-mod-base) ((transform transformq :inline :offset-assert 16) ) @@ -18865,9 +19002,7 @@ (new (symbol type) _type_) ;; 0 ;; (new (symbol type process-drawable int symbol symbol symbol) _type_) ) ) -|# -#| (deftype joint-mod-add-local (joint-mod-base) ((transform transformq :inline :offset-assert 16) ) @@ -18878,9 +19013,7 @@ (new (symbol type) _type_) ;; 0 ;; (new (symbol type process-drawable int symbol symbol symbol) _type_) ) ) -|# -#| (deftype joint-mod-set-world (joint-mod-base) ((transform transformq :inline :offset-assert 16) ) @@ -18891,9 +19024,7 @@ (new (symbol type) _type_) ;; 0 ;; (new (symbol type process-drawable int symbol) _type_) ) ) -|# -#| (deftype joint-mod-set-world-no-trans (joint-mod-base) ((transform transformq :inline :offset-assert 16) ) @@ -18901,9 +19032,7 @@ :size-assert #x40 :flag-assert #xc00000040 ) -|# -#| (deftype joint-mod-blend-local (joint-mod-base) ((transform transformq :inline :offset-assert 16) (blend-transform transformq :inline :offset-assert 64) @@ -18916,9 +19045,7 @@ (new (symbol type) _type_) ;; 0 ;; (new (symbol type process-drawable int symbol) _type_) ) ) -|# -#| (deftype joint-mod-blend-world (joint-mod-base) ((transform transformq :inline :offset-assert 16) (blend-transform transformq :inline :offset-assert 64) @@ -18931,9 +19058,7 @@ (new (symbol type) _type_) ;; 0 ;; (new (symbol type process-drawable int symbol float) _type_) ) ) -|# -#| (deftype joint-mod-ik (basic) ((flags joint-mod-ik-flags :offset-assert 4) ;; guessed by decompiler (process process-drawable :offset-assert 8) ;; guessed by decompiler @@ -18960,9 +19085,7 @@ (joint-mod-ik-method-10 () none) ;; 10 ;; (enable-set! (_type_ symbol) none) ) ) -|# -#| (deftype ik-limb-setup (structure) ((elbow-index int32 :offset-assert 0) (hand-dist float :offset-assert 4) @@ -18971,9 +19094,7 @@ :size-assert #x8 :flag-assert #x900000008 ) -|# -#| (deftype joint-mod-polar-look-at (basic) ((flags uint32 :offset-assert 4) (ear int8 :offset-assert 8) @@ -19005,14 +19126,17 @@ (joint-mod-polar-look-at-method-14 () none) ;; 14 ) ) -|# ;; (define-extern joint-mod-debug-draw function) ;; (function joint-mod none) -;; (define-extern joint-mod-spinner-callback function) ;; (function cspace transformq none) -;; (define-extern joint-mod-rotate-local-callback function) ;; (function cspace transformq none) -;; (define-extern vector<-cspace2! function) -;; (define-extern joint-mod-rotate-world-callback function) -;; (define-extern joint-mod-set-local-callback function) ;; (function cspace transformq none) +(define-extern joint-mod-spinner-callback + "cspace callback for joint-mod-spinner. Update the cspace's bone from the parent transformq, plus the rotation from this spinner." + (function cspace transformq none)) +(define-extern joint-mod-rotate-local-callback + "Apply an additional rotation to the transform (left side quaternion multiplication" + (function cspace transformq none)) +(define-extern vector<-cspace2! "Same as vector<-cspace! Convert a bone matrix from a cspace to the origin of the bone frame." (function vector cspace vector)) +(define-extern joint-mod-rotate-world-callback "Callback for joint-mod-rotate-world. See comment on that type." (function cspace transformq none)) +;; (define-extern joint-mod-set-local-callback function) ;; (define-extern joint-mod-add-local-callback function) ;; (function cspace transformq none) ;; (define-extern joint-mod-set-world-callback function) ;; (function cspace transformq none) ;; (define-extern joint-mod-set-world-no-trans-callback function) @@ -19343,6 +19467,7 @@ (nav-flags uint8 :offset-assert 145) ;; nav-flags (total-prims uint8 :offset-assert 146) (num-riders uint8 :offset-assert 147) + (pat-ignore-mask pat-surface :offset-assert 148) ;; somehow is missing from inspect?? (event-self symbol :offset 152) ;; guessed by decompiler (event-other symbol :offset-assert 156) ;; guessed by decompiler (root-prim collide-shape-prim :offset-assert 160) ;; guessed by decompiler @@ -26864,7 +26989,7 @@ ;; (define-extern cspace<-parent-joint! function) ;; (function cspace (pointer process-drawable) int matrix) ;; (define-extern cspace<-rot-yxy! function) ;; (function cspace transform matrix) ;; (define-extern cspace<-transform-yxy! function) ;; (function cspace transform matrix) -;; (define-extern cspace<-transformq! function) ;; (function cspace transformq matrix) +(define-extern cspace<-transformq! (function cspace transformq matrix)) ;; (define-extern cspace<-transformq+trans! function) ;; (function cspace transformq vector matrix) ;; (define-extern cspace<-transformq+world-trans! function) ;; (function cspace transformq vector matrix) ;; (define-extern cspace<-transformq+rot-offset! function) ;; (function cspace transformq vector matrix) @@ -26875,7 +27000,7 @@ ;; (define-extern cspace<-parented-matrix-mirror! function) ;; (function cspace matrix matrix) ;; (define-extern cspace<-parented-matrix-joint-flip-z! function) ;; (function cspace matrix matrix) ;; (define-extern cspace<-matrix-joint-flip-z! function) ;; (function cspace matrix none) -;; (define-extern cspace<-parented-transformq-joint! function) ;; (function cspace transformq none) +(define-extern cspace<-parented-transformq-joint! (function cspace transformq none)) ;; (define-extern cspace<-parented-transformq-joint-flip-z! function) ;; (function cspace transformq none) ;; (define-extern clear-frame-accumulator function) ;; (define-extern normalize-frame-quaternions function) diff --git a/decompiler/config/jak3/ntsc_v1/type_casts.jsonc b/decompiler/config/jak3/ntsc_v1/type_casts.jsonc index 5b38a4f3c8..99aa967f1a 100644 --- a/decompiler/config/jak3/ntsc_v1/type_casts.jsonc +++ b/decompiler/config/jak3/ntsc_v1/type_casts.jsonc @@ -303,5 +303,12 @@ [8, "v1", "pointer"], [[9, 11], "v1", "touching-prims-entry"], [[1, 20], "a1", "touching-prims-entry"] - ] + ], + "(method 0 prim-strip)": [[[101, 121], "a0", "vector"]], + "(method 0 script-context)": [[[8, 17], "v0", "script-context"]], + "joint-mod-spinner-callback": [[[2, 63], "gp", "joint-mod-spinner"]], + "joint-mod-rotate-local-callback": [ + [[2, 16], "v1", "joint-mod-rotate-local"] + ], + "joint-mod-rotate-world-callback": [[[0, 24], "s3", "joint-mod-rotate-world"]] } diff --git a/decompiler/config/jak3/ntsc_v1/var_names.jsonc b/decompiler/config/jak3/ntsc_v1/var_names.jsonc index c96e72ae77..f05b5e659a 100644 --- a/decompiler/config/jak3/ntsc_v1/var_names.jsonc +++ b/decompiler/config/jak3/ntsc_v1/var_names.jsonc @@ -728,5 +728,8 @@ "a1-0": "current", "a2-0": "next" } + }, + "(method 0 prim-strip)": { + "args": ["allocation", "type-to-make", "num-vertices", "tex-id", "tex-name"] } } diff --git a/goal_src/jak3/engine/anim/aligner-h.gc b/goal_src/jak3/engine/anim/aligner-h.gc index 502032a2b7..8cbd79cdb9 100644 --- a/goal_src/jak3/engine/anim/aligner-h.gc +++ b/goal_src/jak3/engine/anim/aligner-h.gc @@ -5,5 +5,49 @@ ;; name in dgo: aligner-h ;; dgos: GAME +(defenum align-flags + :bitfield #t + :type uint32 + (disabled) ;; keep object velocity + (af01) + (af02) + (af03) + (af04) + (af05) + ) + ;; DECOMP BEGINS +(deftype align-control (basic) + ((flags align-flags) + (process process-drawable) + (frame-group art-joint-anim) + (frame-num float) + (matrix matrix 2 :inline) + (transform transform 2 :inline) + (delta transformq :inline) + (last-speed meters) + (align transformq :inline :overlay-at (-> transform 0 trans data 0)) + ) + (:methods + (new (symbol type process) _type_) + (align-control-method-9 () none) + (align-control-method-10 () none) + (align-control-method-11 () none) + (align-control-method-12 () none) + (align-control-method-13 () none) + ) + ) + + +;; WARN: Return type mismatch object vs align-control. +(defmethod new align-control ((allocation symbol) (type-to-make type) (arg0 process)) + (let ((v0-0 (the-as object (object-new allocation type-to-make (the-as int (-> type-to-make size)))))) + (when (zero? (the-as align-control v0-0)) + (go process-drawable-art-error "memory") + (return (the-as align-control 0)) + ) + (set! (-> (the-as align-control v0-0) process) (the-as process-drawable arg0)) + (the-as align-control v0-0) + ) + ) diff --git a/goal_src/jak3/engine/anim/joint-h.gc b/goal_src/jak3/engine/anim/joint-h.gc index 046e959eba..02ef34f292 100644 --- a/goal_src/jak3/engine/anim/joint-h.gc +++ b/goal_src/jak3/engine/anim/joint-h.gc @@ -5,5 +5,147 @@ ;; name in dgo: joint-h ;; dgos: GAME +(declare-type joint-control basic) + +(defenum joint-control-command + :type uint64 + (push 1) + (blend 2) + (push1 19) + (stack 36) + (float 42) + (stack1 52) + ) + +(defenum joint-control-status + :type uint16 + :bitfield #t + + (sync-math 0) ;; 1 + (spooling 1) ;; 2 + (spooling-not-last-block 2) ;; 4 + (blend-shape 3) ;; 8 + (math-when-off-screen 4) ;; 16 + (valid-spooled-frame 5) ;; 32 + (blend-shape-valid 6) ;; 64 + (eye-anim-valid 7) ;; 128 + (eye-anim 8) ;; 256 + (force-math 9) + (no-joint-callbacks 10) + ) + +(declare-type effect-control basic) + ;; DECOMP BEGINS +(deftype joint-control-channel (structure) + ((parent joint-control) + (frame-group art-joint-anim) + (frame-num float) + (dist meters) + (num-func (function joint-control-channel float float float float)) + (param float 3) + (frame-interp float 2) + (inspector-amount uint8) + (command joint-control-command) + (group-sub-index int8) + (group-size int8) + (eval-time uint32) + ) + ) + + +(deftype top-anim-joint-control (basic) + ((process (pointer process-drawable)) + (interp-select uint64 2) + (base-anim basic) + (base-anim-speed float) + (base-anim-blend float) + (interp float) + (frame-group art-joint-anim) + (frame-group-push art-joint-anim) + (frame-num float) + (frame-targ art-joint-anim) + (frame-speed float) + (frame-blend float) + (frame-cur-blend float) + (frame-start float) + (frame-post-blend float) + (frame-post-end float) + (frame-push-time time-frame) + (frame-post-put-away basic) + (update-time time-frame) + ) + (:methods + (new (symbol type) _type_) + (top-anim-joint-control-method-9 () none) + (top-anim-joint-control-method-10 () none) + (top-anim-joint-control-method-11 () none) + (top-anim-joint-control-method-12 () none) + ) + ) + + +(deftype joint-control (basic) + ((status joint-control-status) + (allocated-length uint8) + (active-channels uint8) + (root-channel (inline-array joint-control-channel) :offset 16) + (blend-index uint8) + (active-frame-interp uint8) + (float-channels uint8) + (generate-frame-function (function joint-anim-frame int joint-control int)) + (prebind-function (function joint-anim-frame int joint-control int)) + (postbind-function (function draw-control cspace-array joint-control none)) + (effect effect-control) + (interp-select int64 2) + (top-anim top-anim-joint-control) + (override (array float)) + (channel joint-control-channel :dynamic) + ) + (:methods + (new (symbol type) _type_) + (joint-control-method-9 () none) + (joint-control-method-10 () none) + (joint-control-method-11 () none) + (joint-control-method-12 () none) + ) + ) + + +(deftype matrix-stack (structure) + ((top matrix) + (data matrix 24 :inline) + ) + ) + + +(deftype channel-upload-info (structure) + ((fixed joint-anim-compressed-fixed) + (fixed-qwc int32) + (frame joint-anim-compressed-frame) + (frame-qwc int32) + (amount float) + (interp float) + ) + :pack-me + ) + + +(deftype joint-work (structure) + ((temp-mtx matrix :inline) + (joint-stack matrix-stack :inline) + (fix-jmp-table (function none) 16) + (frm-jmp-table (function none) 16) + (pair-jmp-table (function none) 16) + (uploads channel-upload-info 24 :inline) + (num-uploads int32) + (mtx-acc matrix 2 :inline) + (tq-acc transformq 100 :inline) + (jacp-hdr joint-anim-compressed-hdr :inline) + (fixed-data joint-anim-compressed-fixed :inline) + (frame-data joint-anim-compressed-frame 2 :inline) + (flatten-array float 576 :overlay-at mtx-acc) + (flattened vector 24 :inline :overlay-at mtx-acc) + ) + ) diff --git a/goal_src/jak3/engine/anim/mspace-h.gc b/goal_src/jak3/engine/anim/mspace-h.gc index 2da6e5d345..15822a4fad 100644 --- a/goal_src/jak3/engine/anim/mspace-h.gc +++ b/goal_src/jak3/engine/anim/mspace-h.gc @@ -68,7 +68,7 @@ The callback function is used to take the joint transforms out of the joint anim (deftype cspace-array (inline-array-class) - ((data cspace :dynamic) + ((data cspace :inline :dynamic) ) ) diff --git a/goal_src/jak3/engine/collide/collide-shape-h.gc b/goal_src/jak3/engine/collide/collide-shape-h.gc index 6b929e0b19..1597868ecc 100644 --- a/goal_src/jak3/engine/collide/collide-shape-h.gc +++ b/goal_src/jak3/engine/collide/collide-shape-h.gc @@ -258,6 +258,7 @@ Most [[process-drawable]]s have a [[collide-shape]] that represents their root t (nav-flags uint8) (total-prims uint8) (num-riders uint8) + (pat-ignore-mask pat-surface) (event-self symbol :offset 152) (event-other symbol) (root-prim collide-shape-prim) @@ -398,7 +399,53 @@ Most [[process-drawable]]s have a [[collide-shape]] that represents their root t (the-as int (-> this num-children)) ) -;; ERROR: function was not converted to expressions. Cannot decompile. +(defmethod new collide-shape ((allocation symbol) (type-to-make type) (arg0 process-drawable) (arg1 collide-list-enum)) + (let ((s5-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> s5-0 actor-hash-index) -1) + (set! (-> s5-0 process) arg0) + (set! (-> s5-0 max-iteration-count) (the-as uint 1)) + (set! (-> s5-0 nav-flags) (the-as uint 1)) + (set! (-> s5-0 event-self) #f) + (set! (-> s5-0 event-other) #f) + (set! (-> s5-0 riders) (the-as (inline-array collide-rider) #f)) + (set! (-> s5-0 root-prim) #f) + (set! (-> s5-0 penetrate-using) (penetrate)) + (set! (-> s5-0 penetrated-by) (penetrate)) + (set! (-> s5-0 event-priority) (the-as uint 0)) + (set! (-> s5-0 rider-max-momentum) 409600.0) + (case (-> arg0 type symbol) + (('camera) + (set! (-> s5-0 pat-ignore-mask) (new 'static 'pat-surface :nocamera #x1 :probe #x1 :noendlessfall #x1)) + ) + (('target) + (set! (-> s5-0 pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :board #x1)) + ) + (else + (set! (-> s5-0 pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + ) + ) + (set! (-> s5-0 trans w) 1.0) + (quaternion-identity! (the-as quaternion (-> s5-0 rot))) + (vector-identity! (-> s5-0 scale)) + (cond + ((= arg1 (collide-list-enum hit-by-player)) + (add-connection *collide-hit-by-player-list* arg0 #f s5-0 #f #f) + ) + ((= arg1 (collide-list-enum usually-hit-by-player)) + (add-connection *collide-hit-by-others-list* arg0 #f s5-0 #f #f) + ) + ((= arg1 (collide-list-enum hit-by-others)) + (add-connection *collide-player-list* arg0 #f s5-0 #f #f) + ) + (else + (format 0 "Unsupported collide-list-enum in collide-shape constructor!~%") + ) + ) + s5-0 + ) + ) ;; WARN: Return type mismatch collide-shape vs collide-shape-moving. (defmethod new collide-shape-moving ((allocation symbol) (type-to-make type) (arg0 process-drawable) (arg1 collide-list-enum)) diff --git a/goal_src/jak3/engine/common-obs/prim-h.gc b/goal_src/jak3/engine/common-obs/prim-h.gc index 8d5852ee82..cd0c0beef0 100644 --- a/goal_src/jak3/engine/common-obs/prim-h.gc +++ b/goal_src/jak3/engine/common-obs/prim-h.gc @@ -5,5 +5,152 @@ ;; name in dgo: prim-h ;; dgos: GAME +(defenum prim-flags + :type uint32 + :bitfield #t + (pf0 0) ;; set by default + (pf1 1) ;; set by default + (pf2 2) + (pf3 3) + (pf4 4) + (no-texture-name 5) ;; only has the ID. + ) +(define-extern process-drawable-art-error (state string process-drawable)) +(define-extern *prim-engine* engine) + ;; DECOMP BEGINS +(deftype prim-vertex (structure) + "Vertex for the prim renderer. These vertices are generated by +some special effect code, then sent to the prim renderer to be drawn." + ((stq vector :inline) + (nokick uint32 :overlay-at (-> stq data 2)) + (col rgba :overlay-at (-> stq data 3)) + (pos vector :inline) + ) + ) + + +(deftype prim-base (basic) + "Base class for prim-strip." + () + (:methods + (prim-base-method-9 () none) + ) + ) + + +(deftype prim-strip (prim-base) + "A collection of vertices, all with the same texture and draw settings. +These are owned by the thing submitting to prim, not the prim renderer itself." + ((flags prim-flags) + (tex-name basic) + (num-verts uint16) + (allocated-num-verts uint16) + (tex-id texture-id) + (adnops gs-adcmd 2 :inline) + (data0 uint64 :overlay-at (-> adnops 0 word 0)) + (reg0 uint64 :overlay-at (-> adnops 0 word 2)) + (data1 uint64 :offset 48) + (reg1 uint64 :offset 56) + (clamp gs-clamp) + (alpha gs-alpha) + (bucket bucket-id) + (sink uint32) + (level basic) + (texture-index uint32) + (data prim-vertex :inline :dynamic) + ) + (:methods + (new (symbol type int texture-id string) _type_) + (prim-strip-method-10 () none) + ) + ) + + +(defmethod new prim-strip ((allocation symbol) (type-to-make type) (num-vertices int) (tex-id texture-id) (tex-name string)) + "Allocate a new prim-strip and room for vertices. The texture can be specified by name or ID." + (with-pp + (let ((s5-0 (object-new allocation type-to-make (the-as int (+ (-> type-to-make size) (* num-vertices 32)))))) + (if (zero? s5-0) + (go process-drawable-art-error "prim-strip") + ) + (add-connection *prim-engine* pp #f pp s5-0 #f) + (set! (-> s5-0 flags) (prim-flags pf0 pf1)) + (set! (-> s5-0 num-verts) (the-as uint num-vertices)) + (set! (-> s5-0 allocated-num-verts) (the-as uint num-vertices)) + (set! (-> s5-0 data0) (the-as uint 0)) + (set! (-> s5-0 adnops 0 cmds) (gs-reg64 hack)) + (set! (-> s5-0 data1) (the-as uint 0)) + (set! (-> s5-0 adnops 1 cmds) (gs-reg64 hack)) + (set! (-> s5-0 clamp) (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp))) + (set! (-> s5-0 alpha) (new 'static 'gs-alpha :b #x1 :d #x1)) + (cond + (tex-name + (set! (-> s5-0 tex-id) (lookup-texture-id-by-name tex-name (the-as string #f))) + (set! (-> s5-0 tex-name) tex-name) + (logclear! (-> s5-0 flags) (prim-flags no-texture-name)) + ) + (else + (set! (-> s5-0 tex-id) tex-id) + (set! (-> s5-0 tex-name) #f) + (logior! (-> s5-0 flags) (prim-flags no-texture-name)) + ) + ) + (set! (-> s5-0 bucket) (bucket-id bucket566)) + (set! (-> s5-0 sink) (the-as uint 64)) + (set! (-> s5-0 level) (-> *level* level-default)) + (set! (-> s5-0 texture-index) (the-as uint 4)) + (let ((f0-1 (/ 1.0 (the float (/ (+ num-vertices -1) 2))))) + (dotimes (v1-24 num-vertices) + (let ((a0-7 (-> s5-0 data v1-24))) + (set! (-> a0-7 stq x) (* (the float (/ v1-24 2)) f0-1)) + (set! (-> a0-7 stq y) (the float (logand v1-24 1))) + (set! (-> a0-7 stq z) 0.0) + (set! (-> a0-7 col) (the-as rgba 0.0)) + ) + (set! (-> s5-0 data v1-24 col) (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)) + (set-vector! + (the-as vector (+ (the-as uint (the-as vector (-> s5-0 data 0 pos))) (* v1-24 32))) + (* 4096.0 (the float (/ v1-24 2))) + (* 4096.0 (the float (logand v1-24 1))) + 0.0 + 1.0 + ) + ) + ) + s5-0 + ) + ) + ) + +;; WARN: Return type mismatch uint vs int. +(defmethod asize-of ((this prim-strip)) + (the-as int (+ (-> this type size) (* (-> this allocated-num-verts) 32))) + ) + +(deftype prim-sink (structure) + ((vertex-count uint8) + (control-count uint8) + ) + :allow-misaligned + ) + + +(deftype prim-work (structure) + ((vertex-tmpl dma-packet 3 :inline) + (control-tmpl dma-packet 2 :inline) + (giftag generic-gif-tag :inline) + (call-scissor dma-packet :inline) + (call-noclip dma-packet :inline) + (shader adgif-shader :inline) + (mask vector4w :inline) + (in-verts int32) + (num-verts int32) + (vert-ptr prim-vertex) + (sinks prim-sink 68 :inline) + ) + (:methods + (prim-work-method-9 () none) + ) + ) diff --git a/goal_src/jak3/engine/debug/debug-h.gc b/goal_src/jak3/engine/debug/debug-h.gc index 4d63596368..0dd2c547c5 100644 --- a/goal_src/jak3/engine/debug/debug-h.gc +++ b/goal_src/jak3/engine/debug/debug-h.gc @@ -7,3 +7,72 @@ ;; DECOMP BEGINS +(deftype pos-history (structure) + ((points (inline-array vector)) + (num-points int32) + (h-first int32) + (h-last int32) + ) + ) + + +(deftype debug-vertex (structure) + ((trans vector4w :inline) + (normal vector3h :inline) + (st vector2h :inline) + (color uint32) + ) + ) + + +(deftype debug-vertex-stats (basic) + ((length int32) + (pos-count int32) + (vertex debug-vertex 600 :inline) + ) + ) + + +(define *color-black* (new 'static 'rgba :a #x80)) + +(define *color-white* (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)) + +(define *color-gray* (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)) + +(define *color-red* (new 'static 'rgba :r #xff :a #x80)) + +(define *color-green* (new 'static 'rgba :g #xff :a #x80)) + +(define *color-blue* (new 'static 'rgba :b #xff :a #x80)) + +(define *color-cyan* (new 'static 'rgba :g #xff :b #xff :a #x80)) + +(define *color-magenta* (new 'static 'rgba :r #xff :b #xff :a #x80)) + +(define *color-yellow* (new 'static 'rgba :r #xff :g #xff :a #x80)) + +(define *color-light-red* (new 'static 'rgba :r #xff :g #x80 :b #x80 :a #x80)) + +(define *color-light-green* (new 'static 'rgba :r #x80 :g #xff :b #x80 :a #x80)) + +(define *color-light-blue* (new 'static 'rgba :r #x80 :g #x80 :b #xff :a #x80)) + +(define *color-light-cyan* (new 'static 'rgba :r #x80 :g #xff :b #xff :a #x80)) + +(define *color-light-magenta* (new 'static 'rgba :r #xff :g #x80 :b #xff :a #x80)) + +(define *color-light-yellow* (new 'static 'rgba :r #xff :g #xff :b #x80 :a #x80)) + +(define *color-dark-red* (new 'static 'rgba :r #x80 :a #x80)) + +(define *color-dark-green* (new 'static 'rgba :g #x80 :a #x80)) + +(define *color-dark-blue* (new 'static 'rgba :b #x80 :a #x80)) + +(define *color-dark-cyan* (new 'static 'rgba :g #x80 :b #x80 :a #x80)) + +(define *color-dark-magenta* (new 'static 'rgba :r #x80 :b #x80 :a #x80)) + +(define *color-dark-yellow* (new 'static 'rgba :r #x80 :g #x80 :a #x80)) + +(define *color-orange* (new 'static 'rgba :r #xff :g #x80 :a #x80)) diff --git a/goal_src/jak3/engine/game/game-h.gc b/goal_src/jak3/engine/game/game-h.gc index 5900c9de88..a776658f9c 100644 --- a/goal_src/jak3/engine/game/game-h.gc +++ b/goal_src/jak3/engine/game/game-h.gc @@ -5,5 +5,378 @@ ;; name in dgo: game-h ;; dgos: GAME +(declare-type nav-control basic) +(declare-type path-control basic) +(declare-type vol-control basic) +(declare-type fact-info basic) +(declare-type actor-link-info basic) +(declare-type water-control basic) +(declare-type carry-info basic) +(declare-type rigid-body-control basic) + +(defenum state-flags + :bitfield #t + :type uint32 + (sf0 0) + (sf1 1) + (sf2 2) + (sf3 3) + (sf4 4) + (sf5 5) + (sf6 6) + (sf7 7) + (sf8 8) + (sf9 9) + (sf10 10) + (sf11 11) + (sf12 12) + (sf13 13) + (sf14 14) + (sf15 15) + (sf16 16) + (sf17 17) + (sf18 18) + (sf19 19) + (sf20 20) + (sf21 21) + (sf22 22) + (sf23 23) + (sf24 24) + (sf25 25) + (sf26 26) + (sf27 27) + (sf28 28) + (sf29 29) + (sf30 30) + (sf31 31) + ) + +(defenum attack-mask + :bitfield #t + :type uint32 + (trans 0) ;; 1 + (vector 1) ;; 2 + (intersection 2) ;; 4 + (attacker 3) ;; 8 + (attack-time 4) ;; 16 + (invinc-time 5) ;; 32 + (mode 6) ;; 64 + (shove-back 7) ;; 128 + (shove-up 8) ;; 256 + (speed 9) ;; 512 + (dist 10) ;; 1024 + (control 11) ;; 2048 + (angle 12) ;; 4096 + (rotate-to 13) ;; 8192 + (prev-state 14) ;; 16384 + (id 15) ;; 32768 + (count 16) ;; hi 1 + (penetrate-using 17) ;; hi 2 + (attacker-velocity 18);; hi 4 + (damage 19) ;; hi 8 + (shield-damage 20) ;; hi16 + (vehicle-damage-factor 21) ;; hi 32 + (vehicle-impulse-factor 22) ;; hi 64 + (knock 23) + (test 24) + ) + ;; DECOMP BEGINS +(deftype process-drawable (process) + "This is the main base class for in-game objects. +This handles drawing, collision, animation, navigation, particles, sounds, physics, etc. +The actual child classes will add most of the functionality, and this just serves as a common +container for references to the `-control` objects for this object." + ((root trsqv) + (node-list cspace-array) + (draw draw-control) + (skel joint-control) + (nav nav-control) + (align align-control) + (path path-control) + (vol vol-control) + (fact fact-info) + (link actor-link-info) + (part sparticle-launch-control) + (water water-control) + (sound ambient-sound) + (carry carry-info) + (rbody rigid-body-control) + (state-flags state-flags) + (state-time time-frame) + ) + (:methods + (process-drawable-method-14 () none) + (process-drawable-method-15 () none) + (process-drawable-method-16 () none) + (process-drawable-method-17 () none) + (process-drawable-method-18 () none) + (process-drawable-method-19 () none) + ) + (:states + (process-drawable-art-error string) + process-drawable-idle + ) + ) + + +(deftype process-drawable-reserved (process-drawable) + "A process drawable with a lot of unused method slots. +GOAL cannot increase the number of methods at runtime, so, for interactive development, it is useful +to have a type with a large number of slots which can be turned into real methods without needed to reboot the PS2." + () + (:methods + (process-drawable-reserved-method-20 () none) + (process-drawable-reserved-method-21 () none) + (process-drawable-reserved-method-22 () none) + (process-drawable-reserved-method-23 () none) + (process-drawable-reserved-method-24 () none) + (process-drawable-reserved-method-25 () none) + (process-drawable-reserved-method-26 () none) + (process-drawable-reserved-method-27 () none) + (process-drawable-reserved-method-28 () none) + (process-drawable-reserved-method-29 () none) + (process-drawable-reserved-method-30 () none) + (process-drawable-reserved-method-31 () none) + (process-drawable-reserved-method-32 () none) + (process-drawable-reserved-method-33 () none) + (process-drawable-reserved-method-34 () none) + (process-drawable-reserved-method-35 () none) + (process-drawable-reserved-method-36 () none) + (process-drawable-reserved-method-37 () none) + (process-drawable-reserved-method-38 () none) + (process-drawable-reserved-method-39 () none) + (process-drawable-reserved-method-40 () none) + (process-drawable-reserved-method-41 () none) + (process-drawable-reserved-method-42 () none) + (process-drawable-reserved-method-43 () none) + (process-drawable-reserved-method-44 () none) + (process-drawable-reserved-method-45 () none) + (process-drawable-reserved-method-46 () none) + (process-drawable-reserved-method-47 () none) + (process-drawable-reserved-method-48 () none) + (process-drawable-reserved-method-49 () none) + (process-drawable-reserved-method-50 () none) + (process-drawable-reserved-method-51 () none) + (process-drawable-reserved-method-52 () none) + (process-drawable-reserved-method-53 () none) + (process-drawable-reserved-method-54 () none) + (process-drawable-reserved-method-55 () none) + (process-drawable-reserved-method-56 () none) + (process-drawable-reserved-method-57 () none) + (process-drawable-reserved-method-58 () none) + (process-drawable-reserved-method-59 () none) + (process-drawable-reserved-method-60 () none) + (process-drawable-reserved-method-61 () none) + (process-drawable-reserved-method-62 () none) + (process-drawable-reserved-method-63 () none) + (process-drawable-reserved-method-64 () none) + (process-drawable-reserved-method-65 () none) + (process-drawable-reserved-method-66 () none) + (process-drawable-reserved-method-67 () none) + (process-drawable-reserved-method-68 () none) + (process-drawable-reserved-method-69 () none) + (process-drawable-reserved-method-70 () none) + (process-drawable-reserved-method-71 () none) + (process-drawable-reserved-method-72 () none) + (process-drawable-reserved-method-73 () none) + (process-drawable-reserved-method-74 () none) + (process-drawable-reserved-method-75 () none) + (process-drawable-reserved-method-76 () none) + (process-drawable-reserved-method-77 () none) + (process-drawable-reserved-method-78 () none) + (process-drawable-reserved-method-79 () none) + (process-drawable-reserved-method-80 () none) + (process-drawable-reserved-method-81 () none) + (process-drawable-reserved-method-82 () none) + (process-drawable-reserved-method-83 () none) + (process-drawable-reserved-method-84 () none) + (process-drawable-reserved-method-85 () none) + (process-drawable-reserved-method-86 () none) + (process-drawable-reserved-method-87 () none) + (process-drawable-reserved-method-88 () none) + (process-drawable-reserved-method-89 () none) + (process-drawable-reserved-method-90 () none) + (process-drawable-reserved-method-91 () none) + (process-drawable-reserved-method-92 () none) + (process-drawable-reserved-method-93 () none) + (process-drawable-reserved-method-94 () none) + (process-drawable-reserved-method-95 () none) + (process-drawable-reserved-method-96 () none) + (process-drawable-reserved-method-97 () none) + (process-drawable-reserved-method-98 () none) + (process-drawable-reserved-method-99 () none) + (process-drawable-reserved-method-100 () none) + (process-drawable-reserved-method-101 () none) + (process-drawable-reserved-method-102 () none) + (process-drawable-reserved-method-103 () none) + (process-drawable-reserved-method-104 () none) + (process-drawable-reserved-method-105 () none) + (process-drawable-reserved-method-106 () none) + (process-drawable-reserved-method-107 () none) + (process-drawable-reserved-method-108 () none) + (process-drawable-reserved-method-109 () none) + (process-drawable-reserved-method-110 () none) + (process-drawable-reserved-method-111 () none) + (process-drawable-reserved-method-112 () none) + (process-drawable-reserved-method-113 () none) + (process-drawable-reserved-method-114 () none) + (process-drawable-reserved-method-115 () none) + (process-drawable-reserved-method-116 () none) + (process-drawable-reserved-method-117 () none) + (process-drawable-reserved-method-118 () none) + (process-drawable-reserved-method-119 () none) + (process-drawable-reserved-method-120 () none) + (process-drawable-reserved-method-121 () none) + (process-drawable-reserved-method-122 () none) + (process-drawable-reserved-method-123 () none) + (process-drawable-reserved-method-124 () none) + (process-drawable-reserved-method-125 () none) + (process-drawable-reserved-method-126 () none) + (process-drawable-reserved-method-127 () none) + (process-drawable-reserved-method-128 () none) + (process-drawable-reserved-method-129 () none) + (process-drawable-reserved-method-130 () none) + (process-drawable-reserved-method-131 () none) + (process-drawable-reserved-method-132 () none) + (process-drawable-reserved-method-133 () none) + (process-drawable-reserved-method-134 () none) + (process-drawable-reserved-method-135 () none) + (process-drawable-reserved-method-136 () none) + (process-drawable-reserved-method-137 () none) + (process-drawable-reserved-method-138 () none) + (process-drawable-reserved-method-139 () none) + (process-drawable-reserved-method-140 () none) + (process-drawable-reserved-method-141 () none) + (process-drawable-reserved-method-142 () none) + (process-drawable-reserved-method-143 () none) + (process-drawable-reserved-method-144 () none) + (process-drawable-reserved-method-145 () none) + (process-drawable-reserved-method-146 () none) + (process-drawable-reserved-method-147 () none) + (process-drawable-reserved-method-148 () none) + (process-drawable-reserved-method-149 () none) + (process-drawable-reserved-method-150 () none) + (process-drawable-reserved-method-151 () none) + (process-drawable-reserved-method-152 () none) + (process-drawable-reserved-method-153 () none) + (process-drawable-reserved-method-154 () none) + (process-drawable-reserved-method-155 () none) + (process-drawable-reserved-method-156 () none) + (process-drawable-reserved-method-157 () none) + (process-drawable-reserved-method-158 () none) + (process-drawable-reserved-method-159 () none) + (process-drawable-reserved-method-160 () none) + (process-drawable-reserved-method-161 () none) + (process-drawable-reserved-method-162 () none) + (process-drawable-reserved-method-163 () none) + (process-drawable-reserved-method-164 () none) + (process-drawable-reserved-method-165 () none) + (process-drawable-reserved-method-166 () none) + (process-drawable-reserved-method-167 () none) + (process-drawable-reserved-method-168 () none) + (process-drawable-reserved-method-169 () none) + (process-drawable-reserved-method-170 () none) + (process-drawable-reserved-method-171 () none) + (process-drawable-reserved-method-172 () none) + (process-drawable-reserved-method-173 () none) + (process-drawable-reserved-method-174 () none) + (process-drawable-reserved-method-175 () none) + (process-drawable-reserved-method-176 () none) + (process-drawable-reserved-method-177 () none) + (process-drawable-reserved-method-178 () none) + (process-drawable-reserved-method-179 () none) + (process-drawable-reserved-method-180 () none) + (process-drawable-reserved-method-181 () none) + (process-drawable-reserved-method-182 () none) + (process-drawable-reserved-method-183 () none) + (process-drawable-reserved-method-184 () none) + (process-drawable-reserved-method-185 () none) + (process-drawable-reserved-method-186 () none) + (process-drawable-reserved-method-187 () none) + (process-drawable-reserved-method-188 () none) + (process-drawable-reserved-method-189 () none) + (process-drawable-reserved-method-190 () none) + (process-drawable-reserved-method-191 () none) + (process-drawable-reserved-method-192 () none) + (process-drawable-reserved-method-193 () none) + (process-drawable-reserved-method-194 () none) + (process-drawable-reserved-method-195 () none) + (process-drawable-reserved-method-196 () none) + (process-drawable-reserved-method-197 () none) + (process-drawable-reserved-method-198 () none) + (process-drawable-reserved-method-199 () none) + (process-drawable-reserved-method-200 () none) + (process-drawable-reserved-method-201 () none) + (process-drawable-reserved-method-202 () none) + (process-drawable-reserved-method-203 () none) + (process-drawable-reserved-method-204 () none) + (process-drawable-reserved-method-205 () none) + (process-drawable-reserved-method-206 () none) + (process-drawable-reserved-method-207 () none) + (process-drawable-reserved-method-208 () none) + (process-drawable-reserved-method-209 () none) + (process-drawable-reserved-method-210 () none) + (process-drawable-reserved-method-211 () none) + (process-drawable-reserved-method-212 () none) + (process-drawable-reserved-method-213 () none) + (process-drawable-reserved-method-214 () none) + (process-drawable-reserved-method-215 () none) + (process-drawable-reserved-method-216 () none) + (process-drawable-reserved-method-217 () none) + ) + ) + + +(deftype attack-dir-info (structure) + ((dir vector :inline) + (xz-dir vector :inline) + (attacker-velocity vector :inline) + (pos vector :inline) + ) + ) + + +(deftype attack-info (structure) + ((trans vector :inline) + (vector vector :inline) + (attacker-velocity vector :inline) + (intersection vector :inline) + (attacker handle) + (attack-time time-frame) + (invinc-time time-frame) + (mask attack-mask) + (mode symbol) + (shove-back meters) + (shove-up meters) + (speed meters) + (dist meters) + (control float) + (angle symbol) + (rotate-to degrees) + (prev-state state) + (id uint32) + (count uint32) + (penetrate-using penetrate) + (damage float) + (shield-damage float) + (vehicle-damage-factor float) + (vehicle-impulse-factor float) + (knock knocked-type) + (test symbol) + ) + (:methods + (attack-info-method-9 () none) + (attack-info-method-10 () none) + (attack-info-method-11 () none) + ) + ) + + +(deftype ground-tween-info (structure) + ((chan uint8 3) + (blend float 3) + (group uint32 5) + ) + ) diff --git a/goal_src/jak3/engine/game/penetrate-h.gc b/goal_src/jak3/engine/game/penetrate-h.gc index b1fc9be11b..141fdb3b74 100644 --- a/goal_src/jak3/engine/game/penetrate-h.gc +++ b/goal_src/jak3/engine/game/penetrate-h.gc @@ -5,10 +5,26 @@ ;; name in dgo: penetrate-h ;; dgos: GAME -;; +++penetrate +;; +++game-h:knocked-type +(defenum knocked-type + :type uint8 + (knocked-type-0 0) + (knocked-type-1 1) + (knocked-type-2 2) + (knocked-type-3 3) + (knocked-type-4 4) ;; what the heck is this! (its on gator, and cant trigger it for the life of me) + (knocked-type-5 5) + (knocked-type-6 6) + (knocked-type-7 7) + (knocked-type-8 8) + (knocked-type-9 9) + (knocked-type-10 10) + ) +;; ---game-h:knocked-type + (defenum penetrate - :type uint64 :bitfield #t + :type uint64 (touch 0) (generic-attack 1) (lunge 2) @@ -47,35 +63,267 @@ (jak-dark-nuke 35) (jak-dark-blackhole 36) (emp-blast 37) - (penetrate-38 38) - (penetrate-39 39) - (penetrate-40 40) - (penetrate-41 41) - (penetrate-42 42) - (penetrate-43 43) - (penetrate-44 44) - (penetrate-45 45) - (penetrate-46 46) - (penetrate-47 47) - (penetrate-48 48) - (penetrate-49 49) - (penetrate-50 50) - (penetrate-51 51) - (penetrate-52 52) - (penetrate-53 53) - (penetrate-54 54) - (penetrate-55 55) - (penetrate-56 56) - (penetrate-57 57) - (penetrate-58 58) - (penetrate-59 59) - (penetrate-60 60) - (penetrate-61 61) - (penetrate-62 62) - (penetrate-63 63) ) -;; ---penetrate - ;; DECOMP BEGINS +;; WARN: Return type mismatch object vs string. +(defun-debug penetrate->string ((arg0 penetrate)) + (if (= (logand (penetrate jak-red-shockwave) arg0) (shl 4 32)) + (format #t "jak-red-shockwave ") + ) + (if (= (logand arg0 (penetrate mech-bonk)) (penetrate mech-bonk)) + (format #t "mech-bonk ") + ) + (if (= (logand (penetrate eco-blue) arg0) (shl #x8000 16)) + (format #t "eco-blue ") + ) + (if (= (logand (penetrate explode) arg0) (penetrate explode)) + (format #t "explode ") + ) + (if (= (logand arg0 (penetrate bonk)) (penetrate bonk)) + (format #t "bonk ") + ) + (if (= (logand (penetrate eco-red) arg0) (penetrate eco-red)) + (format #t "eco-red ") + ) + (if (= (logand arg0 (penetrate roll)) (penetrate roll)) + (format #t "roll ") + ) + (if (= (logand arg0 (penetrate mech)) (penetrate mech)) + (format #t "mech ") + ) + (if (= (logand arg0 (penetrate flut-attack)) (penetrate flut-attack)) + (format #t "flut-attack ") + ) + (if (= (logand arg0 (penetrate mech-punch)) (penetrate mech-punch)) + (format #t "mech-punch ") + ) + (if (= (logand (penetrate jak-dark-shot) arg0) (penetrate jak-dark-shot)) + (format #t "jak-dark-shot ") + ) + (if (= (logand (penetrate dark-smack) arg0) (penetrate dark-smack)) + (format #t "dark-smack ") + ) + (if (= (logand arg0 (penetrate flop)) (penetrate flop)) + (format #t "flop ") + ) + (if (= (logand arg0 (penetrate spin)) (penetrate spin)) + (format #t "spin ") + ) + (if (= (logand (penetrate dark-bomb) arg0) (penetrate dark-bomb)) + (format #t "dark-bomb ") + ) + (if (= (logand arg0 (penetrate vehicle)) (penetrate vehicle)) + (format #t "vehicle ") + ) + (if (= (logand arg0 (penetrate generic-attack)) (penetrate generic-attack)) + (format #t "generic-attack ") + ) + (if (= (logand arg0 (penetrate touch)) (penetrate touch)) + (format #t "touch ") + ) + (if (= (logand (penetrate eco-green) arg0) (shl 1 32)) + (format #t "eco-green ") + ) + (if (= (logand (penetrate jak-red-shot) arg0) (penetrate jak-red-shot)) + (format #t "jak-red-shot ") + ) + (if (= (logand arg0 (penetrate lunge)) (penetrate lunge)) + (format #t "lunge ") + ) + (if (= (logand arg0 (penetrate punch)) (penetrate punch)) + (format #t "punch ") + ) + (if (= (logand arg0 (penetrate tube)) (penetrate tube)) + (format #t "tube ") + ) + (if (= (logand (penetrate jak-dark-nuke) arg0) (shl 8 32)) + (format #t "jak-dark-nuke ") + ) + (if (= (logand (penetrate enemy-yellow-shot) arg0) (penetrate enemy-yellow-shot)) + (format #t "enemy-yellow-shot ") + ) + (if (= (logand (penetrate knocked) arg0) (shl 2 32)) + (format #t "knocked ") + ) + (if (= (logand (penetrate emp-blast) arg0) (shl 32 32)) + (format #t "emp-blast ") + ) + (if (= (logand arg0 (penetrate uppercut)) (penetrate uppercut)) + (format #t "uppercut ") + ) + (if (= (logand (penetrate dark-punch) arg0) (penetrate dark-punch)) + (format #t "dark-punch ") + ) + (if (= (logand (penetrate shield) arg0) (penetrate shield)) + (format #t "shield ") + ) + (if (= (logand (penetrate jak-yellow-shot) arg0) (penetrate jak-yellow-shot)) + (format #t "jak-yellow-shot ") + ) + (if (= (logand arg0 (penetrate board)) (penetrate board)) + (format #t "board ") + ) + (if (= (logand (penetrate flut) arg0) (penetrate flut)) + (format #t "flut ") + ) + (if (= (logand (penetrate eco-yellow) arg0) (penetrate eco-yellow)) + (format #t "eco-yellow ") + ) + (if (= (logand (penetrate dark-skin) arg0) (penetrate dark-skin)) + (format #t "dark-skin ") + ) + (if (= (logand (penetrate jak-dark-blackhole) arg0) (shl 16 32)) + (format #t "jak-dark-blackhole ") + ) + (if (= (logand (penetrate enemy-dark-shot) arg0) (penetrate enemy-dark-shot)) + (format #t "enemy-dark-shot ") + ) + (the-as string (if (= (logand (penetrate jak-blue-shot) arg0) (penetrate jak-blue-shot)) + (format #t "jak-blue-shot ") + ) + ) + ) + +(defun penetrate-using->damage ((arg0 penetrate)) + (cond + ((logtest? (penetrate dark-bomb dark-smack flut) arg0) + 15.0 + ) + ((logtest? arg0 (penetrate mech-punch mech-bonk)) + 5.0 + ) + ((logtest? (penetrate) arg0) + 4.0 + ) + ((logtest? (penetrate punch spin jak-dark-shot enemy-dark-shot) arg0) + 3.0 + ) + ((logtest? (penetrate + flop + uppercut + tube + flut-attack + dark-punch + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + enemy-yellow-shot + eco-yellow + ) + arg0 + ) + 2.0 + ) + ((logtest? arg0 (penetrate generic-attack roll bonk board)) + 1.0 + ) + (else + 0.0 + ) + ) + ) + +;; WARN: Return type mismatch uint vs penetrate. +(defun penetrated-by-all&hit-points->penetrated-by ((arg0 penetrate) (arg1 int)) + (let ((a0-1 arg1)) + (the-as penetrate (logior (logclear arg0 (penetrate + generic-attack + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + knocked + ) + ) + (cond + ((or (zero? a0-1) (= a0-1 1)) + (the-as int (the-as uint #x23fffdbfa)) + ) + ((= a0-1 2) + #x3fdecab8 + ) + ((= a0-1 3) + #x141cc030 + ) + ((= a0-1 4) + #x1cc000 + ) + ((= a0-1 5) + #x1cc000 + ) + ((or (= a0-1 6) + (= a0-1 7) + (= a0-1 8) + (= a0-1 9) + (= a0-1 10) + (= a0-1 11) + (= a0-1 12) + (= a0-1 13) + (= a0-1 14) + (= a0-1 15) + ) + #x1c0000 + ) + (else + 0 + ) + ) + ) + ) + ) + ) + +;; WARN: Return type mismatch int vs knocked-type. +(defun pu->knocked-type ((arg0 penetrate)) + (the-as knocked-type (cond + ((logtest? arg0 (penetrate vehicle)) + 7 + ) + ((logtest? (penetrate jak-blue-shot) arg0) + 6 + ) + ((logtest? (penetrate jak-yellow-shot enemy-yellow-shot) arg0) + 4 + ) + ((logtest? (penetrate jak-red-shot) arg0) + 5 + ) + ((logtest? (penetrate explode jak-dark-shot enemy-dark-shot) arg0) + 2 + ) + ((logtest? (penetrate dark-bomb dark-smack) arg0) + 3 + ) + ((logtest? arg0 (penetrate mech-punch)) + 1 + ) + (else + 0 + ) + ) + ) + ) diff --git a/goal_src/jak3/engine/gfx/foreground/bones-h.gc b/goal_src/jak3/engine/gfx/foreground/bones-h.gc index 301e6d970d..999f094179 100644 --- a/goal_src/jak3/engine/gfx/foreground/bones-h.gc +++ b/goal_src/jak3/engine/gfx/foreground/bones-h.gc @@ -5,5 +5,102 @@ ;; name in dgo: bones-h ;; dgos: GAME +(defenum bone-calc-flags + :type uint16 + :bitfield #t + (write-ripple-data 0) + (no-cam-rot 1) + (bncfl02 2) + (bncfl03 3) + (bncfl04 4) + (bncfl05 5) + (bncfl06 6) + (bncfl07 7) + (bncfl08 8) + (bncfl09 9) + (bncfl10 10) + (bncfl11 11) + (bncfl12 12) + (bncfl13 13) + (bncfl14 14) + (bncfl15 15) + ) + ;; DECOMP BEGINS +(deftype bone-buffer (structure) + ((joint matrix 16 :inline) + (bone bone 16 :inline) + (output pris-mtx 16 :inline) + ) + ) + + +(deftype bone-layout (structure) + ((data uint16 8) + (joint (inline-array matrix) 2 :overlay-at (-> data 0)) + (bone (inline-array bone) 2 :overlay-at (-> data 4)) + (output (inline-array pris-mtx) 2 :offset 16) + (unused uint32 2 :offset 24) + ) + ) + + +(deftype bone-regs (structure) + ((dma-buf dma-buffer) + (wait-count uint32) + (in-count uint32) + (sp-size uint32) + (sp-bufnum uint32) + (joint-ptr (inline-array joint)) + (bone-ptr (inline-array bone)) + (num-bones uint32) + (mtxs (inline-array pris-mtx)) + ) + ) + + +(deftype bone-work (structure) + ((layout bone-layout :inline) + (regs bone-regs :inline) + ) + ) + + +(deftype bone-debug (structure) + ((time-ctr uint32) + (timing uint32 360) + ) + ) + + +(deftype bone-memory (structure) + ((work bone-work :inline) + (buffer bone-buffer 2 :inline) + ) + ) + + +(deftype bone-calculation (structure) + ((flags bone-calc-flags) + (num-bones uint16) + (matrix-area (inline-array pris-mtx)) + (joints (inline-array joint)) + (bones (inline-array bone)) + (ripple-scale float) + (ripple-y-scale float) + (ripple-normal-scale float) + (ripple-area (inline-array vector)) + (next bone-calculation) + (dummy-1 uint32) + (dummy-2 uint32) + (dummy-3 uint32) + ) + ) + + +(deftype bone-calculation-list (structure) + ((first bone-calculation) + (next bone-calculation) + ) + ) diff --git a/goal_src/jak3/engine/gfx/foreground/foreground-h.gc b/goal_src/jak3/engine/gfx/foreground/foreground-h.gc index 51d7c259c5..71a556f5f0 100644 --- a/goal_src/jak3/engine/gfx/foreground/foreground-h.gc +++ b/goal_src/jak3/engine/gfx/foreground/foreground-h.gc @@ -5,5 +5,154 @@ ;; name in dgo: foreground-h ;; dgos: GAME +(declare-type merc-effect structure) + ;; DECOMP BEGINS +(deftype mercneric-chain (structure) + "A DMA chain for drawing with mercneric, and metadata needed to append. +This chain is assumed to run with a specific tpage from a specific level available." + ((first uint32) + (next uint32) + (state generic-bucket-state :inline) + (vu1-bucket bucket-id) + ) + :pack-me + ) + + +(deftype merc-chain (structure) + "A DMA chain for drawing with merc. +This chain is assumed to run with a specific tpage from a specific level available." + ((first dma-packet) + (patch dma-packet) + (vu1-bucket bucket-id) + ) + :pack-me + ) + + +(deftype foreground-bucket (structure) + "A foreground bucket is merc, emerc, and mercneric chain for a given texture mode." + ((merc merc-chain :inline) + (emerc merc-chain :inline) + (mercneric mercneric-chain :inline) + ) + ) + + +(deftype foreground-level-buckets (structure) + "Collection of buckets for a single level. +Each bucket has a different texture. The order is: +tfrag, pris, shrub, alpha, water, pris, pris2" + ((data foreground-bucket 7 :inline) + ) + ) + + +(deftype foreground-bucket-grid (structure) + "Array of buckets for each level, plus the single warp chain shared between everybody." + ((level-buckets foreground-level-buckets 11 :inline) + (warp-chain mercneric-chain :inline) + ) + ) + + +(deftype foreground-regs (structure) + "Frequently accessed foreground values. These are in scratchpad for fast access +during foreground processing." + ((dist float) + (merc-used uint32) + (emerc-used uint32) + (mercneric-used uint32) + (use-isometric uint32) + (base-start dma-packet) + (joint-ptr (inline-array joint)) + (bone-ptr (inline-array bone)) + (num-bones uint32) + (mtxs (inline-array pris-mtx)) + (dma-buf dma-buffer) + (default-texture-index uint32) + (mercneric-chain mercneric-chain) + (level-buckets foreground-level-buckets) + ) + ) + + +(deftype foreground-work (structure) + "Memory map for scratchpad during foreground processing. +This is not used by the renderers, bone matrix, or joint code - just the code +that assigns stuff to buckets and prepares DMA for merc (or requests for generic merc)." + ((regs foreground-regs :inline) + (draw-index-map uint8 11 :offset 64) + (grid foreground-bucket-grid :inline) + (bounds sphere :inline) + (lights vu-lights :inline) + (distance vector :inline) + (next-tmpl dma-packet :inline) + ) + ) + + +;; ERROR: Unsupported inline assembly instruction kind - [cache dxwbin a0, 0] +;; ERROR: Unsupported inline assembly instruction kind - [cache dxwbin a0, 1] +(defun invalidate-cache-line ((arg0 pointer)) + ;; og:preserve-this + ; (.sync.l) + ; (.cache dxwbin arg0 0) + ; (.sync.l) + ; (.cache dxwbin arg0 1) + ; (.sync.l) + 0 + ) + +(deftype texscroll-globals (structure) + "List of all merc-effects that need texscroll applied." + ((requests int32) + (effects merc-effect 32) + ) + ) + + +(deftype merc-effect-bucket-info (structure) + "Scratch info computed per-merc-effect by the foreground code, then later read by merc +DMA generation. This is only for the currently-processing merc model's effects." + ((color-fade rgba) + (merc-path uint8) + (ignore-alpha uint8) + (disable-draw uint8) + (disable-envmap uint8) + ) + :pack-me + ) + + +(deftype merc-bucket-info (structure) + "Scratch info for the current merc-ctrl. Written by the foreground code, read by merc DMA generation." + ((light vu-lights :inline) + (needs-clip int32) + (need-mercprime-if-merc int32) + (must-use-mercneric-for-clip int32) + (effect merc-effect-bucket-info 64 :inline) + ) + ) + + +(deftype foreground-globals (structure) + "The foreground renderer state: all DMA chains, settings for the current merc-ctrl, texscroll list." + ((foreground-grid foreground-bucket-grid :inline) + (merc-bucket-info merc-bucket-info :inline) + (texscroll texscroll-globals :inline) + ) + ) + + +(deftype shadow-dma-packet (structure) + "DMA tag for submitting shadow data." + ((tag generic-merc-tag :inline) + (settings shadow-settings :inline) + (geo-ref dma-packet :inline) + (mtx-ref dma-packet :inline) + (end-tag dma-packet :inline) + ) + ) diff --git a/goal_src/jak3/engine/gfx/vu1-user-h.gc b/goal_src/jak3/engine/gfx/vu1-user-h.gc index a4de5470b9..30c5ee38a9 100644 --- a/goal_src/jak3/engine/gfx/vu1-user-h.gc +++ b/goal_src/jak3/engine/gfx/vu1-user-h.gc @@ -591,7 +591,7 @@ (bucket563 563) (bucket564 564) (bucket565 565) - (bucket566 566) + (bucket566 566) ;; default for prim (bucket567 567) (bucket568 568) (bucket569 569) diff --git a/goal_src/jak3/engine/scene/scene-h.gc b/goal_src/jak3/engine/scene/scene-h.gc index 36483f9775..4229b805a1 100644 --- a/goal_src/jak3/engine/scene/scene-h.gc +++ b/goal_src/jak3/engine/scene/scene-h.gc @@ -5,5 +5,115 @@ ;; name in dgo: scene-h ;; dgos: GAME +(defenum scene-flags + :bitfield #t + :type uint32 + ) + ;; DECOMP BEGINS +(deftype scene-actor (basic) + ((name string) + (level symbol) + (art-group string) + (prefix string) + (draw-frames pair) + (scissor-frames pair) + (shadow-frames basic) + (cloth-reset-frames basic) + (cloth-commands basic) + (camera int16) + (light-index uint8) + (shadow-mask uint8) + (shadow-values uint32) + (flags uint32) + (command-list basic) + (shadow-flags int32) + (shadow-volume-joint basic) + (draw-seg uint64) + (no-draw-seg uint64) + (last-frame float) + (process uint64) + ) + (:methods + (scene-actor-method-9 () none) + ) + ) + + +(deftype scene (art-group) + ((scene-flags scene-flags) + (mask-to-clear process-mask) + (entity string) + (art-group string) + (anim string) + (parts int32) + (command-list pair) + (cut-list pair) + (wait-max-time time-frame) + (wait-air-time time-frame) + (wait-ground-time time-frame) + (actor (array scene-actor)) + (load-point continue-point) + (end-point continue-point) + (borrow pair) + (sfx-volume float) + (ambient-volume float) + (music-volume float) + (music-delay float) + (scene-task uint16) + (on-running basic) + (on-complete basic) + ) + (:methods + (scene-method-16 () none) + (scene-method-17 () none) + ) + ) + + +(deftype scene-player (process-drawable) + ((scene-list (array scene)) + (scene scene) + (scene-index int32) + (anim spool-anim) + (next-anim spool-anim) + (camera handle) + (main-entity entity-actor) + (wait symbol) + (old-target-pos transformq :inline) + (pre-cut-frame basic) + (preload-continue string) + (preload-sound basic) + (dma-max uint32) + (gui-id sound-id) + (aborted? symbol) + (scene-start-time time-frame) + (targ-speed float) + (cur-speed float) + (speed-change-time time-frame) + (speed-press-time time-frame) + (speed-change-speed float) + (subtitle-change-time time-frame) + (user-sound sound-id 4) + (last-frame float) + (end-point basic) + (blackout-end basic) + (new-trans-hook basic) + (cur-trans-hook basic) + (user-data uint64) + ) + (:methods + (scene-player-method-20 () none) + (scene-player-method-21 () none) + (scene-player-method-22 () none) + (scene-player-method-23 () none) + (scene-player-method-24 () none) + (scene-player-method-25 () none) + ) + ) + + +(define *scene-player* (the-as (pointer scene-player) #f)) + +(define *debug-menu-scene-play* (the-as object #f)) diff --git a/goal_src/jak3/engine/util/script-h.gc b/goal_src/jak3/engine/util/script-h.gc index e62b0efe57..5c49da2126 100644 --- a/goal_src/jak3/engine/util/script-h.gc +++ b/goal_src/jak3/engine/util/script-h.gc @@ -5,5 +5,59 @@ ;; name in dgo: script-h ;; dgos: GAME + +(declare-type script-context structure) +(declare-type load-state structure) +(define-extern *load-state* load-state) + ;; DECOMP BEGINS +(deftype script-form (structure) + ((name symbol) + (spec pair) + (func (function script-context object)) + ) + (:methods + (script-form-method-9 () none) + ) + ) + + +(deftype script-context (structure) + ((load-state load-state) + (key object) + (process process) + (trans vector) + (side-effect? symbol) + (got-error? symbol) + (expr pair) + (param-count int32) + (param object 16) + (param-type object 16) + ) + (:methods + (new (symbol type object process vector) _type_) + (script-context-method-9 () none) + (script-context-method-10 () none) + (script-context-method-11 () none) + ) + ) + + +;; WARN: Return type mismatch structure vs script-context. +(defmethod new script-context ((allocation symbol) (type-to-make type) (arg0 object) (arg1 process) (arg2 vector)) + (let ((t9-0 (method-of-type structure new)) + (v1-1 type-to-make) + ) + (-> type-to-make size) + (let ((v0-0 (t9-0 allocation v1-1))) + (set! (-> (the-as script-context v0-0) key) arg0) + (set! (-> (the-as script-context v0-0) process) arg1) + (set! (-> (the-as script-context v0-0) load-state) *load-state*) + (set! (-> (the-as script-context v0-0) side-effect?) #t) + (set! (-> (the-as script-context v0-0) got-error?) #f) + (set! (-> (the-as script-context v0-0) trans) arg2) + (the-as script-context v0-0) + ) + ) + ) diff --git a/test/decompiler/reference/jak3/decompiler-macros.gc b/test/decompiler/reference/jak3/decompiler-macros.gc index 37d952f2d6..a33e93543e 100644 --- a/test/decompiler/reference/jak3/decompiler-macros.gc +++ b/test/decompiler/reference/jak3/decompiler-macros.gc @@ -777,4 +777,4 @@ (defmacro go-virtual (state-name &key (proc self) &rest args) "Change the current process to the virtual state of the given process." `(go (method-of-object ,proc ,state-name) ,@args) - ) \ No newline at end of file + ) diff --git a/test/decompiler/reference/jak3/engine/anim/aligner-h_REF.gc b/test/decompiler/reference/jak3/engine/anim/aligner-h_REF.gc new file mode 100644 index 0000000000..975becda60 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/anim/aligner-h_REF.gc @@ -0,0 +1,61 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type align-control +(deftype align-control (basic) + ((flags align-flags) + (process process-drawable) + (frame-group art-joint-anim) + (frame-num float) + (matrix matrix 2 :inline) + (transform transform 2 :inline) + (delta transformq :inline) + (last-speed meters) + (align transformq :inline :overlay-at (-> transform 0 trans data 0)) + ) + (:methods + (new (symbol type process) _type_) + (align-control-method-9 () none) + (align-control-method-10 () none) + (align-control-method-11 () none) + (align-control-method-12 () none) + (align-control-method-13 () none) + ) + ) + +;; definition for method 3 of type align-control +(defmethod inspect ((this align-control)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tflags: #x~X~%" (-> this flags)) + (format #t "~1Tprocess: ~A~%" (-> this process)) + (format #t "~1Tframe-group: ~A~%" (-> this frame-group)) + (format #t "~1Tframe-num: ~f~%" (-> this frame-num)) + (format #t "~1Tmatrix[2] @ #x~X~%" (-> this matrix)) + (format #t "~1Ttransform[2] @ #x~X~%" (-> this transform)) + (format #t "~1Tdelta: #~%" (-> this delta)) + (format #t "~1Tlast-speed: (meters ~m)~%" (-> this last-speed)) + (format #t "~1Talign: #~%" (-> this transform)) + (label cfg-4) + this + ) + +;; definition for method 0 of type align-control +;; WARN: Return type mismatch object vs align-control. +(defmethod new align-control ((allocation symbol) (type-to-make type) (arg0 process)) + (let ((v0-0 (the-as object (object-new allocation type-to-make (the-as int (-> type-to-make size)))))) + (when (zero? (the-as align-control v0-0)) + (go process-drawable-art-error "memory") + (return (the-as align-control 0)) + ) + (set! (-> (the-as align-control v0-0) process) (the-as process-drawable arg0)) + (the-as align-control v0-0) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/anim/joint-h_REF.gc b/test/decompiler/reference/jak3/engine/anim/joint-h_REF.gc new file mode 100644 index 0000000000..3a46953e9f --- /dev/null +++ b/test/decompiler/reference/jak3/engine/anim/joint-h_REF.gc @@ -0,0 +1,336 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type joint-control-channel +(deftype joint-control-channel (structure) + ((parent joint-control) + (frame-group art-joint-anim) + (frame-num float) + (dist meters) + (num-func (function joint-control-channel float float float float)) + (param float 3) + (frame-interp float 2) + (inspector-amount uint8) + (command joint-control-command) + (group-sub-index int8) + (group-size int8) + (eval-time uint32) + ) + ) + +;; definition for method 3 of type joint-control-channel +(defmethod inspect ((this joint-control-channel)) + (when (not this) + (set! this this) + (goto cfg-23) + ) + (format #t "[~8x] ~A~%" this 'joint-control-channel) + (format #t "~1Tparent: ~A~%" (-> this parent)) + (format #t "~1Tframe-group: ~A~%" (-> this frame-group)) + (format #t "~1Tframe-num: ~f~%" (-> this frame-num)) + (format #t "~1Tdist: (meters ~m)~%" (-> this dist)) + (format #t "~1Tnum-func: ~A~%" (-> this num-func)) + (format #t "~1Tparam[3] @ #x~X~%" (-> this param)) + (dotimes (s5-0 3) + (format #t "~T [~D]~1Tparam: ~`float`P~%" s5-0 (-> this param s5-0)) + ) + (format #t "~1Tframe-interp[2] @ #x~X~%" (-> this frame-interp)) + (dotimes (s5-1 2) + (format #t "~T [~D]~1Tframe-interp: ~`float`P~%" s5-1 (-> this frame-interp s5-1)) + ) + (format #t "~1Tinspector-amount: ~D~%" (-> this inspector-amount)) + (let ((t9-11 format) + (a0-12 #t) + (a1-11 "~1Tcommand: #x~X : ~S~%") + (a2-11 (-> this command)) + (v1-10 (-> this command)) + ) + (t9-11 a0-12 a1-11 a2-11 (cond + ((= v1-10 (joint-control-command stack1)) + "stack1" + ) + ((= v1-10 (joint-control-command push)) + "push" + ) + ((= v1-10 (joint-control-command blend)) + "blend" + ) + ((= v1-10 (joint-control-command push1)) + "push1" + ) + ((= v1-10 (joint-control-command float)) + "float" + ) + ((= v1-10 (joint-control-command stack)) + "stack" + ) + (else + "*unknown*" + ) + ) + ) + ) + (format #t "~1Tgroup-sub-index: ~D~%" (-> this group-sub-index)) + (format #t "~1Tgroup-size: ~D~%" (-> this group-size)) + (format #t "~1Teval-time: ~D~%" (-> this eval-time)) + (label cfg-23) + this + ) + +;; definition of type top-anim-joint-control +(deftype top-anim-joint-control (basic) + ((process (pointer process-drawable)) + (interp-select uint64 2) + (base-anim basic) + (base-anim-speed float) + (base-anim-blend float) + (interp float) + (frame-group art-joint-anim) + (frame-group-push art-joint-anim) + (frame-num float) + (frame-targ art-joint-anim) + (frame-speed float) + (frame-blend float) + (frame-cur-blend float) + (frame-start float) + (frame-post-blend float) + (frame-post-end float) + (frame-push-time time-frame) + (frame-post-put-away basic) + (update-time time-frame) + ) + (:methods + (new (symbol type) _type_) + (top-anim-joint-control-method-9 () none) + (top-anim-joint-control-method-10 () none) + (top-anim-joint-control-method-11 () none) + (top-anim-joint-control-method-12 () none) + ) + ) + +;; definition for method 3 of type top-anim-joint-control +(defmethod inspect ((this top-anim-joint-control)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprocess: #x~X~%" (-> this process)) + (format #t "~1Tinterp-select[2] @ #x~X~%" (-> this interp-select)) + (format #t "~1Tbase-anim: ~A~%" (-> this base-anim)) + (format #t "~1Tbase-anim-speed: ~f~%" (-> this base-anim-speed)) + (format #t "~1Tbase-anim-blend: ~f~%" (-> this base-anim-blend)) + (format #t "~1Tinterp: ~f~%" (-> this interp)) + (format #t "~1Tframe-group: ~A~%" (-> this frame-group)) + (format #t "~1Tframe-group-push: ~A~%" (-> this frame-group-push)) + (format #t "~1Tframe-num: ~f~%" (-> this frame-num)) + (format #t "~1Tframe-targ: ~A~%" (-> this frame-targ)) + (format #t "~1Tframe-speed: ~f~%" (-> this frame-speed)) + (format #t "~1Tframe-blend: ~f~%" (-> this frame-blend)) + (format #t "~1Tframe-cur-blend: ~f~%" (-> this frame-cur-blend)) + (format #t "~1Tframe-start: ~f~%" (-> this frame-start)) + (format #t "~1Tframe-post-blend: ~f~%" (-> this frame-post-blend)) + (format #t "~1Tframe-post-end: ~f~%" (-> this frame-post-end)) + (format #t "~1Tframe-push-time: ~D~%" (-> this frame-push-time)) + (format #t "~1Tframe-post-put-away: ~A~%" (-> this frame-post-put-away)) + (format #t "~1Tupdate-time: ~D~%" (-> this update-time)) + (label cfg-4) + this + ) + +;; definition of type joint-control +(deftype joint-control (basic) + ((status joint-control-status) + (allocated-length uint8) + (active-channels uint8) + (root-channel (inline-array joint-control-channel) :offset 16) + (blend-index uint8) + (active-frame-interp uint8) + (float-channels uint8) + (generate-frame-function (function joint-anim-frame int joint-control int)) + (prebind-function (function joint-anim-frame int joint-control int)) + (postbind-function (function draw-control cspace-array joint-control none)) + (effect effect-control) + (interp-select int64 2) + (top-anim top-anim-joint-control) + (override (array float)) + (channel joint-control-channel :dynamic) + ) + (:methods + (new (symbol type) _type_) + (joint-control-method-9 () none) + (joint-control-method-10 () none) + (joint-control-method-11 () none) + (joint-control-method-12 () none) + ) + ) + +;; definition for method 3 of type joint-control +(defmethod inspect ((this joint-control)) + (when (not this) + (set! this this) + (goto cfg-32) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tstatus: #x~X : (joint-control-status " (-> this status)) + (let ((s5-0 (-> this status))) + (if (= (logand s5-0 (joint-control-status blend-shape)) (joint-control-status blend-shape)) + (format #t "blend-shape ") + ) + (if (= (logand s5-0 (joint-control-status valid-spooled-frame)) (joint-control-status valid-spooled-frame)) + (format #t "valid-spooled-frame ") + ) + (if (= (logand s5-0 (joint-control-status no-joint-callbacks)) (joint-control-status no-joint-callbacks)) + (format #t "no-joint-callbacks ") + ) + (if (= (logand s5-0 (joint-control-status spooling-not-last-block)) + (joint-control-status spooling-not-last-block) + ) + (format #t "spooling-not-last-block ") + ) + (if (= (logand s5-0 (joint-control-status eye-anim)) (joint-control-status eye-anim)) + (format #t "eye-anim ") + ) + (if (= (logand s5-0 (joint-control-status math-when-off-screen)) (joint-control-status math-when-off-screen)) + (format #t "math-when-off-screen ") + ) + (if (= (logand s5-0 (joint-control-status sync-math)) (joint-control-status sync-math)) + (format #t "sync-math ") + ) + (if (= (logand s5-0 (joint-control-status eye-anim-valid)) (joint-control-status eye-anim-valid)) + (format #t "eye-anim-valid ") + ) + (if (= (logand s5-0 (joint-control-status blend-shape-valid)) (joint-control-status blend-shape-valid)) + (format #t "blend-shape-valid ") + ) + (if (= (logand s5-0 (joint-control-status force-math)) (joint-control-status force-math)) + (format #t "force-math ") + ) + (if (= (logand s5-0 (joint-control-status spooling)) (joint-control-status spooling)) + (format #t "spooling ") + ) + ) + (format #t ")~%") + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tactive-channels: ~D~%" (-> this active-channels)) + (format #t "~1Troot-channel: #x~X~%" (-> this root-channel)) + (format #t "~1Tblend-index: ~D~%" (-> this blend-index)) + (format #t "~1Tactive-frame-interp: ~D~%" (-> this active-frame-interp)) + (format #t "~1Tfloat-channels: ~D~%" (-> this float-channels)) + (format #t "~1Tgenerate-frame-function: ~A~%" (-> this generate-frame-function)) + (format #t "~1Tprebind-function: ~A~%" (-> this prebind-function)) + (format #t "~1Tpostbind-function: ~A~%" (-> this postbind-function)) + (format #t "~1Teffect: ~A~%" (-> this effect)) + (format #t "~1Tinterp-select[2] @ #x~X~%" (-> this interp-select)) + (dotimes (s5-1 2) + (format #t "~T [~D]~1Tinterp-select: ~D~%" s5-1 (-> this interp-select s5-1)) + ) + (format #t "~1Ttop-anim: ~A~%" (-> this top-anim)) + (format #t "~1Toverride: ~A~%" (-> this override)) + (format #t "~1Tchannel[0] @ #x~X~%" (-> this channel)) + (dotimes (s5-2 (the-as int (-> this active-channels))) + (format #t "~T [~D]~1Tchannel: ~`joint-control-channel`P~%" s5-2 (+ (+ (* s5-2 64) 60) (the-as int this))) + ) + (label cfg-32) + this + ) + +;; definition of type matrix-stack +(deftype matrix-stack (structure) + ((top matrix) + (data matrix 24 :inline) + ) + ) + +;; definition for method 3 of type matrix-stack +(defmethod inspect ((this matrix-stack)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'matrix-stack) + (format #t "~1Ttop: #~%" (-> this top)) + (format #t "~1Tdata[24] @ #x~X~%" (-> this data)) + (label cfg-4) + this + ) + +;; definition of type channel-upload-info +(deftype channel-upload-info (structure) + ((fixed joint-anim-compressed-fixed) + (fixed-qwc int32) + (frame joint-anim-compressed-frame) + (frame-qwc int32) + (amount float) + (interp float) + ) + :pack-me + ) + +;; definition for method 3 of type channel-upload-info +(defmethod inspect ((this channel-upload-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'channel-upload-info) + (format #t "~1Tfixed: #~%" (-> this fixed)) + (format #t "~1Tfixed-qwc: ~D~%" (-> this fixed-qwc)) + (format #t "~1Tframe: #~%" (-> this frame)) + (format #t "~1Tframe-qwc: ~D~%" (-> this frame-qwc)) + (format #t "~1Tamount: ~f~%" (-> this amount)) + (format #t "~1Tinterp: ~f~%" (-> this interp)) + (label cfg-4) + this + ) + +;; definition of type joint-work +(deftype joint-work (structure) + ((temp-mtx matrix :inline) + (joint-stack matrix-stack :inline) + (fix-jmp-table (function none) 16) + (frm-jmp-table (function none) 16) + (pair-jmp-table (function none) 16) + (uploads channel-upload-info 24 :inline) + (num-uploads int32) + (mtx-acc matrix 2 :inline) + (tq-acc transformq 100 :inline) + (jacp-hdr joint-anim-compressed-hdr :inline) + (fixed-data joint-anim-compressed-fixed :inline) + (frame-data joint-anim-compressed-frame 2 :inline) + (flatten-array float 576 :overlay-at mtx-acc) + (flattened vector 24 :inline :overlay-at mtx-acc) + ) + ) + +;; definition for method 3 of type joint-work +(defmethod inspect ((this joint-work)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'joint-work) + (format #t "~1Ttemp-mtx: #~%" (-> this temp-mtx)) + (format #t "~1Tjoint-stack: #~%" (-> this joint-stack)) + (format #t "~1Tfix-jmp-table[16] @ #x~X~%" (-> this fix-jmp-table)) + (format #t "~1Tfrm-jmp-table[16] @ #x~X~%" (-> this frm-jmp-table)) + (format #t "~1Tpair-jmp-table[16] @ #x~X~%" (-> this pair-jmp-table)) + (format #t "~1Tuploads[24] @ #x~X~%" (-> this uploads)) + (format #t "~1Tnum-uploads: ~D~%" (-> this num-uploads)) + (format #t "~1Tmtx-acc[2] @ #x~X~%" (-> this mtx-acc)) + (format #t "~1Ttq-acc[100] @ #x~X~%" (-> this tq-acc)) + (format #t "~1Tjacp-hdr: #~%" (-> this jacp-hdr)) + (format #t "~1Tfixed-data: #~%" (-> this fixed-data)) + (format #t "~1Tframe-data[2] @ #x~X~%" (-> this frame-data)) + (format #t "~1Tflatten-array[576] @ #x~X~%" (-> this mtx-acc)) + (format #t "~1Tflattened[24] @ #x~X~%" (-> this mtx-acc)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/engine/anim/mspace-h_REF.gc b/test/decompiler/reference/jak3/engine/anim/mspace-h_REF.gc index 007e4a1714..cd0d2e91e0 100644 --- a/test/decompiler/reference/jak3/engine/anim/mspace-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/anim/mspace-h_REF.gc @@ -142,7 +142,7 @@ The callback function is used to take the joint transforms out of the joint anim ;; definition of type cspace-array (deftype cspace-array (inline-array-class) - ((data cspace :dynamic) + ((data cspace :inline :dynamic) ) ) @@ -179,7 +179,3 @@ The callback function is used to take the joint transforms out of the joint anim ;; 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 2b473ab357..5028253e6f 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 @@ -1388,6 +1388,7 @@ Most [[process-drawable]]s have a [[collide-shape]] that represents their root t (nav-flags uint8) (total-prims uint8) (num-riders uint8) + (pat-ignore-mask pat-surface) (event-self symbol :offset 152) (event-other symbol) (root-prim collide-shape-prim) @@ -1638,7 +1639,53 @@ Most [[process-drawable]]s have a [[collide-shape]] that represents their root t ) ;; definition for method 0 of type collide-shape -;; ERROR: function was not converted to expressions. Cannot decompile. +(defmethod new collide-shape ((allocation symbol) (type-to-make type) (arg0 process-drawable) (arg1 collide-list-enum)) + (let ((s5-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> s5-0 actor-hash-index) -1) + (set! (-> s5-0 process) arg0) + (set! (-> s5-0 max-iteration-count) (the-as uint 1)) + (set! (-> s5-0 nav-flags) (the-as uint 1)) + (set! (-> s5-0 event-self) #f) + (set! (-> s5-0 event-other) #f) + (set! (-> s5-0 riders) (the-as (inline-array collide-rider) #f)) + (set! (-> s5-0 root-prim) #f) + (set! (-> s5-0 penetrate-using) (penetrate)) + (set! (-> s5-0 penetrated-by) (penetrate)) + (set! (-> s5-0 event-priority) (the-as uint 0)) + (set! (-> s5-0 rider-max-momentum) 409600.0) + (case (-> arg0 type symbol) + (('camera) + (set! (-> s5-0 pat-ignore-mask) (new 'static 'pat-surface :nocamera #x1 :probe #x1 :noendlessfall #x1)) + ) + (('target) + (set! (-> s5-0 pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :board #x1)) + ) + (else + (set! (-> s5-0 pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + ) + ) + (set! (-> s5-0 trans w) 1.0) + (quaternion-identity! (the-as quaternion (-> s5-0 rot))) + (vector-identity! (-> s5-0 scale)) + (cond + ((= arg1 (collide-list-enum hit-by-player)) + (add-connection *collide-hit-by-player-list* arg0 #f s5-0 #f #f) + ) + ((= arg1 (collide-list-enum usually-hit-by-player)) + (add-connection *collide-hit-by-others-list* arg0 #f s5-0 #f #f) + ) + ((= arg1 (collide-list-enum hit-by-others)) + (add-connection *collide-player-list* arg0 #f s5-0 #f #f) + ) + (else + (format 0 "Unsupported collide-list-enum in collide-shape constructor!~%") + ) + ) + s5-0 + ) + ) ;; definition for method 0 of type collide-shape-moving ;; INFO: Used lq/sq @@ -1685,7 +1732,3 @@ Most [[process-drawable]]s have a [[collide-shape]] that represents their root t ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/engine/common_objs/prim-h_REF.gc b/test/decompiler/reference/jak3/engine/common_objs/prim-h_REF.gc new file mode 100644 index 0000000000..dbf2389056 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/common_objs/prim-h_REF.gc @@ -0,0 +1,236 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type prim-vertex +(deftype prim-vertex (structure) + "Vertex for the prim renderer. These vertices are generated by +some special effect code, then sent to the prim renderer to be drawn." + ((stq vector :inline) + (nokick uint32 :overlay-at (-> stq data 2)) + (col rgba :overlay-at (-> stq data 3)) + (pos vector :inline) + ) + ) + +;; definition for method 3 of type prim-vertex +(defmethod inspect ((this prim-vertex)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'prim-vertex) + (format #t "~1Tstq: #~%" (-> this stq)) + (format #t "~1Tnokick: ~D~%" (-> this stq z)) + (format #t "~1Tcol: ~D~%" (-> this col)) + (format #t "~1Tpos: #~%" (-> this pos)) + (label cfg-4) + this + ) + +;; definition of type prim-base +(deftype prim-base (basic) + "Base class for prim-strip." + () + (:methods + (prim-base-method-9 () none) + ) + ) + +;; definition for method 3 of type prim-base +(defmethod inspect ((this prim-base)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (label cfg-4) + this + ) + +;; definition of type prim-strip +(deftype prim-strip (prim-base) + "A collection of vertices, all with the same texture and draw settings. +These are owned by the thing submitting to prim, not the prim renderer itself." + ((flags prim-flags) + (tex-name basic) + (num-verts uint16) + (allocated-num-verts uint16) + (tex-id texture-id) + (adnops gs-adcmd 2 :inline) + (data0 uint64 :overlay-at (-> adnops 0 word 0)) + (reg0 uint64 :overlay-at (-> adnops 0 word 2)) + (data1 uint64 :offset 48) + (reg1 uint64 :offset 56) + (clamp gs-clamp) + (alpha gs-alpha) + (bucket bucket-id) + (sink uint32) + (level basic) + (texture-index uint32) + (data prim-vertex :inline :dynamic) + ) + (:methods + (new (symbol type int texture-id string) _type_) + (prim-strip-method-10 () none) + ) + ) + +;; definition for method 3 of type prim-strip +(defmethod inspect ((this prim-strip)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Ttex-name: ~A~%" (-> this tex-name)) + (format #t "~1Tnum-verts: ~D~%" (-> this num-verts)) + (format #t "~1Tallocated-num-verts: ~D~%" (-> this allocated-num-verts)) + (format #t "~1Ttex-id: ~D~%" (-> this tex-id)) + (format #t "~1Tadnops[2] @ #x~X~%" (-> this adnops)) + (format #t "~1Tdata0: ~D~%" (-> this data0)) + (format #t "~1Treg0: ~D~%" (-> this adnops 0 cmds)) + (format #t "~1Tdata1: ~D~%" (-> this data1)) + (format #t "~1Treg1: ~D~%" (-> this adnops 1 cmds)) + (format #t "~1Tclamp: ~D~%" (-> this clamp)) + (format #t "~1Talpha: ~D~%" (-> this alpha)) + (format #t "~1Tbucket: ~D~%" (-> this bucket)) + (format #t "~1Tsink: ~D~%" (-> this sink)) + (format #t "~1Tlevel: ~A~%" (-> this level)) + (format #t "~1Ttexture-index: ~D~%" (-> this texture-index)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) + (label cfg-4) + this + ) + +;; definition for method 0 of type prim-strip +(defmethod new prim-strip ((allocation symbol) (type-to-make type) (num-vertices int) (tex-id texture-id) (tex-name string)) + "Allocate a new prim-strip and room for vertices. The texture can be specified by name or ID." + (with-pp + (let ((s5-0 (object-new allocation type-to-make (the-as int (+ (-> type-to-make size) (* num-vertices 32)))))) + (if (zero? s5-0) + (go process-drawable-art-error "prim-strip") + ) + (add-connection *prim-engine* pp #f pp s5-0 #f) + (set! (-> s5-0 flags) (prim-flags pf0 pf1)) + (set! (-> s5-0 num-verts) (the-as uint num-vertices)) + (set! (-> s5-0 allocated-num-verts) (the-as uint num-vertices)) + (set! (-> s5-0 data0) (the-as uint 0)) + (set! (-> s5-0 adnops 0 cmds) (gs-reg64 hack)) + (set! (-> s5-0 data1) (the-as uint 0)) + (set! (-> s5-0 adnops 1 cmds) (gs-reg64 hack)) + (set! (-> s5-0 clamp) (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp))) + (set! (-> s5-0 alpha) (new 'static 'gs-alpha :b #x1 :d #x1)) + (cond + (tex-name + (set! (-> s5-0 tex-id) (lookup-texture-id-by-name tex-name (the-as string #f))) + (set! (-> s5-0 tex-name) tex-name) + (logclear! (-> s5-0 flags) (prim-flags no-texture-name)) + ) + (else + (set! (-> s5-0 tex-id) tex-id) + (set! (-> s5-0 tex-name) #f) + (logior! (-> s5-0 flags) (prim-flags no-texture-name)) + ) + ) + (set! (-> s5-0 bucket) (bucket-id bucket566)) + (set! (-> s5-0 sink) (the-as uint 64)) + (set! (-> s5-0 level) (-> *level* level-default)) + (set! (-> s5-0 texture-index) (the-as uint 4)) + (let ((f0-1 (/ 1.0 (the float (/ (+ num-vertices -1) 2))))) + (dotimes (v1-24 num-vertices) + (let ((a0-7 (-> s5-0 data v1-24))) + (set! (-> a0-7 stq x) (* (the float (/ v1-24 2)) f0-1)) + (set! (-> a0-7 stq y) (the float (logand v1-24 1))) + (set! (-> a0-7 stq z) 0.0) + (set! (-> a0-7 col) (the-as rgba 0.0)) + ) + (set! (-> s5-0 data v1-24 col) (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)) + (set-vector! + (the-as vector (+ (the-as uint (the-as vector (-> s5-0 data 0 pos))) (* v1-24 32))) + (* 4096.0 (the float (/ v1-24 2))) + (* 4096.0 (the float (logand v1-24 1))) + 0.0 + 1.0 + ) + ) + ) + s5-0 + ) + ) + ) + +;; definition for method 5 of type prim-strip +;; WARN: Return type mismatch uint vs int. +(defmethod asize-of ((this prim-strip)) + (the-as int (+ (-> this type size) (* (-> this allocated-num-verts) 32))) + ) + +;; definition of type prim-sink +(deftype prim-sink (structure) + ((vertex-count uint8) + (control-count uint8) + ) + :allow-misaligned + ) + +;; definition for method 3 of type prim-sink +(defmethod inspect ((this prim-sink)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'prim-sink) + (format #t "~1Tvertex-count: ~D~%" (-> this vertex-count)) + (format #t "~1Tcontrol-count: ~D~%" (-> this control-count)) + (label cfg-4) + this + ) + +;; definition of type prim-work +(deftype prim-work (structure) + ((vertex-tmpl dma-packet 3 :inline) + (control-tmpl dma-packet 2 :inline) + (giftag generic-gif-tag :inline) + (call-scissor dma-packet :inline) + (call-noclip dma-packet :inline) + (shader adgif-shader :inline) + (mask vector4w :inline) + (in-verts int32) + (num-verts int32) + (vert-ptr prim-vertex) + (sinks prim-sink 68 :inline) + ) + (:methods + (prim-work-method-9 () none) + ) + ) + +;; definition for method 3 of type prim-work +(defmethod inspect ((this prim-work)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'prim-work) + (format #t "~1Tvertex-tmpl[3] @ #x~X~%" (-> this vertex-tmpl)) + (format #t "~1Tcontrol-tmpl[2] @ #x~X~%" (-> this control-tmpl)) + (format #t "~1Tgiftag: #~%" (-> this giftag)) + (format #t "~1Tcall-scissor: #~%" (-> this call-scissor)) + (format #t "~1Tcall-noclip: #~%" (-> this call-noclip)) + (format #t "~1Tshader: #~%" (-> this shader)) + (format #t "~1Tmask: #~%" (-> this mask)) + (format #t "~1Tin-verts: ~D~%" (-> this in-verts)) + (format #t "~1Tnum-verts: ~D~%" (-> this num-verts)) + (format #t "~1Tvert-ptr: #~%" (-> this vert-ptr)) + (format #t "~1Tsinks[68] @ #x~X~%" (-> this sinks)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/engine/debug/debug-h_REF.gc b/test/decompiler/reference/jak3/engine/debug/debug-h_REF.gc new file mode 100644 index 0000000000..4c91bf419e --- /dev/null +++ b/test/decompiler/reference/jak3/engine/debug/debug-h_REF.gc @@ -0,0 +1,145 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type pos-history +(deftype pos-history (structure) + ((points (inline-array vector)) + (num-points int32) + (h-first int32) + (h-last int32) + ) + ) + +;; definition for method 3 of type pos-history +(defmethod inspect ((this pos-history)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'pos-history) + (format #t "~1Tpoints: #x~X~%" (-> this points)) + (format #t "~1Tnum-points: ~D~%" (-> this num-points)) + (format #t "~1Th-first: ~D~%" (-> this h-first)) + (format #t "~1Th-last: ~D~%" (-> this h-last)) + (label cfg-4) + this + ) + +;; definition of type debug-vertex +(deftype debug-vertex (structure) + ((trans vector4w :inline) + (normal vector3h :inline) + (st vector2h :inline) + (color uint32) + ) + ) + +;; definition for method 3 of type debug-vertex +(defmethod inspect ((this debug-vertex)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'debug-vertex) + (format #t "~1Ttrans: ~`vector4w`P~%" (-> this trans)) + (format #t "~1Tnormal: ~`vector3h`P~%" (-> this normal)) + (format #t "~1Tst: ~`vector2h`P~%" (-> this st)) + (format #t "~1Tcolor: #x~X~%" (-> this color)) + (label cfg-4) + this + ) + +;; definition of type debug-vertex-stats +(deftype debug-vertex-stats (basic) + ((length int32) + (pos-count int32) + (vertex debug-vertex 600 :inline) + ) + ) + +;; definition for method 3 of type debug-vertex-stats +(defmethod inspect ((this debug-vertex-stats)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tpos-count: ~D~%" (-> this pos-count)) + (format #t "~1Tvertex[600] @ #x~X~%" (-> this vertex)) + (label cfg-4) + this + ) + +;; definition for symbol *color-black*, type rgba +(define *color-black* (new 'static 'rgba :a #x80)) + +;; definition for symbol *color-white*, type rgba +(define *color-white* (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)) + +;; definition for symbol *color-gray*, type rgba +(define *color-gray* (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)) + +;; definition for symbol *color-red*, type rgba +(define *color-red* (new 'static 'rgba :r #xff :a #x80)) + +;; definition for symbol *color-green*, type rgba +(define *color-green* (new 'static 'rgba :g #xff :a #x80)) + +;; definition for symbol *color-blue*, type rgba +(define *color-blue* (new 'static 'rgba :b #xff :a #x80)) + +;; definition for symbol *color-cyan*, type rgba +(define *color-cyan* (new 'static 'rgba :g #xff :b #xff :a #x80)) + +;; definition for symbol *color-magenta*, type rgba +(define *color-magenta* (new 'static 'rgba :r #xff :b #xff :a #x80)) + +;; definition for symbol *color-yellow*, type rgba +(define *color-yellow* (new 'static 'rgba :r #xff :g #xff :a #x80)) + +;; definition for symbol *color-light-red*, type rgba +(define *color-light-red* (new 'static 'rgba :r #xff :g #x80 :b #x80 :a #x80)) + +;; definition for symbol *color-light-green*, type rgba +(define *color-light-green* (new 'static 'rgba :r #x80 :g #xff :b #x80 :a #x80)) + +;; definition for symbol *color-light-blue*, type rgba +(define *color-light-blue* (new 'static 'rgba :r #x80 :g #x80 :b #xff :a #x80)) + +;; definition for symbol *color-light-cyan*, type rgba +(define *color-light-cyan* (new 'static 'rgba :r #x80 :g #xff :b #xff :a #x80)) + +;; definition for symbol *color-light-magenta*, type rgba +(define *color-light-magenta* (new 'static 'rgba :r #xff :g #x80 :b #xff :a #x80)) + +;; definition for symbol *color-light-yellow*, type rgba +(define *color-light-yellow* (new 'static 'rgba :r #xff :g #xff :b #x80 :a #x80)) + +;; definition for symbol *color-dark-red*, type rgba +(define *color-dark-red* (new 'static 'rgba :r #x80 :a #x80)) + +;; definition for symbol *color-dark-green*, type rgba +(define *color-dark-green* (new 'static 'rgba :g #x80 :a #x80)) + +;; definition for symbol *color-dark-blue*, type rgba +(define *color-dark-blue* (new 'static 'rgba :b #x80 :a #x80)) + +;; definition for symbol *color-dark-cyan*, type rgba +(define *color-dark-cyan* (new 'static 'rgba :g #x80 :b #x80 :a #x80)) + +;; definition for symbol *color-dark-magenta*, type rgba +(define *color-dark-magenta* (new 'static 'rgba :r #x80 :b #x80 :a #x80)) + +;; definition for symbol *color-dark-yellow*, type rgba +(define *color-dark-yellow* (new 'static 'rgba :r #x80 :g #x80 :a #x80)) + +;; definition for symbol *color-orange*, type rgba +(define *color-orange* (new 'static 'rgba :r #xff :g #x80 :a #x80)) + +;; 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 new file mode 100644 index 0000000000..b996967241 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/game/game-h_REF.gc @@ -0,0 +1,495 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type process-drawable +(deftype process-drawable (process) + "This is the main base class for in-game objects. +This handles drawing, collision, animation, navigation, particles, sounds, physics, etc. +The actual child classes will add most of the functionality, and this just serves as a common +container for references to the `-control` objects for this object." + ((root trsqv) + (node-list cspace-array) + (draw draw-control) + (skel joint-control) + (nav nav-control) + (align align-control) + (path path-control) + (vol vol-control) + (fact fact-info) + (link actor-link-info) + (part sparticle-launch-control) + (water water-control) + (sound ambient-sound) + (carry carry-info) + (rbody rigid-body-control) + (state-flags state-flags) + (state-time time-frame) + ) + (:methods + (process-drawable-method-14 () none) + (process-drawable-method-15 () none) + (process-drawable-method-16 () none) + (process-drawable-method-17 () none) + (process-drawable-method-18 () none) + (process-drawable-method-19 () none) + ) + (:states + (process-drawable-art-error string) + process-drawable-idle + ) + ) + +;; definition for method 3 of type process-drawable +(defmethod inspect ((this process-drawable)) + (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 "~2Tnode-list: ~A~%" (-> this node-list)) + (format #t "~2Tdraw: ~A~%" (-> this draw)) + (format #t "~2Tskel: ~A~%" (-> this skel)) + (format #t "~2Tnav: ~A~%" (-> this nav)) + (format #t "~2Talign: ~A~%" (-> this align)) + (format #t "~2Tpath: ~A~%" (-> this path)) + (format #t "~2Tvol: ~A~%" (-> this vol)) + (format #t "~2Tfact: ~A~%" (-> this fact)) + (format #t "~2Tlink: ~A~%" (-> this link)) + (format #t "~2Tpart: ~A~%" (-> this part)) + (format #t "~2Twater: ~A~%" (-> this water)) + (format #t "~2Tsound: ~A~%" (-> this sound)) + (format #t "~2Tcarry: ~A~%" (-> this carry)) + (format #t "~2Trbody: ~A~%" (-> this rbody)) + (format #t "~2Tstate-flags: ~D~%" (-> this state-flags)) + (format #t "~2Tstate-time: ~D~%" (-> this state-time)) + (label cfg-4) + this + ) + +;; definition of type process-drawable-reserved +(deftype process-drawable-reserved (process-drawable) + "A process drawable with a lot of unused method slots. +GOAL cannot increase the number of methods at runtime, so, for interactive development, it is useful +to have a type with a large number of slots which can be turned into real methods without needed to reboot the PS2." + () + (:methods + (process-drawable-reserved-method-20 () none) + (process-drawable-reserved-method-21 () none) + (process-drawable-reserved-method-22 () none) + (process-drawable-reserved-method-23 () none) + (process-drawable-reserved-method-24 () none) + (process-drawable-reserved-method-25 () none) + (process-drawable-reserved-method-26 () none) + (process-drawable-reserved-method-27 () none) + (process-drawable-reserved-method-28 () none) + (process-drawable-reserved-method-29 () none) + (process-drawable-reserved-method-30 () none) + (process-drawable-reserved-method-31 () none) + (process-drawable-reserved-method-32 () none) + (process-drawable-reserved-method-33 () none) + (process-drawable-reserved-method-34 () none) + (process-drawable-reserved-method-35 () none) + (process-drawable-reserved-method-36 () none) + (process-drawable-reserved-method-37 () none) + (process-drawable-reserved-method-38 () none) + (process-drawable-reserved-method-39 () none) + (process-drawable-reserved-method-40 () none) + (process-drawable-reserved-method-41 () none) + (process-drawable-reserved-method-42 () none) + (process-drawable-reserved-method-43 () none) + (process-drawable-reserved-method-44 () none) + (process-drawable-reserved-method-45 () none) + (process-drawable-reserved-method-46 () none) + (process-drawable-reserved-method-47 () none) + (process-drawable-reserved-method-48 () none) + (process-drawable-reserved-method-49 () none) + (process-drawable-reserved-method-50 () none) + (process-drawable-reserved-method-51 () none) + (process-drawable-reserved-method-52 () none) + (process-drawable-reserved-method-53 () none) + (process-drawable-reserved-method-54 () none) + (process-drawable-reserved-method-55 () none) + (process-drawable-reserved-method-56 () none) + (process-drawable-reserved-method-57 () none) + (process-drawable-reserved-method-58 () none) + (process-drawable-reserved-method-59 () none) + (process-drawable-reserved-method-60 () none) + (process-drawable-reserved-method-61 () none) + (process-drawable-reserved-method-62 () none) + (process-drawable-reserved-method-63 () none) + (process-drawable-reserved-method-64 () none) + (process-drawable-reserved-method-65 () none) + (process-drawable-reserved-method-66 () none) + (process-drawable-reserved-method-67 () none) + (process-drawable-reserved-method-68 () none) + (process-drawable-reserved-method-69 () none) + (process-drawable-reserved-method-70 () none) + (process-drawable-reserved-method-71 () none) + (process-drawable-reserved-method-72 () none) + (process-drawable-reserved-method-73 () none) + (process-drawable-reserved-method-74 () none) + (process-drawable-reserved-method-75 () none) + (process-drawable-reserved-method-76 () none) + (process-drawable-reserved-method-77 () none) + (process-drawable-reserved-method-78 () none) + (process-drawable-reserved-method-79 () none) + (process-drawable-reserved-method-80 () none) + (process-drawable-reserved-method-81 () none) + (process-drawable-reserved-method-82 () none) + (process-drawable-reserved-method-83 () none) + (process-drawable-reserved-method-84 () none) + (process-drawable-reserved-method-85 () none) + (process-drawable-reserved-method-86 () none) + (process-drawable-reserved-method-87 () none) + (process-drawable-reserved-method-88 () none) + (process-drawable-reserved-method-89 () none) + (process-drawable-reserved-method-90 () none) + (process-drawable-reserved-method-91 () none) + (process-drawable-reserved-method-92 () none) + (process-drawable-reserved-method-93 () none) + (process-drawable-reserved-method-94 () none) + (process-drawable-reserved-method-95 () none) + (process-drawable-reserved-method-96 () none) + (process-drawable-reserved-method-97 () none) + (process-drawable-reserved-method-98 () none) + (process-drawable-reserved-method-99 () none) + (process-drawable-reserved-method-100 () none) + (process-drawable-reserved-method-101 () none) + (process-drawable-reserved-method-102 () none) + (process-drawable-reserved-method-103 () none) + (process-drawable-reserved-method-104 () none) + (process-drawable-reserved-method-105 () none) + (process-drawable-reserved-method-106 () none) + (process-drawable-reserved-method-107 () none) + (process-drawable-reserved-method-108 () none) + (process-drawable-reserved-method-109 () none) + (process-drawable-reserved-method-110 () none) + (process-drawable-reserved-method-111 () none) + (process-drawable-reserved-method-112 () none) + (process-drawable-reserved-method-113 () none) + (process-drawable-reserved-method-114 () none) + (process-drawable-reserved-method-115 () none) + (process-drawable-reserved-method-116 () none) + (process-drawable-reserved-method-117 () none) + (process-drawable-reserved-method-118 () none) + (process-drawable-reserved-method-119 () none) + (process-drawable-reserved-method-120 () none) + (process-drawable-reserved-method-121 () none) + (process-drawable-reserved-method-122 () none) + (process-drawable-reserved-method-123 () none) + (process-drawable-reserved-method-124 () none) + (process-drawable-reserved-method-125 () none) + (process-drawable-reserved-method-126 () none) + (process-drawable-reserved-method-127 () none) + (process-drawable-reserved-method-128 () none) + (process-drawable-reserved-method-129 () none) + (process-drawable-reserved-method-130 () none) + (process-drawable-reserved-method-131 () none) + (process-drawable-reserved-method-132 () none) + (process-drawable-reserved-method-133 () none) + (process-drawable-reserved-method-134 () none) + (process-drawable-reserved-method-135 () none) + (process-drawable-reserved-method-136 () none) + (process-drawable-reserved-method-137 () none) + (process-drawable-reserved-method-138 () none) + (process-drawable-reserved-method-139 () none) + (process-drawable-reserved-method-140 () none) + (process-drawable-reserved-method-141 () none) + (process-drawable-reserved-method-142 () none) + (process-drawable-reserved-method-143 () none) + (process-drawable-reserved-method-144 () none) + (process-drawable-reserved-method-145 () none) + (process-drawable-reserved-method-146 () none) + (process-drawable-reserved-method-147 () none) + (process-drawable-reserved-method-148 () none) + (process-drawable-reserved-method-149 () none) + (process-drawable-reserved-method-150 () none) + (process-drawable-reserved-method-151 () none) + (process-drawable-reserved-method-152 () none) + (process-drawable-reserved-method-153 () none) + (process-drawable-reserved-method-154 () none) + (process-drawable-reserved-method-155 () none) + (process-drawable-reserved-method-156 () none) + (process-drawable-reserved-method-157 () none) + (process-drawable-reserved-method-158 () none) + (process-drawable-reserved-method-159 () none) + (process-drawable-reserved-method-160 () none) + (process-drawable-reserved-method-161 () none) + (process-drawable-reserved-method-162 () none) + (process-drawable-reserved-method-163 () none) + (process-drawable-reserved-method-164 () none) + (process-drawable-reserved-method-165 () none) + (process-drawable-reserved-method-166 () none) + (process-drawable-reserved-method-167 () none) + (process-drawable-reserved-method-168 () none) + (process-drawable-reserved-method-169 () none) + (process-drawable-reserved-method-170 () none) + (process-drawable-reserved-method-171 () none) + (process-drawable-reserved-method-172 () none) + (process-drawable-reserved-method-173 () none) + (process-drawable-reserved-method-174 () none) + (process-drawable-reserved-method-175 () none) + (process-drawable-reserved-method-176 () none) + (process-drawable-reserved-method-177 () none) + (process-drawable-reserved-method-178 () none) + (process-drawable-reserved-method-179 () none) + (process-drawable-reserved-method-180 () none) + (process-drawable-reserved-method-181 () none) + (process-drawable-reserved-method-182 () none) + (process-drawable-reserved-method-183 () none) + (process-drawable-reserved-method-184 () none) + (process-drawable-reserved-method-185 () none) + (process-drawable-reserved-method-186 () none) + (process-drawable-reserved-method-187 () none) + (process-drawable-reserved-method-188 () none) + (process-drawable-reserved-method-189 () none) + (process-drawable-reserved-method-190 () none) + (process-drawable-reserved-method-191 () none) + (process-drawable-reserved-method-192 () none) + (process-drawable-reserved-method-193 () none) + (process-drawable-reserved-method-194 () none) + (process-drawable-reserved-method-195 () none) + (process-drawable-reserved-method-196 () none) + (process-drawable-reserved-method-197 () none) + (process-drawable-reserved-method-198 () none) + (process-drawable-reserved-method-199 () none) + (process-drawable-reserved-method-200 () none) + (process-drawable-reserved-method-201 () none) + (process-drawable-reserved-method-202 () none) + (process-drawable-reserved-method-203 () none) + (process-drawable-reserved-method-204 () none) + (process-drawable-reserved-method-205 () none) + (process-drawable-reserved-method-206 () none) + (process-drawable-reserved-method-207 () none) + (process-drawable-reserved-method-208 () none) + (process-drawable-reserved-method-209 () none) + (process-drawable-reserved-method-210 () none) + (process-drawable-reserved-method-211 () none) + (process-drawable-reserved-method-212 () none) + (process-drawable-reserved-method-213 () none) + (process-drawable-reserved-method-214 () none) + (process-drawable-reserved-method-215 () none) + (process-drawable-reserved-method-216 () none) + (process-drawable-reserved-method-217 () none) + ) + ) + +;; definition for method 3 of type process-drawable-reserved +(defmethod inspect ((this process-drawable-reserved)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition of type attack-dir-info +(deftype attack-dir-info (structure) + ((dir vector :inline) + (xz-dir vector :inline) + (attacker-velocity vector :inline) + (pos vector :inline) + ) + ) + +;; definition for method 3 of type attack-dir-info +(defmethod inspect ((this attack-dir-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'attack-dir-info) + (format #t "~1Tdir: #~%" (-> this dir)) + (format #t "~1Txz-dir: #~%" (-> this xz-dir)) + (format #t "~1Tattacker-velocity: #~%" (-> this attacker-velocity)) + (format #t "~1Tpos: #~%" (-> this pos)) + (label cfg-4) + this + ) + +;; definition of type attack-info +(deftype attack-info (structure) + ((trans vector :inline) + (vector vector :inline) + (attacker-velocity vector :inline) + (intersection vector :inline) + (attacker handle) + (attack-time time-frame) + (invinc-time time-frame) + (mask attack-mask) + (mode symbol) + (shove-back meters) + (shove-up meters) + (speed meters) + (dist meters) + (control float) + (angle symbol) + (rotate-to degrees) + (prev-state state) + (id uint32) + (count uint32) + (penetrate-using penetrate) + (damage float) + (shield-damage float) + (vehicle-damage-factor float) + (vehicle-impulse-factor float) + (knock knocked-type) + (test symbol) + ) + (:methods + (attack-info-method-9 () none) + (attack-info-method-10 () none) + (attack-info-method-11 () none) + ) + ) + +;; definition for method 3 of type attack-info +(defmethod inspect ((this attack-info)) + (when (not this) + (set! this this) + (goto cfg-54) + ) + (format #t "[~8x] ~A~%" this 'attack-info) + (format #t "~1Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~1Tvector: ~`vector`P~%" (-> this vector)) + (format #t "~1Tattacker-velocity: ~`vector`P~%" (-> this attacker-velocity)) + (format #t "~1Tintersection: ~`vector`P~%" (-> this intersection)) + (format #t "~1Tattacker: ~`handle`P~%" (-> this attacker)) + (format #t "~1Tattack-time: ~D~%" (-> this attack-time)) + (format #t "~1Tinvinc-time: ~D~%" (-> this invinc-time)) + (format #t "~1Tmask: #x~X : (attack-info-mask " (-> this mask)) + (let ((s5-0 (-> this mask))) + (if (= (logand s5-0 (attack-mask vector)) (attack-mask vector)) + (format #t "vector ") + ) + (if (= (logand s5-0 (attack-mask angle)) (attack-mask angle)) + (format #t "angle ") + ) + (if (= (logand (attack-mask test) s5-0) (attack-mask test)) + (format #t "test ") + ) + (if (= (logand s5-0 (attack-mask invinc-time)) (attack-mask invinc-time)) + (format #t "invinc-time ") + ) + (if (= (logand s5-0 (attack-mask attacker)) (attack-mask attacker)) + (format #t "attacker ") + ) + (if (= (logand s5-0 (attack-mask dist)) (attack-mask dist)) + (format #t "dist ") + ) + (if (= (logand s5-0 (attack-mask intersection)) (attack-mask intersection)) + (format #t "intersection ") + ) + (if (= (logand s5-0 (attack-mask shove-back)) (attack-mask shove-back)) + (format #t "shove-back ") + ) + (if (= (logand s5-0 (attack-mask shove-up)) (attack-mask shove-up)) + (format #t "shove-up ") + ) + (if (= (logand s5-0 (attack-mask mode)) (attack-mask mode)) + (format #t "mode ") + ) + (if (= (logand (attack-mask count) s5-0) (attack-mask count)) + (format #t "count ") + ) + (if (= (logand s5-0 (attack-mask rotate-to)) (attack-mask rotate-to)) + (format #t "rotate-to ") + ) + (if (= (logand s5-0 (attack-mask speed)) (attack-mask speed)) + (format #t "speed ") + ) + (if (= (logand s5-0 (attack-mask attack-time)) (attack-mask attack-time)) + (format #t "attack-time ") + ) + (if (= (logand (attack-mask vehicle-damage-factor) s5-0) (attack-mask vehicle-damage-factor)) + (format #t "vehicle-damage-factor ") + ) + (if (= (logand (attack-mask damage) s5-0) (attack-mask damage)) + (format #t "damage ") + ) + (if (= (logand s5-0 (attack-mask control)) (attack-mask control)) + (format #t "control ") + ) + (if (= (logand s5-0 (attack-mask trans)) (attack-mask trans)) + (format #t "trans ") + ) + (if (= (logand (attack-mask penetrate-using) s5-0) (attack-mask penetrate-using)) + (format #t "penetrate-using ") + ) + (if (= (logand (attack-mask vehicle-impulse-factor) s5-0) (attack-mask vehicle-impulse-factor)) + (format #t "vehicle-impulse-factor ") + ) + (if (= (logand (attack-mask attacker-velocity) s5-0) (attack-mask attacker-velocity)) + (format #t "attacker-velocity ") + ) + (if (= (logand s5-0 (attack-mask id)) (attack-mask id)) + (format #t "id ") + ) + (if (= (logand s5-0 (attack-mask prev-state)) (attack-mask prev-state)) + (format #t "prev-state ") + ) + (if (= (logand (attack-mask knock) s5-0) (attack-mask knock)) + (format #t "knock ") + ) + (if (= (logand (attack-mask shield-damage) s5-0) (attack-mask shield-damage)) + (format #t "shield-damage ") + ) + ) + (format #t ")~%") + (format #t "~1Tmode: ~A~%" (-> this mode)) + (format #t "~1Tshove-back: (meters ~m)~%" (-> this shove-back)) + (format #t "~1Tshove-up: (meters ~m)~%" (-> this shove-up)) + (format #t "~1Tspeed: (meters ~m)~%" (-> this speed)) + (format #t "~1Tdist: (meters ~m)~%" (-> this dist)) + (format #t "~1Tcontrol: ~f~%" (-> this control)) + (format #t "~1Tangle: ~A~%" (-> this angle)) + (format #t "~1Trotate-to: (deg ~r)~%" (-> this rotate-to)) + (format #t "~1Tprev-state: ~A~%" (-> this prev-state)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tcount: ~D~%" (-> this count)) + (format #t "~1Tpenetrate-using: ~D~%" (-> this penetrate-using)) + (format #t "~1Tdamage: ~f~%" (-> this damage)) + (format #t "~1Tshield-damage: ~f~%" (-> this shield-damage)) + (format #t "~1Tvehicle-damage-factor: ~f~%" (-> this vehicle-damage-factor)) + (format #t "~1Tvehicle-impulse-factor: ~f~%" (-> this vehicle-impulse-factor)) + (format #t "~1Tknock: ~D~%" (-> this knock)) + (format #t "~1Ttest: ~A~%" (-> this test)) + (label cfg-54) + this + ) + +;; definition of type ground-tween-info +(deftype ground-tween-info (structure) + ((chan uint8 3) + (blend float 3) + (group uint32 5) + ) + ) + +;; definition for method 3 of type ground-tween-info +(defmethod inspect ((this ground-tween-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'ground-tween-info) + (format #t "~1Tchan[3] @ #x~X~%" (-> this chan)) + (format #t "~1Tblend[3] @ #x~X~%" (-> this blend)) + (format #t "~1Tgroup[5] @ #x~X~%" (-> this group)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/engine/game/penetrate-h_REF.gc b/test/decompiler/reference/jak3/engine/game/penetrate-h_REF.gc new file mode 100644 index 0000000000..74dc053c09 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/game/penetrate-h_REF.gc @@ -0,0 +1,271 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition (debug) for function penetrate->string +;; WARN: Return type mismatch object vs string. +(defun-debug penetrate->string ((arg0 penetrate)) + (if (= (logand (penetrate jak-red-shockwave) arg0) (shl 4 32)) + (format #t "jak-red-shockwave ") + ) + (if (= (logand arg0 (penetrate mech-bonk)) (penetrate mech-bonk)) + (format #t "mech-bonk ") + ) + (if (= (logand (penetrate eco-blue) arg0) (shl #x8000 16)) + (format #t "eco-blue ") + ) + (if (= (logand (penetrate explode) arg0) (penetrate explode)) + (format #t "explode ") + ) + (if (= (logand arg0 (penetrate bonk)) (penetrate bonk)) + (format #t "bonk ") + ) + (if (= (logand (penetrate eco-red) arg0) (penetrate eco-red)) + (format #t "eco-red ") + ) + (if (= (logand arg0 (penetrate roll)) (penetrate roll)) + (format #t "roll ") + ) + (if (= (logand arg0 (penetrate mech)) (penetrate mech)) + (format #t "mech ") + ) + (if (= (logand arg0 (penetrate flut-attack)) (penetrate flut-attack)) + (format #t "flut-attack ") + ) + (if (= (logand arg0 (penetrate mech-punch)) (penetrate mech-punch)) + (format #t "mech-punch ") + ) + (if (= (logand (penetrate jak-dark-shot) arg0) (penetrate jak-dark-shot)) + (format #t "jak-dark-shot ") + ) + (if (= (logand (penetrate dark-smack) arg0) (penetrate dark-smack)) + (format #t "dark-smack ") + ) + (if (= (logand arg0 (penetrate flop)) (penetrate flop)) + (format #t "flop ") + ) + (if (= (logand arg0 (penetrate spin)) (penetrate spin)) + (format #t "spin ") + ) + (if (= (logand (penetrate dark-bomb) arg0) (penetrate dark-bomb)) + (format #t "dark-bomb ") + ) + (if (= (logand arg0 (penetrate vehicle)) (penetrate vehicle)) + (format #t "vehicle ") + ) + (if (= (logand arg0 (penetrate generic-attack)) (penetrate generic-attack)) + (format #t "generic-attack ") + ) + (if (= (logand arg0 (penetrate touch)) (penetrate touch)) + (format #t "touch ") + ) + (if (= (logand (penetrate eco-green) arg0) (shl 1 32)) + (format #t "eco-green ") + ) + (if (= (logand (penetrate jak-red-shot) arg0) (penetrate jak-red-shot)) + (format #t "jak-red-shot ") + ) + (if (= (logand arg0 (penetrate lunge)) (penetrate lunge)) + (format #t "lunge ") + ) + (if (= (logand arg0 (penetrate punch)) (penetrate punch)) + (format #t "punch ") + ) + (if (= (logand arg0 (penetrate tube)) (penetrate tube)) + (format #t "tube ") + ) + (if (= (logand (penetrate jak-dark-nuke) arg0) (shl 8 32)) + (format #t "jak-dark-nuke ") + ) + (if (= (logand (penetrate enemy-yellow-shot) arg0) (penetrate enemy-yellow-shot)) + (format #t "enemy-yellow-shot ") + ) + (if (= (logand (penetrate knocked) arg0) (shl 2 32)) + (format #t "knocked ") + ) + (if (= (logand (penetrate emp-blast) arg0) (shl 32 32)) + (format #t "emp-blast ") + ) + (if (= (logand arg0 (penetrate uppercut)) (penetrate uppercut)) + (format #t "uppercut ") + ) + (if (= (logand (penetrate dark-punch) arg0) (penetrate dark-punch)) + (format #t "dark-punch ") + ) + (if (= (logand (penetrate shield) arg0) (penetrate shield)) + (format #t "shield ") + ) + (if (= (logand (penetrate jak-yellow-shot) arg0) (penetrate jak-yellow-shot)) + (format #t "jak-yellow-shot ") + ) + (if (= (logand arg0 (penetrate board)) (penetrate board)) + (format #t "board ") + ) + (if (= (logand (penetrate flut) arg0) (penetrate flut)) + (format #t "flut ") + ) + (if (= (logand (penetrate eco-yellow) arg0) (penetrate eco-yellow)) + (format #t "eco-yellow ") + ) + (if (= (logand (penetrate dark-skin) arg0) (penetrate dark-skin)) + (format #t "dark-skin ") + ) + (if (= (logand (penetrate jak-dark-blackhole) arg0) (shl 16 32)) + (format #t "jak-dark-blackhole ") + ) + (if (= (logand (penetrate enemy-dark-shot) arg0) (penetrate enemy-dark-shot)) + (format #t "enemy-dark-shot ") + ) + (the-as string (if (= (logand (penetrate jak-blue-shot) arg0) (penetrate jak-blue-shot)) + (format #t "jak-blue-shot ") + ) + ) + ) + +;; definition for function penetrate-using->damage +(defun penetrate-using->damage ((arg0 penetrate)) + (cond + ((logtest? (penetrate dark-bomb dark-smack flut) arg0) + 15.0 + ) + ((logtest? arg0 (penetrate mech-punch mech-bonk)) + 5.0 + ) + ((logtest? (penetrate) arg0) + 4.0 + ) + ((logtest? (penetrate punch spin jak-dark-shot enemy-dark-shot) arg0) + 3.0 + ) + ((logtest? (penetrate + flop + uppercut + tube + flut-attack + dark-punch + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + enemy-yellow-shot + eco-yellow + ) + arg0 + ) + 2.0 + ) + ((logtest? arg0 (penetrate generic-attack roll bonk board)) + 1.0 + ) + (else + 0.0 + ) + ) + ) + +;; definition for function penetrated-by-all&hit-points->penetrated-by +;; WARN: Return type mismatch uint vs penetrate. +(defun penetrated-by-all&hit-points->penetrated-by ((arg0 penetrate) (arg1 int)) + (let ((a0-1 arg1)) + (the-as penetrate (logior (logclear arg0 (penetrate + generic-attack + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + knocked + ) + ) + (cond + ((or (zero? a0-1) (= a0-1 1)) + (the-as int (the-as uint #x23fffdbfa)) + ) + ((= a0-1 2) + #x3fdecab8 + ) + ((= a0-1 3) + #x141cc030 + ) + ((= a0-1 4) + #x1cc000 + ) + ((= a0-1 5) + #x1cc000 + ) + ((or (= a0-1 6) + (= a0-1 7) + (= a0-1 8) + (= a0-1 9) + (= a0-1 10) + (= a0-1 11) + (= a0-1 12) + (= a0-1 13) + (= a0-1 14) + (= a0-1 15) + ) + #x1c0000 + ) + (else + 0 + ) + ) + ) + ) + ) + ) + +;; definition for function pu->knocked-type +;; WARN: Return type mismatch int vs knocked-type. +(defun pu->knocked-type ((arg0 penetrate)) + (the-as knocked-type (cond + ((logtest? arg0 (penetrate vehicle)) + 7 + ) + ((logtest? (penetrate jak-blue-shot) arg0) + 6 + ) + ((logtest? (penetrate jak-yellow-shot enemy-yellow-shot) arg0) + 4 + ) + ((logtest? (penetrate jak-red-shot) arg0) + 5 + ) + ((logtest? (penetrate explode jak-dark-shot enemy-dark-shot) arg0) + 2 + ) + ((logtest? (penetrate dark-bomb dark-smack) arg0) + 3 + ) + ((logtest? arg0 (penetrate mech-punch)) + 1 + ) + (else + 0 + ) + ) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/gfx/foreground/bones-h_REF.gc b/test/decompiler/reference/jak3/engine/gfx/foreground/bones-h_REF.gc new file mode 100644 index 0000000000..09bdb109c2 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/gfx/foreground/bones-h_REF.gc @@ -0,0 +1,213 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type bone-buffer +(deftype bone-buffer (structure) + ((joint matrix 16 :inline) + (bone bone 16 :inline) + (output pris-mtx 16 :inline) + ) + ) + +;; definition for method 3 of type bone-buffer +(defmethod inspect ((this bone-buffer)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'bone-buffer) + (format #t "~1Tjoint[16] @ #x~X~%" (-> this joint)) + (format #t "~1Tbone[16] @ #x~X~%" (-> this bone)) + (format #t "~1Toutput[16] @ #x~X~%" (-> this output)) + (label cfg-4) + this + ) + +;; definition of type bone-layout +(deftype bone-layout (structure) + ((data uint16 8) + (joint (inline-array matrix) 2 :overlay-at (-> data 0)) + (bone (inline-array bone) 2 :overlay-at (-> data 4)) + (output (inline-array pris-mtx) 2 :offset 16) + (unused uint32 2 :offset 24) + ) + ) + +;; definition for method 3 of type bone-layout +(defmethod inspect ((this bone-layout)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'bone-layout) + (format #t "~1Tdata[8] @ #x~X~%" (-> this data)) + (format #t "~1Tjoint[2] @ #x~X~%" (-> this data)) + (format #t "~1Tbone[2] @ #x~X~%" (-> this bone)) + (format #t "~1Toutput[2] @ #x~X~%" (-> this output)) + (format #t "~1Tunused[2] @ #x~X~%" (-> this unused)) + (label cfg-4) + this + ) + +;; definition of type bone-regs +(deftype bone-regs (structure) + ((dma-buf dma-buffer) + (wait-count uint32) + (in-count uint32) + (sp-size uint32) + (sp-bufnum uint32) + (joint-ptr (inline-array joint)) + (bone-ptr (inline-array bone)) + (num-bones uint32) + (mtxs (inline-array pris-mtx)) + ) + ) + +;; definition for method 3 of type bone-regs +(defmethod inspect ((this bone-regs)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'bone-regs) + (format #t "~1Tdma-buf: ~A~%" (-> this dma-buf)) + (format #t "~1Twait-count: ~D~%" (-> this wait-count)) + (format #t "~1Tin-count: ~D~%" (-> this in-count)) + (format #t "~1Tsp-size: ~D~%" (-> this sp-size)) + (format #t "~1Tsp-bufnum: ~D~%" (-> this sp-bufnum)) + (format #t "~1Tjoint-ptr: #x~X~%" (-> this joint-ptr)) + (format #t "~1Tbone-ptr: #x~X~%" (-> this bone-ptr)) + (format #t "~1Tnum-bones: ~D~%" (-> this num-bones)) + (format #t "~1Tmtxs: #x~X~%" (-> this mtxs)) + (label cfg-4) + this + ) + +;; definition of type bone-work +(deftype bone-work (structure) + ((layout bone-layout :inline) + (regs bone-regs :inline) + ) + ) + +;; definition for method 3 of type bone-work +(defmethod inspect ((this bone-work)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'bone-work) + (format #t "~1Tlayout: #~%" (-> this layout)) + (format #t "~1Tregs: #~%" (-> this regs)) + (label cfg-4) + this + ) + +;; definition of type bone-debug +(deftype bone-debug (structure) + ((time-ctr uint32) + (timing uint32 360) + ) + ) + +;; definition for method 3 of type bone-debug +(defmethod inspect ((this bone-debug)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'bone-debug) + (format #t "~1Ttime-ctr: ~D~%" (-> this time-ctr)) + (format #t "~1Ttiming[360] @ #x~X~%" (-> this timing)) + (label cfg-4) + this + ) + +;; definition of type bone-memory +(deftype bone-memory (structure) + ((work bone-work :inline) + (buffer bone-buffer 2 :inline) + ) + ) + +;; definition for method 3 of type bone-memory +(defmethod inspect ((this bone-memory)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'bone-memory) + (format #t "~1Twork: #~%" (-> this work)) + (format #t "~1Tbuffer[2] @ #x~X~%" (-> this buffer)) + (label cfg-4) + this + ) + +;; definition of type bone-calculation +(deftype bone-calculation (structure) + ((flags bone-calc-flags) + (num-bones uint16) + (matrix-area (inline-array pris-mtx)) + (joints (inline-array joint)) + (bones (inline-array bone)) + (ripple-scale float) + (ripple-y-scale float) + (ripple-normal-scale float) + (ripple-area (inline-array vector)) + (next bone-calculation) + (dummy-1 uint32) + (dummy-2 uint32) + (dummy-3 uint32) + ) + ) + +;; definition for method 3 of type bone-calculation +(defmethod inspect ((this bone-calculation)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'bone-calculation) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tnum-bones: ~D~%" (-> this num-bones)) + (format #t "~1Tmatrix-area: #x~X~%" (-> this matrix-area)) + (format #t "~1Tjoints: #x~X~%" (-> this joints)) + (format #t "~1Tbones: #x~X~%" (-> this bones)) + (format #t "~1Tripple-scale: ~f~%" (-> this ripple-scale)) + (format #t "~1Tripple-y-scale: ~f~%" (-> this ripple-y-scale)) + (format #t "~1Tripple-normal-scale: ~f~%" (-> this ripple-normal-scale)) + (format #t "~1Tripple-area: #x~X~%" (-> this ripple-area)) + (format #t "~1Tnext: #~%" (-> this next)) + (format #t "~1Tdummy-1: ~D~%" (-> this dummy-1)) + (format #t "~1Tdummy-2: ~D~%" (-> this dummy-2)) + (format #t "~1Tdummy-3: ~D~%" (-> this dummy-3)) + (label cfg-4) + this + ) + +;; definition of type bone-calculation-list +(deftype bone-calculation-list (structure) + ((first bone-calculation) + (next bone-calculation) + ) + ) + +;; definition for method 3 of type bone-calculation-list +(defmethod inspect ((this bone-calculation-list)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'bone-calculation-list) + (format #t "~1Tfirst: #~%" (-> this first)) + (format #t "~1Tnext: #~%" (-> this next)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/engine/gfx/foreground/foreground-h_REF.gc b/test/decompiler/reference/jak3/engine/gfx/foreground/foreground-h_REF.gc new file mode 100644 index 0000000000..1d4d85b70c --- /dev/null +++ b/test/decompiler/reference/jak3/engine/gfx/foreground/foreground-h_REF.gc @@ -0,0 +1,344 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type mercneric-chain +(deftype mercneric-chain (structure) + "A DMA chain for drawing with mercneric, and metadata needed to append. +This chain is assumed to run with a specific tpage from a specific level available." + ((first uint32) + (next uint32) + (state generic-bucket-state :inline) + (vu1-bucket bucket-id) + ) + :pack-me + ) + +;; definition for method 3 of type mercneric-chain +(defmethod inspect ((this mercneric-chain)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'mercneric-chain) + (format #t "~1Tfirst: #x~X~%" (-> this first)) + (format #t "~1Tnext: #x~X~%" (-> this next)) + (format #t "~1Tstate: #~%" (-> this state)) + (format #t "~1Tvu1-bucket: ~D~%" (-> this vu1-bucket)) + (label cfg-4) + this + ) + +;; definition of type merc-chain +(deftype merc-chain (structure) + "A DMA chain for drawing with merc. +This chain is assumed to run with a specific tpage from a specific level available." + ((first dma-packet) + (patch dma-packet) + (vu1-bucket bucket-id) + ) + :pack-me + ) + +;; definition for method 3 of type merc-chain +(defmethod inspect ((this merc-chain)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'merc-chain) + (format #t "~1Tfirst: #~%" (-> this first)) + (format #t "~1Tpatch: #~%" (-> this patch)) + (format #t "~1Tvu1-bucket: ~D~%" (-> this vu1-bucket)) + (label cfg-4) + this + ) + +;; definition of type foreground-bucket +(deftype foreground-bucket (structure) + "A foreground bucket is merc, emerc, and mercneric chain for a given texture mode." + ((merc merc-chain :inline) + (emerc merc-chain :inline) + (mercneric mercneric-chain :inline) + ) + ) + +;; definition for method 3 of type foreground-bucket +(defmethod inspect ((this foreground-bucket)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'foreground-bucket) + (format #t "~1Tmerc: #~%" (-> this merc)) + (format #t "~1Temerc: #~%" (-> this emerc)) + (format #t "~1Tmercneric: #~%" (-> this mercneric)) + (label cfg-4) + this + ) + +;; definition of type foreground-level-buckets +(deftype foreground-level-buckets (structure) + "Collection of buckets for a single level. +Each bucket has a different texture. The order is: +tfrag, pris, shrub, alpha, water, pris, pris2" + ((data foreground-bucket 7 :inline) + ) + ) + +;; definition for method 3 of type foreground-level-buckets +(defmethod inspect ((this foreground-level-buckets)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'foreground-level-buckets) + (format #t "~1Tdata[7] @ #x~X~%" (-> this data)) + (label cfg-4) + this + ) + +;; definition of type foreground-bucket-grid +(deftype foreground-bucket-grid (structure) + "Array of buckets for each level, plus the single warp chain shared between everybody." + ((level-buckets foreground-level-buckets 11 :inline) + (warp-chain mercneric-chain :inline) + ) + ) + +;; definition for method 3 of type foreground-bucket-grid +(defmethod inspect ((this foreground-bucket-grid)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'foreground-bucket-grid) + (format #t "~1Tlevel-buckets[11] @ #x~X~%" (-> this level-buckets)) + (format #t "~1Twarp-chain: #~%" (-> this warp-chain)) + (label cfg-4) + this + ) + +;; definition of type foreground-regs +(deftype foreground-regs (structure) + "Frequently accessed foreground values. These are in scratchpad for fast access +during foreground processing." + ((dist float) + (merc-used uint32) + (emerc-used uint32) + (mercneric-used uint32) + (use-isometric uint32) + (base-start dma-packet) + (joint-ptr (inline-array joint)) + (bone-ptr (inline-array bone)) + (num-bones uint32) + (mtxs (inline-array pris-mtx)) + (dma-buf dma-buffer) + (default-texture-index uint32) + (mercneric-chain mercneric-chain) + (level-buckets foreground-level-buckets) + ) + ) + +;; definition for method 3 of type foreground-regs +(defmethod inspect ((this foreground-regs)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'foreground-regs) + (format #t "~1Tdist: ~f~%" (-> this dist)) + (format #t "~1Tmerc-used: ~D~%" (-> this merc-used)) + (format #t "~1Temerc-used: ~D~%" (-> this emerc-used)) + (format #t "~1Tmercneric-used: ~D~%" (-> this mercneric-used)) + (format #t "~1Tuse-isometric: ~D~%" (-> this use-isometric)) + (format #t "~1Tbase-start: #~%" (-> this base-start)) + (format #t "~1Tjoint-ptr: #x~X~%" (-> this joint-ptr)) + (format #t "~1Tbone-ptr: #x~X~%" (-> this bone-ptr)) + (format #t "~1Tnum-bones: ~D~%" (-> this num-bones)) + (format #t "~1Tmtxs: #x~X~%" (-> this mtxs)) + (format #t "~1Tdma-buf: ~A~%" (-> this dma-buf)) + (format #t "~1Tdefault-texture-index: ~D~%" (-> this default-texture-index)) + (format #t "~1Tmercneric-chain: #~%" (-> this mercneric-chain)) + (format #t "~1Tlevel-buckets: #~%" (-> this level-buckets)) + (label cfg-4) + this + ) + +;; definition of type foreground-work +(deftype foreground-work (structure) + "Memory map for scratchpad during foreground processing. +This is not used by the renderers, bone matrix, or joint code - just the code +that assigns stuff to buckets and prepares DMA for merc (or requests for generic merc)." + ((regs foreground-regs :inline) + (draw-index-map uint8 11 :offset 64) + (grid foreground-bucket-grid :inline) + (bounds sphere :inline) + (lights vu-lights :inline) + (distance vector :inline) + (next-tmpl dma-packet :inline) + ) + ) + +;; definition for method 3 of type foreground-work +(defmethod inspect ((this foreground-work)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'foreground-work) + (format #t "~1Tregs: #~%" (-> this regs)) + (format #t "~1Tdraw-index-map[11] @ #x~X~%" (-> this draw-index-map)) + (format #t "~1Tgrid: #~%" (-> this grid)) + (format #t "~1Tbounds: #~%" (-> this bounds)) + (format #t "~1Tlights: #~%" (-> this lights)) + (format #t "~1Tdistance: #~%" (-> this distance)) + (format #t "~1Tnext-tmpl: #~%" (-> this next-tmpl)) + (label cfg-4) + this + ) + +;; definition for function invalidate-cache-line +;; ERROR: Unsupported inline assembly instruction kind - [cache dxwbin a0, 0] +;; ERROR: Unsupported inline assembly instruction kind - [cache dxwbin a0, 1] +(defun invalidate-cache-line ((arg0 pointer)) + (.sync.l) + (.cache dxwbin arg0 0) + (.sync.l) + (.cache dxwbin arg0 1) + (.sync.l) + 0 + ) + +;; definition of type texscroll-globals +(deftype texscroll-globals (structure) + "List of all merc-effects that need texscroll applied." + ((requests int32) + (effects merc-effect 32) + ) + ) + +;; definition for method 3 of type texscroll-globals +(defmethod inspect ((this texscroll-globals)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'texscroll-globals) + (format #t "~1Trequests: ~D~%" (-> this requests)) + (format #t "~1Teffects[32] @ #x~X~%" (-> this effects)) + (label cfg-4) + this + ) + +;; definition of type merc-effect-bucket-info +(deftype merc-effect-bucket-info (structure) + "Scratch info computed per-merc-effect by the foreground code, then later read by merc +DMA generation. This is only for the currently-processing merc model's effects." + ((color-fade rgba) + (merc-path uint8) + (ignore-alpha uint8) + (disable-draw uint8) + (disable-envmap uint8) + ) + :pack-me + ) + +;; definition for method 3 of type merc-effect-bucket-info +(defmethod inspect ((this merc-effect-bucket-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'merc-effect-bucket-info) + (format #t "~1Tcolor-fade: ~D~%" (-> this color-fade)) + (format #t "~1Tmerc-path: ~D~%" (-> this merc-path)) + (format #t "~1Tignore-alpha: ~D~%" (-> this ignore-alpha)) + (format #t "~1Tdisable-draw: ~D~%" (-> this disable-draw)) + (format #t "~1Tdisable-envmap: ~D~%" (-> this disable-envmap)) + (label cfg-4) + this + ) + +;; definition of type merc-bucket-info +(deftype merc-bucket-info (structure) + "Scratch info for the current merc-ctrl. Written by the foreground code, read by merc DMA generation." + ((light vu-lights :inline) + (needs-clip int32) + (need-mercprime-if-merc int32) + (must-use-mercneric-for-clip int32) + (effect merc-effect-bucket-info 64 :inline) + ) + ) + +;; definition for method 3 of type merc-bucket-info +(defmethod inspect ((this merc-bucket-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'merc-bucket-info) + (format #t "~1Tlight: #~%" (-> this light)) + (format #t "~1Tneeds-clip: ~D~%" (-> this needs-clip)) + (format #t "~1Tneed-mercprime-if-merc: ~D~%" (-> this need-mercprime-if-merc)) + (format #t "~1Tmust-use-mercneric-for-clip: ~D~%" (-> this must-use-mercneric-for-clip)) + (format #t "~1Teffect[64] @ #x~X~%" (-> this effect)) + (label cfg-4) + this + ) + +;; definition of type foreground-globals +(deftype foreground-globals (structure) + "The foreground renderer state: all DMA chains, settings for the current merc-ctrl, texscroll list." + ((foreground-grid foreground-bucket-grid :inline) + (merc-bucket-info merc-bucket-info :inline) + (texscroll texscroll-globals :inline) + ) + ) + +;; definition for method 3 of type foreground-globals +(defmethod inspect ((this foreground-globals)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'foreground-globals) + (format #t "~1Tforeground-grid: #~%" (-> this foreground-grid)) + (format #t "~1Tmerc-bucket-info: #~%" (-> this merc-bucket-info)) + (format #t "~1Ttexscroll: #~%" (-> this texscroll)) + (label cfg-4) + this + ) + +;; definition of type shadow-dma-packet +(deftype shadow-dma-packet (structure) + "DMA tag for submitting shadow data." + ((tag generic-merc-tag :inline) + (settings shadow-settings :inline) + (geo-ref dma-packet :inline) + (mtx-ref dma-packet :inline) + (end-tag dma-packet :inline) + ) + ) + +;; definition for method 3 of type shadow-dma-packet +(defmethod inspect ((this shadow-dma-packet)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'shadow-dma-packet) + (format #t "~1Ttag: #~%" (-> this tag)) + (format #t "~1Tsettings: #~%" (-> this settings)) + (format #t "~1Tgeo-ref: #~%" (-> this geo-ref)) + (format #t "~1Tmtx-ref: #~%" (-> this mtx-ref)) + (format #t "~1Tend-tag: #~%" (-> this end-tag)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/engine/math/matrix_REF.gc b/test/decompiler/reference/jak3/engine/math/matrix_REF.gc index fcacb1e17e..95e301ed45 100644 --- a/test/decompiler/reference/jak3/engine/math/matrix_REF.gc +++ b/test/decompiler/reference/jak3/engine/math/matrix_REF.gc @@ -2,6 +2,7 @@ (in-package goal) ;; definition for method 3 of type matrix +;; INFO: this function exists in multiple non-identical object files (defmethod inspect ((this matrix)) (format #t "[~8x] matrix~%" this) (format #t "~T[~F] [~F] [~F] [~F]~%" (-> this rvec x) (-> this rvec y) (-> this rvec z) (-> this rvec w)) @@ -12,6 +13,7 @@ ) ;; definition for method 3 of type matrix3 +;; INFO: this function exists in multiple non-identical object files (defmethod inspect ((this matrix3)) (format #t "[~8x] matrix3~%" this) (format #t "~T[~F] [~F] [~F]~%" (-> this vector 0 x) (-> this vector 0 y) (-> this vector 0 z)) @@ -1842,7 +1844,7 @@ (vector-normalize! (-> s4-0 fvec) 1.0) (vector-cross! (-> s4-0 fvec) (-> s4-0 rvec) (-> s4-0 uvec)) (vector-cross! (-> s4-0 uvec) (-> s4-0 fvec) (-> s4-0 rvec)) - (matrix->quaternion (the-as quaternion (-> arg0 rot)) s4-0) + (matrix->quaternion (-> arg0 quat) s4-0) ) (set-vector! (-> arg0 scale) 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 258975981b..834b1dec39 100644 --- a/test/decompiler/reference/jak3/engine/math/transformq-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/math/transformq-h_REF.gc @@ -15,9 +15,9 @@ ) (format #t "[~8x] ~A~%" this 'transformq) (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 ) diff --git a/test/decompiler/reference/jak3/engine/scene/scene-h_REF.gc b/test/decompiler/reference/jak3/engine/scene/scene-h_REF.gc new file mode 100644 index 0000000000..966b087d22 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/scene/scene-h_REF.gc @@ -0,0 +1,229 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type scene-actor +(deftype scene-actor (basic) + ((name string) + (level symbol) + (art-group string) + (prefix string) + (draw-frames pair) + (scissor-frames pair) + (shadow-frames basic) + (cloth-reset-frames basic) + (cloth-commands basic) + (camera int16) + (light-index uint8) + (shadow-mask uint8) + (shadow-values uint32) + (flags uint32) + (command-list basic) + (shadow-flags int32) + (shadow-volume-joint basic) + (draw-seg uint64) + (no-draw-seg uint64) + (last-frame float) + (process uint64) + ) + (:methods + (scene-actor-method-9 () none) + ) + ) + +;; definition for method 3 of type scene-actor +(defmethod inspect ((this scene-actor)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tlevel: ~A~%" (-> this level)) + (format #t "~1Tart-group: ~A~%" (-> this art-group)) + (format #t "~1Tprefix: ~A~%" (-> this prefix)) + (format #t "~1Tdraw-frames: ~A~%" (-> this draw-frames)) + (format #t "~1Tscissor-frames: ~A~%" (-> this scissor-frames)) + (format #t "~1Tshadow-frames: ~A~%" (-> this shadow-frames)) + (format #t "~1Tcloth-reset-frames: ~A~%" (-> this cloth-reset-frames)) + (format #t "~1Tcloth-commands: ~A~%" (-> this cloth-commands)) + (format #t "~1Tcamera: ~D~%" (-> this camera)) + (format #t "~1Tlight-index: ~D~%" (-> this light-index)) + (format #t "~1Tshadow-mask: ~D~%" (-> this shadow-mask)) + (format #t "~1Tshadow-values: ~D~%" (-> this shadow-values)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tcommand-list: ~A~%" (-> this command-list)) + (format #t "~1Tshadow-flags: ~D~%" (-> this shadow-flags)) + (format #t "~1Tshadow-volume-joint: ~A~%" (-> this shadow-volume-joint)) + (format #t "~1Tdraw-seg: ~D~%" (-> this draw-seg)) + (format #t "~1Tno-draw-seg: ~D~%" (-> this no-draw-seg)) + (format #t "~1Tlast-frame: ~f~%" (-> this last-frame)) + (format #t "~1Tprocess: ~D~%" (-> this process)) + (label cfg-4) + this + ) + +;; definition of type scene +(deftype scene (art-group) + ((scene-flags scene-flags) + (mask-to-clear process-mask) + (entity string) + (art-group string) + (anim string) + (parts int32) + (command-list pair) + (cut-list pair) + (wait-max-time time-frame) + (wait-air-time time-frame) + (wait-ground-time time-frame) + (actor (array scene-actor)) + (load-point continue-point) + (end-point continue-point) + (borrow pair) + (sfx-volume float) + (ambient-volume float) + (music-volume float) + (music-delay float) + (scene-task uint16) + (on-running basic) + (on-complete basic) + ) + (:methods + (scene-method-16 () none) + (scene-method-17 () none) + ) + ) + +;; definition for method 3 of type scene +(defmethod inspect ((this scene)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Textra: ~A~%" (-> this extra)) + (format #t "~1Tinfo: ~A~%" (-> this info)) + (format #t "~1Tdata[0] @ #x~X~%" (&-> this scene-flags)) + (format #t "~1Tscene-flags: ~D~%" (-> this scene-flags)) + (format #t "~1Tmask-to-clear: ~D~%" (-> this mask-to-clear)) + (format #t "~1Tentity: ~A~%" (-> this entity)) + (format #t "~1Tart-group: ~A~%" (-> this art-group)) + (format #t "~1Tanim: ~A~%" (-> this anim)) + (format #t "~1Tparts: ~D~%" (-> this parts)) + (format #t "~1Tcommand-list: ~A~%" (-> this command-list)) + (format #t "~1Tcut-list: ~A~%" (-> this cut-list)) + (format #t "~1Twait-max-time: ~D~%" (-> this wait-max-time)) + (format #t "~1Twait-air-time: ~D~%" (-> this wait-air-time)) + (format #t "~1Twait-ground-time: ~D~%" (-> this wait-ground-time)) + (format #t "~1Tactor: ~A~%" (-> this actor)) + (format #t "~1Tload-point: ~A~%" (-> this load-point)) + (format #t "~1Tend-point: ~A~%" (-> this end-point)) + (format #t "~1Tborrow: ~A~%" (-> this borrow)) + (format #t "~1Tsfx-volume: ~f~%" (-> this sfx-volume)) + (format #t "~1Tambient-volume: ~f~%" (-> this ambient-volume)) + (format #t "~1Tmusic-volume: ~f~%" (-> this music-volume)) + (format #t "~1Tmusic-delay: ~f~%" (-> this music-delay)) + (format #t "~1Tscene-task: ~D~%" (-> this scene-task)) + (format #t "~1Ton-running: ~A~%" (-> this on-running)) + (format #t "~1Ton-complete: ~A~%" (-> this on-complete)) + (label cfg-4) + this + ) + +;; definition of type scene-player +(deftype scene-player (process-drawable) + ((scene-list (array scene)) + (scene scene) + (scene-index int32) + (anim spool-anim) + (next-anim spool-anim) + (camera handle) + (main-entity entity-actor) + (wait symbol) + (old-target-pos transformq :inline) + (pre-cut-frame basic) + (preload-continue string) + (preload-sound basic) + (dma-max uint32) + (gui-id sound-id) + (aborted? symbol) + (scene-start-time time-frame) + (targ-speed float) + (cur-speed float) + (speed-change-time time-frame) + (speed-press-time time-frame) + (speed-change-speed float) + (subtitle-change-time time-frame) + (user-sound sound-id 4) + (last-frame float) + (end-point basic) + (blackout-end basic) + (new-trans-hook basic) + (cur-trans-hook basic) + (user-data uint64) + ) + (:methods + (scene-player-method-20 () none) + (scene-player-method-21 () none) + (scene-player-method-22 () none) + (scene-player-method-23 () none) + (scene-player-method-24 () none) + (scene-player-method-25 () none) + ) + ) + +;; definition for method 3 of type scene-player +(defmethod inspect ((this scene-player)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tscene-list: ~A~%" (-> this scene-list)) + (format #t "~2Tscene: ~A~%" (-> this scene)) + (format #t "~2Tscene-index: ~D~%" (-> this scene-index)) + (format #t "~2Tanim: ~A~%" (-> this anim)) + (format #t "~2Tnext-anim: ~A~%" (-> this next-anim)) + (format #t "~2Tcamera: ~D~%" (-> this camera)) + (format #t "~2Tmain-entity: ~A~%" (-> this main-entity)) + (format #t "~2Twait: ~A~%" (-> this wait)) + (format #t "~2Told-target-pos: #~%" (-> this old-target-pos)) + (format #t "~2Tpre-cut-frame: ~A~%" (-> this pre-cut-frame)) + (format #t "~2Tpreload-continue: ~A~%" (-> this preload-continue)) + (format #t "~2Tpreload-sound: ~A~%" (-> this preload-sound)) + (format #t "~2Tdma-max: ~D~%" (-> this dma-max)) + (format #t "~2Tgui-id: ~D~%" (-> this gui-id)) + (format #t "~2Taborted?: ~A~%" (-> this aborted?)) + (format #t "~2Tscene-start-time: ~D~%" (-> this scene-start-time)) + (format #t "~2Ttarg-speed: ~f~%" (-> this targ-speed)) + (format #t "~2Tcur-speed: ~f~%" (-> this cur-speed)) + (format #t "~2Tspeed-change-time: ~D~%" (-> this speed-change-time)) + (format #t "~2Tspeed-press-time: ~D~%" (-> this speed-press-time)) + (format #t "~2Tspeed-change-speed: ~f~%" (-> this speed-change-speed)) + (format #t "~2Tsubtitle-change-time: ~D~%" (-> this subtitle-change-time)) + (format #t "~2Tuser-sound[4] @ #x~X~%" (-> this user-sound)) + (format #t "~2Tlast-frame: ~f~%" (-> this last-frame)) + (format #t "~2Tend-point: ~A~%" (-> this end-point)) + (format #t "~2Tblackout-end: ~A~%" (-> this blackout-end)) + (format #t "~2Tnew-trans-hook: ~A~%" (-> this new-trans-hook)) + (format #t "~2Tcur-trans-hook: ~A~%" (-> this cur-trans-hook)) + (format #t "~2Tuser-data: ~A~%" (-> this user-data)) + (label cfg-4) + this + ) + +;; definition for symbol *scene-player*, type (pointer scene-player) +(define *scene-player* (the-as (pointer scene-player) #f)) + +;; definition for symbol *debug-menu-scene-play*, type object +(define *debug-menu-scene-play* (the-as object #f)) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/engine/util/script-h_REF.gc b/test/decompiler/reference/jak3/engine/util/script-h_REF.gc new file mode 100644 index 0000000000..ae415f410e --- /dev/null +++ b/test/decompiler/reference/jak3/engine/util/script-h_REF.gc @@ -0,0 +1,101 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type script-form +(deftype script-form (structure) + ((name symbol) + (spec pair) + (func (function script-context object)) + ) + (:methods + (script-form-method-9 () none) + ) + ) + +;; definition for method 3 of type script-form +(defmethod inspect ((this script-form)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'script-form) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tspec: ~A~%" (-> this spec)) + (format #t "~1Tfunc: ~A~%" (-> this func)) + (label cfg-4) + this + ) + +;; definition of type script-context +(deftype script-context (structure) + ((load-state load-state) + (key object) + (process process) + (trans vector) + (side-effect? symbol) + (got-error? symbol) + (expr pair) + (param-count int32) + (param object 16) + (param-type object 16) + ) + (:methods + (new (symbol type object process vector) _type_) + (script-context-method-9 () none) + (script-context-method-10 () none) + (script-context-method-11 () none) + ) + ) + +;; definition for method 3 of type script-context +(defmethod inspect ((this script-context)) + (when (not this) + (set! this this) + (goto cfg-10) + ) + (format #t "[~8x] ~A~%" this 'script-context) + (format #t "~1Tload-state: ~A~%" (-> this load-state)) + (format #t "~1Tkey: ~A~%" (-> this key)) + (format #t "~1Tprocess: ~A~%" (-> this process)) + (format #t "~1Ttrans: #~%" (-> this trans)) + (format #t "~1Tside-effect?: ~A~%" (-> this side-effect?)) + (format #t "~1Tgot-error?: ~A~%" (-> this got-error?)) + (format #t "~1Texpr: ~A~%" (-> this expr)) + (format #t "~1Tparam-count: ~D~%" (-> this param-count)) + (format #t "~1Tparam[16] @ #x~X~%" (-> this param)) + (dotimes (s5-0 (-> this param-count)) + (format #t "~T [~D]~1Tparam: ~`object`P~%" s5-0 (-> this param s5-0)) + ) + (format #t "~1Tparam-type[16] @ #x~X~%" (-> this param-type)) + (dotimes (s5-1 (-> this param-count)) + (format #t "~T [~D]~1Tparam-type: ~`object`P~%" s5-1 (-> this param-type s5-1)) + ) + (label cfg-10) + this + ) + +;; definition for method 0 of type script-context +;; WARN: Return type mismatch structure vs script-context. +(defmethod new script-context ((allocation symbol) (type-to-make type) (arg0 object) (arg1 process) (arg2 vector)) + (let ((t9-0 (method-of-type structure new)) + (v1-1 type-to-make) + ) + (-> type-to-make size) + (let ((v0-0 (t9-0 allocation v1-1))) + (set! (-> (the-as script-context v0-0) key) arg0) + (set! (-> (the-as script-context v0-0) process) arg1) + (set! (-> (the-as script-context v0-0) load-state) *load-state*) + (set! (-> (the-as script-context v0-0) side-effect?) #t) + (set! (-> (the-as script-context v0-0) got-error?) #f) + (set! (-> (the-as script-context v0-0) trans) arg2) + (the-as script-context v0-0) + ) + ) + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/offline/config/jak3/config.jsonc b/test/offline/config/jak3/config.jsonc index 63222abf2b..74eaaf2564 100644 --- a/test/offline/config/jak3/config.jsonc +++ b/test/offline/config/jak3/config.jsonc @@ -56,7 +56,9 @@ "(method 3 sky-vertex)", // texture "(method 9 texture-page-dir)", "set-dirty-mask!", - "(method 3 generic-tie-interp-point)" + "(method 3 generic-tie-interp-point)", + // cache stuff + "invalidate-cache-line" ], "skip_compile_states": {}