From af2fa6acbcb47cc30ff35f5c422d7a4e05565ca5 Mon Sep 17 00:00:00 2001 From: water111 <48171810+water111@users.noreply.github.com> Date: Sat, 3 Feb 2024 12:15:51 -0500 Subject: [PATCH] [jak3] More headers again again (#3359) collide-cache-h, collide-h, projectile-h, background-h, subdivide-h, hfrag-h, shrubbery-h, tfrag-h, tie-h --- decompiler/config/jak3/all-types.gc | 1213 ++++++++--------- .../config/jak3/ntsc_v1/type_casts.jsonc | 15 +- .../jak3/engine/camera/cam-interface-h.gc | 2 + .../jak3/engine/collide/collide-cache-h.gc | 138 ++ goal_src/jak3/engine/collide/collide-h.gc | 45 + goal_src/jak3/engine/draw/drawable-h.gc | 2 +- .../engine/gfx/background/background-h.gc | 22 + .../engine/gfx/background/hfrag/hfrag-h.gc | 431 ++++++ .../jak3/engine/gfx/background/subdivide-h.gc | 147 ++ .../engine/gfx/background/tfrag/tfrag-h.gc | 207 +++ .../jak3/engine/gfx/background/tie/tie-h.gc | 305 +++++ goal_src/jak3/engine/gfx/shrub/shrubbery-h.gc | 235 ++++ .../sprite/particles/sparticle-launcher-h.gc | 214 +++ .../engine/collide/collide-cache-h_REF.gc | 252 ++++ .../jak3/engine/collide/collide-h_REF.gc | 104 ++ .../cloth-art-h_REF.gc | 0 .../{common_objs => common-obs}/prim-h_REF.gc | 0 .../projectile-h_REF.gc | 0 .../jak3/engine/draw/drawable-h_REF.gc | 6 +- .../engine/gfx/background/background-h_REF.gc | 62 + .../engine/gfx/background/subdivide-h_REF.gc | 327 +++++ .../jak3/engine/gfx/hfrag/hfrag-h_REF.gc | 1071 +++++++++++++++ .../jak3/engine/gfx/shrub/shrubbery-h_REF.gc | 482 +++++++ .../particles/sparticle-launcher-h_REF.gc | 372 +++++ .../jak3/engine/gfx/tfrag/tfrag-h_REF.gc | 457 +++++++ .../jak3/engine/gfx/tie/tie-h_REF.gc | 669 +++++++++ test/offline/config/jak3/config.jsonc | 11 +- 27 files changed, 6159 insertions(+), 630 deletions(-) create mode 100644 test/decompiler/reference/jak3/engine/collide/collide-cache-h_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/collide/collide-h_REF.gc rename test/decompiler/reference/jak3/engine/{common_objs => common-obs}/cloth-art-h_REF.gc (100%) rename test/decompiler/reference/jak3/engine/{common_objs => common-obs}/prim-h_REF.gc (100%) rename test/decompiler/reference/jak3/engine/{common_objs => common-obs}/projectile-h_REF.gc (100%) create mode 100644 test/decompiler/reference/jak3/engine/gfx/background/background-h_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/gfx/background/subdivide-h_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/gfx/hfrag/hfrag-h_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/gfx/shrub/shrubbery-h_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/gfx/sprite/particles/sparticle-launcher-h_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/gfx/tfrag/tfrag-h_REF.gc create mode 100644 test/decompiler/reference/jak3/engine/gfx/tie/tie-h_REF.gc diff --git a/decompiler/config/jak3/all-types.gc b/decompiler/config/jak3/all-types.gc index 61f375d852..8e9ec6183a 100644 --- a/decompiler/config/jak3/all-types.gc +++ b/decompiler/config/jak3/all-types.gc @@ -11861,7 +11861,7 @@ :size-assert #x20 :flag-assert #x1100000020 (:methods - (drawable-method-9 () none) ;; 9 ;; (login (_type_) _type_) + (login "Initialize the object after it is loaded." (_type_) _type_);; 9 (draw (_type_ _type_ display-frame) none) ;; 10 (drawable-method-11 () none) ;; 11 ;; (fill-collide-list-from-box (_type_ int collide-list collide-query) int) (drawable-method-12 () none) ;; 12 ;; (fill-collide-list-from-line-sphere (_type_ int collide-list collide-query) int) @@ -21918,8 +21918,13 @@ ;; collide-cache-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +(declare-type collide-cache-prim structure) +(declare-type collide-using-spheres-params structure) +(declare-type instance-tie structure) + (deftype collide-puss-sphere (structure) + "A query sphere from the user for the porbe-using-spheres query. + This is used internally by the collide-cache implementation." ((bsphere sphere :inline :offset-assert 0) (bbox4w bounding-box4w :inline :offset-assert 16) ) @@ -21927,55 +21932,63 @@ :size-assert #x30 :flag-assert #x900000030 ) -|# -#| (deftype collide-puss-work (structure) + "Scratchpad memory map for probe-using-spheres query." ((closest-pt vector :inline :offset-assert 0) (tri-normal vector :inline :offset-assert 16) (tri-bbox4w bounding-box4w :inline :offset-assert 32) (spheres-bbox4w bounding-box4w :inline :offset-assert 64) - (spheres collide-puss-sphere 64 :offset-assert 96) ;; guessed by decompiler + (spheres collide-puss-sphere 64 :inline :offset-assert 96) ;; guessed by decompiler ) :method-count-assert 11 :size-assert #xc60 :flag-assert #xb00000c60 (:methods - (collide-puss-work-method-9 () none) ;; 9 ;; (collide-puss-work-method-9 () none) - (collide-puss-work-method-10 () none) ;; 10 ;; (collide-puss-work-method-10 () none) + (check-mesh-prim-against-spheres "Check a single mesh prim against the spheres in this type." (_type_ collide-cache-prim collide-using-spheres-params) symbol) ;; 9 + (check-sphere-prim-against-spheres "Check a single sphere prim against the spheres in this type." (_type_ collide-cache-prim collide-using-spheres-params) symbol) ;; 10 ) ) -|# -#| (deftype collide-cache-tri (structure) - ((vertex vector 3 :offset-assert 0) ;; guessed by decompiler + "A single triangle inside the collision cache. + Contains a reference back to the source object (like a collide-shape or water-control), and the prim itself." + ((vertex vector 3 :inline :offset-assert 0) ;; guessed by decompiler (extra-quad uint8 16 :offset-assert 48) ;; guessed by decompiler - (pat pat-surface :offset-assert 48) ;; guessed by decompiler - (collide-ptr basic :offset-assert 52) - (prim-index uint16 :offset-assert 56) - (user16 uint16 :offset-assert 58) - (user32 uint32 :offset-assert 60) + (pat pat-surface :offset 48) ;; guessed by decompiler + (collide-ptr basic :offset 52) + (prim-index uint16 :offset 56) + (user16 uint16 :offset 58) + (user32 uint32 :offset 60) ) :method-count-assert 9 :size-assert #x40 :flag-assert #x900000040 ) -|# -#| +(defenum prim-type + :type int8 + (prim -2) + (sphere -1) + (group 0) + (mesh 1) + (fake-prim 2) + ) + (deftype collide-cache-prim (structure) + "A primitive inside the collide-cache. + This can represent a sphere, a triangle mesh, or a group of other primitives within a bounding sphere." ((prim-core collide-prim-core :inline :offset-assert 0) (extra-quad uint8 16 :offset-assert 32) ;; guessed by decompiler - (ccache collide-cache :offset-assert 32) ;; guessed by decompiler - (prim collide-shape-prim :offset-assert 36) ;; guessed by decompiler - (first-tri uint16 :offset-assert 40) - (num-tris uint16 :offset-assert 42) - (unused uint8 4 :offset-assert 44) ;; guessed by decompiler - (world-sphere vector :inline :offset-assert 0) - (collide-as collide-spec :offset-assert 16) ;; guessed by decompiler - (action collide-action :offset-assert 24) ;; guessed by decompiler - (prim-type int8 :offset-assert 28) ;; prim-type + (ccache collide-cache :offset 32) ;; guessed by decompiler + (prim collide-shape-prim :offset 36) ;; guessed by decompiler + (first-tri uint16 :offset 40) + (num-tris uint16 :offset 42) + (unused uint8 4 :offset 44) ;; guessed by decompiler + (world-sphere vector :inline :offset 0) + (collide-as collide-spec :offset 16) ;; guessed by decompiler + (action collide-action :offset 24) ;; guessed by decompiler + (prim-type prim-type :offset 28) ;; prim-type ) :method-count-assert 11 :size-assert #x30 @@ -21985,10 +21998,14 @@ (collide-cache-prim-method-10 () none) ;; 10 ;; (resolve-moving-sphere-sphere (_type_ collide-tri-result collide-prim-core vector float collide-action) float) ) ) -|# -#| (deftype collide-cache (basic) + "The collide-cache is a structure to accelerate collision queries. + In particular, it helps with queries where you don't know what you might hit. + It can detect collision with the background geometry, foreground dynamic collision shapes (spheres and meshes), and water. + To use it, it must first be 'filled' with geometry. Then you can manually inspect the geometry, or use one of the queries. + The supported queries are 'line-sphere' (raycast) and 'spheres' (check if intersecting anything). + It is not useful for ollision queries against a specific foreground object, like 'am I on top of platform X right now?'." ((num-tris int32 :offset-assert 4) (num-prims int32 :offset-assert 8) (ignore-mask pat-surface :offset-assert 12) ;; guessed by decompiler @@ -21997,8 +22014,8 @@ (collide-box4w bounding-box4w :inline :offset-assert 64) (collide-with collide-spec :offset-assert 96) ;; guessed by decompiler (unused uint32 :offset-assert 100) - (prims collide-cache-prim 100 :offset-assert 112) ;; guessed by decompiler - (tris collide-cache-tri 461 :offset-assert 4912) ;; guessed by decompiler + (prims collide-cache-prim 100 :inline :offset-assert 112) ;; guessed by decompiler + (tris collide-cache-tri 461 :inline :offset-assert 4912) ;; guessed by decompiler ) :method-count-assert 26 :size-assert #x8670 @@ -22023,47 +22040,47 @@ (collide-cache-method-25 () none) ;; 25 ;; (collide-cache-method-25 () none) ) ) -|# -#| (deftype collide-list-item (structure) + "Entry on the broad-phase collision list. + Can represent instanced collision, as a TIE instance, or a single non-instanced mesh fragment." ((mesh instance-tie :offset-assert 0) ;; guessed by decompiler (inst basic :offset-assert 4) ) + :pack-me :method-count-assert 9 :size-assert #x8 :flag-assert #x900000008 ) -|# -#| (deftype collide-list (structure) + "List of items returned by the broad-phase collision query." ((num-items int32 :offset-assert 0) - (items collide-list-item 256 :offset-assert 16) ;; guessed by decompiler + (items collide-list-item 256 :inline :offset 16) ;; guessed by decompiler ) :method-count-assert 9 :size-assert #x810 :flag-assert #x900000810 ) -|# -;; (define-extern *collide-cache* object) ;; collide-cache -;; (define-extern *collide-list* object) ;; collide-list +(define-extern *collide-cache* collide-cache) +(define-extern *collide-list* collide-list) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; collide-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype collide-query (structure) + "Very general collision-query structure. The meaning is different depending on where it used. + This has both inputs from the user, and collision results." ((best-other-tri collide-tri-result :inline :offset-assert 0) - (best-my-tri collide-tri-result :inline :offset-assert 0) + (best-my-tri collide-tri-result :inline :offset 0) (ignore-processes process-tree 2 :offset-assert 88) ;; guessed by decompiler - (ignore-process0 process-tree :offset-assert 88) ;; guessed by decompiler - (ignore-process1 process-tree :offset-assert 92) ;; guessed by decompiler + (ignore-process0 process-tree :offset 88) ;; guessed by decompiler + (ignore-process1 process-tree :offset 92) ;; guessed by decompiler (ignore-pat pat-surface :offset-assert 96) ;; guessed by decompiler (collide-with collide-spec :offset-assert 100) ;; guessed by decompiler - (overlay-params uint32 3 :offset-assert 112) ;; guessed by decompiler + (overlay-params uint32 3 :offset 112) ;; guessed by decompiler (bbox bounding-box :inline :offset-assert 128) (bbox4w bounding-box4w :inline :offset-assert 160) (bsphere sphere :inline :offset-assert 192) @@ -22071,17 +22088,17 @@ (move-dist vector :inline :offset-assert 224) (rlength vector :inline :offset-assert 240) (exit-planes plane 2 :offset-assert 256) ;; guessed by decompiler - (radius float :offset-assert 268) - (inv-mat matrix :inline :offset-assert 288) - (spheres (inline-array sphere) :offset-assert 112) ;; guessed by decompiler - (num-spheres uint32 :offset-assert 116) - (solid-only symbol :offset-assert 120) ;; guessed by decompiler - (best-dist float :offset-assert 112) - (best-other-prim collide-shape-prim :offset-assert 116) ;; guessed by decompiler - (best-my-prim collide-shape-prim :offset-assert 120) ;; guessed by decompiler - (move-vec vector :inline :offset-assert 224) - (best-u float :offset-assert 112) - (action-mask collide-action :offset-assert 352) ;; guessed by decompiler + (radius float :offset 268) + (inv-mat matrix :inline :offset 288) + (spheres (inline-array sphere) :offset 112) ;; guessed by decompiler + (num-spheres uint32 :offset 116) + (solid-only symbol :offset 120) ;; guessed by decompiler + (best-dist float :offset 112) + (best-other-prim collide-shape-prim :offset 116) ;; guessed by decompiler + (best-my-prim collide-shape-prim :offset 120) ;; guessed by decompiler + (move-vec vector :inline :offset 224) + (best-u float :offset 112) + (action-mask collide-action :offset 352) ;; guessed by decompiler (local-box4w bounding-box4w :inline :offset-assert 368) (search-box bounding-box4w :inline :offset-assert 400) (search-vector vector4w :inline :offset-assert 432) @@ -22098,122 +22115,128 @@ :size-assert #x21c :flag-assert #x90000021c ) -|# -;; (define-extern *collide-test-flag* object) ;; symbol +(define-extern *collide-test-flag* symbol) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; shrubbery-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype billboard (drawable) + "A billboard for shrubbery in the distance. This is simple a quad that faces the camera. + The only data needed is the texture/mode. The location is determined by bsphere." ((flat adgif-shader :inline :offset-assert 32) ) :method-count-assert 17 :size-assert #x70 :flag-assert #x1100000070 ) -|# -#| (deftype shrub-view-data (structure) + "Camera and general settings for shrubbery VU1 program." ((data uint128 3 :offset-assert 0) ;; guessed by decompiler - (texture-giftag qword :inline :offset-assert 0) ;; gs-gif-tag :inline - (consts vector :inline :offset-assert 16) - (fog-clamp vector :inline :offset-assert 32) - (tex-start-ptr int32 :offset-assert 16) - (gifbufsum float :offset-assert 16) - (mtx-buf-ptr int32 :offset-assert 20) - (exp23 float :offset-assert 20) - (fog-0 float :offset-assert 24) - (fog-1 float :offset-assert 28) - (fog-min float :offset-assert 32) - (fog-max float :offset-assert 36) + (texture-giftag gs-gif-tag :inline :offset 0) ;; :inline + (consts vector :inline :offset 16) + (fog-clamp vector :inline :offset 32) + (tex-start-ptr int32 :offset 16) + (gifbufsum float :offset 16) + (mtx-buf-ptr int32 :offset 20) + (exp23 float :offset 20) + (fog-0 float :offset 24) + (fog-1 float :offset 28) + (fog-min float :offset 32) + (fog-max float :offset 36) ) :method-count-assert 9 :size-assert #x30 :flag-assert #x900000030 ) -|# -#| (deftype shrubbery (drawable) - ((textures (inline-array adgif-shader) :offset-assert 4) ;; guessed by decompiler - (header qword :offset-assert 8) - (obj-qwc uint8 :offset-assert 12) - (vtx-qwc uint8 :offset-assert 13) - (col-qwc uint8 :offset-assert 14) - (stq-qwc uint8 :offset-assert 15) - (obj uint32 :offset-assert 16) - (vtx uint32 :offset-assert 20) - (col uint32 :offset-assert 24) - (stq uint32 :offset-assert 28) + "Prototype (mesh/geometry) for a shrub. not _really_ a drawable in any way, as it + overwrites all the normal drawable fields." + ((textures (inline-array adgif-shader) :offset 4) ;; guessed by decompiler + (header qword :offset 8) + (obj-qwc uint8 :offset 12) + (vtx-qwc uint8 :offset 13) + (col-qwc uint8 :offset 14) + (stq-qwc uint8 :offset 15) + (obj uint32 :offset 16) + (vtx uint32 :offset 20) + (col uint32 :offset 24) + (stq uint32 :offset 28) ) :method-count-assert 17 :size-assert #x20 :flag-assert #x1100000020 ) -|# -#| (deftype instance-shrubbery (instance) + "Instance of a shrub." ((flat-normal vector :inline :offset-assert 64) - (flat-hwidth float :offset-assert 76) - (color uint32 :offset-assert 8) + (flat-hwidth float :offset 76) + (color uint32 :offset 8) ) :method-count-assert 17 :size-assert #x50 :flag-assert #x1100000050 ) -|# -;; (deftype drawable-inline-array-instance-shrub (drawable-inline-array) -;; () -;; :flag-assert #x1100000074 -;; ) +(deftype drawable-inline-array-instance-shrub (drawable-inline-array) + "Array of shrub instances stored in the level data." + ((data instance-shrubbery 1 :inline :offset-assert 32) + (pad uint32) + ) + :flag-assert #x1100000074 + ) -;; (deftype drawable-tree-instance-shrub (drawable-tree) -;; () -;; :flag-assert #x1100000020 -;; ) +(deftype drawable-tree-instance-shrub (drawable-tree) + "Drawable-tree for the shrubs." + () + :flag-assert #x1100000020 + ) -#| (deftype generic-shrub-fragment (drawable) - ((textures (inline-array adgif-shader) :offset-assert 4) ;; guessed by decompiler - (vtx-cnt uint32 :offset-assert 8) - (cnt-qwc uint8 :offset-assert 12) - (vtx-qwc uint8 :offset-assert 13) - (col-qwc uint8 :offset-assert 14) - (stq-qwc uint8 :offset-assert 15) - (cnt uint32 :offset-assert 16) - (vtx uint32 :offset-assert 20) - (col uint32 :offset-assert 24) - (stq uint32 :offset-assert 28) + "Shrub data, converted into the format for generic. + The shrub renderer doesn't support clipping, so it falls back to generic. + This requires storing the data for all shrubs prototype twice!" + ((textures (inline-array adgif-shader) :offset 4) ;; guessed by decompiler + (vtx-cnt uint32 :offset 8) + (cnt-qwc uint8 :offset 12) + (vtx-qwc uint8 :offset 13) + (col-qwc uint8 :offset 14) + (stq-qwc uint8 :offset 15) + (cnt uint32 :offset 16) + (vtx uint32 :offset 20) + (col uint32 :offset 24) + (stq uint32 :offset 28) ) :method-count-assert 17 :size-assert #x20 :flag-assert #x1100000020 ) -|# -;; (deftype prototype-shrubbery (drawable-inline-array) -;; () -;; :flag-assert #x1100000044 -;; ) +(deftype prototype-shrubbery (drawable-inline-array) + "Array of shrub prototypes." + ((data shrubbery 1 :inline :offset-assert 32) + (pad uint32) + ) + :flag-assert #x1100000044 + ) -;; (deftype prototype-trans-shrubbery (prototype-shrubbery) -;; () -;; :flag-assert #x1100000044 -;; ) +(deftype prototype-trans-shrubbery (prototype-shrubbery) + "Array of transparent shrub prototypes." + () + :flag-assert #x1100000044 + ) -;; (deftype prototype-generic-shrub (drawable-group) -;; () -;; :flag-assert #x1100000020 -;; ) +(deftype prototype-generic-shrub (drawable-group) + () + :flag-assert #x1100000020 + ) -#| (deftype shrubbery-matrix (structure) + "Instance matrix for a shrub, contains interpolated color." ((mat matrix :inline :offset-assert 0) (color qword :inline :offset-assert 64) ) @@ -22221,10 +22244,9 @@ :size-assert #x50 :flag-assert #x900000050 ) -|# -#| (deftype shrub-near-packet (structure) + "DMA templates for generic rendering of shrubs." ((matrix-tmpl dma-packet :inline :offset-assert 0) (header-tmpl dma-packet :inline :offset-assert 16) (stq-tmpl dma-packet :inline :offset-assert 32) @@ -22238,22 +22260,21 @@ :size-assert #x90 :flag-assert #x900000090 ) -|# -#| (deftype instance-shrub-work (structure) - ((dummy qword 3 :offset-assert 0) ;; guessed by decompiler - (chaina qword 8 :offset-assert 48) ;; guessed by decompiler - (chainb qword 8 :offset-assert 176) ;; guessed by decompiler + "Scratchpad layout for generating shrub DMA." + ((dummy qword 3 :inline :offset-assert 0) ;; guessed by decompiler + (chaina qword 8 :inline :offset-assert 48) ;; guessed by decompiler + (chainb qword 8 :inline :offset-assert 176) ;; guessed by decompiler (colors rgba 1024 :offset-assert 304) ;; guessed by decompiler - (matrix-tmpl qword 20 :offset-assert 4400) ;; guessed by decompiler - (count-tmpl vector4w 20 :offset-assert 4720) ;; guessed by decompiler + (matrix-tmpl qword 20 :inline :offset-assert 4400) ;; guessed by decompiler + (count-tmpl vector4w 20 :inline :offset-assert 4720) ;; guessed by decompiler (mscalf-tmpl dma-packet :inline :offset-assert 5040) (mscalf-ret-tmpl dma-packet :inline :offset-assert 5056) (adgif-tmpl dma-gif-packet :inline :offset-assert 5072) (billboard-tmpl dma-gif-packet :inline :offset-assert 5104) (billboard-const vector :inline :offset-assert 5136) - (shrub-near-packets shrub-near-packet 6 :offset-assert 5152) ;; guessed by decompiler + (shrub-near-packets shrub-near-packet 6 :inline :offset-assert 5152) ;; guessed by decompiler (dma-ref dma-packet :inline :offset-assert 6016) (dma-end dma-packet :inline :offset-assert 6032) (wind-const vector :inline :offset-assert 6048) @@ -22266,8 +22287,8 @@ (bb-color vector :inline :offset-assert 6160) (min-dist vector :inline :offset-assert 6176) (temp-vec vector :inline :offset-assert 6192) - (guard-plane plane 4 :offset-assert 6208) ;; guessed by decompiler - (plane plane 4 :offset-assert 6272) ;; guessed by decompiler + (guard-plane plane 4 :inline :offset-assert 6208) ;; guessed by decompiler + (plane plane 4 :inline :offset-assert 6272) ;; guessed by decompiler (last uint32 4 :offset-assert 6336) ;; guessed by decompiler (next uint32 4 :offset-assert 6352) ;; guessed by decompiler (count uint16 4 :offset-assert 6368) ;; guessed by decompiler @@ -22282,19 +22303,19 @@ (to-spr uint32 :offset-assert 6412) (from-spr uint32 :offset-assert 6416) (shrub-count uint32 :offset-assert 6420) - (stack-ptr uint32 :offset-assert 6400) - (node uint32 6 :offset-assert 6428) ;; guessed by decompiler + (stack-ptr2 uint32 :offset 6400) + (node uint32 6 :offset 6428) ;; guessed by decompiler (length uint32 6 :offset-assert 6452) ;; guessed by decompiler (prototypes uint32 :offset-assert 6476) - (bucket-ptr uint32 :offset-assert 6404) - (start-bank uint8 20 :offset-assert 6484) ;; guessed by decompiler + (bucket-ptr2 uint32 :offset 6404) + (start-bank uint8 20 :offset 6484) ;; guessed by decompiler (buffer-index uint32 :offset-assert 6504) (current-spr uint32 :offset-assert 6508) (current-mem uint32 :offset-assert 6512) (current-shrub-near-packet uint32 :offset-assert 6516) (current-shrub-near-trans-packet uint32 :offset-assert 6520) - (to-spr uint32 :offset-assert 6412) - (dma-buffer basic :offset-assert 6528) + (to-spr2 uint32 :offset 6412) + (dma-buffer basic :offset 6528) (near-last uint32 :offset-assert 6532) (near-next uint32 :offset-assert 6536) (near-count uint32 :offset-assert 6540) @@ -22314,9 +22335,7 @@ :size-assert #x19bc :flag-assert #x9000019bc ) -|# -#| (deftype instance-shrub-dma (structure) ((instancea uint128 325 :offset-assert 0) ;; guessed by decompiler (instanceb uint128 325 :offset-assert 5200) ;; guessed by decompiler @@ -22327,17 +22346,16 @@ :size-assert #x38a0 :flag-assert #x9000038a0 ) -|# -;; (define-extern shrubbery-login-post-texture function) ;; (function shrubbery none) -;; (define-extern *shrub-state* object) ;; int +(define-extern shrubbery-login-post-texture "Do some weird fix-up to the shrubbery textures. this is likely to present normal-looking adgifs to the texture system, but then we scramble them up for easier consumption by VU1." (function shrubbery none)) +(define-extern *shrub-state* int) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; tie-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype tie-fragment-debug (structure) + "Optional debug information about a tie-fragment." ((num-tris uint16 :offset-assert 0) (num-dverts uint16 :offset-assert 2) (debug-lines (array vector-array) :offset-assert 4) ;; guessed by decompiler @@ -22346,17 +22364,16 @@ :size-assert #x8 :flag-assert #x900000008 ) -|# -#| (deftype tie-fragment (drawable) - ((gif-ref (inline-array adgif-shader) :offset-assert 4) ;; guessed by decompiler - (point-ref uint32 :offset-assert 8) - (color-index uint16 :offset-assert 12) - (base-colors uint8 :offset-assert 14) - (tex-count uint16 :offset-assert 32) - (gif-count uint16 :offset-assert 34) - (vertex-count uint16 :offset-assert 36) + "A mesh fragment of a TIE. This is a chunk of mesh that is rendered by VU1, stored as DMA chains." + ((gif-ref (inline-array adgif-shader) :offset 4) ;; guessed by decompiler + (point-ref uint32 :offset 8) + (color-index uint16 :offset 12) + (base-colors uint8 :offset 14) + (tex-count uint16 :offset 32) + (gif-count uint16 :offset 34) + (vertex-count uint16 :offset 36) (color-count uint16 :offset-assert 38) (dp-ref uint32 :offset-assert 40) (dp-qwc uint32 :offset-assert 44) @@ -22370,65 +22387,62 @@ :size-assert #x40 :flag-assert #x1100000040 ) -|# -#| (deftype instance-tie (instance) - ((color-indices uint32 :offset-assert 8) - (bucket-ptr prototype-bucket-tie :offset-assert 12) ;; guessed by decompiler - (max-scale uint16 :offset-assert 38) - (rmin-scale uint16 :offset-assert 54) + "A TIE model instance." + ((color-indices uint32 :offset 8) + (bucket-ptr prototype-bucket-tie :offset 12) ;; guessed by decompiler + (max-scale uint16 :offset 38) + (rmin-scale uint16 :offset 54) ) :method-count-assert 17 :size-assert #x40 :flag-assert #x1100000040 ) -|# -;; (deftype drawable-inline-array-instance-tie (drawable-inline-array) -;; () -;; :flag-assert #x1100000064 -;; ) +(deftype drawable-inline-array-instance-tie (drawable-inline-array) + "Array of tie instances stored in the level." + ((data instance-tie 1 :inline :offset-assert 32) ;; not sure on type here + (pad uint32) + ) + :flag-assert #x1100000064 + ) -#| (deftype drawable-tree-instance-tie (drawable-tree) - ((id int16 :offset-assert 0) - (bsphere vector :inline :offset-assert 12) - (length int16 :offset-assert 2) - (data drawable :dynamic :offset-assert 28) ;; guessed by decompiler - (UNKNOWN UNKNOWN :offset-assert -1) ;; field could not be read. - (prototypes proxy-prototype-array-tie :offset-assert 4) ;; guessed by decompiler + "Top-level drawable-tree for TIEs" + ((prototypes proxy-prototype-array-tie :offset 8) ;; guessed by decompiler ) :method-count-assert 17 :size-assert #x20 :flag-assert #x1100000020 ) -|# -;; (deftype prototype-tie (drawable-inline-array) -;; () -;; :flag-assert #x1100000064 -;; ) +(deftype prototype-tie (drawable-inline-array) + "Prototype for a TIE: just an array of fragments." + ((data tie-fragment 1 :inline :offset-assert 32) + (pad uint32) + ) + :flag-assert #x1100000064 + ) -#| (deftype tie-matrix (structure) + "Per-instance matrix for TIE VU1 rendering." ((mat matrix :inline :offset-assert 0) (morph qword :inline :offset-assert 64) (fog qword :inline :offset-assert 80) - (envmap-flag uint32 :offset-assert 80) - (guard-flag uint32 :offset-assert 84) - (vertex-alpha float :offset-assert 88) - (fog-value float :offset-assert 92) - (fixed-alpha float :offset-assert 68) + (envmap-flag uint32 :offset 80) + (guard-flag uint32 :offset 84) + (vertex-alpha float :offset 88) + (fog-value float :offset 92) + (fixed-alpha float :offset 68) ) :method-count-assert 9 :size-assert #x60 :flag-assert #x900000060 ) -|# -#| (deftype instance-tie-work (structure) + "workspace for TIE instance DMA generation" ((wind-const vector :inline :offset-assert 0) (hmge-d vector :inline :offset-assert 16) (hvdf-offset vector :inline :offset-assert 32) @@ -22437,7 +22451,7 @@ (far-morph vector :inline :offset-assert 80) (dist-test vector :inline :offset-assert 96) (min-dist vector :inline :offset-assert 112) - (guard-plane plane 4 :offset-assert 128) ;; guessed by decompiler + (guard-plane plane 4 :inline :offset-assert 128) ;; guessed by decompiler (upload-color-0 dma-packet :inline :offset-assert 192) (upload-color-1 dma-packet :inline :offset-assert 208) (upload-color-2 dma-packet :inline :offset-assert 224) @@ -22480,24 +22494,23 @@ :size-assert #x22c :flag-assert #x90000022c ) -|# -#| (deftype instance-tie-dma (structure) - ((banka instance-tie 32 :offset-assert 4) ;; guessed by decompiler - (bankb instance-tie 32 :offset-assert 2052) ;; guessed by decompiler + "Scratchpad memory layout for TIE instance DMA generation." + ((banka instance-tie 32 :inline :offset-assert 0) ;; guessed by decompiler + (bankb instance-tie 32 :inline :offset-assert 2048) ;; guessed by decompiler (outa uint128 256 :offset-assert 4096) ;; guessed by decompiler (outb uint128 256 :offset-assert 8192) ;; guessed by decompiler - (work instance-tie-work :offset-assert 12288) + ;; this is outside the type???? + (work instance-tie-work :dynamic :offset-assert 12288) ) :method-count-assert 9 :size-assert #x3000 :flag-assert #x900003000 ) -|# -#| (deftype prototype-tie-work (structure) + "workspace for TIE protype DMA generation." ((upload-flushe dma-packet :inline :offset-assert 0) (upload-palette dma-packet :inline :offset-assert 16) (upload-model-0 dma-packet :inline :offset-assert 32) @@ -22527,65 +22540,63 @@ (wait-from-spr uint32 :offset-assert 396) (wait-to-spr uint32 :offset-assert 400) (mood mood-context :offset-assert 404) - (last uint32 16 :offset-assert 416) ;; guessed by decompiler + (last uint32 16 :offset 416) ;; guessed by decompiler (next uint32 16 :offset-assert 480) ;; guessed by decompiler (count uint16 16 :offset-assert 544) ;; guessed by decompiler - (tie-last uint32 :offset-assert 416) - (tie-next uint32 :offset-assert 480) - (tie-count uint16 :offset-assert 544) - (trans-last uint32 :offset-assert 420) - (trans-next uint32 :offset-assert 484) - (trans-count uint16 :offset-assert 546) - (water-last uint32 :offset-assert 424) - (water-next uint32 :offset-assert 488) - (water-count uint16 :offset-assert 548) - (scissor-last uint32 :offset-assert 428) - (scissor-next uint32 :offset-assert 492) - (scissor-count uint16 :offset-assert 550) - (scissor-trans-last uint32 :offset-assert 432) - (scissor-trans-next uint32 :offset-assert 496) - (scissor-trans-count uint16 :offset-assert 552) - (scissor-water-last uint32 :offset-assert 436) - (scissor-water-next uint32 :offset-assert 500) - (scissor-water-count uint16 :offset-assert 554) - (envmap-last uint32 :offset-assert 440) - (envmap-next uint32 :offset-assert 504) - (envmap-count uint16 :offset-assert 556) - (envmap-trans-last uint32 :offset-assert 444) - (envmap-trans-next uint32 :offset-assert 508) - (envmap-trans-count uint16 :offset-assert 558) - (envmap-water-last uint32 :offset-assert 448) - (envmap-water-next uint32 :offset-assert 512) - (envmap-water-count uint16 :offset-assert 560) - (envmap-scissor-last uint32 :offset-assert 452) - (envmap-scissor-next uint32 :offset-assert 516) - (envmap-scissor-count uint16 :offset-assert 562) - (envmap-scissor-trans-last uint32 :offset-assert 456) - (envmap-scissor-trans-next uint32 :offset-assert 520) - (envmap-scissor-trans-count uint16 :offset-assert 564) - (envmap-scissor-water-last uint32 :offset-assert 460) - (envmap-scissor-water-next uint32 :offset-assert 524) - (envmap-scissor-water-count uint16 :offset-assert 566) - (generic-last uint32 :offset-assert 464) - (generic-next uint32 :offset-assert 528) - (generic-count uint16 :offset-assert 568) - (generic-trans-last uint32 :offset-assert 468) - (generic-trans-next uint32 :offset-assert 532) - (generic-trans-count uint16 :offset-assert 570) - (generic-water-last uint32 :offset-assert 472) - (generic-water-next uint32 :offset-assert 536) - (generic-water-count uint16 :offset-assert 572) - (vanish-last uint32 :offset-assert 476) - (vanish-next uint32 :offset-assert 540) - (vanish-count uint16 :offset-assert 574) + (tie-last uint32 :offset 416) + (tie-next uint32 :offset 480) + (tie-count uint16 :offset 544) + (trans-last uint32 :offset 420) + (trans-next uint32 :offset 484) + (trans-count uint16 :offset 546) + (water-last uint32 :offset 424) + (water-next uint32 :offset 488) + (water-count uint16 :offset 548) + (scissor-last uint32 :offset 428) + (scissor-next uint32 :offset 492) + (scissor-count uint16 :offset 550) + (scissor-trans-last uint32 :offset 432) + (scissor-trans-next uint32 :offset 496) + (scissor-trans-count uint16 :offset 552) + (scissor-water-last uint32 :offset 436) + (scissor-water-next uint32 :offset 500) + (scissor-water-count uint16 :offset 554) + (envmap-last uint32 :offset 440) + (envmap-next uint32 :offset 504) + (envmap-count uint16 :offset 556) + (envmap-trans-last uint32 :offset 444) + (envmap-trans-next uint32 :offset 508) + (envmap-trans-count uint16 :offset 558) + (envmap-water-last uint32 :offset 448) + (envmap-water-next uint32 :offset 512) + (envmap-water-count uint16 :offset 560) + (envmap-scissor-last uint32 :offset 452) + (envmap-scissor-next uint32 :offset 516) + (envmap-scissor-count uint16 :offset 562) + (envmap-scissor-trans-last uint32 :offset 456) + (envmap-scissor-trans-next uint32 :offset 520) + (envmap-scissor-trans-count uint16 :offset 564) + (envmap-scissor-water-last uint32 :offset 460) + (envmap-scissor-water-next uint32 :offset 524) + (envmap-scissor-water-count uint16 :offset 566) + (generic-last uint32 :offset 464) + (generic-next uint32 :offset 528) + (generic-count uint16 :offset 568) + (generic-trans-last uint32 :offset 468) + (generic-trans-next uint32 :offset 532) + (generic-trans-count uint16 :offset 570) + (generic-water-last uint32 :offset 472) + (generic-water-next uint32 :offset 536) + (generic-water-count uint16 :offset 572) + (vanish-last uint32 :offset 476) + (vanish-next uint32 :offset 540) + (vanish-count uint16 :offset 574) ) :method-count-assert 9 :size-assert #x240 :flag-assert #x900000240 ) -|# -#| (deftype prototype-tie-dma (structure) ((colora rgba 256 :offset-assert 0) ;; guessed by decompiler (colorb rgba 256 :offset-assert 1024) ;; guessed by decompiler @@ -22595,8 +22606,8 @@ (next uint32 12 :offset-assert 10256) ;; guessed by decompiler (count uint16 12 :offset-assert 10304) ;; guessed by decompiler (counts uint32 4 :offset-assert 10328) ;; guessed by decompiler - (palette-ptr uint32 :offset-assert 10336) - (model-ptr uint32 :offset-assert 10340) + (palette-ptr uint32 :offset 10336) + (model-ptr uint32 :offset 10340) (ret-ptr uint32 :offset-assert 10344) (length uint32 :offset-assert 10348) (flags uint32 :offset-assert 10352) @@ -22607,76 +22618,75 @@ (to-spr uint32 :offset-assert 10372) (spr-out uint32 :offset-assert 10376) (this-count uint32 :offset-assert 10380) - (scissor-geometry uint32 :offset-assert 10240) - (near-geometry uint32 :offset-assert 10244) - (mid-geometry uint32 :offset-assert 10248) - (far-geometry uint32 :offset-assert 10252) - (scissor-frag-count uint8 :offset-assert 10364) - (near-frag-count uint8 :offset-assert 10365) - (mid-frag-count uint8 :offset-assert 10366) - (far-frag-count uint8 :offset-assert 10367) - (tie-scissor-next uint32 :offset-assert 10256) - (tie-near-next uint32 :offset-assert 10260) - (tie-mid-next uint32 :offset-assert 10264) - (tie-far-next uint32 :offset-assert 10268) - (trans-scissor-next uint32 4 :offset-assert 10256) ;; guessed by decompiler - (trans-near-next uint32 :offset-assert 10260) - (trans-mid-next uint32 :offset-assert 10264) - (trans-far-next uint32 :offset-assert 10268) - (water-scissor-next uint32 4 :offset-assert 10256) ;; guessed by decompiler - (water-near-next uint32 :offset-assert 10260) - (water-mid-next uint32 :offset-assert 10264) - (water-far-next uint32 :offset-assert 10268) - (envmap-scissor-next uint32 4 :offset-assert 10272) ;; guessed by decompiler - (envmap-near-next uint32 :offset-assert 10276) - (envmap-mid-next uint32 :offset-assert 10280) - (envmap-far-next uint32 :offset-assert 10284) - (generic-near-next uint32 :offset-assert 10288) - (generic-mid-next uint32 :offset-assert 10292) - (generic-far-next uint32 :offset-assert 10296) - (vanish-next uint32 :offset-assert 10300) - (tie-count uint16 :offset-assert 10304) - (tie-scissor-count uint16 :offset-assert 10304) - (tie-near-count uint16 :offset-assert 10306) - (tie-mid-count uint16 :offset-assert 10308) - (tie-far-count uint16 :offset-assert 10310) - (trans-count uint16 :offset-assert 10304) - (trans-scissor-count uint16 :offset-assert 10304) - (trans-near-count uint16 :offset-assert 10306) - (trans-mid-count uint16 :offset-assert 10308) - (trans-far-count uint16 :offset-assert 10310) - (water-count uint16 :offset-assert 10304) - (water-scissor-count uint16 :offset-assert 10304) - (water-near-count uint16 :offset-assert 10306) - (water-mid-count uint16 :offset-assert 10308) - (water-far-count uint16 :offset-assert 10310) - (envmap-count uint16 :offset-assert 10312) - (envmap-scissor-count uint16 :offset-assert 10312) - (envmap-near-count uint16 :offset-assert 10314) - (envmap-mid-count uint16 :offset-assert 10316) - (envmap-far-count uint16 :offset-assert 10318) - (generic-count uint16 :offset-assert 10320) - (generic-near-count uint16 :offset-assert 10320) - (generic-mid-count uint16 :offset-assert 10322) - (generic-far-count uint16 :offset-assert 10324) - (vanish-count uint16 :offset-assert 10326) - (next-clear uint32 3 :offset-assert 10256) ;; guessed by decompiler - (count-clear uint16 3 :offset-assert 10304) ;; guessed by decompiler + (scissor-geometry uint32 :offset 10240) + (near-geometry uint32 :offset 10244) + (mid-geometry uint32 :offset 10248) + (far-geometry uint32 :offset 10252) + (scissor-frag-count uint8 :offset 10364) + (near-frag-count uint8 :offset 10365) + (mid-frag-count uint8 :offset 10366) + (far-frag-count uint8 :offset 10367) + (tie-scissor-next uint32 :offset 10256) + (tie-near-next uint32 :offset 10260) + (tie-mid-next uint32 :offset 10264) + (tie-far-next uint32 :offset 10268) + (trans-scissor-next uint32 4 :offset 10256) ;; guessed by decompiler + (trans-near-next uint32 :offset 10260) + (trans-mid-next uint32 :offset 10264) + (trans-far-next uint32 :offset 10268) + (water-scissor-next uint32 4 :offset 10256) ;; guessed by decompiler + (water-near-next uint32 :offset 10260) + (water-mid-next uint32 :offset 10264) + (water-far-next uint32 :offset 10268) + (envmap-scissor-next uint32 4 :offset 10272) ;; guessed by decompiler + (envmap-near-next uint32 :offset 10276) + (envmap-mid-next uint32 :offset 10280) + (envmap-far-next uint32 :offset 10284) + (generic-near-next uint32 :offset 10288) + (generic-mid-next uint32 :offset 10292) + (generic-far-next uint32 :offset 10296) + (vanish-next uint32 :offset 10300) + (tie-count uint16 :offset 10304) + (tie-scissor-count uint16 :offset 10304) + (tie-near-count uint16 :offset 10306) + (tie-mid-count uint16 :offset 10308) + (tie-far-count uint16 :offset 10310) + (trans-count uint16 :offset 10304) + (trans-scissor-count uint16 :offset 10304) + (trans-near-count uint16 :offset 10306) + (trans-mid-count uint16 :offset 10308) + (trans-far-count uint16 :offset 10310) + (water-count uint16 :offset 10304) + (water-scissor-count uint16 :offset 10304) + (water-near-count uint16 :offset 10306) + (water-mid-count uint16 :offset 10308) + (water-far-count uint16 :offset 10310) + (envmap-count uint16 :offset 10312) + (envmap-scissor-count uint16 :offset 10312) + (envmap-near-count uint16 :offset 10314) + (envmap-mid-count uint16 :offset 10316) + (envmap-far-count uint16 :offset 10318) + (generic-count uint16 :offset 10320) + (generic-near-count uint16 :offset 10320) + (generic-mid-count uint16 :offset 10322) + (generic-far-count uint16 :offset 10324) + (vanish-count uint16 :offset 10326) + (next-clear uint32 3 :offset 10256) ;; guessed by decompiler + (count-clear uint16 3 :offset 10304) ;; guessed by decompiler ) :method-count-assert 9 :size-assert #x2890 :flag-assert #x900002890 ) -|# -;; (define-extern *instance-tie-work-copy* object) ;; instance-tie-work +(define-extern *instance-tie-work-copy* instance-tie-work) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; tfrag-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype tfragment-stats (structure) + "Triangle and vertex stats for a single tfragment." ((num-tris uint16 4 :offset-assert 0) ;; guessed by decompiler (num-dverts uint16 4 :offset-assert 8) ;; guessed by decompiler ) @@ -22684,10 +22694,9 @@ :size-assert #x10 :flag-assert #x900000010 ) -|# -#| (deftype tfragment-debug-data (structure) + "Optional debug information (stats, lines) for a tfragment." ((stats tfragment-stats :inline :offset-assert 0) (debug-lines (array vector-array) :offset-assert 16) ;; guessed by decompiler ) @@ -22695,115 +22704,119 @@ :size-assert #x14 :flag-assert #x900000014 ) -|# -#| (deftype generic-tfragment (structure) + "Unused. Could have been a way to render tfrag's through generic." ((dummy int32 :offset-assert 0) ) :method-count-assert 9 :size-assert #x4 :flag-assert #x900000004 ) -|# -#| (deftype tfragment (drawable) - ((color-index uint16 :offset-assert 6) - (debug-data tfragment-debug-data :offset-assert 8) - (color-indices uint32 :offset-assert 12) - (colors uint32 :offset-assert 12) - (dma-chain uint32 3 :offset-assert 32) ;; guessed by decompiler - (dma-common uint32 :offset-assert 32) - (dma-level-0 uint32 :offset-assert 32) - (dma-base uint32 :offset-assert 36) - (dma-level-1 uint32 :offset-assert 40) - (dma-qwc uint8 4 :offset-assert 44) ;; guessed by decompiler - (shader (inline-array adgif-shader) :offset-assert 48) ;; guessed by decompiler - (num-shaders uint8 :offset-assert 52) - (num-base-colors uint8 :offset-assert 53) - (num-level0-colors uint8 :offset-assert 54) - (num-level1-colors uint8 :offset-assert 55) - (color-offset uint8 :offset-assert 56) - (color-count uint8 :offset-assert 57) - (texture-masks-index uint16 :offset-assert 58) - (generic generic-tfragment :offset-assert 60) + "A tfrag mesh fragment. This is just references to DMA data, plus some metadata." + ((color-index uint16 :offset 6) + (debug-data tfragment-debug-data :offset 8) + (color-indices uint32 :offset 12) + (colors uint32 :offset 12) + (dma-chain uint32 3 :offset 32) ;; guessed by decompiler + (dma-common uint32 :offset 32) + (dma-level-0 uint32 :offset 32) + (dma-base uint32 :offset 36) + (dma-level-1 uint32 :offset 40) + (dma-qwc uint8 4 :offset 44) ;; guessed by decompiler + (shader (inline-array adgif-shader) :offset 48) ;; guessed by decompiler + (num-shaders uint8 :offset 52) + (num-base-colors uint8 :offset 53) + (num-level0-colors uint8 :offset 54) + (num-level1-colors uint8 :offset 55) + (color-offset uint8 :offset 56) + (color-count uint8 :offset 57) + (texture-masks-index uint16 :offset 58) + (generic generic-tfragment :offset 60) ) :method-count-assert 17 :size-assert #x40 :flag-assert #x1100000040 ) -|# -;; (deftype drawable-inline-array-tfrag (drawable-inline-array) -;; () -;; :flag-assert #x1100000064 -;; ) +(deftype drawable-inline-array-tfrag (drawable-inline-array) + "Array of tfragments" + ((data tfragment 1 :inline :offset-assert 32) + (pad uint32)) + :flag-assert #x1100000064 + ) -;; (deftype drawable-inline-array-tfrag-trans (drawable-inline-array-tfrag) -;; () -;; :flag-assert #x11000000b4 -;; ) +(deftype drawable-inline-array-tfrag-trans (drawable-inline-array-tfrag) + ;; note: this is probably a bug in the type layout, copied from jak 1. + ;; this data2 is not used. + ((data2 tfragment 1 :inline :offset-assert 112) + (pad2 uint32)) + :flag-assert #x11000000b4 + ) -;; (deftype drawable-inline-array-tfrag-water (drawable-inline-array-tfrag) -;; () -;; :flag-assert #x11000000b4 -;; ) +(deftype drawable-inline-array-tfrag-water (drawable-inline-array-tfrag) + ((data2 tfragment 1 :inline :offset-assert 112) + (pad2 uint32)) + :flag-assert #x11000000b4 + ) -;; (deftype drawable-tree-tfrag (drawable-tree) -;; () -;; :flag-assert #x1100000020 -;; ) +(deftype drawable-tree-tfrag (drawable-tree) + "top level tfrag tree." + ((time-of-day-pal time-of-day-palette :offset 12) + (arrays drawable-inline-array :dynamic :offset 32 :score 100) ;; either drawable-inline-array-node or drawable-inline-array-tfrag + ) + :flag-assert #x1100000020 + ) -;; (deftype drawable-tree-tfrag-trans (drawable-tree-tfrag) -;; () -;; :flag-assert #x1100000020 -;; ) +(deftype drawable-tree-tfrag-trans (drawable-tree-tfrag) + () + :flag-assert #x1100000020 + ) -;; (deftype drawable-tree-tfrag-water (drawable-tree-tfrag-trans) -;; () -;; :flag-assert #x1100000020 -;; ) +(deftype drawable-tree-tfrag-water (drawable-tree-tfrag-trans) + () + :flag-assert #x1100000020 + ) -#| (deftype tfrag-dists (structure) + "Distances for mesh level-of-detail blending for use on VU1." ((data uint32 16 :offset-assert 0) ;; guessed by decompiler - (vector vector 4 :offset-assert 0) ;; guessed by decompiler - (k0s vector 2 :offset-assert 0) ;; guessed by decompiler - (k1s vector 2 :offset-assert 32) ;; guessed by decompiler + (vector vector 4 :offset 0) ;; guessed by decompiler + (k0s vector 2 :offset 0) ;; guessed by decompiler + (k1s vector 2 :offset 32) ;; guessed by decompiler ) :method-count-assert 9 :size-assert #x40 :flag-assert #x900000040 ) -|# -#| (deftype tfrag-data (structure) + "Constants for VU1 data memory for tfrag rendering." ((data uint32 56 :offset-assert 0) ;; guessed by decompiler - (vector vector 14 :offset-assert 0) ;; guessed by decompiler - (fog vector :inline :offset-assert 0) - (val vector :inline :offset-assert 16) - (strgif qword :inline :offset-assert 32) ;; gs-gif-tag :inline - (fangif qword :inline :offset-assert 48) ;; gs-gif-tag :inline - (adgif qword :inline :offset-assert 64) ;; gs-gif-tag :inline - (hvdf-offset vector :inline :offset-assert 80) - (hmge-scale vector :inline :offset-assert 96) - (invh-scale vector :inline :offset-assert 112) - (ambient vector :inline :offset-assert 128) - (guard vector :inline :offset-assert 144) - (dists tfrag-dists :inline :offset-assert 160) - (k0s uint128 2 :offset-assert 160) ;; guessed by decompiler - (k1s uint128 2 :offset-assert 192) ;; guessed by decompiler + (vector vector 14 :offset 0) ;; guessed by decompiler + (fog vector :inline :offset 0) + (val vector :inline :offset 16) + (strgif gs-gif-tag :inline :offset 32) ;; gs-gif-tag :inline + (fangif gs-gif-tag :inline :offset 48) ;; gs-gif-tag :inline + (adgif gs-gif-tag :inline :offset 64) ;; gs-gif-tag :inline + (hvdf-offset vector :inline :offset 80) + (hmge-scale vector :inline :offset 96) + (invh-scale vector :inline :offset 112) + (ambient vector :inline :offset 128) + (guard vector :inline :offset 144) + (dists tfrag-dists :inline :offset 160) + (k0s uint128 2 :offset 160) ;; guessed by decompiler + (k1s uint128 2 :offset 192) ;; guessed by decompiler ) :method-count-assert 9 :size-assert #xe0 :flag-assert #x9000000e0 ) -|# -#| (deftype tfrag-control (structure) + "VU1 'control' data containing address and counters." ((num-base-points uint32 :offset-assert 0) (num-shared-base-points uint32 :offset-assert 4) (num-level0-points uint32 :offset-assert 8) @@ -22829,10 +22842,9 @@ :size-assert #x50 :flag-assert #x900000050 ) -|# -#| (deftype tfrag-stats (structure) + "TFRAG statistics computed on EE." ((from int32 :offset-assert 0) (to int32 :offset-assert 4) (cnt int32 :offset-assert 8) @@ -22854,9 +22866,7 @@ :size-assert #x40 :flag-assert #x900000040 ) -|# -#| (deftype tfrag-packet (structure) ((tag uint128 2 :offset-assert 0) ;; guessed by decompiler ) @@ -22864,10 +22874,9 @@ :size-assert #x20 :flag-assert #x900000020 ) -|# -#| (deftype tfrag-work (structure) + "Scratch space for generating TFRAG DMA." ((base-tmpl dma-packet :inline :offset-assert 0) (level-0-tmpl dma-packet :inline :offset-assert 16) (common-tmpl dma-packet :inline :offset-assert 32) @@ -22898,21 +22907,20 @@ :size-assert #xc0 :flag-assert #x9000000c0 ) -|# -#| (deftype tfrag-dma (structure) - ((banka tfragment 16 :offset-assert 4) ;; guessed by decompiler - (bankb tfragment 16 :offset-assert 1028) ;; guessed by decompiler + "Memory layout for to/from scratchpad for tfrag." + ((banka tfragment 16 :inline :offset-assert 0) ;; guessed by decompiler + (bankb tfragment 16 :inline :offset-assert 1024) ;; guessed by decompiler (outa uint128 128 :offset-assert 2048) ;; guessed by decompiler (outb uint128 128 :offset-assert 4096) ;; guessed by decompiler - (colors rgba 2048 :offset-assert 6144) ;; guessed by decompiler + ;; another weird bug with size here... + (colors rgba 2047 :offset-assert 6144) ;; guessed by decompiler ) :method-count-assert 9 :size-assert #x37fc :flag-assert #x9000037fc ) -|# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -22921,17 +22929,14 @@ ;; adgif-shader-array is already defined! -#| (deftype hfrag-montage (structure) - ((data UNKNOWN 16 :offset-assert 0) + ((data uint16 16 :offset-assert 0) ) :method-count-assert 9 :size-assert #x20 :flag-assert #x900000020 ) -|# -#| (deftype hfrag-bucket (structure) ((next uint32 :offset-assert 0) (count uint16 :offset-assert 4) @@ -22944,152 +22949,129 @@ :size-assert #x10 :flag-assert #x900000010 ) -|# -;; (deftype hfrag-packed-index (uint16) -;; () -;; :flag-assert #x900000002 -;; ) +(deftype hfrag-packed-index (uint16) + () + :flag-assert #x900000002 + ) -#| (deftype hfrag-vertex (structure) ((height uint16 :offset-assert 0) - (packed-index uint16 :offset-assert 2) + (packed-index hfrag-packed-index :offset-assert 2) ) :method-count-assert 9 :size-assert #x4 :flag-assert #x900000004 ) -|# -#| (deftype hfrag-vert-index (structure) ((pos vector2ub :inline :offset-assert 0) - (index0 uint16 :offset-assert 2) - (index1 uint16 :offset-assert 4) - (index2 uint16 :offset-assert 6) + (index0 uint16 :offset 2) + (index1 uint16 :offset 4) + (index2 uint16 :offset 6) ) + :pack-me :method-count-assert 9 :size-assert #x8 :flag-assert #x900000008 ) -|# -#| +;; note: the poly vert-index stuff is a total guess! + (deftype hfrag-poly4 (structure) - ((UNKNOWN UNKNOWN :offset-assert -1) ;; field could not be read. + ((data hfrag-vert-index 4 :inline :offset-assert 0) ;; field could not be read. ) :method-count-assert 9 :size-assert #x20 :flag-assert #x900000020 ) -|# -#| (deftype hfrag-poly9 (structure) - ((UNKNOWN UNKNOWN :offset-assert -1) ;; field could not be read. + ((data hfrag-vert-index 9 :inline :offset-assert 0) ;; field could not be read. ) :method-count-assert 9 :size-assert #x48 :flag-assert #x900000048 ) -|# -#| (deftype hfrag-poly25 (structure) - ((UNKNOWN UNKNOWN :offset-assert -1) ;; field could not be read. + ((data hfrag-vert-index 25 :inline :offset-assert 0) ;; field could not be read. ) :method-count-assert 9 :size-assert #xc8 :flag-assert #x9000000c8 ) -|# -#| (deftype hfrag-poly4-chain (structure) ((tag dma-packet :inline :offset-assert 0) - (verts UNKNOWN 4 :offset-assert 16) - (next dma-packet :inline :offset-assert 208) + (verts vector4w-3 4 :inline :offset-assert 16) + (next dma-packet :inline :offset 208) ) :method-count-assert 9 :size-assert #xe0 :flag-assert #x9000000e0 ) -|# -#| (deftype hfrag-poly9-chain (structure) ((tag dma-packet :inline :offset-assert 0) - (verts UNKNOWN 12 :offset-assert 16) - (next dma-packet :inline :offset-assert 592) + (verts vector4w-3 12 :inline :offset-assert 16) + (next dma-packet :inline :offset 592) ) :method-count-assert 9 :size-assert #x260 :flag-assert #x900000260 ) -|# -#| (deftype hfrag-poly25-chain (structure) ((tag dma-packet :inline :offset-assert 0) - (verts UNKNOWN 40 :offset-assert 16) + (verts vector4w-3 40 :inline :offset-assert 16) (next dma-packet :inline :offset-assert 1936) ) :method-count-assert 9 :size-assert #x7a0 :flag-assert #x9000007a0 ) -|# -#| (deftype hfrag-cache-vertex (structure) ((color vector4w :inline :offset-assert 0) (pos vector :inline :offset-assert 16) - (clip uint32 :offset-assert 28) + (clip uint32 :offset 28) ) :method-count-assert 9 :size-assert #x20 :flag-assert #x900000020 ) -|# -#| (deftype hfrag-cache-line (structure) - ((data UNKNOWN 9 :offset-assert 0) + ((data hfrag-cache-vertex 9 :inline :offset-assert 0) ) :method-count-assert 9 :size-assert #x120 :flag-assert #x900000120 ) -|# -#| (deftype hfrag-visbits (structure) - ((data UNKNOWN 128 :offset-assert 0) + ((data uint8 128 :offset-assert 0) ) :method-count-assert 9 :size-assert #x80 :flag-assert #x900000080 ) -|# -#| (deftype hfrag-gcf-control (structure) ((matrix matrix :inline :offset-assert 0) (giftag generic-gif-tag :inline :offset-assert 64) - (adnops UNKNOWN 2 :offset-assert 80) - (num-strips uint32 :offset-assert 76) - (num-dps uint32 :offset-assert 92) - (kick-offset uint32 :offset-assert 108) + (adnops gs-adcmd 2 :inline :offset-assert 80) + (num-strips uint32 :offset 76) + (num-dps uint32 :offset 92) + (kick-offset uint32 :offset 108) (shader gcf-shader :inline :offset-assert 112) ) :method-count-assert 9 :size-assert #xc0 :flag-assert #x9000000c0 ) -|# -#| (deftype hfrag-gcf-ctrl (structure) ((tag dma-packet :inline :offset-assert 0) (control hfrag-gcf-control :inline :offset-assert 16) @@ -23098,21 +23080,17 @@ :size-assert #xd0 :flag-assert #x9000000d0 ) -|# -#| (deftype hfrag-init-packet (structure) ((init-tmpl dma-packet :inline :offset-assert 0) - (init-data UNKNOWN 8 :offset-assert 16) - (quad UNKNOWN 3 :offset-assert 0) + (init-data uint32 8 :offset-assert 16) + ;(quad UNKNOWN 3 :offset-assert 0) ) :method-count-assert 9 :size-assert #x30 :flag-assert #x900000030 ) -|# -#| (deftype hfrag-sprite-coord (structure) ((pos0 vector4w :inline :offset-assert 0) (pos1 vector4w :inline :offset-assert 16) @@ -23121,9 +23099,7 @@ :size-assert #x20 :flag-assert #x900000020 ) -|# -#| (deftype hfrag-montage-coord (structure) ((stq0 vector4 :inline :offset-assert 0) (stq1 vector4 :inline :offset-assert 16) @@ -23132,9 +23108,7 @@ :size-assert #x20 :flag-assert #x900000020 ) -|# -#| (deftype hfrag-sprite-packet (structure) ((sprite-tmpl dma-gif-packet :inline :offset-assert 0) (color vector4w :inline :offset-assert 32) @@ -23147,26 +23121,22 @@ :size-assert #x70 :flag-assert #x900000070 ) -|# -#| (deftype hfrag-tex-data (structure) - ((quad UNKNOWN 3 :offset-assert 0) - (prims UNKNOWN 6 :offset-assert 0) - (reg-0 uint8 :offset-assert 8) - (reg-1 uint8 :offset-assert 24) - (reg-2 uint8 :offset-assert 40) - (tex0 uint64 :offset-assert 0) - (tex1 uint64 :offset-assert 16) - (texflush uint64 :offset-assert 32) + ((quad qword 3 :inline :offset-assert 0) + (prims uint64 6 :offset 0) + (reg-0 uint8 :offset 8) + (reg-1 uint8 :offset 24) + (reg-2 uint8 :offset 40) + (tex0 uint64 :offset 0) + (tex1 uint64 :offset 16) + (texflush uint64 :offset 32) ) :method-count-assert 9 :size-assert #x30 :flag-assert #x900000030 ) -|# -#| (deftype hfrag-mip-packet (structure) ((mip-tmpl dma-gif-packet :inline :offset-assert 0) (tex0-1 vector :inline :offset-assert 32) @@ -23182,9 +23152,7 @@ :size-assert #xa0 :flag-assert #x9000000a0 ) -|# -#| (deftype hfrag-adgif-packet (structure) ((adgif-tmpl dma-gif-packet :inline :offset-assert 0) (adgif-data adgif-shader :inline :offset-assert 32) @@ -23193,9 +23161,7 @@ :size-assert #x70 :flag-assert #x900000070 ) -|# -#| (deftype hfrag-adgif-packet2 (structure) ((adgif-tmpl dma-gif-packet :inline :offset-assert 0) (adgif-data adgif-shader :inline :offset-assert 32) @@ -23205,28 +23171,24 @@ :size-assert #x80 :flag-assert #x900000080 ) -|# -#| (deftype hfrag-frame (structure) - ((quad UNKNOWN 4 :offset-assert 0) - (prims UNKNOWN 8 :offset-assert 0) - (reg-0 uint8 :offset-assert 8) - (reg-1 uint8 :offset-assert 24) - (reg-2 uint8 :offset-assert 40) - (reg-3 uint8 :offset-assert 56) - (frame uint64 :offset-assert 0) - (scissor uint64 :offset-assert 16) - (xyoffset uint64 :offset-assert 32) - (test uint64 :offset-assert 48) + ((quad qword 4 :inline :offset 0) + (prims uint64 8 :offset 0) + (reg-0 uint8 :offset 8) + (reg-1 uint8 :offset 24) + (reg-2 uint8 :offset 40) + (reg-3 uint8 :offset 56) + (frame uint64 :offset 0) + (scissor uint64 :offset 16) + (xyoffset uint64 :offset 32) + (test uint64 :offset 48) ) :method-count-assert 9 :size-assert #x40 :flag-assert #x900000040 ) -|# -#| (deftype hfrag-frame-packet (structure) ((frame-tmpl dma-gif-packet :inline :offset-assert 0) (frame-data hfrag-frame :inline :offset-assert 32) @@ -23235,14 +23197,12 @@ :size-assert #x60 :flag-assert #x900000060 ) -|# -#| (deftype hfragment (drawable) ((start-corner vector :inline :offset-assert 32) (spheres uint32 :offset-assert 48) (visids uint32 :offset-assert 52) - (shaders uint32 :offset-assert 56) + (shaders (inline-array adgif-shader) :offset-assert 56) (colors basic :offset-assert 60) (montage uint32 :offset-assert 64) (buckets-far uint32 :offset-assert 68) @@ -23254,7 +23214,7 @@ (num-buckets-far uint16 :offset-assert 90) (num-buckets-mid uint16 :offset-assert 92) (num-buckets-near uint16 :offset-assert 94) - (size uint32 :offset-assert 44) + (size uint32 :offset 44) ) :method-count-assert 22 :size-assert #x60 @@ -23267,72 +23227,68 @@ (hfragment-method-21 () none) ;; 21 ) ) -|# -#| (deftype hfrag-dma (structure) - ((banka UNKNOWN 340 :offset-assert 0) - (bankb UNKNOWN 340 :offset-assert 1360) - (outa UNKNOWN 227 :offset-assert 2720) - (outb UNKNOWN 227 :offset-assert 6352) - (cache UNKNOWN 8 :offset-assert 9984) - (colors UNKNOWN 1024 :offset-assert 12288) + ((banka uint32 340 :offset-assert 0) + (bankb uint32 340 :offset-assert 1360) + (outa uint128 227 :offset-assert 2720) + (outb uint128 227 :offset-assert 6352) + (cache hfrag-cache-line 8 :inline :offset-assert 9984) + (colors rgba 1024 :offset-assert 12288) ) :method-count-assert 9 :size-assert #x4000 :flag-assert #x900004000 ) -|# -#| (deftype hfrag-work (structure) - ((far-chaina UNKNOWN 6 :offset-assert 0) - (far-chainb UNKNOWN 6 :offset-assert 96) - (mid-chaina UNKNOWN 10 :offset-assert 192) - (mid-chainb UNKNOWN 10 :offset-assert 352) - (near-chaina UNKNOWN 18 :offset-assert 512) - (near-chainb UNKNOWN 18 :offset-assert 800) - (poly4-tmpl UNKNOWN 3 :offset-assert 1088) - (poly9-tmpl UNKNOWN 3 :offset-assert 1136) - (poly25-tmpl UNKNOWN 3 :offset-assert 1184) - (init-tmpl UNKNOWN 3 :offset-assert 1232) - (control-tmpl UNKNOWN 2 :offset-assert 1376) - (heights4-tmpl UNKNOWN 2 :offset-assert 1408) - (colors4-tmpl UNKNOWN 2 :offset-assert 1440) - (heights9-tmpl UNKNOWN 2 :offset-assert 1472) - (colors9-tmpl UNKNOWN 2 :offset-assert 1504) - (heights25-tmpl UNKNOWN 2 :offset-assert 1536) - (colors25-tmpl UNKNOWN 2 :offset-assert 1568) - (init-vu1-tmpl UNKNOWN 2 :offset-assert 1600) - (next-tmpl dma-packet :inline :offset-assert 1696) + ((far-chaina dma-packet 6 :inline :offset-assert 0) + (far-chainb dma-packet 6 :inline :offset-assert 96) + (mid-chaina dma-packet 10 :inline :offset-assert 192) + (mid-chainb dma-packet 10 :inline :offset-assert 352) + (near-chaina dma-packet 18 :inline :offset-assert 512) + (near-chainb dma-packet 18 :inline :offset-assert 800) + (poly4-tmpl dma-packet 3 :inline :offset-assert 1088) + (poly9-tmpl dma-packet 3 :inline :offset-assert 1136) + (poly25-tmpl dma-packet 3 :inline :offset-assert 1184) + (init-tmpl dma-packet 3 :inline :offset-assert 1232) ;; ?? + (control-tmpl dma-packet 2 :inline :offset 1376) + (heights4-tmpl dma-packet 2 :inline :offset-assert 1408) + (colors4-tmpl dma-packet 2 :inline :offset-assert 1440) + (heights9-tmpl dma-packet 2 :inline :offset-assert 1472) + (colors9-tmpl dma-packet 2 :inline :offset-assert 1504) + (heights25-tmpl dma-packet 2 :inline :offset-assert 1536) + (colors25-tmpl dma-packet 2 :inline :offset-assert 1568) + (init-vu1-tmpl dma-packet 2 :inline :offset-assert 1600) ;; ?? + (next-tmpl dma-packet :inline :offset 1696) (call-tmpl dma-packet :inline :offset-assert 1712) (ret-tmpl dma-packet :inline :offset-assert 1728) (next-scissor-tmpl dma-packet :inline :offset-assert 1744) (ret-scissor-tmpl dma-packet :inline :offset-assert 1760) (frame-tmpl dma-gif-packet :inline :offset-assert 1776) - (frames UNKNOWN 5 :offset-assert 1808) + (frames hfrag-frame 5 :inline :offset-assert 1808) (adgif-tmpl dma-gif-packet :inline :offset-assert 2128) (adgif-tmpl2 dma-gif-packet :inline :offset-assert 2160) (sprite-tmpl dma-gif-packet :inline :offset-assert 2192) (mip-tmpl dma-gif-packet :inline :offset-assert 2224) - (color UNKNOWN 6 :offset-assert 2256) + (color uint128 6 :offset-assert 2256) (far-data hfrag-sprite-coord :inline :offset-assert 2352) - (near-data UNKNOWN 16 :offset-assert 2384) - (mip-data UNKNOWN 7 :offset-assert 2896) - (tex-data UNKNOWN 5 :offset-assert 3120) - (tex UNKNOWN 6 :offset-assert 3360) - (montage-tex-coords UNKNOWN 128 :offset-assert 3456) - (giftag generic-gif-tag :inline :offset-assert 7552) + (near-data vector4w-2 16 :inline :offset-assert 2384) + (mip-data vector4w-3 7 :inline :offset 2896) + (tex-data hfrag-tex-data 5 :offset 3120) + (tex uint128 6 :offset 3360) + (montage-tex-coords uint128 128 :offset 3456) + (giftag generic-gif-tag :inline :offset 7552) (call-abort dma-packet :inline :offset-assert 7568) (call-abort-vu1 dma-packet :inline :offset-assert 7584) (shader-far adgif-shader :inline :offset-assert 7600) (shader-mid adgif-shader :inline :offset-assert 7680) (shader-near adgif-shader :inline :offset-assert 7760) - (stq UNKNOWN 9 :offset-assert 7840) + (stq uint128 9 :offset-assert 7840) (shader adgif-shader :inline :offset-assert 7984) (constants vector :inline :offset-assert 8064) (pos-temp vector4w :inline :offset-assert 8080) - (trans-temp vector :inline :offset-assert 8080) + (trans-temp vector :inline :offset 8080) (dists vector :inline :offset-assert 8096) (rdists vector :inline :offset-assert 8112) (call-poly4-near uint32 :offset-assert 8128) @@ -23354,7 +23310,7 @@ (to-spr uint32 :offset-assert 8192) (from-spr uint32 :offset-assert 8196) (lowres-flag basic :offset-assert 8200) - (hfrag hfragment :inline :offset-assert 8212) + (hfrag hfragment :inline :offset-assert 8208) (next-far int16 :offset-assert 8304) (next-far-mid int16 :offset-assert 8306) (next-mid int16 :offset-assert 8308) @@ -23385,9 +23341,9 @@ (poly-mid uint32 :offset-assert 8380) (poly-near uint32 :offset-assert 8384) (far-texture uint32 :offset-assert 8388) - (near-textures UNKNOWN 16 :offset-assert 8392) - (draw-table UNKNOWN 1024 :offset-assert 8456) - (corners UNKNOWN 1024 :offset-assert 10512) + (near-textures uint16 16 :offset-assert 8392) + (draw-table uint16 1024 :offset 8456) + (corners uint128 1024 :offset-assert 10512) ) :method-count-assert 36 :size-assert #x6910 @@ -23422,25 +23378,22 @@ (hfrag-work-method-35 () none) ;; 35 ) ) -|# -#| (deftype hfrag-mip-packet-array (structure) - ((data UNKNOWN 6 :offset-assert 0) + ((data hfrag-mip-packet 6 :inline :offset-assert 0) ) :method-count-assert 9 :size-assert #x3c0 :flag-assert #x9000003c0 ) -|# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; background-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype background-work (basic) + "List of all things for the background renderer to draw." ((tfrag-tree-count int32 :offset-assert 4) (tfrag-trees drawable-tree-tfrag 11 :offset-assert 8) ;; guessed by decompiler (tfrag-levels level 11 :offset-assert 52) ;; guessed by decompiler @@ -23464,41 +23417,42 @@ :size-assert #x22c :flag-assert #x90000022c ) -|# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; subdivide-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype subdivide-settings (basic) + "Input settings for distances for switching mesh level of details. + These are set by the level code and read by rendering code." ((dist float 5 :offset-assert 4) ;; guessed by decompiler (meters float 5 :offset-assert 24) ;; guessed by decompiler (close float 12 :offset-assert 44) ;; guessed by decompiler (far float 12 :offset-assert 92) ;; guessed by decompiler ) + (:methods + (new (symbol type float float) _type_) + ) :method-count-assert 9 :size-assert #x8c :flag-assert #x90000008c ) -|# -#| (deftype subdivide-dists (structure) - ((data uint32 32 :offset-assert 0) ;; guessed by decompiler - (vector vector 8 :offset-assert 0) ;; guessed by decompiler - (k0s uint128 4 :offset-assert 0) ;; guessed by decompiler - (k1s uint128 4 :offset-assert 64) ;; guessed by decompiler + "Unused subdivide distances. Internally, tfrag/tie figure these out instead." + ((data uint32 32 :offset 0) ;; guessed by decompiler + (vector vector 8 :offset 0) ;; guessed by decompiler + (k0s uint128 4 :offset 0) ;; guessed by decompiler + (k1s uint128 4 :offset 64) ;; guessed by decompiler ) :method-count-assert 9 :size-assert #x80 :flag-assert #x900000080 ) -|# -#| (deftype terrain-stats (structure) + "Desptie the name `terrain-stats`, these are more general triangle stats for all renderers." ((pris tr-stat :inline :offset-assert 0) (tie-generic tr-stat :inline :offset-assert 16) (tie-vanish tr-stat :inline :offset-assert 32) @@ -23535,39 +23489,38 @@ :size-assert #x1f0 :flag-assert #x9000001f0 ) -|# -#| (deftype background-area (structure) - ((dma-area dma-area 14336 :offset-assert 0) ;; guessed by decompiler + "Scratchpad memory layout for most background rendering + This uses the full scratchpad so it should only be used when the stack isn't on the scratchpad (rendering code). + Interestingly, dma-area went from a union of all the -dma types to a plain array of bytes in jak 3." + ((dma-area uint8 14336 :offset-assert 0) ;; guessed by decompiler (vis-list uint8 2048 :offset-assert 14336) ;; guessed by decompiler ) :method-count-assert 9 :size-assert #x4000 :flag-assert #x900004000 ) -|# -#| (deftype foreground-area (structure) - ((generic-work generic-work :inline :offset-assert 0) - (foreground-work foreground-work :inline :offset-assert 0) - (joint-work joint-work :inline :offset-assert 0) - (bone-mem bone-memory :inline :offset-assert 0) - (shadow-work shadow-work :inline :offset-assert 0) + "Scratchpad memory layout for most foreground rendering." + ((generic-work generic-work :inline :offset 0) + (foreground-work foreground-work :inline :offset 0) + (joint-work joint-work :inline :offset 0) + (bone-mem bone-memory :inline :offset 0) + (shadow-work shadow-work :inline :offset 0) ) :method-count-assert 9 :size-assert #x3fe0 :flag-assert #x900003fe0 ) -|# -#| (deftype region-prim-area (structure) + "Scratchpad memory layout for regions." ((region-prim-list region-prim-list :inline :offset-assert 0) (pos vector :inline :offset-assert 1296) - (ray vector :inline :offset-assert 1328) - (region-enter-count int32 :offset-assert 1360) + (ray vector :inline :offset 1328) + (region-enter-count int32 :offset 1360) (region-enter-list region 320 :offset-assert 1364) ;; guessed by decompiler (region-enter-prim-list drawable-region-sphere 320 :offset-assert 2644) ;; guessed by decompiler (region-exit-count int32 :offset-assert 3924) @@ -23590,44 +23543,40 @@ (region-prim-area-method-12 () none) ;; 12 ;; (track-start-region! (_type_ drawable-region-sphere) none) ) ) -|# -#| (deftype sprite-area (structure) - ((clock-data vector 22 :offset-assert 0) ;; guessed by decompiler + "Scratchpad memory layout for sprites." + ((clock-data vector 22 :inline :offset-assert 0) ;; guessed by decompiler (buffer uint8 :dynamic :offset-assert 352) ;; guessed by decompiler ) :method-count-assert 9 :size-assert #x160 :flag-assert #x900000160 ) -|# -#| (deftype work-area (structure) - ((background background-area :inline :offset-assert 0) - (foreground foreground-area :inline :offset-assert 0) - (region-prim region-prim-area :inline :offset-assert 0) - (sprite sprite-area :inline :offset-assert 0) + "All scratchpad memory layouts." + ((background background-area :inline :offset 0) + (foreground foreground-area :inline :offset 0) + (region-prim region-prim-area :inline :offset 0) + (sprite sprite-area :inline :offset 0) ) :method-count-assert 9 :size-assert #x4000 :flag-assert #x900004000 ) -|# -#| (deftype terrain-context (structure) + "Useless wrapper around work-area. (this added some stuff in jak 1)" ((work work-area :inline :offset-assert 0) ) :method-count-assert 9 :size-assert #x4000 :flag-assert #x900004000 ) -|# -;; (define-extern *terrain-stats* object) ;; terrain-stats -;; (define-extern *collide-stats* object) ;; collide-stats +(define-extern *terrain-stats* terrain-stats) +(define-extern *collide-stats* collide-stats) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; entity-h ;; @@ -24356,8 +24305,35 @@ ;; sparticle-launcher-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +(declare-type sprite-vec-data-3d structure) +(declare-type sparticle-cpuinfo structure) +(declare-type sparticle-system structure) + +(defenum sp-field-id + :type uint16 + ) + +(defenum sp-flag + :type uint16 + ) + +(defenum sp-group-item-flag + :bitfield #t + :type uint16 + ) + +(defenum sp-launch-state-flags + :bitfield #t + :type uint16 + ) + +(defenum sp-group-flag + :bitfield #t + :type uint16 + ) + (deftype sparticle-birthinfo (structure) + "Used internally by the sparticle code." ((sprite uint32 :offset-assert 0) (anim int32 :offset-assert 4) (anim-speed float :offset-assert 8) @@ -24365,41 +24341,39 @@ (joint-ppoint int32 :offset-assert 16) (num-to-birth float :offset-assert 20) (sound basic :offset-assert 24) - (dataf float 1 :offset-assert 0) ;; guessed by decompiler - (data uint32 1 :offset-assert 0) ;; guessed by decompiler + (dataf float 1 :offset 0) ;; guessed by decompiler + (data uint32 1 :offset 0) ;; guessed by decompiler ) :method-count-assert 9 :size-assert #x1c :flag-assert #x90000001c ) -|# -#| (deftype sp-field-init-spec (structure) - ((field uint16 :offset-assert 0) ;; sp-field-id - (flags uint16 :offset-assert 2) ;; sp-flag + "Part of a particle definition - how to initialize a field of a particle." + ((field sp-field-id :offset-assert 0) ;; + (flags sp-flag :offset-assert 2) ;; (initial-valuef float :offset-assert 4) (random-rangef float :offset-assert 8) (random-multf float :offset-assert 12) - (initial-value int32 :offset-assert 4) - (random-range int32 :offset-assert 8) - (random-mult int32 :offset-assert 12) - (func symbol :offset-assert 4) ;; guessed by decompiler - (tex texture-id :offset-assert 4) ;; guessed by decompiler - (pntr pointer :offset-assert 4) ;; guessed by decompiler - (object basic :offset-assert 4) - (sym symbol :offset-assert 4) ;; guessed by decompiler - (sound sound-spec :offset-assert 4) ;; guessed by decompiler + (initial-value int32 :offset 4) + (random-range int32 :offset 8) + (random-mult int32 :offset 12) + (func symbol :offset 4) ;; guessed by decompiler + (tex texture-id :offset 4) ;; guessed by decompiler + (pntr pointer :offset 4) ;; guessed by decompiler + (object basic :offset 4) + (sym symbol :offset 4) ;; guessed by decompiler + (sound sound-spec :offset 4) ;; guessed by decompiler ) :method-count-assert 9 :size-assert #x10 :flag-assert #x900000010 ;; field object uses ~A with a signed load. ) -|# -#| (deftype sparticle-launcher (basic) + "A definition of a single particle, as a list of init specs." ((birthaccum float :offset-assert 4) (soundaccum float :offset-assert 8) (init-specs (inline-array sp-field-init-spec) :offset-assert 12) ;; guessed by decompiler @@ -24408,18 +24382,17 @@ :size-assert #x10 :flag-assert #xb00000010 (:methods - (sparticle-launcher-method-9 () none) ;; 9 ;; (get-field-spec-by-id (_type_ sp-field-id) sp-field-init-spec) - (sparticle-launcher-method-10 () none) ;; 10 ;; (setup-user-array (_type_ string) none) + (get-field-spec-by-id "Look up a field's init spec by ID number." (_type_ sp-field-id) sp-field-init-spec) ;; 9 + (setup-special-textures "Set the particle's texture to the texture with the given name, and convert userdata strings to textures." (_type_ string) none) ;; 10 ) ) -|# -#| (deftype sparticle-group-item (structure) + "A reference to a single sparticle-launcher (by ID) and some parameters for using it." ((launcher uint32 :offset-assert 0) (fade-after meters :offset-assert 4) (falloff-to meters :offset-assert 8) - (flags uint16 :offset-assert 12) ;; sp-group-item-flag + (flags sp-group-item-flag :offset-assert 12) ;; sp-group-item-flag (period uint16 :offset-assert 14) (length uint16 :offset-assert 16) (offset int16 :offset-assert 18) @@ -24430,12 +24403,11 @@ :size-assert #x1c :flag-assert #x90000001c ) -|# -#| (deftype sparticle-launch-state (structure) + "The state associated with a launcher of a given sparticle." ((group-item sparticle-group-item :offset-assert 0) - (flags uint16 :offset-assert 4) ;; sp-launch-state-flags + (flags sp-launch-state-flags :offset-assert 4) ;; (randomize uint16 :offset-assert 6) (center vector :offset-assert 8) (sprite3d sprite-vec-data-3d :offset-assert 12) @@ -24444,29 +24416,28 @@ (accum float :offset-assert 24) (spawn-time uint32 :offset-assert 28) (control sparticle-launch-control :offset-assert 32) ;; guessed by decompiler - (swarm basic :offset-assert 20) - (seed uint32 :offset-assert 24) - (time uint32 :offset-assert 28) - (spec basic :offset-assert 16) - (id uint32 :offset-assert 12) + (swarm basic :offset 20) + (seed uint32 :offset 24) + (time uint32 :offset 28) + (spec basic :offset 16) + (id uint32 :offset 12) ) :method-count-assert 9 :size-assert #x24 :flag-assert #x900000024 ) -|# -#| (deftype sparticle-launch-group (basic) + "Definition of multiple a particle-group, which is a collection of particle effects." ((length int16 :offset-assert 4) (duration uint16 :offset-assert 6) (linger-duration uint16 :offset-assert 8) - (flags uint16 :offset-assert 10) ;; sp-group-flag + (flags sp-group-flag :offset-assert 10) ;; (name string :offset-assert 12) ;; guessed by decompiler (launcher (inline-array sparticle-group-item) :offset-assert 16) ;; guessed by decompiler - (rotate-x deg :offset-assert 20) ;; degrees - (rotate-y deg :offset-assert 24) ;; degrees - (rotate-z deg :offset-assert 28) ;; degrees + (rotate-x degrees :offset-assert 20) ;; degrees + (rotate-y degrees :offset-assert 24) ;; degrees + (rotate-z degrees :offset-assert 28) ;; degrees (scale-x float :offset-assert 32) (scale-y float :offset-assert 36) (scale-z float :offset-assert 40) @@ -24476,13 +24447,15 @@ :size-assert #x40 :flag-assert #xa00000040 (:methods - (sparticle-launch-group-method-9 () none) ;; 9 ;; (create-launch-control (_type_ process) sparticle-launch-control) + (create-launch-control (_type_ process) sparticle-launch-control) ;; 9 ) ) -|# -#| (deftype sparticle-launch-control (inline-array-class) + "Top-level type containing all the state needed to launch a particle group. + These are typically owned by a process, and allocated on the process heap. + These refer to static particle definitions, and then spawn particles that are tracked by the + particle system itself. This type just holds the launching-related state." ((group sparticle-launch-group :offset-assert 16) ;; guessed by decompiler (proc process-drawable :offset-assert 20) ;; guessed by decompiler (local-clock int32 :offset-assert 24) @@ -24490,12 +24463,12 @@ (matrix int8 :offset-assert 32) (state-mode uint8 3 :offset-assert 33) ;; guessed by decompiler (state-counter uint32 :offset-assert 36) - (local-space-binding particle-local-space-info :offset-assert 28) + (local-space-binding particle-local-space-info :offset 28) (last-spawn-frame int32 :offset-assert 40) (last-spawn-time int32 :offset-assert 44) (origin matrix :inline :offset-assert 48) - (center vector :inline :offset-assert 96) - (data sparticle-launch-state :dynamic :offset-assert 112) ;; guessed by decompiler + (center vector :inline :offset 96) + (data sparticle-launch-state :dynamic :inline :offset-assert 112) ;; guessed by decompiler ) :method-count-assert 21 :size-assert #x70 @@ -24510,13 +24483,11 @@ (sparticle-launch-control-method-20 () none) ;; 20 ) ) -|# -#| (deftype sparticle-subsampler (basic) ((spt-num float :offset-assert 4) - (sp-system basic :offset-assert 8) - (sp-launcher basic :offset-assert 12) + (sp-system sparticle-system :offset-assert 8) + (sp-launcher sparticle-launcher :offset-assert 12) (spawn-mat matrix :inline :offset-assert 16) (inited? basic :offset-assert 80) ) @@ -24524,14 +24495,14 @@ :size-assert #x54 :flag-assert #xb00000054 (:methods + (new (symbol type sparticle-system sparticle-launcher float) _type_) (sparticle-subsampler-method-9 () none) ;; 9 (sparticle-subsampler-method-10 () none) ;; 10 ) ) -|# -;; (define-extern *launch-matrix* object) ;; matrix -;; (define-extern compute-rot-in-screenspace function) +(define-extern *launch-matrix* matrix) +(define-extern compute-rot-in-screenspace "Unclear what this does, but I'm not actually sure it makes sense. Unused" (function vector float)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; sparticle-h ;; @@ -30595,7 +30566,7 @@ ;; (define-extern camera-pos function) ;; (function vector) ;; (define-extern math-camera-pos function) ;; (function vector) ;; (define-extern camera-matrix function) ;; (function matrix) -;; (define-extern math-camera-matrix function) ;; (function matrix) +(define-extern math-camera-matrix (function matrix)) ;; (define-extern camera-angle function) ;; (function float) ;; (define-extern camera-teleport-to-entity function) ;; (function entity-actor symbol :behavior process) ;; (define-extern camera-teleport-to-entity-named function) diff --git a/decompiler/config/jak3/ntsc_v1/type_casts.jsonc b/decompiler/config/jak3/ntsc_v1/type_casts.jsonc index 8b6c37561b..e0254347ad 100644 --- a/decompiler/config/jak3/ntsc_v1/type_casts.jsonc +++ b/decompiler/config/jak3/ntsc_v1/type_casts.jsonc @@ -335,5 +335,18 @@ "joint-mod-blend-world-callback": [[[1, 150], "gp", "joint-mod-blend-world"]], "(top-level-login eye-h)": [[77, "a3", "eye-control"]], "entity-actor-lookup": [["_stack_", 16, "res-tag"]], - "entity-actor-count": [["_stack_", 16, "res-tag"]] + "entity-actor-count": [["_stack_", 16, "res-tag"]], + "(method 3 collide-query)": [[116, "f0", "float"], [137, "f0", "float"]], + "shrubbery-login-post-texture": [ + [[13, 15], "a3", "qword"], + [16, "a3", "pointer"], + [24, "a3", "pointer"], + [[17, 23], "a3", "qword"], + [[13, 23], "a1", "qword"], + [14, "a2", "qword"], + [[27, 29], "a3", "qword"], + [[27, 29], "a1", "qword"], + [[35, 37], "a3", "qword"], + [[35, 37], "a2", "qword"] + ] } diff --git a/goal_src/jak3/engine/camera/cam-interface-h.gc b/goal_src/jak3/engine/camera/cam-interface-h.gc index 43ec2353e3..17f1d0f16d 100644 --- a/goal_src/jak3/engine/camera/cam-interface-h.gc +++ b/goal_src/jak3/engine/camera/cam-interface-h.gc @@ -5,6 +5,8 @@ ;; name in dgo: cam-interface-h ;; dgos: GAME +(define-extern math-camera-matrix (function matrix)) + ;; DECOMP BEGINS (define-perm *camera-init-mat* matrix #f) diff --git a/goal_src/jak3/engine/collide/collide-cache-h.gc b/goal_src/jak3/engine/collide/collide-cache-h.gc index 82c4f9869e..fc236058fa 100644 --- a/goal_src/jak3/engine/collide/collide-cache-h.gc +++ b/goal_src/jak3/engine/collide/collide-cache-h.gc @@ -5,5 +5,143 @@ ;; name in dgo: collide-cache-h ;; dgos: GAME +(defenum prim-type + :type int8 + (prim -2) + (sphere -1) + (group 0) + (mesh 1) + (fake-prim 2) + ) + +(declare-type collide-cache-prim structure) +(declare-type collide-using-spheres-params structure) +(declare-type instance-tie structure) + ;; DECOMP BEGINS +(deftype collide-puss-sphere (structure) + "A query sphere from the user for the porbe-using-spheres query. +This is used internally by the collide-cache implementation." + ((bsphere sphere :inline) + (bbox4w bounding-box4w :inline) + ) + ) + + +(deftype collide-puss-work (structure) + "Scratchpad memory map for probe-using-spheres query." + ((closest-pt vector :inline) + (tri-normal vector :inline) + (tri-bbox4w bounding-box4w :inline) + (spheres-bbox4w bounding-box4w :inline) + (spheres collide-puss-sphere 64 :inline) + ) + (:methods + (check-mesh-prim-against-spheres (_type_ collide-cache-prim collide-using-spheres-params) symbol) + (check-sphere-prim-against-spheres (_type_ collide-cache-prim collide-using-spheres-params) symbol) + ) + ) + + +(deftype collide-cache-tri (structure) + "A single triangle inside the collision cache. +Contains a reference back to the source object (like a collide-shape or water-control), and the prim itself." + ((vertex vector 3 :inline) + (extra-quad uint8 16) + (pat pat-surface :overlay-at (-> extra-quad 0)) + (collide-ptr basic :overlay-at (-> extra-quad 4)) + (prim-index uint16 :overlay-at (-> extra-quad 8)) + (user16 uint16 :overlay-at (-> extra-quad 10)) + (user32 uint32 :overlay-at (-> extra-quad 12)) + ) + ) + + +(deftype collide-cache-prim (structure) + "A primitive inside the collide-cache. +This can represent a sphere, a triangle mesh, or a group of other primitives within a bounding sphere." + ((prim-core collide-prim-core :inline) + (extra-quad uint8 16) + (ccache collide-cache :overlay-at (-> extra-quad 0)) + (prim collide-shape-prim :overlay-at (-> extra-quad 4)) + (first-tri uint16 :overlay-at (-> extra-quad 8)) + (num-tris uint16 :overlay-at (-> extra-quad 10)) + (unused uint8 4 :overlay-at (-> extra-quad 12)) + (world-sphere vector :inline :overlay-at (-> prim-core world-sphere)) + (collide-as collide-spec :overlay-at (-> prim-core collide-as)) + (action collide-action :overlay-at (-> prim-core action)) + (prim-type prim-type :overlay-at (-> prim-core prim-type)) + ) + (:methods + (collide-cache-prim-method-9 () none) + (collide-cache-prim-method-10 () none) + ) + ) + + +(deftype collide-cache (basic) + "The collide-cache is a structure to accelerate collision queries. +In particular, it helps with queries where you don't know what you might hit. +It can detect collision with the background geometry, foreground dynamic collision shapes (spheres and meshes), and water. +To use it, it must first be 'filled' with geometry. Then you can manually inspect the geometry, or use one of the queries. +The supported queries are 'line-sphere' (raycast) and 'spheres' (check if intersecting anything). +It is not useful for ollision queries against a specific foreground object, like 'am I on top of platform X right now?'." + ((num-tris int32) + (num-prims int32) + (ignore-mask pat-surface) + (ignore-processes process 2) + (collide-box bounding-box :inline) + (collide-box4w bounding-box4w :inline) + (collide-with collide-spec) + (unused uint32) + (prims collide-cache-prim 100 :inline) + (tris collide-cache-tri 461 :inline) + ) + (:methods + (collide-cache-method-9 () none) + (collide-cache-method-10 () none) + (collide-cache-method-11 () none) + (collide-cache-method-12 () none) + (collide-cache-method-13 () none) + (collide-cache-method-14 () none) + (collide-cache-method-15 () none) + (collide-cache-method-16 () none) + (collide-cache-method-17 () none) + (collide-cache-method-18 () none) + (collide-cache-method-19 () none) + (collide-cache-method-20 () none) + (collide-cache-method-21 () none) + (collide-cache-method-22 () none) + (collide-cache-method-23 () none) + (collide-cache-method-24 () none) + (collide-cache-method-25 () none) + ) + ) + + +(deftype collide-list-item (structure) + "Entry on the broad-phase collision list. +Can represent instanced collision, as a TIE instance, or a single non-instanced mesh fragment." + ((mesh instance-tie) + (inst basic) + ) + :pack-me + ) + + +(deftype collide-list (structure) + "List of items returned by the broad-phase collision query." + ((num-items int32) + (items collide-list-item 256 :inline :offset 16) + ) + ) + + +(kmemopen global "collide-cache-buffers") + +(define-perm *collide-cache* collide-cache (new 'global 'collide-cache)) + +(define-perm *collide-list* collide-list (new 'global 'collide-list)) + +(kmemclose) diff --git a/goal_src/jak3/engine/collide/collide-h.gc b/goal_src/jak3/engine/collide/collide-h.gc index e1049c80d2..201578472f 100644 --- a/goal_src/jak3/engine/collide/collide-h.gc +++ b/goal_src/jak3/engine/collide/collide-h.gc @@ -7,3 +7,48 @@ ;; DECOMP BEGINS +(deftype collide-query (structure) + "Very general collision-query structure. The meaning is different depending on where it used. +This has both inputs from the user, and collision results." + ((best-other-tri collide-tri-result :inline) + (best-my-tri collide-tri-result :inline :overlay-at best-other-tri) + (ignore-processes process-tree 2) + (ignore-process0 process-tree :overlay-at (-> ignore-processes 0)) + (ignore-process1 process-tree :overlay-at (-> ignore-processes 1)) + (ignore-pat pat-surface) + (collide-with collide-spec) + (overlay-params uint32 3 :offset 112) + (bbox bounding-box :inline) + (bbox4w bounding-box4w :inline) + (bsphere sphere :inline) + (start-pos vector :inline) + (move-dist vector :inline) + (rlength vector :inline) + (exit-planes plane 2) + (radius float :offset 268) + (inv-mat matrix :inline :offset 288) + (spheres (inline-array sphere) :overlay-at (-> overlay-params 0)) + (num-spheres uint32 :overlay-at (-> overlay-params 1)) + (solid-only symbol :overlay-at (-> overlay-params 2)) + (best-dist float :overlay-at spheres) + (best-other-prim collide-shape-prim :overlay-at num-spheres) + (best-my-prim collide-shape-prim :overlay-at solid-only) + (move-vec vector :inline :overlay-at move-dist) + (best-u float :overlay-at best-dist) + (action-mask collide-action :offset 352) + (local-box4w bounding-box4w :inline) + (search-box bounding-box4w :inline) + (search-vector vector4w :inline) + (instance-mat matrix :inline) + (instance-ptr basic) + (x-addr uint32) + (x-step uint32) + (y-addr uint32) + (y-step uint32) + (z-addr uint32) + (z-step uint32) + ) + ) + + +(define *collide-test-flag* #f) diff --git a/goal_src/jak3/engine/draw/drawable-h.gc b/goal_src/jak3/engine/draw/drawable-h.gc index 2ad7ab865f..22582f82e4 100644 --- a/goal_src/jak3/engine/draw/drawable-h.gc +++ b/goal_src/jak3/engine/draw/drawable-h.gc @@ -18,7 +18,7 @@ control over memory layout for use with DMA." (bsphere vector :inline) ) (:methods - (drawable-method-9 () none) + (login (_type_) _type_) (draw (_type_ _type_ display-frame) none) (drawable-method-11 () none) (drawable-method-12 () none) diff --git a/goal_src/jak3/engine/gfx/background/background-h.gc b/goal_src/jak3/engine/gfx/background/background-h.gc index c4deaef850..78a9d707d6 100644 --- a/goal_src/jak3/engine/gfx/background/background-h.gc +++ b/goal_src/jak3/engine/gfx/background/background-h.gc @@ -7,3 +7,25 @@ ;; DECOMP BEGINS +(deftype background-work (basic) + "List of all things for the background renderer to draw." + ((tfrag-tree-count int32) + (tfrag-trees drawable-tree-tfrag 11) + (tfrag-levels level 11) + (tfrag-trans-tree-count int32) + (tfrag-trans-trees drawable-tree-tfrag-trans 11) + (tfrag-trans-levels level 11) + (tfrag-water-tree-count int32) + (tfrag-water-trees drawable-tree-tfrag-water 11) + (tfrag-water-levels level 11) + (shrub-tree-count int32) + (shrub-trees drawable-tree-instance-shrub 11) + (shrub-levels level 11) + (tie-tree-count int32) + (tie-trees drawable-tree-instance-tie 11) + (tie-levels level 11) + (tie-generic basic 11) + (tie-generic-trans basic 11) + (wait-to-vu0 uint32) + ) + ) diff --git a/goal_src/jak3/engine/gfx/background/hfrag/hfrag-h.gc b/goal_src/jak3/engine/gfx/background/hfrag/hfrag-h.gc index d6c4674d3d..0ebc2c4959 100644 --- a/goal_src/jak3/engine/gfx/background/hfrag/hfrag-h.gc +++ b/goal_src/jak3/engine/gfx/background/hfrag/hfrag-h.gc @@ -7,3 +7,434 @@ ;; DECOMP BEGINS +(deftype adgif-shader-array (inline-array-class) + ((data adgif-shader :inline :dynamic) + ) + ) + + +(set! (-> adgif-shader-array heap-base) (the-as uint 80)) + +(deftype hfrag-montage (structure) + ((data uint16 16) + ) + ) + + +(deftype hfrag-bucket (structure) + ((next uint32) + (count uint16) + (vertex-count uint16) + (next-scissor uint32) + (count-scissor uint16) + (vertex-count-scissor uint16) + ) + ) + + +(deftype hfrag-packed-index (uint16) + () + ) + +(deftype hfrag-vertex (structure) + ((height uint16) + (packed-index hfrag-packed-index) + ) + ) + + +(deftype hfrag-vert-index (structure) + ((pos vector2ub :inline) + (index0 uint16 :offset 2) + (index1 uint16 :offset 4) + (index2 uint16 :offset 6) + ) + :pack-me + ) + + +(deftype hfrag-poly4 (structure) + ((data hfrag-vert-index 4 :inline) + ) + ) + + + +(deftype hfrag-poly9 (structure) + ((data hfrag-vert-index 9 :inline) + ) + ) + + + +(deftype hfrag-poly25 (structure) + ((data hfrag-vert-index 25 :inline) + ) + ) + + + +(deftype hfrag-poly4-chain (structure) + ((tag dma-packet :inline) + (verts vector4w-3 4 :inline) + (next dma-packet :inline :offset 208) + ) + ) + + +(deftype hfrag-poly9-chain (structure) + ((tag dma-packet :inline) + (verts vector4w-3 12 :inline) + (next dma-packet :inline :offset 592) + ) + ) + + +(deftype hfrag-poly25-chain (structure) + ((tag dma-packet :inline) + (verts vector4w-3 40 :inline) + (next dma-packet :inline) + ) + ) + + +(deftype hfrag-cache-vertex (structure) + ((color vector4w :inline) + (pos vector :inline) + (clip uint32 :overlay-at (-> pos data 3)) + ) + ) + + +(deftype hfrag-cache-line (structure) + ((data hfrag-cache-vertex 9 :inline) + ) + ) + + +(deftype hfrag-visbits (structure) + ((data uint8 128) + ) + ) + + +(deftype hfrag-gcf-control (structure) + ((matrix matrix :inline) + (giftag generic-gif-tag :inline) + (adnops gs-adcmd 2 :inline) + (num-strips uint32 :overlay-at (-> giftag data 3)) + (num-dps uint32 :overlay-at (-> adnops 0 word 3)) + (kick-offset uint32 :offset 108) + (shader gcf-shader :inline) + ) + ) + + +(deftype hfrag-gcf-ctrl (structure) + ((tag dma-packet :inline) + (control hfrag-gcf-control :inline) + ) + ) + + +(deftype hfrag-init-packet (structure) + ((init-tmpl dma-packet :inline) + (init-data uint32 8) + ) + ) + + +(deftype hfrag-sprite-coord (structure) + ((pos0 vector4w :inline) + (pos1 vector4w :inline) + ) + ) + + +(deftype hfrag-montage-coord (structure) + ((stq0 vector4 :inline) + (stq1 vector4 :inline) + ) + ) + + +(deftype hfrag-sprite-packet (structure) + ((sprite-tmpl dma-gif-packet :inline) + (color vector4w :inline) + (tex0 vector :inline) + (pos0 vector4w :inline) + (tex1 vector :inline) + (pos1 vector4w :inline) + ) + ) + + +(deftype hfrag-tex-data (structure) + ((quad qword 3 :inline) + (prims uint64 6 :overlay-at quad) + (reg-0 uint8 :overlay-at (-> quad 0 data 2)) + (reg-1 uint8 :overlay-at (-> prims 3)) + (reg-2 uint8 :overlay-at (-> prims 5)) + (tex0 uint64 :overlay-at (-> quad 0 data 0)) + (tex1 uint64 :overlay-at (-> prims 2)) + (texflush uint64 :overlay-at (-> prims 4)) + ) + ) + + +; (deftype hfrag-mip-packet (structure) +; ((mip-tmpl dma-gif-packet :inline) +; (tex0-1 vector :inline) +; (tex1-1 vector :inline) +; (texflush vector :inline) +; (color vector4w :inline) +; (tex0 vector :inline) +; (pos0 vector :inline) +; (tex1 vector :inline) +; (pos1 vector :inline) +; ) +; ) + + +(deftype hfrag-adgif-packet (structure) + ((adgif-tmpl dma-gif-packet :inline) + (adgif-data adgif-shader :inline) + ) + ) + + +(deftype hfrag-adgif-packet2 (structure) + ((adgif-tmpl dma-gif-packet :inline) + (adgif-data adgif-shader :inline) + (texflush uint128) + ) + ) + + +(deftype hfrag-frame (structure) + ((quad qword 4 :inline :offset 0) + (prims uint64 8 :overlay-at quad) + (reg-0 uint8 :overlay-at (-> prims 1)) + (reg-1 uint8 :overlay-at (-> prims 3)) + (reg-2 uint8 :overlay-at (-> prims 5)) + (reg-3 uint8 :overlay-at (-> prims 7)) + (frame uint64 :overlay-at (-> prims 0)) + (scissor uint64 :overlay-at (-> prims 2)) + (xyoffset uint64 :overlay-at (-> prims 4)) + (test uint64 :overlay-at (-> prims 6)) + ) + ) + + +(deftype hfrag-frame-packet (structure) + ((frame-tmpl dma-gif-packet :inline) + (frame-data hfrag-frame :inline) + ) + ) + + +(deftype hfragment (drawable) + ((start-corner vector :inline) + (spheres uint32) + (visids uint32) + (shaders (inline-array adgif-shader)) + (colors basic) + (montage uint32) + (buckets-far uint32) + (buckets-mid uint32) + (buckets-near uint32) + (verts uint32) + (pat-array uint32) + (pat-length uint16) + (num-buckets-far uint16) + (num-buckets-mid uint16) + (num-buckets-near uint16) + (size uint32 :overlay-at (-> start-corner data 3)) + ) + (:methods + (hfragment-method-17 () none) + (hfragment-method-18 () none) + (hfragment-method-19 () none) + (hfragment-method-20 () none) + (hfragment-method-21 () none) + ) + ) + + +(defmethod login ((this hfragment)) + "Initialize the object after it is loaded." + (dotimes (s5-0 3) + (adgif-shader-login (-> this shaders s5-0)) + (if (> s5-0 0) + (set! (-> this shaders s5-0 tex0 tcc) 0) + ) + (set! (-> this shaders 1 tex0 cbp) 3904) + (set! (-> this shaders 2 tex0 cbp) 3904) + ) + this + ) + +(deftype hfrag-dma (structure) + ((banka uint32 340) + (bankb uint32 340) + (outa uint128 227) + (outb uint128 227) + (cache hfrag-cache-line 8 :inline) + (colors rgba 1024) + ) + ) + + +(deftype hfrag-work (structure) + ((far-chaina dma-packet 6 :inline) + (far-chainb dma-packet 6 :inline) + (mid-chaina dma-packet 10 :inline) + (mid-chainb dma-packet 10 :inline) + (near-chaina dma-packet 18 :inline) + (near-chainb dma-packet 18 :inline) + (poly4-tmpl dma-packet 3 :inline) + (poly9-tmpl dma-packet 3 :inline) + (poly25-tmpl dma-packet 3 :inline) + (init-tmpl dma-packet 3 :inline) + (control-tmpl dma-packet 2 :inline :offset 1376) + (heights4-tmpl dma-packet 2 :inline) + (colors4-tmpl dma-packet 2 :inline) + (heights9-tmpl dma-packet 2 :inline) + (colors9-tmpl dma-packet 2 :inline) + (heights25-tmpl dma-packet 2 :inline) + (colors25-tmpl dma-packet 2 :inline) + (init-vu1-tmpl dma-packet 2 :inline) + (next-tmpl dma-packet :inline :offset 1696) + (call-tmpl dma-packet :inline) + (ret-tmpl dma-packet :inline) + (next-scissor-tmpl dma-packet :inline) + (ret-scissor-tmpl dma-packet :inline) + (frame-tmpl dma-gif-packet :inline) + (frames hfrag-frame 5 :inline) + (adgif-tmpl dma-gif-packet :inline) + (adgif-tmpl2 dma-gif-packet :inline) + (sprite-tmpl dma-gif-packet :inline) + (mip-tmpl dma-gif-packet :inline) + (color uint128 6) + (far-data hfrag-sprite-coord :inline) + (near-data vector4w-2 16 :inline) + (mip-data vector4w-3 7 :inline :offset 2896) + (tex-data hfrag-tex-data 5 :offset 3120) + (tex uint128 6 :offset 3360) + (montage-tex-coords uint128 128 :offset 3456) + (giftag generic-gif-tag :inline :offset 7552) + (call-abort dma-packet :inline) + (call-abort-vu1 dma-packet :inline) + (shader-far adgif-shader :inline) + (shader-mid adgif-shader :inline) + (shader-near adgif-shader :inline) + (stq uint128 9) + (shader adgif-shader :inline) + (constants vector :inline) + (pos-temp vector4w :inline) + (trans-temp vector :inline :overlay-at (-> pos-temp data 0)) + (dists vector :inline) + (rdists vector :inline) + (call-poly4-near uint32) + (call-poly9-mid uint32) + (call-poly9-near uint32) + (call-poly25-far uint32) + (call-poly25-mid uint32) + (dma-buffer basic) + (base uint32) + (wait-to-spr uint32) + (wait-from-spr uint32) + (buffer-end uint32) + (subdiv-index uint32) + (scissor basic) + (chain-ptr uint32) + (chain-ptr-next uint32) + (near-dist float) + (far-dist float) + (to-spr uint32) + (from-spr uint32) + (lowres-flag basic) + (hfrag hfragment :inline) + (next-far int16) + (next-far-mid int16) + (next-mid int16) + (next-near-mid int16) + (next-near int16) + (next-far-scissor int16) + (next-near-mid-scissor int16) + (next-near-scissor int16) + (count-far int16) + (count-far-mid int16) + (count-mid int16) + (count-near-mid int16) + (count-near int16) + (count-far-scissor int16) + (count-near-mid-scissor int16) + (count-near-scissor int16) + (size-far int32) + (size-far-mid int32) + (size-mid int32) + (size-near-mid int32) + (size-near int32) + (size-far-scissor int32) + (size-near-mid-scissor int32) + (size-near-scissor int32) + (size-texture int32) + (poly-far hfrag-poly25) + (poly-mid25 uint32) + (poly-mid uint32) + (poly-near uint32) + (far-texture uint32) + (near-textures uint16 16) + (draw-table uint16 1024 :offset 8456) + (corners uint128 1024) + ) + (:methods + (hfrag-work-method-9 () none) + (hfrag-work-method-10 () none) + (hfrag-work-method-11 () none) + (hfrag-work-method-12 () none) + (hfrag-work-method-13 () none) + (hfrag-work-method-14 () none) + (hfrag-work-method-15 () none) + (hfrag-work-method-16 () none) + (hfrag-work-method-17 () none) + (hfrag-work-method-18 () none) + (hfrag-work-method-19 () none) + (hfrag-work-method-20 () none) + (hfrag-work-method-21 () none) + (hfrag-work-method-22 () none) + (hfrag-work-method-23 () none) + (hfrag-work-method-24 () none) + (hfrag-work-method-25 () none) + (hfrag-work-method-26 () none) + (hfrag-work-method-27 () none) + (hfrag-work-method-28 () none) + (hfrag-work-method-29 () none) + (hfrag-work-method-30 () none) + (hfrag-work-method-31 () none) + (hfrag-work-method-32 () none) + (hfrag-work-method-33 () none) + (hfrag-work-method-34 () none) + (hfrag-work-method-35 () none) + ) + ) + +(deftype hfrag-mip-packet (structure) + ((mip-tmpl dma-gif-packet :inline) + (tex0-1 vector :inline) + (tex1-1 vector :inline) + (texflush vector :inline) + (color vector4w :inline) + (tex0 vector :inline) + (pos0 vector :inline) + (tex1 vector :inline) + (pos1 vector :inline) + ) + ) + + +(deftype hfrag-mip-packet-array (structure) + ((data hfrag-mip-packet 6 :inline) + ) + ) diff --git a/goal_src/jak3/engine/gfx/background/subdivide-h.gc b/goal_src/jak3/engine/gfx/background/subdivide-h.gc index c43fc7083b..755b0eec94 100644 --- a/goal_src/jak3/engine/gfx/background/subdivide-h.gc +++ b/goal_src/jak3/engine/gfx/background/subdivide-h.gc @@ -7,3 +7,150 @@ ;; DECOMP BEGINS +(deftype subdivide-settings (basic) + "Input settings for distances for switching mesh level of details. +These are set by the level code and read by rendering code." + ((dist float 5) + (meters float 5) + (close float 12) + (far float 12) + ) + (:methods + (new (symbol type float float) _type_) + ) + ) + + +(defmethod new subdivide-settings ((allocation symbol) (type-to-make type) (arg0 float) (arg1 float)) + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (dotimes (v1-2 10) + (set! (-> v0-0 close v1-2) arg0) + (set! (-> v0-0 far v1-2) arg1) + ) + v0-0 + ) + ) + +(deftype subdivide-dists (structure) + "Unused subdivide distances. Internally, tfrag/tie figure these out instead." + ((data uint32 32 :offset 0) + (vector vector 8 :overlay-at (-> data 0)) + (k0s uint128 4 :overlay-at (-> data 0)) + (k1s uint128 4 :overlay-at (-> data 16)) + ) + ) + + +(deftype terrain-stats (structure) + "Desptie the name `terrain-stats`, these are more general triangle stats for all renderers." + ((pris tr-stat :inline) + (tie-generic tr-stat :inline) + (tie-vanish tr-stat :inline) + (tie tr-stat :inline) + (tie-scissor tr-stat :inline) + (tie-envmap tr-stat :inline) + (tie-envmap-scissor tr-stat :inline) + (tie-trans tr-stat :inline) + (tie-scissor-trans tr-stat :inline) + (tie-envmap-trans tr-stat :inline) + (tie-envmap-scissor-trans tr-stat :inline) + (tie-water tr-stat :inline) + (tie-scissor-water tr-stat :inline) + (tie-envmap-water tr-stat :inline) + (tie-envmap-scissor-water tr-stat :inline) + (shrub-near tr-stat :inline) + (shrub tr-stat :inline) + (tfrag-scissor tr-stat :inline) + (tfrag tr-stat :inline) + (billboard tr-stat :inline) + (tfrag-trans tr-stat :inline) + (tfrag-scissor-trans tr-stat :inline) + (tfrag-water tr-stat :inline) + (tfrag-scissor-water tr-stat :inline) + (trans-pris tr-stat :inline) + (trans-shrub tr-stat :inline) + (ocean-mid tr-stat :inline) + (ocean-near tr-stat :inline) + (shadow tr-stat :inline) + (hfrag tr-stat :inline) + (total tr-stat :inline) + ) + ) + + +(deftype background-area (structure) + "Scratchpad memory layout for most background rendering +This uses the full scratchpad so it should only be used when the stack isn't on the scratchpad (rendering code). +Interestingly, dma-area went from a union of all the -dma types to a plain array of bytes in jak 3." + ((dma-area uint8 14336) + (vis-list uint8 2048) + ) + ) + + +(deftype foreground-area (structure) + "Scratchpad memory layout for most foreground rendering." + ((generic-work generic-work :inline :offset 0) + (foreground-work foreground-work :inline :offset 0) + (joint-work joint-work :inline :offset 0) + (bone-mem bone-memory :inline :offset 0) + (shadow-work shadow-work :inline :offset 0) + ) + ) + + +(deftype region-prim-area (structure) + "Scratchpad memory layout for regions." + ((region-prim-list region-prim-list :inline) + (pos vector :inline) + (ray vector :inline :offset 1328) + (region-enter-count int32 :offset 1360) + (region-enter-list region 320) + (region-enter-prim-list drawable-region-sphere 320) + (region-exit-count int32) + (region-exit-list region 320) + (region-exit-prim-list drawable-region-sphere 320) + (region-inside-count int32) + (region-inside-list region 320) + (region-inside-prim-list drawable-region-sphere 320) + (region-start-count int32) + (region-start-list region 320) + (region-start-prim-list drawable-region-sphere 320) + ) + (:methods + (region-prim-area-method-9 () none) + (region-prim-area-method-10 () none) + (region-prim-area-method-11 () none) + (region-prim-area-method-12 () none) + ) + ) + + +(deftype sprite-area (structure) + "Scratchpad memory layout for sprites." + ((clock-data vector 22 :inline) + (buffer uint8 :dynamic) + ) + ) + + +(deftype work-area (structure) + "All scratchpad memory layouts." + ((background background-area :inline :offset 0) + (foreground foreground-area :inline :offset 0) + (region-prim region-prim-area :inline :offset 0) + (sprite sprite-area :inline :offset 0) + ) + ) + + +(deftype terrain-context (structure) + "Useless wrapper around work-area. (this added some stuff in jak 1)" + ((work work-area :inline) + ) + ) + + +(define *terrain-stats* (new 'global 'terrain-stats)) + +(define *collide-stats* (new 'global 'collide-stats)) diff --git a/goal_src/jak3/engine/gfx/background/tfrag/tfrag-h.gc b/goal_src/jak3/engine/gfx/background/tfrag/tfrag-h.gc index d35afe821f..d02d467aad 100644 --- a/goal_src/jak3/engine/gfx/background/tfrag/tfrag-h.gc +++ b/goal_src/jak3/engine/gfx/background/tfrag/tfrag-h.gc @@ -7,3 +7,210 @@ ;; DECOMP BEGINS +(deftype tfragment-stats (structure) + "Triangle and vertex stats for a single tfragment." + ((num-tris uint16 4) + (num-dverts uint16 4) + ) + ) + + +(deftype tfragment-debug-data (structure) + "Optional debug information (stats, lines) for a tfragment." + ((stats tfragment-stats :inline) + (debug-lines (array vector-array)) + ) + ) + + +(deftype generic-tfragment (structure) + "Unused. Could have been a way to render tfrag's through generic." + ((dummy int32) + ) + ) + + +(deftype tfragment (drawable) + "A tfrag mesh fragment. This is just references to DMA data, plus some metadata." + ((color-index uint16 :offset 6) + (debug-data tfragment-debug-data :offset 8) + (color-indices uint32 :offset 12) + (colors uint32 :overlay-at color-indices) + (dma-chain uint32 3 :offset 32) + (dma-common uint32 :overlay-at (-> dma-chain 0)) + (dma-level-0 uint32 :overlay-at dma-common) + (dma-base uint32 :overlay-at (-> dma-chain 1)) + (dma-level-1 uint32 :overlay-at (-> dma-chain 2)) + (dma-qwc uint8 4 :offset 44) + (shader (inline-array adgif-shader) :offset 48) + (num-shaders uint8 :offset 52) + (num-base-colors uint8 :offset 53) + (num-level0-colors uint8 :offset 54) + (num-level1-colors uint8 :offset 55) + (color-offset uint8 :offset 56) + (color-count uint8 :offset 57) + (texture-masks-index uint16 :offset 58) + (generic generic-tfragment :offset 60) + ) + ) + + +(deftype drawable-inline-array-tfrag (drawable-inline-array) + "Array of tfragments" + ((data tfragment 1 :inline) + (pad uint32) + ) + ) + +(deftype drawable-inline-array-tfrag-trans (drawable-inline-array-tfrag) + ((data2 tfragment 1 :inline) + (pad2 uint32) + ) + ) + +(deftype drawable-inline-array-tfrag-water (drawable-inline-array-tfrag) + ((data2 tfragment 1 :inline) + (pad2 uint32) + ) + ) + +(deftype drawable-tree-tfrag (drawable-tree) + "top level tfrag tree." + ((time-of-day-pal time-of-day-palette :offset 12) + (arrays drawable-inline-array :dynamic :offset 32) + ) + ) + +(deftype drawable-tree-tfrag-trans (drawable-tree-tfrag) + () + ) + +(deftype drawable-tree-tfrag-water (drawable-tree-tfrag-trans) + () + ) + +(deftype tfrag-dists (structure) + "Distances for mesh level-of-detail blending for use on VU1." + ((data uint32 16) + (vector vector 4 :overlay-at (-> data 0)) + (k0s vector 2 :overlay-at (-> data 0)) + (k1s vector 2 :overlay-at (-> data 8)) + ) + ) + + +(deftype tfrag-data (structure) + "Constants for VU1 data memory for tfrag rendering." + ((data uint32 56) + (vector vector 14 :overlay-at (-> data 0)) + (fog vector :inline :overlay-at (-> data 0)) + (val vector :inline :overlay-at (-> data 4)) + (strgif gs-gif-tag :inline :overlay-at (-> data 8)) + (fangif gs-gif-tag :inline :overlay-at (-> data 12)) + (adgif gs-gif-tag :inline :overlay-at (-> data 16)) + (hvdf-offset vector :inline :overlay-at (-> data 20)) + (hmge-scale vector :inline :overlay-at (-> data 24)) + (invh-scale vector :inline :overlay-at (-> data 28)) + (ambient vector :inline :overlay-at (-> data 32)) + (guard vector :inline :overlay-at (-> data 36)) + (dists tfrag-dists :inline :overlay-at (-> data 40)) + (k0s uint128 2 :overlay-at (-> data 40)) + (k1s uint128 2 :overlay-at (-> data 48)) + ) + ) + + +(deftype tfrag-control (structure) + "VU1 'control' data containing address and counters." + ((num-base-points uint32) + (num-shared-base-points uint32) + (num-level0-points uint32) + (num-shared-level0-points uint32) + (num-level1-points uint32) + (num-shared-level1-points uint32) + (ptr-vtxdata uint32) + (ptr-base-points uint32) + (ptr-shared-base-points uint32) + (ptr-level0-points uint32) + (ptr-shared-level0-points uint32) + (ptr-level1-points uint32) + (ptr-shared-level1-points uint32) + (ptr-draw-points uint32) + (ptr-interpolated-0 uint32) + (ptr-shared-interpolated-0 uint32) + (ptr-interpolated1 uint32) + (ptr-shared-interpolated1 uint32) + (ptr-strip-data uint32) + (ptr-texture-data uint32) + ) + ) + + +(deftype tfrag-stats (structure) + "TFRAG statistics computed on EE." + ((from int32) + (to int32) + (cnt int32) + (tris int32) + (tfaces int32) + (tfrags int32) + (dtris int32) + (base-verts int32) + (level0-verts int32) + (level1-verts int32) + (dma-cnt int32) + (dma-dta int32) + (dma-tex int32) + (strips int32) + (drawpoints int32) + (vif int32) + ) + ) + + +(deftype tfrag-packet (structure) + ((tag uint128 2) + ) + ) + + +(deftype tfrag-work (structure) + "Scratch space for generating TFRAG DMA." + ((base-tmpl dma-packet :inline) + (level-0-tmpl dma-packet :inline) + (common-tmpl dma-packet :inline) + (level-1-tmpl dma-packet :inline) + (color-tmpl dma-packet :inline) + (frag-dists vector :inline) + (min-dist vector :inline) + (color-ptr vector4w :inline) + (tr-stat-tfrag tr-stat) + (tr-stat-tfrag-scissor tr-stat) + (vu1-enable-tfrag int32) + (vu1-enable-tfrag-scissor int32) + (cur-vis-bits uint32) + (end-vis-bits uint32) + (src-ptr uint32) + (last-call uint32) + (dma-buffer basic) + (test-id uint32) + (wait-from-spr uint32) + (wait-to-spr uint32) + (near-wait-from-spr uint32) + (near-wait-to-spr uint32) + (max-fragment uint16) + (min-fragment uint16) + (texture-dists uint32) + ) + ) + + +(deftype tfrag-dma (structure) + "Memory layout for to/from scratchpad for tfrag." + ((banka tfragment 16 :inline) + (bankb tfragment 16 :inline) + (outa uint128 128) + (outb uint128 128) + (colors rgba 2047) + ) + ) diff --git a/goal_src/jak3/engine/gfx/background/tie/tie-h.gc b/goal_src/jak3/engine/gfx/background/tie/tie-h.gc index 2c029574ca..1e92f603e3 100644 --- a/goal_src/jak3/engine/gfx/background/tie/tie-h.gc +++ b/goal_src/jak3/engine/gfx/background/tie/tie-h.gc @@ -7,3 +7,308 @@ ;; DECOMP BEGINS +(deftype tie-fragment-debug (structure) + "Optional debug information about a tie-fragment." + ((num-tris uint16) + (num-dverts uint16) + (debug-lines (array vector-array)) + ) + ) + + +(deftype tie-fragment (drawable) + "A mesh fragment of a TIE. This is a chunk of mesh that is rendered by VU1, stored as DMA chains." + ((gif-ref (inline-array adgif-shader) :overlay-at id) + (point-ref uint32 :offset 8) + (color-index uint16 :offset 12) + (base-colors uint8 :offset 14) + (tex-count uint16 :offset 32) + (gif-count uint16 :offset 34) + (vertex-count uint16 :offset 36) + (color-count uint16) + (dp-ref uint32) + (dp-qwc uint32) + (generic-ref uint32) + (generic-count uint16) + (normal-count uint16) + (normal-ref uint32) + (debug tie-fragment-debug) + ) + ) + + +(deftype instance-tie (instance) + "A TIE model instance." + ((color-indices uint32 :offset 8) + (bucket-ptr prototype-bucket-tie :offset 12) + (max-scale uint16 :overlay-at (-> origin data 3)) + (rmin-scale uint16 :overlay-at (-> origin data 11)) + ) + ) + + +(deftype drawable-inline-array-instance-tie (drawable-inline-array) + "Array of tie instances stored in the level." + ((data instance-tie 1 :inline) + (pad uint32) + ) + ) + +(deftype drawable-tree-instance-tie (drawable-tree) + "Top-level drawable-tree for TIEs" + ((prototypes proxy-prototype-array-tie :offset 8) + ) + ) + + +(deftype prototype-tie (drawable-inline-array) + "Prototype for a TIE: just an array of fragments." + ((data tie-fragment 1 :inline) + (pad uint32) + ) + ) + +(deftype tie-matrix (structure) + "Per-instance matrix for TIE VU1 rendering." + ((mat matrix :inline) + (morph qword :inline) + (fog qword :inline) + (envmap-flag uint32 :overlay-at (-> fog data 0)) + (guard-flag uint32 :overlay-at (-> fog data 1)) + (vertex-alpha float :overlay-at (-> fog data 2)) + (fog-value float :overlay-at (-> fog data 3)) + (fixed-alpha float :overlay-at (-> morph data 1)) + ) + ) + + +(deftype instance-tie-work (structure) + "workspace for TIE instance DMA generation" + ((wind-const vector :inline) + (hmge-d vector :inline) + (hvdf-offset vector :inline) + (wind-force vector :inline) + (constant vector :inline) + (far-morph vector :inline) + (dist-test vector :inline) + (min-dist vector :inline) + (guard-plane plane 4 :inline) + (upload-color-0 dma-packet :inline) + (upload-color-1 dma-packet :inline) + (upload-color-2 dma-packet :inline) + (upload-color-ret dma-packet :inline) + (upload-color-temp dma-packet :inline) + (generic-color-0 dma-packet :inline) + (generic-color-1 dma-packet :inline) + (generic-color-end dma-packet :inline) + (envmap-color-0 dma-packet :inline) + (envmap-color-1 dma-packet :inline) + (tie-scissor-perspective-matrix matrix :inline) + (tod-env-color vector :inline) + (morph-temp vector :inline) + (fog-temp vector :inline) + (fade-temp float) + (wind-vectors uint32) + (test-id uint32) + (test-id2 uint32) + (dma-buffer basic) + (to-spr uint32) + (from-spr uint32) + (wind-work uint32) + (cur-vis-bits uint32) + (end-vis-bits uint32) + (refl-fade-fac float) + (refl-fade-end float) + (flags uint32) + (vanish-flag uint32) + (translucent-flag uint32) + (wait-from-spr uint32) + (wait-to-spr uint32) + (use-etie symbol) + (buffer-start uint32) + (buffer-end uint32) + (tfrag-dists uint32) + (alpha-dists uint32) + (water-dists uint32) + ) + ) + + +(deftype instance-tie-dma (structure) + "Scratchpad memory layout for TIE instance DMA generation." + ((banka instance-tie 32 :inline) + (bankb instance-tie 32 :inline) + (outa uint128 256) + (outb uint128 256) + (work instance-tie-work :dynamic) + ) + ) + + +(deftype prototype-tie-work (structure) + "workspace for TIE protype DMA generation." + ((upload-flushe dma-packet :inline) + (upload-palette dma-packet :inline) + (upload-model-0 dma-packet :inline) + (upload-model-1 dma-packet :inline) + (upload-model-2 dma-packet :inline) + (upload-model-3 dma-packet :inline) + (upload-model-near-0 dma-packet :inline) + (upload-model-near-1 dma-packet :inline) + (upload-model-near-2 dma-packet :inline) + (upload-model-near-3 dma-packet :inline) + (upload-model-near-4 dma-packet :inline) + (envmap-palette dma-packet :inline) + (envmap-shader dma-packet :inline) + (upload-envmap-0 dma-packet :inline) + (upload-envmap-1 dma-packet :inline) + (upload-envmap-2 dma-packet :inline) + (upload-envmap-3 dma-packet :inline) + (upload-envmap-4 dma-packet :inline) + (upload-envmap-scissor-4 dma-packet :inline) + (generic-palette dma-packet :inline) + (generic-model-0 dma-packet :inline) + (generic-model-1 dma-packet :inline) + (generic-model-2 dma-packet :inline) + (model-next dma-packet :inline) + (clamp uint64) + (prototype-array basic) + (wait-from-spr uint32) + (wait-to-spr uint32) + (mood mood-context) + (last uint32 16 :offset 416) + (next uint32 16) + (count uint16 16) + (tie-last uint32 :overlay-at (-> last 0)) + (tie-next uint32 :overlay-at (-> next 0)) + (tie-count uint16 :overlay-at (-> count 0)) + (trans-last uint32 :overlay-at (-> last 1)) + (trans-next uint32 :overlay-at (-> next 1)) + (trans-count uint16 :overlay-at (-> count 1)) + (water-last uint32 :overlay-at (-> last 2)) + (water-next uint32 :overlay-at (-> next 2)) + (water-count uint16 :overlay-at (-> count 2)) + (scissor-last uint32 :overlay-at (-> last 3)) + (scissor-next uint32 :overlay-at (-> next 3)) + (scissor-count uint16 :overlay-at (-> count 3)) + (scissor-trans-last uint32 :overlay-at (-> last 4)) + (scissor-trans-next uint32 :overlay-at (-> next 4)) + (scissor-trans-count uint16 :overlay-at (-> count 4)) + (scissor-water-last uint32 :overlay-at (-> last 5)) + (scissor-water-next uint32 :overlay-at (-> next 5)) + (scissor-water-count uint16 :overlay-at (-> count 5)) + (envmap-last uint32 :overlay-at (-> last 6)) + (envmap-next uint32 :overlay-at (-> next 6)) + (envmap-count uint16 :overlay-at (-> count 6)) + (envmap-trans-last uint32 :overlay-at (-> last 7)) + (envmap-trans-next uint32 :overlay-at (-> next 7)) + (envmap-trans-count uint16 :overlay-at (-> count 7)) + (envmap-water-last uint32 :overlay-at (-> last 8)) + (envmap-water-next uint32 :overlay-at (-> next 8)) + (envmap-water-count uint16 :overlay-at (-> count 8)) + (envmap-scissor-last uint32 :overlay-at (-> last 9)) + (envmap-scissor-next uint32 :overlay-at (-> next 9)) + (envmap-scissor-count uint16 :overlay-at (-> count 9)) + (envmap-scissor-trans-last uint32 :overlay-at (-> last 10)) + (envmap-scissor-trans-next uint32 :overlay-at (-> next 10)) + (envmap-scissor-trans-count uint16 :overlay-at (-> count 10)) + (envmap-scissor-water-last uint32 :overlay-at (-> last 11)) + (envmap-scissor-water-next uint32 :overlay-at (-> next 11)) + (envmap-scissor-water-count uint16 :overlay-at (-> count 11)) + (generic-last uint32 :overlay-at (-> last 12)) + (generic-next uint32 :overlay-at (-> next 12)) + (generic-count uint16 :overlay-at (-> count 12)) + (generic-trans-last uint32 :overlay-at (-> last 13)) + (generic-trans-next uint32 :overlay-at (-> next 13)) + (generic-trans-count uint16 :overlay-at (-> count 13)) + (generic-water-last uint32 :overlay-at (-> last 14)) + (generic-water-next uint32 :overlay-at (-> next 14)) + (generic-water-count uint16 :overlay-at (-> count 14)) + (vanish-last uint32 :overlay-at (-> last 15)) + (vanish-next uint32 :overlay-at (-> next 15)) + (vanish-count uint16 :overlay-at (-> count 15)) + ) + ) + + +(deftype prototype-tie-dma (structure) + ((colora rgba 256) + (colorb rgba 256) + (outa uint128 256) + (outb uint128 256) + (geometry uint32 4) + (next uint32 12) + (count uint16 12) + (counts uint32 4) + (palette-ptr uint32 :overlay-at (-> counts 2)) + (model-ptr uint32 :overlay-at (-> counts 3)) + (ret-ptr uint32) + (length uint32) + (flags uint32) + (dma-buffer basic) + (this-frag-count uint32) + (frag-count uint8 4) + (from-spr uint32) + (to-spr uint32) + (spr-out uint32) + (this-count uint32) + (scissor-geometry uint32 :overlay-at (-> geometry 0)) + (near-geometry uint32 :overlay-at (-> geometry 1)) + (mid-geometry uint32 :overlay-at (-> geometry 2)) + (far-geometry uint32 :overlay-at (-> geometry 3)) + (scissor-frag-count uint8 :overlay-at (-> frag-count 0)) + (near-frag-count uint8 :overlay-at (-> frag-count 1)) + (mid-frag-count uint8 :overlay-at (-> frag-count 2)) + (far-frag-count uint8 :overlay-at (-> frag-count 3)) + (tie-scissor-next uint32 :overlay-at (-> next 0)) + (tie-near-next uint32 :overlay-at (-> next 1)) + (tie-mid-next uint32 :overlay-at (-> next 2)) + (tie-far-next uint32 :overlay-at (-> next 3)) + (trans-scissor-next uint32 4 :overlay-at (-> next 0)) + (trans-near-next uint32 :overlay-at (-> next 1)) + (trans-mid-next uint32 :overlay-at (-> next 2)) + (trans-far-next uint32 :overlay-at (-> next 3)) + (water-scissor-next uint32 4 :overlay-at (-> next 0)) + (water-near-next uint32 :overlay-at (-> next 1)) + (water-mid-next uint32 :overlay-at (-> next 2)) + (water-far-next uint32 :overlay-at (-> next 3)) + (envmap-scissor-next uint32 4 :overlay-at (-> next 4)) + (envmap-near-next uint32 :overlay-at (-> next 5)) + (envmap-mid-next uint32 :overlay-at (-> next 6)) + (envmap-far-next uint32 :overlay-at (-> next 7)) + (generic-near-next uint32 :overlay-at (-> next 8)) + (generic-mid-next uint32 :overlay-at (-> next 9)) + (generic-far-next uint32 :overlay-at (-> next 10)) + (vanish-next uint32 :overlay-at (-> next 11)) + (tie-count uint16 :overlay-at (-> count 0)) + (tie-scissor-count uint16 :overlay-at (-> count 0)) + (tie-near-count uint16 :overlay-at (-> count 1)) + (tie-mid-count uint16 :overlay-at (-> count 2)) + (tie-far-count uint16 :overlay-at (-> count 3)) + (trans-count uint16 :overlay-at (-> count 0)) + (trans-scissor-count uint16 :overlay-at (-> count 0)) + (trans-near-count uint16 :overlay-at (-> count 1)) + (trans-mid-count uint16 :overlay-at (-> count 2)) + (trans-far-count uint16 :overlay-at (-> count 3)) + (water-count uint16 :overlay-at (-> count 0)) + (water-scissor-count uint16 :overlay-at (-> count 0)) + (water-near-count uint16 :overlay-at (-> count 1)) + (water-mid-count uint16 :overlay-at (-> count 2)) + (water-far-count uint16 :overlay-at (-> count 3)) + (envmap-count uint16 :overlay-at (-> count 4)) + (envmap-scissor-count uint16 :overlay-at (-> count 4)) + (envmap-near-count uint16 :overlay-at (-> count 5)) + (envmap-mid-count uint16 :overlay-at (-> count 6)) + (envmap-far-count uint16 :overlay-at (-> count 7)) + (generic-count uint16 :overlay-at (-> count 8)) + (generic-near-count uint16 :overlay-at (-> count 8)) + (generic-mid-count uint16 :overlay-at (-> count 9)) + (generic-far-count uint16 :overlay-at (-> count 10)) + (vanish-count uint16 :overlay-at (-> count 11)) + (next-clear uint32 3 :overlay-at (-> next 0)) + (count-clear uint16 3 :overlay-at (-> count 0)) + ) + ) + + +(define *instance-tie-work-copy* (the-as instance-tie-work #f)) diff --git a/goal_src/jak3/engine/gfx/shrub/shrubbery-h.gc b/goal_src/jak3/engine/gfx/shrub/shrubbery-h.gc index 1eac07d349..b6ccf2382f 100644 --- a/goal_src/jak3/engine/gfx/shrub/shrubbery-h.gc +++ b/goal_src/jak3/engine/gfx/shrub/shrubbery-h.gc @@ -7,3 +7,238 @@ ;; DECOMP BEGINS +(deftype billboard (drawable) + "A billboard for shrubbery in the distance. This is simple a quad that faces the camera. +The only data needed is the texture/mode. The location is determined by bsphere." + ((flat adgif-shader :inline) + ) + ) + + +(deftype shrub-view-data (structure) + "Camera and general settings for shrubbery VU1 program." + ((data uint128 3) + (texture-giftag gs-gif-tag :inline :overlay-at (-> data 0)) + (consts vector :inline :overlay-at (-> data 1)) + (fog-clamp vector :inline :overlay-at (-> data 2)) + (tex-start-ptr int32 :overlay-at (-> data 1)) + (gifbufsum float :overlay-at (-> data 1)) + (mtx-buf-ptr int32 :overlay-at (-> consts y)) + (exp23 float :overlay-at mtx-buf-ptr) + (fog-0 float :overlay-at (-> consts z)) + (fog-1 float :overlay-at (-> consts w)) + (fog-min float :overlay-at (-> data 2)) + (fog-max float :overlay-at (-> fog-clamp y)) + ) + ) + + +(deftype shrubbery (drawable) + "Prototype (mesh/geometry) for a shrub. not _really_ a drawable in any way, as it +overwrites all the normal drawable fields." + ((textures (inline-array adgif-shader) :overlay-at id) + (header qword :offset 8) + (obj-qwc uint8 :offset 12) + (vtx-qwc uint8 :offset 13) + (col-qwc uint8 :offset 14) + (stq-qwc uint8 :offset 15) + (obj uint32 :overlay-at (-> bsphere data 0)) + (vtx uint32 :overlay-at (-> bsphere data 1)) + (col uint32 :overlay-at (-> bsphere data 2)) + (stq uint32 :overlay-at (-> bsphere data 3)) + ) + ) + + +(deftype instance-shrubbery (instance) + "Instance of a shrub." + ((flat-normal vector :inline) + (flat-hwidth float :overlay-at (-> flat-normal data 3)) + (color uint32 :offset 8) + ) + ) + + +(deftype drawable-inline-array-instance-shrub (drawable-inline-array) + "Array of shrub instances stored in the level data." + ((data instance-shrubbery 1 :inline) + (pad uint32) + ) + ) + +(deftype drawable-tree-instance-shrub (drawable-tree) + "Drawable-tree for the shrubs." + () + ) + +(deftype generic-shrub-fragment (drawable) + "Shrub data, converted into the format for generic. +The shrub renderer doesn't support clipping, so it falls back to generic. +This requires storing the data for all shrubs prototype twice!" + ((textures (inline-array adgif-shader) :overlay-at id) + (vtx-cnt uint32 :offset 8) + (cnt-qwc uint8 :offset 12) + (vtx-qwc uint8 :offset 13) + (col-qwc uint8 :offset 14) + (stq-qwc uint8 :offset 15) + (cnt uint32 :overlay-at (-> bsphere data 0)) + (vtx uint32 :overlay-at (-> bsphere data 1)) + (col uint32 :overlay-at (-> bsphere data 2)) + (stq uint32 :overlay-at (-> bsphere data 3)) + ) + ) + + +(deftype prototype-shrubbery (drawable-inline-array) + "Array of shrub prototypes." + ((data shrubbery 1 :inline) + (pad uint32) + ) + ) + +(deftype prototype-trans-shrubbery (prototype-shrubbery) + "Array of transparent shrub prototypes." + () + ) + +(deftype prototype-generic-shrub (drawable-group) + () + ) + +(deftype shrubbery-matrix (structure) + "Instance matrix for a shrub, contains interpolated color." + ((mat matrix :inline) + (color qword :inline) + ) + ) + + +;; WARN: Return type mismatch symbol vs none. +(defun shrubbery-login-post-texture ((arg0 shrubbery)) + "Do some weird fix-up to the shrubbery textures. this is likely to present normal-looking adgifs to the texture system, but then we scramble them up for easier consumption by VU1." + (let* ((v1-1 (-> arg0 header data 0)) + (a1-1 (the-as object (+ (the-as uint (-> arg0 header)) (* (+ (-> arg0 header data 1) 1) 16)))) + (a2-5 (the-as object (+ (the-as int a1-1) (* v1-1 64)))) + (a3-0 (the-as object (-> arg0 textures))) + ) + (dotimes (a0-1 (the-as int v1-1)) + (set! (-> (the-as qword a2-5) quad) (-> (the-as qword a3-0) quad)) + (let ((a2-6 (the-as object (+ (the-as int a2-5) 16))) + (a3-1 (the-as object (&+ (the-as pointer a3-0) 16))) + ) + (set! (-> (the-as qword a1-1) vector4w x) (the-as int (-> (the-as qword a3-1) data 0))) + (set! (-> (the-as qword a1-1) vector4w y) (the-as int (-> (the-as qword a3-1) data 1))) + (set! (-> (the-as qword a1-1) vector4w z) (the-as int (-> (the-as qword a3-1) data 2))) + (set! a1-1 (+ (the-as int a1-1) 16)) + (let ((a3-2 (the-as object (&+ (the-as pointer a3-1) 16)))) + (dotimes (t0-4 3) + (set! (-> (the-as qword a1-1) quad) (-> (the-as qword a3-2) quad)) + (set! a1-1 (+ (the-as int a1-1) 16)) + (set! a3-2 (&+ (the-as pointer a3-2) 16)) + ) + (set! (-> (the-as qword a2-6) quad) (-> (the-as qword a3-2) quad)) + (set! a2-5 (+ (the-as int a2-6) 16)) + (set! a3-0 (&+ (the-as pointer a3-2) 80)) + ) + ) + ) + ) + (none) + ) + +(define *shrub-state* 0) + +(deftype shrub-near-packet (structure) + "DMA templates for generic rendering of shrubs." + ((matrix-tmpl dma-packet :inline) + (header-tmpl dma-packet :inline) + (stq-tmpl dma-packet :inline) + (color-tmpl dma-packet :inline) + (vertex-tmpl dma-packet :inline) + (mscal-tmpl dma-packet :inline) + (init-tmpl dma-packet :inline) + (init-data qword 8) + ) + ) + + +(deftype instance-shrub-work (structure) + "Scratchpad layout for generating shrub DMA." + ((dummy qword 3 :inline) + (chaina qword 8 :inline) + (chainb qword 8 :inline) + (colors rgba 1024) + (matrix-tmpl qword 20 :inline) + (count-tmpl vector4w 20 :inline) + (mscalf-tmpl dma-packet :inline) + (mscalf-ret-tmpl dma-packet :inline) + (adgif-tmpl dma-gif-packet :inline) + (billboard-tmpl dma-gif-packet :inline) + (billboard-const vector :inline) + (shrub-near-packets shrub-near-packet 6 :inline) + (dma-ref dma-packet :inline) + (dma-end dma-packet :inline) + (wind-const vector :inline) + (constants vector :inline) + (color-constant vector4w :inline) + (hmge-d vector :inline) + (hvdf-offset vector :inline) + (wind-force vector :inline) + (color vector :inline) + (bb-color vector :inline) + (min-dist vector :inline) + (temp-vec vector :inline) + (guard-plane plane 4 :inline) + (plane plane 4 :inline) + (last uint32 4) + (next uint32 4) + (count uint16 4) + (mod-count uint16 4) + (wind-vectors uint32) + (instance-ptr uint32) + (chain-ptr uint32) + (chain-ptr-next uint32) + (stack-ptr uint32) + (bucket-ptr uint32) + (src-ptr uint32) + (to-spr uint32) + (from-spr uint32) + (shrub-count uint32) + (stack-ptr2 uint32 :overlay-at stack-ptr) + (node uint32 6 :offset 6428) + (length uint32 6) + (prototypes uint32) + (bucket-ptr2 uint32 :overlay-at bucket-ptr) + (start-bank uint8 20 :offset 6484) + (buffer-index uint32) + (current-spr uint32) + (current-mem uint32) + (current-shrub-near-packet uint32) + (current-shrub-near-trans-packet uint32) + (to-spr2 uint32 :overlay-at to-spr) + (dma-buffer basic :offset 6528) + (near-last uint32) + (near-next uint32) + (near-count uint32) + (near-trans-last uint32) + (near-trans-next uint32) + (near-trans-count uint32) + (last-shrubs uint32) + (chains uint32) + (flags uint32) + (node-count uint32) + (inst-count uint32) + (wait-from-spr uint32) + (wait-to-spr uint32) + (texture-dists uint32) + ) + ) + + +(deftype instance-shrub-dma (structure) + ((instancea uint128 325) + (instanceb uint128 325) + (outa uint128 128) + (outb uint128 128) + ) + ) diff --git a/goal_src/jak3/engine/gfx/sprite/particles/sparticle-launcher-h.gc b/goal_src/jak3/engine/gfx/sprite/particles/sparticle-launcher-h.gc index da962c5931..f3a61ddacb 100644 --- a/goal_src/jak3/engine/gfx/sprite/particles/sparticle-launcher-h.gc +++ b/goal_src/jak3/engine/gfx/sprite/particles/sparticle-launcher-h.gc @@ -5,5 +5,219 @@ ;; name in dgo: sparticle-launcher-h ;; dgos: GAME +(declare-type sprite-vec-data-3d structure) +(declare-type sparticle-cpuinfo structure) +(declare-type sparticle-system structure) + +(defenum sp-field-id + :type uint16 + ) + +(defenum sp-flag + :type uint16 + ) + +(defenum sp-group-item-flag + :bitfield #t + :type uint16 + ) + +(defenum sp-launch-state-flags + :bitfield #t + :type uint16 + ) + +(defenum sp-group-flag + :bitfield #t + :type uint16 + ) + ;; DECOMP BEGINS +(deftype sparticle-birthinfo (structure) + "Used internally by the sparticle code." + ((sprite uint32) + (anim int32) + (anim-speed float) + (birth-func basic) + (joint-ppoint int32) + (num-to-birth float) + (sound basic) + (dataf float 1 :overlay-at sprite) + (data uint32 1 :overlay-at sprite) + ) + ) + + +(deftype sp-field-init-spec (structure) + "Part of a particle definition - how to initialize a field of a particle." + ((field sp-field-id) + (flags sp-flag) + (initial-valuef float) + (random-rangef float) + (random-multf float) + (initial-value int32 :overlay-at initial-valuef) + (random-range int32 :overlay-at random-rangef) + (random-mult int32 :overlay-at random-multf) + (func symbol :overlay-at initial-valuef) + (tex texture-id :overlay-at initial-valuef) + (pntr pointer :overlay-at initial-valuef) + (object basic :overlay-at initial-valuef) + (sym symbol :overlay-at initial-valuef) + (sound sound-spec :overlay-at initial-valuef) + ) + ) + + +(deftype sparticle-launcher (basic) + "A definition of a single particle, as a list of init specs." + ((birthaccum float) + (soundaccum float) + (init-specs (inline-array sp-field-init-spec)) + ) + (:methods + (get-field-spec-by-id (_type_ sp-field-id) sp-field-init-spec) + (setup-special-textures (_type_ string) none) + ) + ) + + +(deftype sparticle-group-item (structure) + "A reference to a single sparticle-launcher (by ID) and some parameters for using it." + ((launcher uint32) + (fade-after meters) + (falloff-to meters) + (flags sp-group-item-flag) + (period uint16) + (length uint16) + (offset int16) + (hour-mask uint32) + (binding uint32) + ) + ) + + +(deftype sparticle-launch-state (structure) + "The state associated with a launcher of a given sparticle." + ((group-item sparticle-group-item) + (flags sp-launch-state-flags) + (randomize uint16) + (center vector) + (sprite3d sprite-vec-data-3d) + (sprite sparticle-cpuinfo) + (offset uint32) + (accum float) + (spawn-time uint32) + (control sparticle-launch-control) + (swarm basic :overlay-at offset) + (seed uint32 :overlay-at accum) + (time uint32 :overlay-at spawn-time) + (spec basic :overlay-at sprite) + (id uint32 :overlay-at sprite3d) + ) + ) + + +(deftype sparticle-launch-group (basic) + "Definition of multiple a particle-group, which is a collection of particle effects." + ((length int16) + (duration uint16) + (linger-duration uint16) + (flags sp-group-flag) + (name string) + (launcher (inline-array sparticle-group-item)) + (rotate-x degrees) + (rotate-y degrees) + (rotate-z degrees) + (scale-x float) + (scale-y float) + (scale-z float) + (bounds sphere :inline) + ) + (:methods + (create-launch-control (_type_ process) sparticle-launch-control) + ) + ) + + +(define *launch-matrix* (matrix-identity! (new 'global 'matrix))) + +(deftype sparticle-launch-control (inline-array-class) + "Top-level type containing all the state needed to launch a particle group. +These are typically owned by a process, and allocated on the process heap. +These refer to static particle definitions, and then spawn particles that are tracked by the +particle system itself. This type just holds the launching-related state." + ((group sparticle-launch-group) + (proc process-drawable) + (local-clock int32) + (fade float) + (matrix int8) + (state-mode uint8 3) + (state-counter uint32) + (local-space-binding particle-local-space-info :overlay-at fade) + (last-spawn-frame int32) + (last-spawn-time int32) + (origin matrix :inline) + (center vector :inline :overlay-at (-> origin data 12)) + (data sparticle-launch-state :inline :dynamic) + ) + (:methods + (sparticle-launch-control-method-14 () none) + (sparticle-launch-control-method-15 () none) + (sparticle-launch-control-method-16 () none) + (sparticle-launch-control-method-17 () none) + (sparticle-launch-control-method-18 () none) + (sparticle-launch-control-method-19 () none) + (sparticle-launch-control-method-20 () none) + ) + ) + + +(set! (-> sparticle-launch-control heap-base) (the-as uint 48)) + +(deftype sparticle-subsampler (basic) + ((spt-num float) + (sp-system sparticle-system) + (sp-launcher sparticle-launcher) + (spawn-mat matrix :inline) + (inited? basic) + ) + (:methods + (new (symbol type sparticle-system sparticle-launcher float) _type_) + (sparticle-subsampler-method-9 () none) + (sparticle-subsampler-method-10 () none) + ) + ) + + +(defmethod new sparticle-subsampler ((allocation symbol) (type-to-make type) (arg0 sparticle-system) (arg1 sparticle-launcher) (arg2 float)) + (let ((s3-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (if (zero? s3-0) + (go process-drawable-art-error "sparticle-subsampler") + ) + (set! (-> s3-0 sp-launcher) arg1) + (set! (-> s3-0 inited?) #f) + (set! (-> s3-0 sp-system) arg0) + (set! (-> s3-0 spt-num) arg2) + (matrix-identity! (-> s3-0 spawn-mat)) + s3-0 + ) + ) + +(defun compute-rot-in-screenspace ((arg0 vector)) + "Unclear what this does, but I'm not actually sure it makes sense. Unused" + 0.0 + (let ((a0-1 (-> (math-camera-matrix) fvec))) + 0.0 + (let ((v1-0 (new 'stack-no-clear 'vector))) + (let ((f0-3 (vector-dot a0-1 arg0))) + (vector-float*! v1-0 a0-1 f0-3) + ) + (vector-! arg0 arg0 v1-0) + ) + ) + (let ((a2-1 (matrix-transpose! (new 'stack-no-clear 'matrix) (math-camera-matrix)))) + (vector-matrix*! arg0 arg0 a2-1) + ) + (the float (sar (shl (the int (atan (-> arg0 y) (* -1.0 (-> arg0 x)))) 48) 48)) + ) diff --git a/test/decompiler/reference/jak3/engine/collide/collide-cache-h_REF.gc b/test/decompiler/reference/jak3/engine/collide/collide-cache-h_REF.gc new file mode 100644 index 0000000000..d0d8f66076 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/collide/collide-cache-h_REF.gc @@ -0,0 +1,252 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type collide-puss-sphere +(deftype collide-puss-sphere (structure) + "A query sphere from the user for the porbe-using-spheres query. +This is used internally by the collide-cache implementation." + ((bsphere sphere :inline) + (bbox4w bounding-box4w :inline) + ) + ) + +;; definition for method 3 of type collide-puss-sphere +(defmethod inspect ((this collide-puss-sphere)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'collide-puss-sphere) + (format #t "~1Tbsphere: #~%" (-> this bsphere)) + (format #t "~1Tbbox4w: #~%" (-> this bbox4w)) + (label cfg-4) + this + ) + +;; definition of type collide-puss-work +(deftype collide-puss-work (structure) + "Scratchpad memory map for probe-using-spheres query." + ((closest-pt vector :inline) + (tri-normal vector :inline) + (tri-bbox4w bounding-box4w :inline) + (spheres-bbox4w bounding-box4w :inline) + (spheres collide-puss-sphere 64 :inline) + ) + (:methods + (check-mesh-prim-against-spheres (_type_ collide-cache-prim collide-using-spheres-params) symbol) + (check-sphere-prim-against-spheres (_type_ collide-cache-prim collide-using-spheres-params) symbol) + ) + ) + +;; definition for method 3 of type collide-puss-work +(defmethod inspect ((this collide-puss-work)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'collide-puss-work) + (format #t "~1Tclosest-pt: #~%" (-> this closest-pt)) + (format #t "~1Ttri-normal: #~%" (-> this tri-normal)) + (format #t "~1Ttri-bbox4w: #~%" (-> this tri-bbox4w)) + (format #t "~1Tspheres-bbox4w: #~%" (-> this spheres-bbox4w)) + (format #t "~1Tspheres[64] @ #x~X~%" (-> this spheres)) + (label cfg-4) + this + ) + +;; definition of type collide-cache-tri +(deftype collide-cache-tri (structure) + "A single triangle inside the collision cache. +Contains a reference back to the source object (like a collide-shape or water-control), and the prim itself." + ((vertex vector 3 :inline) + (extra-quad uint8 16) + (pat pat-surface :overlay-at (-> extra-quad 0)) + (collide-ptr basic :overlay-at (-> extra-quad 4)) + (prim-index uint16 :overlay-at (-> extra-quad 8)) + (user16 uint16 :overlay-at (-> extra-quad 10)) + (user32 uint32 :overlay-at (-> extra-quad 12)) + ) + ) + +;; definition for method 3 of type collide-cache-tri +(defmethod inspect ((this collide-cache-tri)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'collide-cache-tri) + (format #t "~1Tvertex[3] @ #x~X~%" (-> this vertex)) + (format #t "~1Textra-quad[16] @ #x~X~%" (-> this extra-quad)) + (format #t "~1Tpat: ~D~%" (-> this pat)) + (format #t "~1Tcollide-ptr: ~A~%" (-> this collide-ptr)) + (format #t "~1Tprim-index: ~D~%" (-> this prim-index)) + (format #t "~1Tuser16: ~D~%" (-> this user16)) + (format #t "~1Tuser32: ~D~%" (-> this user32)) + (label cfg-4) + this + ) + +;; definition of type collide-cache-prim +(deftype collide-cache-prim (structure) + "A primitive inside the collide-cache. +This can represent a sphere, a triangle mesh, or a group of other primitives within a bounding sphere." + ((prim-core collide-prim-core :inline) + (extra-quad uint8 16) + (ccache collide-cache :overlay-at (-> extra-quad 0)) + (prim collide-shape-prim :overlay-at (-> extra-quad 4)) + (first-tri uint16 :overlay-at (-> extra-quad 8)) + (num-tris uint16 :overlay-at (-> extra-quad 10)) + (unused uint8 4 :overlay-at (-> extra-quad 12)) + (world-sphere vector :inline :overlay-at (-> prim-core world-sphere)) + (collide-as collide-spec :overlay-at (-> prim-core collide-as)) + (action collide-action :overlay-at (-> prim-core action)) + (prim-type prim-type :overlay-at (-> prim-core prim-type)) + ) + (:methods + (collide-cache-prim-method-9 () none) + (collide-cache-prim-method-10 () none) + ) + ) + +;; definition for method 3 of type collide-cache-prim +(defmethod inspect ((this collide-cache-prim)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'collide-cache-prim) + (format #t "~1Tprim-core: #~%" (-> this prim-core)) + (format #t "~1Textra-quad[16] @ #x~X~%" (-> this extra-quad)) + (format #t "~1Tccache: ~A~%" (-> this ccache)) + (format #t "~1Tprim: ~A~%" (-> this prim)) + (format #t "~1Tfirst-tri: ~D~%" (-> this first-tri)) + (format #t "~1Tnum-tris: ~D~%" (-> this num-tris)) + (format #t "~1Tunused[4] @ #x~X~%" (-> this unused)) + (format #t "~1Tworld-sphere: ~`vector`P~%" (-> this prim-core)) + (format #t "~1Tcollide-as: ~D~%" (-> this prim-core collide-as)) + (format #t "~1Taction: ~D~%" (-> this prim-core action)) + (format #t "~1Tprim-type: ~D~%" (-> this prim-core prim-type)) + (label cfg-4) + this + ) + +;; definition of type collide-cache +(deftype collide-cache (basic) + "The collide-cache is a structure to accelerate collision queries. +In particular, it helps with queries where you don't know what you might hit. +It can detect collision with the background geometry, foreground dynamic collision shapes (spheres and meshes), and water. +To use it, it must first be 'filled' with geometry. Then you can manually inspect the geometry, or use one of the queries. +The supported queries are 'line-sphere' (raycast) and 'spheres' (check if intersecting anything). +It is not useful for ollision queries against a specific foreground object, like 'am I on top of platform X right now?'." + ((num-tris int32) + (num-prims int32) + (ignore-mask pat-surface) + (ignore-processes process 2) + (collide-box bounding-box :inline) + (collide-box4w bounding-box4w :inline) + (collide-with collide-spec) + (unused uint32) + (prims collide-cache-prim 100 :inline) + (tris collide-cache-tri 461 :inline) + ) + (:methods + (collide-cache-method-9 () none) + (collide-cache-method-10 () none) + (collide-cache-method-11 () none) + (collide-cache-method-12 () none) + (collide-cache-method-13 () none) + (collide-cache-method-14 () none) + (collide-cache-method-15 () none) + (collide-cache-method-16 () none) + (collide-cache-method-17 () none) + (collide-cache-method-18 () none) + (collide-cache-method-19 () none) + (collide-cache-method-20 () none) + (collide-cache-method-21 () none) + (collide-cache-method-22 () none) + (collide-cache-method-23 () none) + (collide-cache-method-24 () none) + (collide-cache-method-25 () none) + ) + ) + +;; definition for method 3 of type collide-cache +(defmethod inspect ((this collide-cache)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tnum-tris: ~D~%" (-> this num-tris)) + (format #t "~1Tnum-prims: ~D~%" (-> this num-prims)) + (format #t "~1Tignore-mask: ~D~%" (-> this ignore-mask)) + (format #t "~1Tignore-processes[2] @ #x~X~%" (-> this ignore-processes)) + (format #t "~1Tcollide-box: #~%" (-> this collide-box)) + (format #t "~1Tcollide-box4w: #~%" (-> this collide-box4w)) + (format #t "~1Tcollide-with: ~D~%" (-> this collide-with)) + (format #t "~1Tunused: ~D~%" (-> this unused)) + (format #t "~1Tprims[100] @ #x~X~%" (-> this prims)) + (format #t "~1Ttris[461] @ #x~X~%" (-> this tris)) + (label cfg-4) + this + ) + +;; definition of type collide-list-item +(deftype collide-list-item (structure) + "Entry on the broad-phase collision list. +Can represent instanced collision, as a TIE instance, or a single non-instanced mesh fragment." + ((mesh instance-tie) + (inst basic) + ) + :pack-me + ) + +;; definition for method 3 of type collide-list-item +(defmethod inspect ((this collide-list-item)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'collide-list-item) + (format #t "~1Tmesh: ~A~%" (-> this mesh)) + (format #t "~1Tinst: ~A~%" (-> this inst)) + (label cfg-4) + this + ) + +;; definition of type collide-list +(deftype collide-list (structure) + "List of items returned by the broad-phase collision query." + ((num-items int32) + (items collide-list-item 256 :inline :offset 16) + ) + ) + +;; definition for method 3 of type collide-list +(defmethod inspect ((this collide-list)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'collide-list) + (format #t "~1Tnum-items: ~D~%" (-> this num-items)) + (format #t "~1Titems[256] @ #x~X~%" (-> this items)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(kmemopen global "collide-cache-buffers") + +;; definition (perm) for symbol *collide-cache*, type collide-cache +(define-perm *collide-cache* collide-cache (new 'global 'collide-cache)) + +;; definition (perm) for symbol *collide-list*, type collide-list +(define-perm *collide-list* collide-list (new 'global 'collide-list)) + +;; failed to figure out what this is: +(kmemclose) + + + + diff --git a/test/decompiler/reference/jak3/engine/collide/collide-h_REF.gc b/test/decompiler/reference/jak3/engine/collide/collide-h_REF.gc new file mode 100644 index 0000000000..a044bd236e --- /dev/null +++ b/test/decompiler/reference/jak3/engine/collide/collide-h_REF.gc @@ -0,0 +1,104 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type collide-query +(deftype collide-query (structure) + "Very general collision-query structure. The meaning is different depending on where it used. +This has both inputs from the user, and collision results." + ((best-other-tri collide-tri-result :inline) + (best-my-tri collide-tri-result :inline :overlay-at best-other-tri) + (ignore-processes process-tree 2) + (ignore-process0 process-tree :overlay-at (-> ignore-processes 0)) + (ignore-process1 process-tree :overlay-at (-> ignore-processes 1)) + (ignore-pat pat-surface) + (collide-with collide-spec) + (overlay-params uint32 3 :offset 112) + (bbox bounding-box :inline) + (bbox4w bounding-box4w :inline) + (bsphere sphere :inline) + (start-pos vector :inline) + (move-dist vector :inline) + (rlength vector :inline) + (exit-planes plane 2) + (radius float :offset 268) + (inv-mat matrix :inline :offset 288) + (spheres (inline-array sphere) :overlay-at (-> overlay-params 0)) + (num-spheres uint32 :overlay-at (-> overlay-params 1)) + (solid-only symbol :overlay-at (-> overlay-params 2)) + (best-dist float :overlay-at spheres) + (best-other-prim collide-shape-prim :overlay-at num-spheres) + (best-my-prim collide-shape-prim :overlay-at solid-only) + (move-vec vector :inline :overlay-at move-dist) + (best-u float :overlay-at best-dist) + (action-mask collide-action :offset 352) + (local-box4w bounding-box4w :inline) + (search-box bounding-box4w :inline) + (search-vector vector4w :inline) + (instance-mat matrix :inline) + (instance-ptr basic) + (x-addr uint32) + (x-step uint32) + (y-addr uint32) + (y-step uint32) + (z-addr uint32) + (z-step uint32) + ) + ) + +;; definition for method 3 of type collide-query +(defmethod inspect ((this collide-query)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'collide-query) + (format #t "~1Tbest-other-tri: #~%" (-> this best-other-tri)) + (format #t "~1Tbest-my-tri: #~%" (-> this best-other-tri)) + (format #t "~1Tignore-processes[2] @ #x~X~%" (-> this ignore-processes)) + (format #t "~1Tignore-process0: ~A~%" (-> this ignore-process0)) + (format #t "~1Tignore-process1: ~A~%" (-> this ignore-process1)) + (format #t "~1Tignore-pat: ~D~%" (-> this ignore-pat)) + (format #t "~1Tcollide-with: ~D~%" (-> this collide-with)) + (format #t "~1Toverlay-params[3] @ #x~X~%" (-> this overlay-params)) + (format #t "~1Tbbox: #~%" (-> this bbox)) + (format #t "~1Tbbox4w: #~%" (-> this bbox4w)) + (format #t "~1Tbsphere: #~%" (-> this bsphere)) + (format #t "~1Tstart-pos: #~%" (-> this start-pos)) + (format #t "~1Tmove-dist: #~%" (-> this move-dist)) + (format #t "~1Trlength: #~%" (-> this rlength)) + (format #t "~1Texit-planes[2] @ #x~X~%" (-> this exit-planes)) + (format #t "~1Tradius: ~f~%" (-> this radius)) + (format #t "~1Tinv-mat: #~%" (-> this inv-mat)) + (format #t "~1Tspheres: #x~X~%" (-> this spheres)) + (format #t "~1Tnum-spheres: ~D~%" (-> this num-spheres)) + (format #t "~1Tsolid-only: ~A~%" (-> this solid-only)) + (format #t "~1Tbest-dist: ~f~%" (the-as float (-> this spheres))) + (format #t "~1Tbest-other-prim: ~A~%" (-> this num-spheres)) + (format #t "~1Tbest-my-prim: ~A~%" (-> this solid-only)) + (format #t "~1Tmove-vec: #~%" (-> this move-dist)) + (format #t "~1Tbest-u: ~f~%" (the-as float (-> this spheres))) + (format #t "~1Taction-mask: ~D~%" (-> this action-mask)) + (format #t "~1Tlocal-box4w: #~%" (-> this local-box4w)) + (format #t "~1Tsearch-box: #~%" (-> this search-box)) + (format #t "~1Tsearch-vector: #~%" (-> this search-vector)) + (format #t "~1Tinstance-mat: #~%" (-> this instance-mat)) + (format #t "~1Tinstance-ptr: ~A~%" (-> this instance-ptr)) + (format #t "~1Tx-addr: ~D~%" (-> this x-addr)) + (format #t "~1Tx-step: ~D~%" (-> this x-step)) + (format #t "~1Ty-addr: ~D~%" (-> this y-addr)) + (format #t "~1Ty-step: ~D~%" (-> this y-step)) + (format #t "~1Tz-addr: ~D~%" (-> this z-addr)) + (format #t "~1Tz-step: ~D~%" (-> this z-step)) + (label cfg-4) + this + ) + +;; definition for symbol *collide-test-flag*, type symbol +(define *collide-test-flag* #f) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/engine/common_objs/cloth-art-h_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/cloth-art-h_REF.gc similarity index 100% rename from test/decompiler/reference/jak3/engine/common_objs/cloth-art-h_REF.gc rename to test/decompiler/reference/jak3/engine/common-obs/cloth-art-h_REF.gc diff --git a/test/decompiler/reference/jak3/engine/common_objs/prim-h_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/prim-h_REF.gc similarity index 100% rename from test/decompiler/reference/jak3/engine/common_objs/prim-h_REF.gc rename to test/decompiler/reference/jak3/engine/common-obs/prim-h_REF.gc diff --git a/test/decompiler/reference/jak3/engine/common_objs/projectile-h_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/projectile-h_REF.gc similarity index 100% rename from test/decompiler/reference/jak3/engine/common_objs/projectile-h_REF.gc rename to test/decompiler/reference/jak3/engine/common-obs/projectile-h_REF.gc diff --git a/test/decompiler/reference/jak3/engine/draw/drawable-h_REF.gc b/test/decompiler/reference/jak3/engine/draw/drawable-h_REF.gc index bf1dd7f467..62c327c7b0 100644 --- a/test/decompiler/reference/jak3/engine/draw/drawable-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/draw/drawable-h_REF.gc @@ -13,7 +13,7 @@ control over memory layout for use with DMA." (bsphere vector :inline) ) (:methods - (drawable-method-9 () none) + (login (_type_) _type_) (draw (_type_ _type_ display-frame) none) (drawable-method-11 () none) (drawable-method-12 () none) @@ -60,7 +60,3 @@ control over memory layout for use with DMA." ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/engine/gfx/background/background-h_REF.gc b/test/decompiler/reference/jak3/engine/gfx/background/background-h_REF.gc new file mode 100644 index 0000000000..2127bad6ed --- /dev/null +++ b/test/decompiler/reference/jak3/engine/gfx/background/background-h_REF.gc @@ -0,0 +1,62 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type background-work +(deftype background-work (basic) + "List of all things for the background renderer to draw." + ((tfrag-tree-count int32) + (tfrag-trees drawable-tree-tfrag 11) + (tfrag-levels level 11) + (tfrag-trans-tree-count int32) + (tfrag-trans-trees drawable-tree-tfrag-trans 11) + (tfrag-trans-levels level 11) + (tfrag-water-tree-count int32) + (tfrag-water-trees drawable-tree-tfrag-water 11) + (tfrag-water-levels level 11) + (shrub-tree-count int32) + (shrub-trees drawable-tree-instance-shrub 11) + (shrub-levels level 11) + (tie-tree-count int32) + (tie-trees drawable-tree-instance-tie 11) + (tie-levels level 11) + (tie-generic basic 11) + (tie-generic-trans basic 11) + (wait-to-vu0 uint32) + ) + ) + +;; definition for method 3 of type background-work +(defmethod inspect ((this background-work)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Ttfrag-tree-count: ~D~%" (-> this tfrag-tree-count)) + (format #t "~1Ttfrag-trees[11] @ #x~X~%" (-> this tfrag-trees)) + (format #t "~1Ttfrag-levels[11] @ #x~X~%" (-> this tfrag-levels)) + (format #t "~1Ttfrag-trans-tree-count: ~D~%" (-> this tfrag-trans-tree-count)) + (format #t "~1Ttfrag-trans-trees[11] @ #x~X~%" (-> this tfrag-trans-trees)) + (format #t "~1Ttfrag-trans-levels[11] @ #x~X~%" (-> this tfrag-trans-levels)) + (format #t "~1Ttfrag-water-tree-count: ~D~%" (-> this tfrag-water-tree-count)) + (format #t "~1Ttfrag-water-trees[11] @ #x~X~%" (-> this tfrag-water-trees)) + (format #t "~1Ttfrag-water-levels[11] @ #x~X~%" (-> this tfrag-water-levels)) + (format #t "~1Tshrub-tree-count: ~D~%" (-> this shrub-tree-count)) + (format #t "~1Tshrub-trees[11] @ #x~X~%" (-> this shrub-trees)) + (format #t "~1Tshrub-levels[11] @ #x~X~%" (-> this shrub-levels)) + (format #t "~1Ttie-tree-count: ~D~%" (-> this tie-tree-count)) + (format #t "~1Ttie-trees[11] @ #x~X~%" (-> this tie-trees)) + (format #t "~1Ttie-levels[11] @ #x~X~%" (-> this tie-levels)) + (format #t "~1Ttie-generic[11] @ #x~X~%" (-> this tie-generic)) + (format #t "~1Ttie-generic-trans[11] @ #x~X~%" (-> this tie-generic-trans)) + (format #t "~1Twait-to-vu0: ~D~%" (-> this wait-to-vu0)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/engine/gfx/background/subdivide-h_REF.gc b/test/decompiler/reference/jak3/engine/gfx/background/subdivide-h_REF.gc new file mode 100644 index 0000000000..1f077ace25 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/gfx/background/subdivide-h_REF.gc @@ -0,0 +1,327 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type subdivide-settings +(deftype subdivide-settings (basic) + "Input settings for distances for switching mesh level of details. +These are set by the level code and read by rendering code." + ((dist float 5) + (meters float 5) + (close float 12) + (far float 12) + ) + (:methods + (new (symbol type float float) _type_) + ) + ) + +;; definition for method 3 of type subdivide-settings +(defmethod inspect ((this subdivide-settings)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tdist[5] @ #x~X~%" (-> this dist)) + (format #t "~1Tmeters[5] @ #x~X~%" (-> this meters)) + (format #t "~1Tclose[12] @ #x~X~%" (-> this close)) + (format #t "~1Tfar[12] @ #x~X~%" (-> this far)) + (label cfg-4) + this + ) + +;; definition for method 0 of type subdivide-settings +(defmethod new subdivide-settings ((allocation symbol) (type-to-make type) (arg0 float) (arg1 float)) + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (dotimes (v1-2 10) + (set! (-> v0-0 close v1-2) arg0) + (set! (-> v0-0 far v1-2) arg1) + ) + v0-0 + ) + ) + +;; definition of type subdivide-dists +(deftype subdivide-dists (structure) + "Unused subdivide distances. Internally, tfrag/tie figure these out instead." + ((data uint32 32 :offset 0) + (vector vector 8 :overlay-at (-> data 0)) + (k0s uint128 4 :overlay-at (-> data 0)) + (k1s uint128 4 :overlay-at (-> data 16)) + ) + ) + +;; definition for method 3 of type subdivide-dists +(defmethod inspect ((this subdivide-dists)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'subdivide-dists) + (format #t "~1Tdata[32] @ #x~X~%" (-> this data)) + (format #t "~1Tvector[8] @ #x~X~%" (-> this data)) + (format #t "~1Tk0s[4] @ #x~X~%" (-> this data)) + (format #t "~1Tk1s[4] @ #x~X~%" (-> this k1s)) + (label cfg-4) + this + ) + +;; definition of type terrain-stats +(deftype terrain-stats (structure) + "Desptie the name `terrain-stats`, these are more general triangle stats for all renderers." + ((pris tr-stat :inline) + (tie-generic tr-stat :inline) + (tie-vanish tr-stat :inline) + (tie tr-stat :inline) + (tie-scissor tr-stat :inline) + (tie-envmap tr-stat :inline) + (tie-envmap-scissor tr-stat :inline) + (tie-trans tr-stat :inline) + (tie-scissor-trans tr-stat :inline) + (tie-envmap-trans tr-stat :inline) + (tie-envmap-scissor-trans tr-stat :inline) + (tie-water tr-stat :inline) + (tie-scissor-water tr-stat :inline) + (tie-envmap-water tr-stat :inline) + (tie-envmap-scissor-water tr-stat :inline) + (shrub-near tr-stat :inline) + (shrub tr-stat :inline) + (tfrag-scissor tr-stat :inline) + (tfrag tr-stat :inline) + (billboard tr-stat :inline) + (tfrag-trans tr-stat :inline) + (tfrag-scissor-trans tr-stat :inline) + (tfrag-water tr-stat :inline) + (tfrag-scissor-water tr-stat :inline) + (trans-pris tr-stat :inline) + (trans-shrub tr-stat :inline) + (ocean-mid tr-stat :inline) + (ocean-near tr-stat :inline) + (shadow tr-stat :inline) + (hfrag tr-stat :inline) + (total tr-stat :inline) + ) + ) + +;; definition for method 3 of type terrain-stats +(defmethod inspect ((this terrain-stats)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'terrain-stats) + (format #t "~1Tpris: #~%" (-> this pris)) + (format #t "~1Ttie-generic: #~%" (-> this tie-generic)) + (format #t "~1Ttie-vanish: #~%" (-> this tie-vanish)) + (format #t "~1Ttie: #~%" (-> this tie)) + (format #t "~1Ttie-scissor: #~%" (-> this tie-scissor)) + (format #t "~1Ttie-envmap: #~%" (-> this tie-envmap)) + (format #t "~1Ttie-envmap-scissor: #~%" (-> this tie-envmap-scissor)) + (format #t "~1Ttie-trans: #~%" (-> this tie-trans)) + (format #t "~1Ttie-scissor-trans: #~%" (-> this tie-scissor-trans)) + (format #t "~1Ttie-envmap-trans: #~%" (-> this tie-envmap-trans)) + (format #t "~1Ttie-envmap-scissor-trans: #~%" (-> this tie-envmap-scissor-trans)) + (format #t "~1Ttie-water: #~%" (-> this tie-water)) + (format #t "~1Ttie-scissor-water: #~%" (-> this tie-scissor-water)) + (format #t "~1Ttie-envmap-water: #~%" (-> this tie-envmap-water)) + (format #t "~1Ttie-envmap-scissor-water: #~%" (-> this tie-envmap-scissor-water)) + (format #t "~1Tshrub-near: #~%" (-> this shrub-near)) + (format #t "~1Tshrub: #~%" (-> this shrub)) + (format #t "~1Ttfrag-scissor: #~%" (-> this tfrag-scissor)) + (format #t "~1Ttfrag: #~%" (-> this tfrag)) + (format #t "~1Tbillboard: #~%" (-> this billboard)) + (format #t "~1Ttfrag-trans: #~%" (-> this tfrag-trans)) + (format #t "~1Ttfrag-scissor-trans: #~%" (-> this tfrag-scissor-trans)) + (format #t "~1Ttfrag-water: #~%" (-> this tfrag-water)) + (format #t "~1Ttfrag-scissor-water: #~%" (-> this tfrag-scissor-water)) + (format #t "~1Ttrans-pris: #~%" (-> this trans-pris)) + (format #t "~1Ttrans-shrub: #~%" (-> this trans-shrub)) + (format #t "~1Tocean-mid: #~%" (-> this ocean-mid)) + (format #t "~1Tocean-near: #~%" (-> this ocean-near)) + (format #t "~1Tshadow: #~%" (-> this shadow)) + (format #t "~1Thfrag: #~%" (-> this hfrag)) + (format #t "~1Ttotal: #~%" (-> this total)) + (label cfg-4) + this + ) + +;; definition of type background-area +(deftype background-area (structure) + "Scratchpad memory layout for most background rendering +This uses the full scratchpad so it should only be used when the stack isn't on the scratchpad (rendering code). +Interestingly, dma-area went from a union of all the -dma types to a plain array of bytes in jak 3." + ((dma-area uint8 14336) + (vis-list uint8 2048) + ) + ) + +;; definition for method 3 of type background-area +(defmethod inspect ((this background-area)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'background-area) + (format #t "~1Tdma-area[14336] @ #x~X~%" (-> this dma-area)) + (format #t "~1Tvis-list[2048] @ #x~X~%" (-> this vis-list)) + (label cfg-4) + this + ) + +;; definition of type foreground-area +(deftype foreground-area (structure) + "Scratchpad memory layout for most foreground rendering." + ((generic-work generic-work :inline :offset 0) + (foreground-work foreground-work :inline :offset 0) + (joint-work joint-work :inline :offset 0) + (bone-mem bone-memory :inline :offset 0) + (shadow-work shadow-work :inline :offset 0) + ) + ) + +;; definition for method 3 of type foreground-area +(defmethod inspect ((this foreground-area)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'foreground-area) + (format #t "~1Tgeneric-work: #~%" (-> this generic-work)) + (format #t "~1Tforeground-work: #~%" (-> this generic-work)) + (format #t "~1Tjoint-work: #~%" (-> this generic-work)) + (format #t "~1Tbone-mem: #~%" (-> this generic-work)) + (format #t "~1Tshadow-work: #~%" (-> this generic-work)) + (label cfg-4) + this + ) + +;; definition of type region-prim-area +(deftype region-prim-area (structure) + "Scratchpad memory layout for regions." + ((region-prim-list region-prim-list :inline) + (pos vector :inline) + (ray vector :inline :offset 1328) + (region-enter-count int32 :offset 1360) + (region-enter-list region 320) + (region-enter-prim-list drawable-region-sphere 320) + (region-exit-count int32) + (region-exit-list region 320) + (region-exit-prim-list drawable-region-sphere 320) + (region-inside-count int32) + (region-inside-list region 320) + (region-inside-prim-list drawable-region-sphere 320) + (region-start-count int32) + (region-start-list region 320) + (region-start-prim-list drawable-region-sphere 320) + ) + (:methods + (region-prim-area-method-9 () none) + (region-prim-area-method-10 () none) + (region-prim-area-method-11 () none) + (region-prim-area-method-12 () none) + ) + ) + +;; definition for method 3 of type region-prim-area +(defmethod inspect ((this region-prim-area)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'region-prim-area) + (format #t "~1Tregion-prim-list: #~%" (-> this region-prim-list)) + (format #t "~1Tpos: ~`vector`P~%" (-> this pos)) + (format #t "~1Tray: ~`vector`P~%" (-> this ray)) + (format #t "~1Tregion-enter-count: ~D~%" (-> this region-enter-count)) + (format #t "~1Tregion-enter-list[320] @ #x~X~%" (-> this region-enter-list)) + (format #t "~1Tregion-enter-prim-list[320] @ #x~X~%" (-> this region-enter-prim-list)) + (format #t "~1Tregion-exit-count: ~D~%" (-> this region-exit-count)) + (format #t "~1Tregion-exit-list[320] @ #x~X~%" (-> this region-exit-list)) + (format #t "~1Tregion-exit-prim-list[320] @ #x~X~%" (-> this region-exit-prim-list)) + (format #t "~1Tregion-inside-count: ~D~%" (-> this region-inside-count)) + (format #t "~1Tregion-inside-list[320] @ #x~X~%" (-> this region-inside-list)) + (format #t "~1Tregion-inside-prim-list[320] @ #x~X~%" (-> this region-inside-prim-list)) + (format #t "~1Tregion-start-count: ~D~%" (-> this region-start-count)) + (format #t "~1Tregion-start-list[320] @ #x~X~%" (-> this region-start-list)) + (format #t "~1Tregion-start-prim-list[320] @ #x~X~%" (-> this region-start-prim-list)) + (label cfg-4) + this + ) + +;; definition of type sprite-area +(deftype sprite-area (structure) + "Scratchpad memory layout for sprites." + ((clock-data vector 22 :inline) + (buffer uint8 :dynamic) + ) + ) + +;; definition for method 3 of type sprite-area +(defmethod inspect ((this sprite-area)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'sprite-area) + (format #t "~1Tclock-data[22] @ #x~X~%" (-> this clock-data)) + (format #t "~1Tbuffer[0] @ #x~X~%" (-> this buffer)) + (label cfg-4) + this + ) + +;; definition of type work-area +(deftype work-area (structure) + "All scratchpad memory layouts." + ((background background-area :inline :offset 0) + (foreground foreground-area :inline :offset 0) + (region-prim region-prim-area :inline :offset 0) + (sprite sprite-area :inline :offset 0) + ) + ) + +;; definition for method 3 of type work-area +(defmethod inspect ((this work-area)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'work-area) + (format #t "~1Tbackground: #~%" (-> this background)) + (format #t "~1Tforeground: #~%" (-> this background)) + (format #t "~1Tregion-prim: #~%" (-> this background)) + (format #t "~1Tsprite: #~%" (-> this background)) + (label cfg-4) + this + ) + +;; definition of type terrain-context +(deftype terrain-context (structure) + "Useless wrapper around work-area. (this added some stuff in jak 1)" + ((work work-area :inline) + ) + ) + +;; definition for method 3 of type terrain-context +(defmethod inspect ((this terrain-context)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'terrain-context) + (format #t "~1Twork: #~%" (-> this work)) + (label cfg-4) + this + ) + +;; definition for symbol *terrain-stats*, type terrain-stats +(define *terrain-stats* (new 'global 'terrain-stats)) + +;; definition for symbol *collide-stats*, type collide-stats +(define *collide-stats* (new 'global 'collide-stats)) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/engine/gfx/hfrag/hfrag-h_REF.gc b/test/decompiler/reference/jak3/engine/gfx/hfrag/hfrag-h_REF.gc new file mode 100644 index 0000000000..b6dbea68cb --- /dev/null +++ b/test/decompiler/reference/jak3/engine/gfx/hfrag/hfrag-h_REF.gc @@ -0,0 +1,1071 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type adgif-shader-array +(deftype adgif-shader-array (inline-array-class) + ((data adgif-shader :inline :dynamic) + ) + ) + +;; definition for method 3 of type adgif-shader-array +(defmethod inspect ((this adgif-shader-array)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(set! (-> adgif-shader-array heap-base) (the-as uint 80)) + +;; definition of type hfrag-montage +(deftype hfrag-montage (structure) + ((data uint16 16) + ) + ) + +;; definition for method 3 of type hfrag-montage +(defmethod inspect ((this hfrag-montage)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'hfrag-montage) + (format #t "~1Tdata[16] @ #x~X~%" (-> this data)) + (label cfg-4) + this + ) + +;; definition of type hfrag-bucket +(deftype hfrag-bucket (structure) + ((next uint32) + (count uint16) + (vertex-count uint16) + (next-scissor uint32) + (count-scissor uint16) + (vertex-count-scissor uint16) + ) + ) + +;; definition for method 3 of type hfrag-bucket +(defmethod inspect ((this hfrag-bucket)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'hfrag-bucket) + (format #t "~1Tnext: #x~X~%" (-> this next)) + (format #t "~1Tcount: ~D~%" (-> this count)) + (format #t "~1Tvertex-count: ~D~%" (-> this vertex-count)) + (format #t "~1Tnext-scissor: #x~X~%" (-> this next-scissor)) + (format #t "~1Tcount-scissor: ~D~%" (-> this count-scissor)) + (format #t "~1Tvertex-count-scissor: ~D~%" (-> this vertex-count-scissor)) + (label cfg-4) + this + ) + +;; definition of type hfrag-packed-index +(deftype hfrag-packed-index (uint16) + () + ) + +;; definition of type hfrag-vertex +(deftype hfrag-vertex (structure) + ((height uint16) + (packed-index hfrag-packed-index) + ) + ) + +;; definition for method 3 of type hfrag-vertex +(defmethod inspect ((this hfrag-vertex)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'hfrag-vertex) + (format #t "~1Theight: ~D~%" (-> this height)) + (format #t "~1Tpacked-index: ~D~%" (-> this packed-index)) + (label cfg-4) + this + ) + +;; definition of type hfrag-vert-index +(deftype hfrag-vert-index (structure) + ((pos vector2ub :inline) + (index0 uint16 :offset 2) + (index1 uint16 :offset 4) + (index2 uint16 :offset 6) + ) + :pack-me + ) + +;; definition for method 3 of type hfrag-vert-index +(defmethod inspect ((this hfrag-vert-index)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'hfrag-vert-index) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tindex0: ~D~%" (-> this index0)) + (format #t "~1Tindex1: ~D~%" (-> this index1)) + (format #t "~1Tindex2: ~D~%" (-> this index2)) + (label cfg-4) + this + ) + +;; definition of type hfrag-poly4 +(deftype hfrag-poly4 (structure) + ((data hfrag-vert-index 4 :inline) + ) + ) + +;; definition for method 3 of type hfrag-poly4 +;; INFO: this function exists in multiple non-identical object files +(defmethod inspect ((this hfrag-poly4)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'hfrag-poly4) + (format #t "~1Tdata[4] @ #x~X~%" (-> this data)) + (label cfg-4) + this + ) + +;; definition for method 3 of type hfrag-poly4 +;; INFO: this function exists in multiple non-identical object files +(defmethod inspect ((this hfrag-poly4)) + (format #t "[~8x] hfrag-poly4~%" this) + (dotimes (s5-0 4) + (format + #t + "~T~d: index0: ~d index1: ~d index2: ~d pos: ~d ~d~%" + s5-0 + (shr (-> this data s5-0 index0) 2) + (shr (-> this data s5-0 index1) 2) + (shr (-> this data s5-0 index2) 2) + (-> this data s5-0 pos x) + (-> this data s5-0 pos y) + ) + ) + this + ) + +;; definition of type hfrag-poly9 +(deftype hfrag-poly9 (structure) + ((data hfrag-vert-index 9 :inline) + ) + ) + +;; definition for method 3 of type hfrag-poly9 +;; INFO: this function exists in multiple non-identical object files +(defmethod inspect ((this hfrag-poly9)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'hfrag-poly9) + (format #t "~1Tdata[9] @ #x~X~%" (-> this data)) + (label cfg-4) + this + ) + +;; definition for method 3 of type hfrag-poly9 +;; INFO: this function exists in multiple non-identical object files +(defmethod inspect ((this hfrag-poly9)) + (format #t "[~8x] hfrag-poly9~%" this) + (dotimes (s5-0 9) + (format + #t + "~T~d: index0: ~d index1: ~d index2: ~d pos: ~d ~d~%" + s5-0 + (shr (-> this data s5-0 index0) 2) + (shr (-> this data s5-0 index1) 2) + (shr (-> this data s5-0 index2) 2) + (-> this data s5-0 pos x) + (-> this data s5-0 pos y) + ) + ) + this + ) + +;; definition of type hfrag-poly25 +(deftype hfrag-poly25 (structure) + ((data hfrag-vert-index 25 :inline) + ) + ) + +;; definition for method 3 of type hfrag-poly25 +;; INFO: this function exists in multiple non-identical object files +(defmethod inspect ((this hfrag-poly25)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'hfrag-poly25) + (format #t "~1Tdata[25] @ #x~X~%" (-> this data)) + (label cfg-4) + this + ) + +;; definition for method 3 of type hfrag-poly25 +;; INFO: this function exists in multiple non-identical object files +(defmethod inspect ((this hfrag-poly25)) + (format #t "[~8x] hfrag-poly9~%" this) + (dotimes (s5-0 25) + (format + #t + "~T~d: index0: ~d index1: ~d index2: ~d pos: ~d ~d~%" + s5-0 + (shr (-> this data s5-0 index0) 2) + (shr (-> this data s5-0 index1) 2) + (shr (-> this data s5-0 index2) 2) + (-> this data s5-0 pos x) + (-> this data s5-0 pos y) + ) + ) + this + ) + +;; definition of type hfrag-poly4-chain +(deftype hfrag-poly4-chain (structure) + ((tag dma-packet :inline) + (verts vector4w-3 4 :inline) + (next dma-packet :inline :offset 208) + ) + ) + +;; definition for method 3 of type hfrag-poly4-chain +(defmethod inspect ((this hfrag-poly4-chain)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'hfrag-poly4-chain) + (format #t "~1Ttag: #~%" (-> this tag)) + (format #t "~1Tverts[4] @ #x~X~%" (-> this verts)) + (format #t "~1Tnext: #~%" (-> this next)) + (label cfg-4) + this + ) + +;; definition of type hfrag-poly9-chain +(deftype hfrag-poly9-chain (structure) + ((tag dma-packet :inline) + (verts vector4w-3 12 :inline) + (next dma-packet :inline :offset 592) + ) + ) + +;; definition for method 3 of type hfrag-poly9-chain +(defmethod inspect ((this hfrag-poly9-chain)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'hfrag-poly9-chain) + (format #t "~1Ttag: #~%" (-> this tag)) + (format #t "~1Tverts[12] @ #x~X~%" (-> this verts)) + (format #t "~1Tnext: #~%" (-> this next)) + (label cfg-4) + this + ) + +;; definition of type hfrag-poly25-chain +(deftype hfrag-poly25-chain (structure) + ((tag dma-packet :inline) + (verts vector4w-3 40 :inline) + (next dma-packet :inline) + ) + ) + +;; definition for method 3 of type hfrag-poly25-chain +(defmethod inspect ((this hfrag-poly25-chain)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'hfrag-poly25-chain) + (format #t "~1Ttag: #~%" (-> this tag)) + (format #t "~1Tverts[40] @ #x~X~%" (-> this verts)) + (format #t "~1Tnext: #~%" (-> this next)) + (label cfg-4) + this + ) + +;; definition of type hfrag-cache-vertex +(deftype hfrag-cache-vertex (structure) + ((color vector4w :inline) + (pos vector :inline) + (clip uint32 :overlay-at (-> pos data 3)) + ) + ) + +;; definition for method 3 of type hfrag-cache-vertex +(defmethod inspect ((this hfrag-cache-vertex)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'hfrag-cache-vertex) + (format #t "~1Tcolor: #~%" (-> this color)) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tclip: ~D~%" (-> this pos w)) + (label cfg-4) + this + ) + +;; definition of type hfrag-cache-line +(deftype hfrag-cache-line (structure) + ((data hfrag-cache-vertex 9 :inline) + ) + ) + +;; definition for method 3 of type hfrag-cache-line +(defmethod inspect ((this hfrag-cache-line)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'hfrag-cache-line) + (format #t "~1Tdata[9] @ #x~X~%" (-> this data)) + (label cfg-4) + this + ) + +;; definition of type hfrag-visbits +(deftype hfrag-visbits (structure) + ((data uint8 128) + ) + ) + +;; definition for method 3 of type hfrag-visbits +(defmethod inspect ((this hfrag-visbits)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'hfrag-visbits) + (format #t "~1Tdata[128] @ #x~X~%" (-> this data)) + (label cfg-4) + this + ) + +;; definition of type hfrag-gcf-control +(deftype hfrag-gcf-control (structure) + ((matrix matrix :inline) + (giftag generic-gif-tag :inline) + (adnops gs-adcmd 2 :inline) + (num-strips uint32 :overlay-at (-> giftag data 3)) + (num-dps uint32 :overlay-at (-> adnops 0 word 3)) + (kick-offset uint32 :offset 108) + (shader gcf-shader :inline) + ) + ) + +;; definition for method 3 of type hfrag-gcf-control +(defmethod inspect ((this hfrag-gcf-control)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'hfrag-gcf-control) + (format #t "~1Tmatrix: #~%" (-> this matrix)) + (format #t "~1Tgiftag: #~%" (-> this giftag)) + (format #t "~1Tadnops[2] @ #x~X~%" (-> this adnops)) + (format #t "~1Tnum-strips: ~D~%" (-> this giftag num-strips)) + (format #t "~1Tnum-dps: ~D~%" (-> this num-dps)) + (format #t "~1Tkick-offset: ~D~%" (-> this kick-offset)) + (format #t "~1Tshader: #~%" (-> this shader)) + (label cfg-4) + this + ) + +;; definition of type hfrag-gcf-ctrl +(deftype hfrag-gcf-ctrl (structure) + ((tag dma-packet :inline) + (control hfrag-gcf-control :inline) + ) + ) + +;; definition for method 3 of type hfrag-gcf-ctrl +(defmethod inspect ((this hfrag-gcf-ctrl)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'hfrag-gcf-ctrl) + (format #t "~1Ttag: #~%" (-> this tag)) + (format #t "~1Tcontrol: #~%" (-> this control)) + (label cfg-4) + this + ) + +;; definition of type hfrag-init-packet +(deftype hfrag-init-packet (structure) + ((init-tmpl dma-packet :inline) + (init-data uint32 8) + ) + ) + +;; definition for method 3 of type hfrag-init-packet +(defmethod inspect ((this hfrag-init-packet)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'hfrag-init-packet) + (format #t "~1Tinit-tmpl: #~%" (-> this init-tmpl)) + (format #t "~1Tinit-data[8] @ #x~X~%" (-> this init-data)) + (format #t "~1Tquad[3] @ #x~X~%" (-> this init-tmpl)) + (label cfg-4) + this + ) + +;; definition of type hfrag-sprite-coord +(deftype hfrag-sprite-coord (structure) + ((pos0 vector4w :inline) + (pos1 vector4w :inline) + ) + ) + +;; definition for method 3 of type hfrag-sprite-coord +(defmethod inspect ((this hfrag-sprite-coord)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'hfrag-sprite-coord) + (format #t "~1Tpos0: #~%" (-> this pos0)) + (format #t "~1Tpos1: #~%" (-> this pos1)) + (label cfg-4) + this + ) + +;; definition of type hfrag-montage-coord +(deftype hfrag-montage-coord (structure) + ((stq0 vector4 :inline) + (stq1 vector4 :inline) + ) + ) + +;; definition for method 3 of type hfrag-montage-coord +(defmethod inspect ((this hfrag-montage-coord)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'hfrag-montage-coord) + (format #t "~1Tstq0: #~%" (-> this stq0)) + (format #t "~1Tstq1: #~%" (-> this stq1)) + (label cfg-4) + this + ) + +;; definition of type hfrag-sprite-packet +(deftype hfrag-sprite-packet (structure) + ((sprite-tmpl dma-gif-packet :inline) + (color vector4w :inline) + (tex0 vector :inline) + (pos0 vector4w :inline) + (tex1 vector :inline) + (pos1 vector4w :inline) + ) + ) + +;; definition for method 3 of type hfrag-sprite-packet +(defmethod inspect ((this hfrag-sprite-packet)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'hfrag-sprite-packet) + (format #t "~1Tsprite-tmpl: #~%" (-> this sprite-tmpl)) + (format #t "~1Tcolor: #~%" (-> this color)) + (format #t "~1Ttex0: #~%" (-> this tex0)) + (format #t "~1Tpos0: #~%" (-> this pos0)) + (format #t "~1Ttex1: #~%" (-> this tex1)) + (format #t "~1Tpos1: #~%" (-> this pos1)) + (label cfg-4) + this + ) + +;; definition of type hfrag-tex-data +(deftype hfrag-tex-data (structure) + ((quad qword 3 :inline) + (prims uint64 6 :overlay-at quad) + (reg-0 uint8 :overlay-at (-> quad 0 data 2)) + (reg-1 uint8 :overlay-at (-> prims 3)) + (reg-2 uint8 :overlay-at (-> prims 5)) + (tex0 uint64 :overlay-at (-> quad 0 data 0)) + (tex1 uint64 :overlay-at (-> prims 2)) + (texflush uint64 :overlay-at (-> prims 4)) + ) + ) + +;; definition for method 3 of type hfrag-tex-data +(defmethod inspect ((this hfrag-tex-data)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'hfrag-tex-data) + (format #t "~1Tquad[3] @ #x~X~%" (-> this quad)) + (format #t "~1Tprims[6] @ #x~X~%" (-> this quad)) + (format #t "~1Treg-0: ~D~%" (-> this reg-0)) + (format #t "~1Treg-1: ~D~%" (-> this reg-1)) + (format #t "~1Treg-2: ~D~%" (-> this reg-2)) + (format #t "~1Ttex0: #x~X~%" (-> this tex0)) + (format #t "~1Ttex1: #x~X~%" (-> this tex1)) + (format #t "~1Ttexflush: #x~X~%" (-> this texflush)) + (label cfg-4) + this + ) + +;; definition of type hfrag-mip-packet +(deftype hfrag-mip-packet (structure) + ((mip-tmpl dma-gif-packet :inline) + (tex0-1 vector :inline) + (tex1-1 vector :inline) + (texflush vector :inline) + (color vector4w :inline) + (tex0 vector :inline) + (pos0 vector :inline) + (tex1 vector :inline) + (pos1 vector :inline) + ) + ) + +;; definition for method 3 of type hfrag-mip-packet +;; INFO: this function exists in multiple non-identical object files +(defmethod inspect ((this hfrag-mip-packet)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'hfrag-mip-packet) + (format #t "~1Tsprite-tmpl: #~%" (-> this mip-tmpl)) + (format #t "~1Tadnop0: #~%" (-> this tex0-1)) + (format #t "~1Tadnop1: #~%" (-> this tex1-1)) + (format #t "~1Tcolor: #~%" (-> this texflush)) + (format #t "~1Ttex0: #~%" (-> this color)) + (format #t "~1Tpos0: #~%" (-> this tex0)) + (format #t "~1Ttex1: #~%" (-> this pos0)) + (format #t "~1Tpos1: #~%" (-> this tex1)) + (label cfg-4) + this + ) + +;; definition of type hfrag-adgif-packet +(deftype hfrag-adgif-packet (structure) + ((adgif-tmpl dma-gif-packet :inline) + (adgif-data adgif-shader :inline) + ) + ) + +;; definition for method 3 of type hfrag-adgif-packet +(defmethod inspect ((this hfrag-adgif-packet)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'hfrag-adgif-packet) + (format #t "~1Tadgif-tmpl: #~%" (-> this adgif-tmpl)) + (format #t "~1Tadgif-data: #~%" (-> this adgif-data)) + (label cfg-4) + this + ) + +;; definition of type hfrag-adgif-packet2 +(deftype hfrag-adgif-packet2 (structure) + ((adgif-tmpl dma-gif-packet :inline) + (adgif-data adgif-shader :inline) + (texflush uint128) + ) + ) + +;; definition for method 3 of type hfrag-adgif-packet2 +;; INFO: Used lq/sq +(defmethod inspect ((this hfrag-adgif-packet2)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'hfrag-adgif-packet2) + (format #t "~1Tadgif-tmpl: #~%" (-> this adgif-tmpl)) + (format #t "~1Tadgif-data: #~%" (-> this adgif-data)) + (format #t "~1Ttexflush: ~D~%" (-> this texflush)) + (label cfg-4) + this + ) + +;; definition of type hfrag-frame +(deftype hfrag-frame (structure) + ((quad qword 4 :inline :offset 0) + (prims uint64 8 :overlay-at quad) + (reg-0 uint8 :overlay-at (-> prims 1)) + (reg-1 uint8 :overlay-at (-> prims 3)) + (reg-2 uint8 :overlay-at (-> prims 5)) + (reg-3 uint8 :overlay-at (-> prims 7)) + (frame uint64 :overlay-at (-> prims 0)) + (scissor uint64 :overlay-at (-> prims 2)) + (xyoffset uint64 :overlay-at (-> prims 4)) + (test uint64 :overlay-at (-> prims 6)) + ) + ) + +;; definition for method 3 of type hfrag-frame +(defmethod inspect ((this hfrag-frame)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'hfrag-frame) + (format #t "~1Tquad[4] @ #x~X~%" (-> this quad)) + (format #t "~1Tprims[8] @ #x~X~%" (-> this quad)) + (format #t "~1Treg-0: ~D~%" (-> this reg-0)) + (format #t "~1Treg-1: ~D~%" (-> this reg-1)) + (format #t "~1Treg-2: ~D~%" (-> this reg-2)) + (format #t "~1Treg-3: ~D~%" (-> this reg-3)) + (format #t "~1Tframe: #x~X~%" (-> this frame)) + (format #t "~1Tscissor: #x~X~%" (-> this scissor)) + (format #t "~1Txyoffset: #x~X~%" (-> this xyoffset)) + (format #t "~1Ttest: #x~X~%" (-> this test)) + (label cfg-4) + this + ) + +;; definition of type hfrag-frame-packet +(deftype hfrag-frame-packet (structure) + ((frame-tmpl dma-gif-packet :inline) + (frame-data hfrag-frame :inline) + ) + ) + +;; definition for method 3 of type hfrag-frame-packet +(defmethod inspect ((this hfrag-frame-packet)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'hfrag-frame-packet) + (format #t "~1Tframe-tmpl: #~%" (-> this frame-tmpl)) + (format #t "~1Tframe-data: #~%" (-> this frame-data)) + (label cfg-4) + this + ) + +;; definition of type hfragment +(deftype hfragment (drawable) + ((start-corner vector :inline) + (spheres uint32) + (visids uint32) + (shaders (inline-array adgif-shader)) + (colors basic) + (montage uint32) + (buckets-far uint32) + (buckets-mid uint32) + (buckets-near uint32) + (verts uint32) + (pat-array uint32) + (pat-length uint16) + (num-buckets-far uint16) + (num-buckets-mid uint16) + (num-buckets-near uint16) + (size uint32 :overlay-at (-> start-corner data 3)) + ) + (:methods + (hfragment-method-17 () none) + (hfragment-method-18 () none) + (hfragment-method-19 () none) + (hfragment-method-20 () none) + (hfragment-method-21 () none) + ) + ) + +;; definition for method 3 of type hfragment +(defmethod inspect ((this hfragment)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~1Tstart-corner: #~%" (-> this start-corner)) + (format #t "~1Tspheres: #x~X~%" (-> this spheres)) + (format #t "~1Tvisids: #x~X~%" (-> this visids)) + (format #t "~1Tshaders: #x~X~%" (-> this shaders)) + (format #t "~1Tcolors: ~A~%" (-> this colors)) + (format #t "~1Tmontage: #x~X~%" (-> this montage)) + (format #t "~1Tbuckets-far: #x~X~%" (-> this buckets-far)) + (format #t "~1Tbuckets-mid: #x~X~%" (-> this buckets-mid)) + (format #t "~1Tbuckets-near: #x~X~%" (-> this buckets-near)) + (format #t "~1Tverts: #x~X~%" (-> this verts)) + (format #t "~1Tpat-array: #x~X~%" (-> this pat-array)) + (format #t "~1Tpat-length: ~D~%" (-> this pat-length)) + (format #t "~1Tnum-buckets-far: ~D~%" (-> this num-buckets-far)) + (format #t "~1Tnum-buckets-mid: ~D~%" (-> this num-buckets-mid)) + (format #t "~1Tnum-buckets-near: ~D~%" (-> this num-buckets-near)) + (format #t "~1Tsize: ~D~%" (-> this start-corner w)) + (label cfg-4) + this + ) + +;; definition for method 9 of type hfragment +(defmethod login ((this hfragment)) + "Initialize the object after it is loaded." + (dotimes (s5-0 3) + (adgif-shader-login (-> this shaders s5-0)) + (if (> s5-0 0) + (set! (-> this shaders s5-0 tex0 tcc) 0) + ) + (set! (-> this shaders 1 tex0 cbp) 3904) + (set! (-> this shaders 2 tex0 cbp) 3904) + ) + this + ) + +;; definition of type hfrag-dma +(deftype hfrag-dma (structure) + ((banka uint32 340) + (bankb uint32 340) + (outa uint128 227) + (outb uint128 227) + (cache hfrag-cache-line 8 :inline) + (colors rgba 1024) + ) + ) + +;; definition for method 3 of type hfrag-dma +(defmethod inspect ((this hfrag-dma)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'hfrag-dma) + (format #t "~1Tbanka[340] @ #x~X~%" (-> this banka)) + (format #t "~1Tbankb[340] @ #x~X~%" (-> this bankb)) + (format #t "~1Touta[227] @ #x~X~%" (-> this outa)) + (format #t "~1Toutb[227] @ #x~X~%" (-> this outb)) + (format #t "~1Tcache[8] @ #x~X~%" (-> this cache)) + (format #t "~1Tcolors[1024] @ #x~X~%" (-> this colors)) + (label cfg-4) + this + ) + +;; definition of type hfrag-work +(deftype hfrag-work (structure) + ((far-chaina dma-packet 6 :inline) + (far-chainb dma-packet 6 :inline) + (mid-chaina dma-packet 10 :inline) + (mid-chainb dma-packet 10 :inline) + (near-chaina dma-packet 18 :inline) + (near-chainb dma-packet 18 :inline) + (poly4-tmpl dma-packet 3 :inline) + (poly9-tmpl dma-packet 3 :inline) + (poly25-tmpl dma-packet 3 :inline) + (init-tmpl dma-packet 3 :inline) + (control-tmpl dma-packet 2 :inline :offset 1376) + (heights4-tmpl dma-packet 2 :inline) + (colors4-tmpl dma-packet 2 :inline) + (heights9-tmpl dma-packet 2 :inline) + (colors9-tmpl dma-packet 2 :inline) + (heights25-tmpl dma-packet 2 :inline) + (colors25-tmpl dma-packet 2 :inline) + (init-vu1-tmpl dma-packet 2 :inline) + (next-tmpl dma-packet :inline :offset 1696) + (call-tmpl dma-packet :inline) + (ret-tmpl dma-packet :inline) + (next-scissor-tmpl dma-packet :inline) + (ret-scissor-tmpl dma-packet :inline) + (frame-tmpl dma-gif-packet :inline) + (frames hfrag-frame 5 :inline) + (adgif-tmpl dma-gif-packet :inline) + (adgif-tmpl2 dma-gif-packet :inline) + (sprite-tmpl dma-gif-packet :inline) + (mip-tmpl dma-gif-packet :inline) + (color uint128 6) + (far-data hfrag-sprite-coord :inline) + (near-data vector4w-2 16 :inline) + (mip-data vector4w-3 7 :inline :offset 2896) + (tex-data hfrag-tex-data 5 :offset 3120) + (tex uint128 6 :offset 3360) + (montage-tex-coords uint128 128 :offset 3456) + (giftag generic-gif-tag :inline :offset 7552) + (call-abort dma-packet :inline) + (call-abort-vu1 dma-packet :inline) + (shader-far adgif-shader :inline) + (shader-mid adgif-shader :inline) + (shader-near adgif-shader :inline) + (stq uint128 9) + (shader adgif-shader :inline) + (constants vector :inline) + (pos-temp vector4w :inline) + (trans-temp vector :inline :overlay-at (-> pos-temp data 0)) + (dists vector :inline) + (rdists vector :inline) + (call-poly4-near uint32) + (call-poly9-mid uint32) + (call-poly9-near uint32) + (call-poly25-far uint32) + (call-poly25-mid uint32) + (dma-buffer basic) + (base uint32) + (wait-to-spr uint32) + (wait-from-spr uint32) + (buffer-end uint32) + (subdiv-index uint32) + (scissor basic) + (chain-ptr uint32) + (chain-ptr-next uint32) + (near-dist float) + (far-dist float) + (to-spr uint32) + (from-spr uint32) + (lowres-flag basic) + (hfrag hfragment :inline) + (next-far int16) + (next-far-mid int16) + (next-mid int16) + (next-near-mid int16) + (next-near int16) + (next-far-scissor int16) + (next-near-mid-scissor int16) + (next-near-scissor int16) + (count-far int16) + (count-far-mid int16) + (count-mid int16) + (count-near-mid int16) + (count-near int16) + (count-far-scissor int16) + (count-near-mid-scissor int16) + (count-near-scissor int16) + (size-far int32) + (size-far-mid int32) + (size-mid int32) + (size-near-mid int32) + (size-near int32) + (size-far-scissor int32) + (size-near-mid-scissor int32) + (size-near-scissor int32) + (size-texture int32) + (poly-far hfrag-poly25) + (poly-mid25 uint32) + (poly-mid uint32) + (poly-near uint32) + (far-texture uint32) + (near-textures uint16 16) + (draw-table uint16 1024 :offset 8456) + (corners uint128 1024) + ) + (:methods + (hfrag-work-method-9 () none) + (hfrag-work-method-10 () none) + (hfrag-work-method-11 () none) + (hfrag-work-method-12 () none) + (hfrag-work-method-13 () none) + (hfrag-work-method-14 () none) + (hfrag-work-method-15 () none) + (hfrag-work-method-16 () none) + (hfrag-work-method-17 () none) + (hfrag-work-method-18 () none) + (hfrag-work-method-19 () none) + (hfrag-work-method-20 () none) + (hfrag-work-method-21 () none) + (hfrag-work-method-22 () none) + (hfrag-work-method-23 () none) + (hfrag-work-method-24 () none) + (hfrag-work-method-25 () none) + (hfrag-work-method-26 () none) + (hfrag-work-method-27 () none) + (hfrag-work-method-28 () none) + (hfrag-work-method-29 () none) + (hfrag-work-method-30 () none) + (hfrag-work-method-31 () none) + (hfrag-work-method-32 () none) + (hfrag-work-method-33 () none) + (hfrag-work-method-34 () none) + (hfrag-work-method-35 () none) + ) + ) + +;; definition for method 3 of type hfrag-work +(defmethod inspect ((this hfrag-work)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'hfrag-work) + (format #t "~1Tfar-chaina[6] @ #x~X~%" (-> this far-chaina)) + (format #t "~1Tfar-chainb[6] @ #x~X~%" (-> this far-chainb)) + (format #t "~1Tmid-chaina[10] @ #x~X~%" (-> this mid-chaina)) + (format #t "~1Tmid-chainb[10] @ #x~X~%" (-> this mid-chainb)) + (format #t "~1Tnear-chaina[18] @ #x~X~%" (-> this near-chaina)) + (format #t "~1Tnear-chainb[18] @ #x~X~%" (-> this near-chainb)) + (format #t "~1Tpoly4-tmpl[3] @ #x~X~%" (-> this poly4-tmpl)) + (format #t "~1Tpoly9-tmpl[3] @ #x~X~%" (-> this poly9-tmpl)) + (format #t "~1Tpoly25-tmpl[3] @ #x~X~%" (-> this poly25-tmpl)) + (format #t "~1Tinit-tmpl[3] @ #x~X~%" (-> this init-tmpl)) + (format #t "~1Tcontrol-tmpl[2] @ #x~X~%" (-> this control-tmpl)) + (format #t "~1Theights4-tmpl[2] @ #x~X~%" (-> this heights4-tmpl)) + (format #t "~1Tcolors4-tmpl[2] @ #x~X~%" (-> this colors4-tmpl)) + (format #t "~1Theights9-tmpl[2] @ #x~X~%" (-> this heights9-tmpl)) + (format #t "~1Tcolors9-tmpl[2] @ #x~X~%" (-> this colors9-tmpl)) + (format #t "~1Theights25-tmpl[2] @ #x~X~%" (-> this heights25-tmpl)) + (format #t "~1Tcolors25-tmpl[2] @ #x~X~%" (-> this colors25-tmpl)) + (format #t "~1Tinit-vu1-tmpl[2] @ #x~X~%" (-> this init-vu1-tmpl)) + (format #t "~1Tnext-tmpl: #~%" (-> this next-tmpl)) + (format #t "~1Tcall-tmpl: #~%" (-> this call-tmpl)) + (format #t "~1Tret-tmpl: #~%" (-> this ret-tmpl)) + (format #t "~1Tnext-scissor-tmpl: #~%" (-> this next-scissor-tmpl)) + (format #t "~1Tret-scissor-tmpl: #~%" (-> this ret-scissor-tmpl)) + (format #t "~1Tframe-tmpl: #~%" (-> this frame-tmpl)) + (format #t "~1Tframes[5] @ #x~X~%" (-> this frames)) + (format #t "~1Tadgif-tmpl: #~%" (-> this adgif-tmpl)) + (format #t "~1Tadgif-tmpl2: #~%" (-> this adgif-tmpl2)) + (format #t "~1Tsprite-tmpl: #~%" (-> this sprite-tmpl)) + (format #t "~1Tmip-tmpl: #~%" (-> this mip-tmpl)) + (format #t "~1Tcolor[6] @ #x~X~%" (-> this color)) + (format #t "~1Tfar-data: #~%" (-> this far-data)) + (format #t "~1Tnear-data[16] @ #x~X~%" (-> this near-data)) + (format #t "~1Tmip-data[7] @ #x~X~%" (-> this mip-data)) + (format #t "~1Ttex-data[5] @ #x~X~%" (-> this tex-data)) + (format #t "~1Ttex[6] @ #x~X~%" (-> this tex)) + (format #t "~1Tmontage-tex-coords[128] @ #x~X~%" (-> this montage-tex-coords)) + (format #t "~1Tgiftag: #~%" (-> this giftag)) + (format #t "~1Tcall-abort: #~%" (-> this call-abort)) + (format #t "~1Tcall-abort-vu1: #~%" (-> this call-abort-vu1)) + (format #t "~1Tshader-far: #~%" (-> this shader-far)) + (format #t "~1Tshader-mid: #~%" (-> this shader-mid)) + (format #t "~1Tshader-near: #~%" (-> this shader-near)) + (format #t "~1Tstq[9] @ #x~X~%" (-> this stq)) + (format #t "~1Tshader: #~%" (-> this shader)) + (format #t "~1Tconstants: #~%" (-> this constants)) + (format #t "~1Tpos-temp: #~%" (-> this pos-temp)) + (format #t "~1Ttrans-temp: #~%" (-> this pos-temp)) + (format #t "~1Tdists: #~%" (-> this dists)) + (format #t "~1Trdists: #~%" (-> this rdists)) + (format #t "~1Tcall-poly4-near: ~D~%" (-> this call-poly4-near)) + (format #t "~1Tcall-poly9-mid: ~D~%" (-> this call-poly9-mid)) + (format #t "~1Tcall-poly9-near: ~D~%" (-> this call-poly9-near)) + (format #t "~1Tcall-poly25-far: ~D~%" (-> this call-poly25-far)) + (format #t "~1Tcall-poly25-mid: ~D~%" (-> this call-poly25-mid)) + (format #t "~1Tdma-buffer: ~A~%" (-> this dma-buffer)) + (format #t "~1Tbase: #x~X~%" (-> this base)) + (format #t "~1Twait-to-spr: ~D~%" (-> this wait-to-spr)) + (format #t "~1Twait-from-spr: ~D~%" (-> this wait-from-spr)) + (format #t "~1Tbuffer-end: #x~X~%" (-> this buffer-end)) + (format #t "~1Tsubdiv-index: ~D~%" (-> this subdiv-index)) + (format #t "~1Tscissor: ~A~%" (-> this scissor)) + (format #t "~1Tchain-ptr: ~D~%" (-> this chain-ptr)) + (format #t "~1Tchain-ptr-next: ~D~%" (-> this chain-ptr-next)) + (format #t "~1Tnear-dist: ~f~%" (-> this near-dist)) + (format #t "~1Tfar-dist: ~f~%" (-> this far-dist)) + (format #t "~1Tto-spr: ~D~%" (-> this to-spr)) + (format #t "~1Tfrom-spr: ~D~%" (-> this from-spr)) + (format #t "~1Tlowres-flag: ~A~%" (-> this lowres-flag)) + (format #t "~1Thfrag: #~%" (-> this hfrag)) + (format #t "~1Tnext-far: ~D~%" (-> this next-far)) + (format #t "~1Tnext-far-mid: ~D~%" (-> this next-far-mid)) + (format #t "~1Tnext-mid: ~D~%" (-> this next-mid)) + (format #t "~1Tnext-near-mid: ~D~%" (-> this next-near-mid)) + (format #t "~1Tnext-near: ~D~%" (-> this next-near)) + (format #t "~1Tnext-far-scissor: ~D~%" (-> this next-far-scissor)) + (format #t "~1Tnext-near-mid-scissor: ~D~%" (-> this next-near-mid-scissor)) + (format #t "~1Tnext-near-scissor: ~D~%" (-> this next-near-scissor)) + (format #t "~1Tcount-far: ~D~%" (-> this count-far)) + (format #t "~1Tcount-far-mid: ~D~%" (-> this count-far-mid)) + (format #t "~1Tcount-mid: ~D~%" (-> this count-mid)) + (format #t "~1Tcount-near-mid: ~D~%" (-> this count-near-mid)) + (format #t "~1Tcount-near: ~D~%" (-> this count-near)) + (format #t "~1Tcount-far-scissor: ~D~%" (-> this count-far-scissor)) + (format #t "~1Tcount-near-mid-scissor: ~D~%" (-> this count-near-mid-scissor)) + (format #t "~1Tcount-near-scissor: ~D~%" (-> this count-near-scissor)) + (format #t "~1Tsize-far: ~D~%" (-> this size-far)) + (format #t "~1Tsize-far-mid: ~D~%" (-> this size-far-mid)) + (format #t "~1Tsize-mid: ~D~%" (-> this size-mid)) + (format #t "~1Tsize-near-mid: ~D~%" (-> this size-near-mid)) + (format #t "~1Tsize-near: ~D~%" (-> this size-near)) + (format #t "~1Tsize-far-scissor: ~D~%" (-> this size-far-scissor)) + (format #t "~1Tsize-near-mid-scissor: ~D~%" (-> this size-near-mid-scissor)) + (format #t "~1Tsize-near-scissor: ~D~%" (-> this size-near-scissor)) + (format #t "~1Tsize-texture: ~D~%" (-> this size-texture)) + (format #t "~1Tpoly-far: #~%" (-> this poly-far)) + (format #t "~1Tpoly-mid25: #x~X~%" (-> this poly-mid25)) + (format #t "~1Tpoly-mid: #x~X~%" (-> this poly-mid)) + (format #t "~1Tpoly-near: #x~X~%" (-> this poly-near)) + (format #t "~1Tfar-texture: #x~X~%" (-> this far-texture)) + (format #t "~1Tnear-textures[16] @ #x~X~%" (-> this near-textures)) + (format #t "~1Tdraw-table[1024] @ #x~X~%" (-> this draw-table)) + (format #t "~1Tcorners[1024] @ #x~X~%" (-> this corners)) + (label cfg-4) + this + ) + +;; definition of type hfrag-mip-packet +(deftype hfrag-mip-packet (structure) + ((mip-tmpl dma-gif-packet :inline) + (tex0-1 vector :inline) + (tex1-1 vector :inline) + (texflush vector :inline) + (color vector4w :inline) + (tex0 vector :inline) + (pos0 vector :inline) + (tex1 vector :inline) + (pos1 vector :inline) + ) + ) + +;; definition for method 3 of type hfrag-mip-packet +;; INFO: this function exists in multiple non-identical object files +(defmethod inspect ((this hfrag-mip-packet)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'hfrag-mip-packet) + (format #t "~1Tmip-tmpl: #~%" (-> this mip-tmpl)) + (format #t "~1Ttex0-1: #~%" (-> this tex0-1)) + (format #t "~1Ttex1-1: #~%" (-> this tex1-1)) + (format #t "~1Ttexflush: #~%" (-> this texflush)) + (format #t "~1Tcolor: #~%" (-> this color)) + (format #t "~1Ttex0: #~%" (-> this tex0)) + (format #t "~1Tpos0: #~%" (-> this pos0)) + (format #t "~1Ttex1: #~%" (-> this tex1)) + (format #t "~1Tpos1: #~%" (-> this pos1)) + (label cfg-4) + this + ) + +;; definition of type hfrag-mip-packet-array +(deftype hfrag-mip-packet-array (structure) + ((data hfrag-mip-packet 6 :inline) + ) + ) + +;; definition for method 3 of type hfrag-mip-packet-array +(defmethod inspect ((this hfrag-mip-packet-array)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'hfrag-mip-packet-array) + (format #t "~1Tdata[6] @ #x~X~%" (-> this data)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/engine/gfx/shrub/shrubbery-h_REF.gc b/test/decompiler/reference/jak3/engine/gfx/shrub/shrubbery-h_REF.gc new file mode 100644 index 0000000000..880db4759a --- /dev/null +++ b/test/decompiler/reference/jak3/engine/gfx/shrub/shrubbery-h_REF.gc @@ -0,0 +1,482 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type billboard +(deftype billboard (drawable) + "A billboard for shrubbery in the distance. This is simple a quad that faces the camera. +The only data needed is the texture/mode. The location is determined by bsphere." + ((flat adgif-shader :inline) + ) + ) + +;; definition for method 3 of type billboard +(defmethod inspect ((this billboard)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~1Tflat: #~%" (-> this flat)) + (label cfg-4) + this + ) + +;; definition of type shrub-view-data +(deftype shrub-view-data (structure) + "Camera and general settings for shrubbery VU1 program." + ((data uint128 3) + (texture-giftag gs-gif-tag :inline :overlay-at (-> data 0)) + (consts vector :inline :overlay-at (-> data 1)) + (fog-clamp vector :inline :overlay-at (-> data 2)) + (tex-start-ptr int32 :overlay-at (-> data 1)) + (gifbufsum float :overlay-at (-> data 1)) + (mtx-buf-ptr int32 :overlay-at (-> consts y)) + (exp23 float :overlay-at mtx-buf-ptr) + (fog-0 float :overlay-at (-> consts z)) + (fog-1 float :overlay-at (-> consts w)) + (fog-min float :overlay-at (-> data 2)) + (fog-max float :overlay-at (-> fog-clamp y)) + ) + ) + +;; definition for method 3 of type shrub-view-data +(defmethod inspect ((this shrub-view-data)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'shrub-view-data) + (format #t "~1Tdata[3] @ #x~X~%" (-> this data)) + (format #t "~1Ttexture-giftag: #~%" (-> this data)) + (format #t "~1Tconsts: #~%" (-> this consts)) + (format #t "~1Tfog-clamp: #~%" (-> this fog-clamp)) + (format #t "~1Ttex-start-ptr: ~D~%" (-> this consts x)) + (format #t "~1Tgifbufsum: ~f~%" (-> this consts x)) + (format #t "~1Tmtx-buf-ptr: ~D~%" (-> this consts y)) + (format #t "~1Texp23: ~f~%" (-> this consts y)) + (format #t "~1Tfog-0: ~f~%" (-> this consts z)) + (format #t "~1Tfog-1: ~f~%" (-> this consts w)) + (format #t "~1Tfog-min: ~f~%" (-> this fog-clamp x)) + (format #t "~1Tfog-max: ~f~%" (-> this fog-clamp y)) + (label cfg-4) + this + ) + +;; definition of type shrubbery +(deftype shrubbery (drawable) + "Prototype (mesh/geometry) for a shrub. not _really_ a drawable in any way, as it +overwrites all the normal drawable fields." + ((textures (inline-array adgif-shader) :overlay-at id) + (header qword :offset 8) + (obj-qwc uint8 :offset 12) + (vtx-qwc uint8 :offset 13) + (col-qwc uint8 :offset 14) + (stq-qwc uint8 :offset 15) + (obj uint32 :overlay-at (-> bsphere data 0)) + (vtx uint32 :overlay-at (-> bsphere data 1)) + (col uint32 :overlay-at (-> bsphere data 2)) + (stq uint32 :overlay-at (-> bsphere data 3)) + ) + ) + +;; definition for method 3 of type shrubbery +(defmethod inspect ((this shrubbery)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~1Ttextures: #x~X~%" (-> this textures)) + (format #t "~1Theader: #~%" (-> this header)) + (format #t "~1Tobj-qwc: ~D~%" (-> this obj-qwc)) + (format #t "~1Tvtx-qwc: ~D~%" (-> this vtx-qwc)) + (format #t "~1Tcol-qwc: ~D~%" (-> this col-qwc)) + (format #t "~1Tstq-qwc: ~D~%" (-> this stq-qwc)) + (format #t "~1Tobj: #x~X~%" (-> this bsphere x)) + (format #t "~1Tvtx: #x~X~%" (-> this bsphere y)) + (format #t "~1Tcol: #x~X~%" (-> this bsphere z)) + (format #t "~1Tstq: #x~X~%" (-> this bsphere w)) + (label cfg-4) + this + ) + +;; definition of type instance-shrubbery +(deftype instance-shrubbery (instance) + "Instance of a shrub." + ((flat-normal vector :inline) + (flat-hwidth float :overlay-at (-> flat-normal data 3)) + (color uint32 :offset 8) + ) + ) + +;; definition for method 3 of type instance-shrubbery +(defmethod inspect ((this instance-shrubbery)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~1Tbucket-index: ~D~%" (-> this bucket-index)) + (format #t "~1Torigin: #~%" (-> this origin)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Twind-index: ~D~%" (-> this wind-index)) + (format #t "~1Tflat-normal: #~%" (-> this flat-normal)) + (format #t "~1Tflat-hwidth: ~f~%" (-> this flat-normal w)) + (format #t "~1Tcolor: ~D~%" (-> this color)) + (label cfg-4) + this + ) + +;; definition of type drawable-inline-array-instance-shrub +(deftype drawable-inline-array-instance-shrub (drawable-inline-array) + "Array of shrub instances stored in the level data." + ((data instance-shrubbery 1 :inline) + (pad uint32) + ) + ) + +;; definition of type drawable-tree-instance-shrub +(deftype drawable-tree-instance-shrub (drawable-tree) + "Drawable-tree for the shrubs." + () + ) + +;; definition of type generic-shrub-fragment +(deftype generic-shrub-fragment (drawable) + "Shrub data, converted into the format for generic. +The shrub renderer doesn't support clipping, so it falls back to generic. +This requires storing the data for all shrubs prototype twice!" + ((textures (inline-array adgif-shader) :overlay-at id) + (vtx-cnt uint32 :offset 8) + (cnt-qwc uint8 :offset 12) + (vtx-qwc uint8 :offset 13) + (col-qwc uint8 :offset 14) + (stq-qwc uint8 :offset 15) + (cnt uint32 :overlay-at (-> bsphere data 0)) + (vtx uint32 :overlay-at (-> bsphere data 1)) + (col uint32 :overlay-at (-> bsphere data 2)) + (stq uint32 :overlay-at (-> bsphere data 3)) + ) + ) + +;; definition for method 3 of type generic-shrub-fragment +(defmethod inspect ((this generic-shrub-fragment)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~1Ttextures: #x~X~%" (-> this textures)) + (format #t "~1Tvtx-cnt: ~D~%" (-> this vtx-cnt)) + (format #t "~1Tcnt-qwc: ~D~%" (-> this cnt-qwc)) + (format #t "~1Tvtx-qwc: ~D~%" (-> this vtx-qwc)) + (format #t "~1Tcol-qwc: ~D~%" (-> this col-qwc)) + (format #t "~1Tstq-qwc: ~D~%" (-> this stq-qwc)) + (format #t "~1Tcnt: #x~X~%" (-> this bsphere x)) + (format #t "~1Tvtx: #x~X~%" (-> this bsphere y)) + (format #t "~1Tcol: #x~X~%" (-> this bsphere z)) + (format #t "~1Tstq: #x~X~%" (-> this bsphere w)) + (label cfg-4) + this + ) + +;; definition of type prototype-shrubbery +(deftype prototype-shrubbery (drawable-inline-array) + "Array of shrub prototypes." + ((data shrubbery 1 :inline) + (pad uint32) + ) + ) + +;; definition of type prototype-trans-shrubbery +(deftype prototype-trans-shrubbery (prototype-shrubbery) + "Array of transparent shrub prototypes." + () + ) + +;; definition of type prototype-generic-shrub +(deftype prototype-generic-shrub (drawable-group) + () + ) + +;; definition of type shrubbery-matrix +(deftype shrubbery-matrix (structure) + "Instance matrix for a shrub, contains interpolated color." + ((mat matrix :inline) + (color qword :inline) + ) + ) + +;; definition for method 3 of type shrubbery-matrix +(defmethod inspect ((this shrubbery-matrix)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'shrubbery-matrix) + (format #t "~1Tmat: #~%" (-> this mat)) + (format #t "~1Tcolor: #~%" (-> this color)) + (label cfg-4) + this + ) + +;; definition for function shrubbery-login-post-texture +;; INFO: Used lq/sq +;; WARN: Return type mismatch symbol vs none. +(defun shrubbery-login-post-texture ((arg0 shrubbery)) + "Do some weird fix-up to the shrubbery textures. this is likely to present normal-looking adgifs to the texture system, but then we scramble them up for easier consumption by VU1." + (let* ((v1-1 (-> arg0 header data 0)) + (a1-1 (the-as object (+ (the-as uint (-> arg0 header)) (* (+ (-> arg0 header data 1) 1) 16)))) + (a2-5 (the-as object (+ (the-as int a1-1) (* v1-1 64)))) + (a3-0 (the-as object (-> arg0 textures))) + ) + (dotimes (a0-1 (the-as int v1-1)) + (set! (-> (the-as qword a2-5) quad) (-> (the-as qword a3-0) quad)) + (let ((a2-6 (the-as object (+ (the-as int a2-5) 16))) + (a3-1 (the-as object (&+ (the-as pointer a3-0) 16))) + ) + (set! (-> (the-as qword a1-1) vector4w x) (the-as int (-> (the-as qword a3-1) data 0))) + (set! (-> (the-as qword a1-1) vector4w y) (the-as int (-> (the-as qword a3-1) data 1))) + (set! (-> (the-as qword a1-1) vector4w z) (the-as int (-> (the-as qword a3-1) data 2))) + (set! a1-1 (+ (the-as int a1-1) 16)) + (let ((a3-2 (the-as object (&+ (the-as pointer a3-1) 16)))) + (dotimes (t0-4 3) + (set! (-> (the-as qword a1-1) quad) (-> (the-as qword a3-2) quad)) + (set! a1-1 (+ (the-as int a1-1) 16)) + (set! a3-2 (&+ (the-as pointer a3-2) 16)) + ) + (set! (-> (the-as qword a2-6) quad) (-> (the-as qword a3-2) quad)) + (set! a2-5 (+ (the-as int a2-6) 16)) + (set! a3-0 (&+ (the-as pointer a3-2) 80)) + ) + ) + ) + ) + (none) + ) + +;; definition for symbol *shrub-state*, type int +(define *shrub-state* 0) + +;; definition of type shrub-near-packet +(deftype shrub-near-packet (structure) + "DMA templates for generic rendering of shrubs." + ((matrix-tmpl dma-packet :inline) + (header-tmpl dma-packet :inline) + (stq-tmpl dma-packet :inline) + (color-tmpl dma-packet :inline) + (vertex-tmpl dma-packet :inline) + (mscal-tmpl dma-packet :inline) + (init-tmpl dma-packet :inline) + (init-data qword 8) + ) + ) + +;; definition for method 3 of type shrub-near-packet +(defmethod inspect ((this shrub-near-packet)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'shrub-near-packet) + (format #t "~1Tmatrix-tmpl: #~%" (-> this matrix-tmpl)) + (format #t "~1Theader-tmpl: #~%" (-> this header-tmpl)) + (format #t "~1Tstq-tmpl: #~%" (-> this stq-tmpl)) + (format #t "~1Tcolor-tmpl: #~%" (-> this color-tmpl)) + (format #t "~1Tvertex-tmpl: #~%" (-> this vertex-tmpl)) + (format #t "~1Tmscal-tmpl: #~%" (-> this mscal-tmpl)) + (format #t "~1Tinit-tmpl: #~%" (-> this init-tmpl)) + (format #t "~1Tinit-data[8] @ #x~X~%" (-> this init-data)) + (label cfg-4) + this + ) + +;; definition of type instance-shrub-work +(deftype instance-shrub-work (structure) + "Scratchpad layout for generating shrub DMA." + ((dummy qword 3 :inline) + (chaina qword 8 :inline) + (chainb qword 8 :inline) + (colors rgba 1024) + (matrix-tmpl qword 20 :inline) + (count-tmpl vector4w 20 :inline) + (mscalf-tmpl dma-packet :inline) + (mscalf-ret-tmpl dma-packet :inline) + (adgif-tmpl dma-gif-packet :inline) + (billboard-tmpl dma-gif-packet :inline) + (billboard-const vector :inline) + (shrub-near-packets shrub-near-packet 6 :inline) + (dma-ref dma-packet :inline) + (dma-end dma-packet :inline) + (wind-const vector :inline) + (constants vector :inline) + (color-constant vector4w :inline) + (hmge-d vector :inline) + (hvdf-offset vector :inline) + (wind-force vector :inline) + (color vector :inline) + (bb-color vector :inline) + (min-dist vector :inline) + (temp-vec vector :inline) + (guard-plane plane 4 :inline) + (plane plane 4 :inline) + (last uint32 4) + (next uint32 4) + (count uint16 4) + (mod-count uint16 4) + (wind-vectors uint32) + (instance-ptr uint32) + (chain-ptr uint32) + (chain-ptr-next uint32) + (stack-ptr uint32) + (bucket-ptr uint32) + (src-ptr uint32) + (to-spr uint32) + (from-spr uint32) + (shrub-count uint32) + (stack-ptr2 uint32 :overlay-at stack-ptr) + (node uint32 6 :offset 6428) + (length uint32 6) + (prototypes uint32) + (bucket-ptr2 uint32 :overlay-at bucket-ptr) + (start-bank uint8 20 :offset 6484) + (buffer-index uint32) + (current-spr uint32) + (current-mem uint32) + (current-shrub-near-packet uint32) + (current-shrub-near-trans-packet uint32) + (to-spr2 uint32 :overlay-at to-spr) + (dma-buffer basic :offset 6528) + (near-last uint32) + (near-next uint32) + (near-count uint32) + (near-trans-last uint32) + (near-trans-next uint32) + (near-trans-count uint32) + (last-shrubs uint32) + (chains uint32) + (flags uint32) + (node-count uint32) + (inst-count uint32) + (wait-from-spr uint32) + (wait-to-spr uint32) + (texture-dists uint32) + ) + ) + +;; definition for method 3 of type instance-shrub-work +(defmethod inspect ((this instance-shrub-work)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'instance-shrub-work) + (format #t "~1Tdummy[3] @ #x~X~%" (-> this dummy)) + (format #t "~1Tchaina[8] @ #x~X~%" (-> this chaina)) + (format #t "~1Tchainb[8] @ #x~X~%" (-> this chainb)) + (format #t "~1Tcolors[1024] @ #x~X~%" (-> this colors)) + (format #t "~1Tmatrix-tmpl[20] @ #x~X~%" (-> this matrix-tmpl)) + (format #t "~1Tcount-tmpl[20] @ #x~X~%" (-> this count-tmpl)) + (format #t "~1Tmscalf-tmpl: #~%" (-> this mscalf-tmpl)) + (format #t "~1Tmscalf-ret-tmpl: #~%" (-> this mscalf-ret-tmpl)) + (format #t "~1Tadgif-tmpl: #~%" (-> this adgif-tmpl)) + (format #t "~1Tbillboard-tmpl: #~%" (-> this billboard-tmpl)) + (format #t "~1Tbillboard-const: #~%" (-> this billboard-const)) + (format #t "~1Tshrub-near-packets[6] @ #x~X~%" (-> this shrub-near-packets)) + (format #t "~1Tdma-ref: #~%" (-> this dma-ref)) + (format #t "~1Tdma-end: #~%" (-> this dma-end)) + (format #t "~1Twind-const: #~%" (-> this wind-const)) + (format #t "~1Tconstants: #~%" (-> this constants)) + (format #t "~1Tcolor-constant: #~%" (-> this color-constant)) + (format #t "~1Thmge-d: #~%" (-> this hmge-d)) + (format #t "~1Thvdf-offset: #~%" (-> this hvdf-offset)) + (format #t "~1Twind-force: #~%" (-> this wind-force)) + (format #t "~1Tcolor: #~%" (-> this color)) + (format #t "~1Tbb-color: #~%" (-> this bb-color)) + (format #t "~1Tmin-dist: #~%" (-> this min-dist)) + (format #t "~1Ttemp-vec: #~%" (-> this temp-vec)) + (format #t "~1Tguard-plane[4] @ #x~X~%" (-> this guard-plane)) + (format #t "~1Tplane[4] @ #x~X~%" (-> this plane)) + (format #t "~1Tlast[4] @ #x~X~%" (-> this last)) + (format #t "~1Tnext[4] @ #x~X~%" (-> this next)) + (format #t "~1Tcount[4] @ #x~X~%" (-> this count)) + (format #t "~1Tmod-count[4] @ #x~X~%" (-> this mod-count)) + (format #t "~1Twind-vectors: #x~X~%" (-> this wind-vectors)) + (format #t "~1Tinstance-ptr: ~D~%" (-> this instance-ptr)) + (format #t "~1Tchain-ptr: ~D~%" (-> this chain-ptr)) + (format #t "~1Tchain-ptr-next: ~D~%" (-> this chain-ptr-next)) + (format #t "~1Tstack-ptr: ~D~%" (-> this stack-ptr)) + (format #t "~1Tbucket-ptr: ~D~%" (-> this bucket-ptr)) + (format #t "~1Tsrc-ptr: ~D~%" (-> this src-ptr)) + (format #t "~1Tto-spr: ~D~%" (-> this to-spr)) + (format #t "~1Tfrom-spr: ~D~%" (-> this from-spr)) + (format #t "~1Tshrub-count: ~D~%" (-> this shrub-count)) + (format #t "~1Tstack-ptr: ~D~%" (-> this stack-ptr)) + (format #t "~1Tnode[6] @ #x~X~%" (-> this node)) + (format #t "~1Tlength[6] @ #x~X~%" (-> this length)) + (format #t "~1Tprototypes: ~D~%" (-> this prototypes)) + (format #t "~1Tbucket-ptr: ~D~%" (-> this bucket-ptr)) + (format #t "~1Tstart-bank[20] @ #x~X~%" (-> this start-bank)) + (format #t "~1Tbuffer-index: ~D~%" (-> this buffer-index)) + (format #t "~1Tcurrent-spr: ~D~%" (-> this current-spr)) + (format #t "~1Tcurrent-mem: ~D~%" (-> this current-mem)) + (format #t "~1Tcurrent-shrub-near-packet: ~D~%" (-> this current-shrub-near-packet)) + (format #t "~1Tcurrent-shrub-near-trans-packet: ~D~%" (-> this current-shrub-near-trans-packet)) + (format #t "~1Tto-spr: ~D~%" (-> this to-spr)) + (format #t "~1Tdma-buffer: ~A~%" (-> this dma-buffer)) + (format #t "~1Tnear-last: ~D~%" (-> this near-last)) + (format #t "~1Tnear-next: ~D~%" (-> this near-next)) + (format #t "~1Tnear-count: ~D~%" (-> this near-count)) + (format #t "~1Tnear-trans-last: ~D~%" (-> this near-trans-last)) + (format #t "~1Tnear-trans-next: ~D~%" (-> this near-trans-next)) + (format #t "~1Tnear-trans-count: ~D~%" (-> this near-trans-count)) + (format #t "~1Tlast-shrubs: ~D~%" (-> this last-shrubs)) + (format #t "~1Tchains: ~D~%" (-> this chains)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tnode-count: ~D~%" (-> this node-count)) + (format #t "~1Tinst-count: ~D~%" (-> this inst-count)) + (format #t "~1Twait-from-spr: ~D~%" (-> this wait-from-spr)) + (format #t "~1Twait-to-spr: ~D~%" (-> this wait-to-spr)) + (format #t "~1Ttexture-dists: #x~X~%" (-> this texture-dists)) + (label cfg-4) + this + ) + +;; definition of type instance-shrub-dma +(deftype instance-shrub-dma (structure) + ((instancea uint128 325) + (instanceb uint128 325) + (outa uint128 128) + (outb uint128 128) + ) + ) + +;; definition for method 3 of type instance-shrub-dma +(defmethod inspect ((this instance-shrub-dma)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'instance-shrub-dma) + (format #t "~1Tinstancea[325] @ #x~X~%" (-> this instancea)) + (format #t "~1Tinstanceb[325] @ #x~X~%" (-> this instanceb)) + (format #t "~1Touta[128] @ #x~X~%" (-> this outa)) + (format #t "~1Toutb[128] @ #x~X~%" (-> this outb)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/engine/gfx/sprite/particles/sparticle-launcher-h_REF.gc b/test/decompiler/reference/jak3/engine/gfx/sprite/particles/sparticle-launcher-h_REF.gc new file mode 100644 index 0000000000..14765bd338 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/gfx/sprite/particles/sparticle-launcher-h_REF.gc @@ -0,0 +1,372 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type sparticle-birthinfo +(deftype sparticle-birthinfo (structure) + "Used internally by the sparticle code." + ((sprite uint32) + (anim int32) + (anim-speed float) + (birth-func basic) + (joint-ppoint int32) + (num-to-birth float) + (sound basic) + (dataf float 1 :overlay-at sprite) + (data uint32 1 :overlay-at sprite) + ) + ) + +;; definition for method 3 of type sparticle-birthinfo +(defmethod inspect ((this sparticle-birthinfo)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'sparticle-birthinfo) + (format #t "~1Tsprite: ~D~%" (-> this sprite)) + (format #t "~1Tanim: ~D~%" (-> this anim)) + (format #t "~1Tanim-speed: ~f~%" (-> this anim-speed)) + (format #t "~1Tbirth-func: ~A~%" (-> this birth-func)) + (format #t "~1Tjoint-ppoint: ~D~%" (-> this joint-ppoint)) + (format #t "~1Tnum-to-birth: ~f~%" (-> this num-to-birth)) + (format #t "~1Tsound: ~A~%" (-> this sound)) + (format #t "~1Tdataf[1] @ #x~X~%" (&-> this sprite)) + (format #t "~1Tdata[1] @ #x~X~%" (&-> this sprite)) + (label cfg-4) + this + ) + +;; definition of type sp-field-init-spec +(deftype sp-field-init-spec (structure) + "Part of a particle definition - how to initialize a field of a particle." + ((field sp-field-id) + (flags sp-flag) + (initial-valuef float) + (random-rangef float) + (random-multf float) + (initial-value int32 :overlay-at initial-valuef) + (random-range int32 :overlay-at random-rangef) + (random-mult int32 :overlay-at random-multf) + (func symbol :overlay-at initial-valuef) + (tex texture-id :overlay-at initial-valuef) + (pntr pointer :overlay-at initial-valuef) + (object basic :overlay-at initial-valuef) + (sym symbol :overlay-at initial-valuef) + (sound sound-spec :overlay-at initial-valuef) + ) + ) + +;; definition for method 3 of type sp-field-init-spec +(defmethod inspect ((this sp-field-init-spec)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'sp-field-init-spec) + (format #t "~1Tfield: ~D~%" (-> this field)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tinitial-valuef: ~f~%" (-> this initial-valuef)) + (format #t "~1Trandom-rangef: ~f~%" (-> this random-rangef)) + (format #t "~1Trandom-multf: ~f~%" (-> this random-multf)) + (format #t "~1Tinitial-value: ~D~%" (-> this initial-valuef)) + (format #t "~1Trandom-range: ~D~%" (-> this random-rangef)) + (format #t "~1Trandom-mult: ~D~%" (-> this random-multf)) + (format #t "~1Tfunc: ~A~%" (-> this initial-valuef)) + (format #t "~1Ttex: ~D~%" (-> this initial-valuef)) + (format #t "~1Tpntr: #x~X~%" (-> this initial-valuef)) + (format #t "~1Tobject: ~A~%" (-> this initial-valuef)) + (format #t "~1Tsym: ~A~%" (-> this initial-valuef)) + (format #t "~1Tsound: ~A~%" (-> this initial-valuef)) + (label cfg-4) + this + ) + +;; definition of type sparticle-launcher +(deftype sparticle-launcher (basic) + "A definition of a single particle, as a list of init specs." + ((birthaccum float) + (soundaccum float) + (init-specs (inline-array sp-field-init-spec)) + ) + (:methods + (get-field-spec-by-id (_type_ sp-field-id) sp-field-init-spec) + (setup-special-textures (_type_ string) none) + ) + ) + +;; definition for method 3 of type sparticle-launcher +(defmethod inspect ((this sparticle-launcher)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tbirthaccum: ~f~%" (-> this birthaccum)) + (format #t "~1Tsoundaccum: ~f~%" (-> this soundaccum)) + (format #t "~1Tinit-specs: #x~X~%" (-> this init-specs)) + (label cfg-4) + this + ) + +;; definition of type sparticle-group-item +(deftype sparticle-group-item (structure) + "A reference to a single sparticle-launcher (by ID) and some parameters for using it." + ((launcher uint32) + (fade-after meters) + (falloff-to meters) + (flags sp-group-item-flag) + (period uint16) + (length uint16) + (offset int16) + (hour-mask uint32) + (binding uint32) + ) + ) + +;; definition for method 3 of type sparticle-group-item +(defmethod inspect ((this sparticle-group-item)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'sparticle-group-item) + (format #t "~1Tlauncher: ~D~%" (-> this launcher)) + (format #t "~1Tfade-after: (meters ~m)~%" (-> this fade-after)) + (format #t "~1Tfalloff-to: (meters ~m)~%" (-> this falloff-to)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tperiod: ~D~%" (-> this period)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Toffset: ~D~%" (-> this offset)) + (format #t "~1Thour-mask: ~D~%" (-> this hour-mask)) + (format #t "~1Tbinding: ~D~%" (-> this binding)) + (label cfg-4) + this + ) + +;; definition of type sparticle-launch-state +(deftype sparticle-launch-state (structure) + "The state associated with a launcher of a given sparticle." + ((group-item sparticle-group-item) + (flags sp-launch-state-flags) + (randomize uint16) + (center vector) + (sprite3d sprite-vec-data-3d) + (sprite sparticle-cpuinfo) + (offset uint32) + (accum float) + (spawn-time uint32) + (control sparticle-launch-control) + (swarm basic :overlay-at offset) + (seed uint32 :overlay-at accum) + (time uint32 :overlay-at spawn-time) + (spec basic :overlay-at sprite) + (id uint32 :overlay-at sprite3d) + ) + ) + +;; definition for method 3 of type sparticle-launch-state +(defmethod inspect ((this sparticle-launch-state)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'sparticle-launch-state) + (format #t "~1Tgroup-item: #~%" (-> this group-item)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Trandomize: ~D~%" (-> this randomize)) + (format #t "~1Tcenter: #~%" (-> this center)) + (format #t "~1Tsprite3d: #~%" (-> this sprite3d)) + (format #t "~1Tsprite: ~A~%" (-> this sprite)) + (format #t "~1Toffset: ~D~%" (-> this offset)) + (format #t "~1Taccum: ~f~%" (-> this accum)) + (format #t "~1Tspawn-time: ~D~%" (-> this spawn-time)) + (format #t "~1Tcontrol: ~A~%" (-> this control)) + (format #t "~1Tswarm: ~A~%" (-> this offset)) + (format #t "~1Tseed: ~D~%" (-> this accum)) + (format #t "~1Ttime: ~D~%" (-> this spawn-time)) + (format #t "~1Tspec: ~A~%" (-> this sprite)) + (format #t "~1Tid: ~D~%" (-> this sprite3d)) + (label cfg-4) + this + ) + +;; definition of type sparticle-launch-group +(deftype sparticle-launch-group (basic) + "Definition of multiple a particle-group, which is a collection of particle effects." + ((length int16) + (duration uint16) + (linger-duration uint16) + (flags sp-group-flag) + (name string) + (launcher (inline-array sparticle-group-item)) + (rotate-x degrees) + (rotate-y degrees) + (rotate-z degrees) + (scale-x float) + (scale-y float) + (scale-z float) + (bounds sphere :inline) + ) + (:methods + (create-launch-control (_type_ process) sparticle-launch-control) + ) + ) + +;; definition for method 3 of type sparticle-launch-group +(defmethod inspect ((this sparticle-launch-group)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tduration: ~D~%" (-> this duration)) + (format #t "~1Tlinger-duration: ~D~%" (-> this linger-duration)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tlauncher: #x~X~%" (-> this launcher)) + (format #t "~1Trotate-x: (deg ~r)~%" (-> this rotate-x)) + (format #t "~1Trotate-y: (deg ~r)~%" (-> this rotate-y)) + (format #t "~1Trotate-z: (deg ~r)~%" (-> this rotate-z)) + (format #t "~1Tscale-x: ~f~%" (-> this scale-x)) + (format #t "~1Tscale-y: ~f~%" (-> this scale-y)) + (format #t "~1Tscale-z: ~f~%" (-> this scale-z)) + (format #t "~1Tbounds: #~%" (-> this bounds)) + (label cfg-4) + this + ) + +;; definition for symbol *launch-matrix*, type matrix +(define *launch-matrix* (matrix-identity! (new 'global 'matrix))) + +;; definition of type sparticle-launch-control +(deftype sparticle-launch-control (inline-array-class) + "Top-level type containing all the state needed to launch a particle group. +These are typically owned by a process, and allocated on the process heap. +These refer to static particle definitions, and then spawn particles that are tracked by the +particle system itself. This type just holds the launching-related state." + ((group sparticle-launch-group) + (proc process-drawable) + (local-clock int32) + (fade float) + (matrix int8) + (state-mode uint8 3) + (state-counter uint32) + (local-space-binding particle-local-space-info :overlay-at fade) + (last-spawn-frame int32) + (last-spawn-time int32) + (origin matrix :inline) + (center vector :inline :overlay-at (-> origin data 12)) + (data sparticle-launch-state :inline :dynamic) + ) + (:methods + (sparticle-launch-control-method-14 () none) + (sparticle-launch-control-method-15 () none) + (sparticle-launch-control-method-16 () none) + (sparticle-launch-control-method-17 () none) + (sparticle-launch-control-method-18 () none) + (sparticle-launch-control-method-19 () none) + (sparticle-launch-control-method-20 () none) + ) + ) + +;; definition for method 3 of type sparticle-launch-control +(defmethod inspect ((this sparticle-launch-control)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tgroup: ~A~%" (-> this group)) + (format #t "~1Tproc: ~A~%" (-> this proc)) + (format #t "~1Tlocal-clock: ~D~%" (-> this local-clock)) + (format #t "~1Tfade: ~f~%" (-> this fade)) + (format #t "~1Tmatrix: ~D~%" (-> this matrix)) + (format #t "~1Tstate-mode[3] @ #x~X~%" (-> this state-mode)) + (format #t "~1Tstate-counter: ~D~%" (-> this state-counter)) + (format #t "~1Tlocal-space-binding: #~%" (-> this fade)) + (format #t "~1Tlast-spawn-frame: ~D~%" (-> this last-spawn-frame)) + (format #t "~1Tlast-spawn-time: ~D~%" (-> this last-spawn-time)) + (format #t "~1Torigin: #~%" (-> this origin)) + (format #t "~1Tcenter: ~`vector`P~%" (-> this origin trans)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(set! (-> sparticle-launch-control heap-base) (the-as uint 48)) + +;; definition of type sparticle-subsampler +(deftype sparticle-subsampler (basic) + ((spt-num float) + (sp-system sparticle-system) + (sp-launcher sparticle-launcher) + (spawn-mat matrix :inline) + (inited? basic) + ) + (:methods + (new (symbol type sparticle-system sparticle-launcher float) _type_) + (sparticle-subsampler-method-9 () none) + (sparticle-subsampler-method-10 () none) + ) + ) + +;; definition for method 3 of type sparticle-subsampler +(defmethod inspect ((this sparticle-subsampler)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tspt-num: ~f~%" (-> this spt-num)) + (format #t "~1Tsp-system: ~A~%" (-> this sp-system)) + (format #t "~1Tsp-launcher: ~A~%" (-> this sp-launcher)) + (format #t "~1Tspawn-mat: #~%" (-> this spawn-mat)) + (format #t "~1Tinited?: ~A~%" (-> this inited?)) + (label cfg-4) + this + ) + +;; definition for method 0 of type sparticle-subsampler +(defmethod new sparticle-subsampler ((allocation symbol) (type-to-make type) (arg0 sparticle-system) (arg1 sparticle-launcher) (arg2 float)) + (let ((s3-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (if (zero? s3-0) + (go process-drawable-art-error "sparticle-subsampler") + ) + (set! (-> s3-0 sp-launcher) arg1) + (set! (-> s3-0 inited?) #f) + (set! (-> s3-0 sp-system) arg0) + (set! (-> s3-0 spt-num) arg2) + (matrix-identity! (-> s3-0 spawn-mat)) + s3-0 + ) + ) + +;; definition for function compute-rot-in-screenspace +(defun compute-rot-in-screenspace ((arg0 vector)) + "Unclear what this does, but I'm not actually sure it makes sense. Unused" + 0.0 + (let ((a0-1 (-> (math-camera-matrix) fvec))) + 0.0 + (let ((v1-0 (new 'stack-no-clear 'vector))) + (let ((f0-3 (vector-dot a0-1 arg0))) + (vector-float*! v1-0 a0-1 f0-3) + ) + (vector-! arg0 arg0 v1-0) + ) + ) + (let ((a2-1 (matrix-transpose! (new 'stack-no-clear 'matrix) (math-camera-matrix)))) + (vector-matrix*! arg0 arg0 a2-1) + ) + (the float (sar (shl (the int (atan (-> arg0 y) (* -1.0 (-> arg0 x)))) 48) 48)) + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/engine/gfx/tfrag/tfrag-h_REF.gc b/test/decompiler/reference/jak3/engine/gfx/tfrag/tfrag-h_REF.gc new file mode 100644 index 0000000000..5a9f333491 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/gfx/tfrag/tfrag-h_REF.gc @@ -0,0 +1,457 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type tfragment-stats +(deftype tfragment-stats (structure) + "Triangle and vertex stats for a single tfragment." + ((num-tris uint16 4) + (num-dverts uint16 4) + ) + ) + +;; definition for method 3 of type tfragment-stats +(defmethod inspect ((this tfragment-stats)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'tfragment-stats) + (format #t "~1Tnum-tris[4] @ #x~X~%" (-> this num-tris)) + (format #t "~1Tnum-dverts[4] @ #x~X~%" (-> this num-dverts)) + (label cfg-4) + this + ) + +;; definition of type tfragment-debug-data +(deftype tfragment-debug-data (structure) + "Optional debug information (stats, lines) for a tfragment." + ((stats tfragment-stats :inline) + (debug-lines (array vector-array)) + ) + ) + +;; definition for method 3 of type tfragment-debug-data +(defmethod inspect ((this tfragment-debug-data)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'tfragment-debug-data) + (format #t "~1Tstats: #~%" (-> this stats)) + (format #t "~1Tdebug-lines: ~A~%" (-> this debug-lines)) + (label cfg-4) + this + ) + +;; definition of type generic-tfragment +(deftype generic-tfragment (structure) + "Unused. Could have been a way to render tfrag's through generic." + ((dummy int32) + ) + ) + +;; definition for method 3 of type generic-tfragment +(defmethod inspect ((this generic-tfragment)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'generic-tfragment) + (format #t "~1Tdummy: ~D~%" (-> this dummy)) + (label cfg-4) + this + ) + +;; definition of type tfragment +(deftype tfragment (drawable) + "A tfrag mesh fragment. This is just references to DMA data, plus some metadata." + ((color-index uint16 :offset 6) + (debug-data tfragment-debug-data :offset 8) + (color-indices uint32 :offset 12) + (colors uint32 :overlay-at color-indices) + (dma-chain uint32 3 :offset 32) + (dma-common uint32 :overlay-at (-> dma-chain 0)) + (dma-level-0 uint32 :overlay-at dma-common) + (dma-base uint32 :overlay-at (-> dma-chain 1)) + (dma-level-1 uint32 :overlay-at (-> dma-chain 2)) + (dma-qwc uint8 4 :offset 44) + (shader (inline-array adgif-shader) :offset 48) + (num-shaders uint8 :offset 52) + (num-base-colors uint8 :offset 53) + (num-level0-colors uint8 :offset 54) + (num-level1-colors uint8 :offset 55) + (color-offset uint8 :offset 56) + (color-count uint8 :offset 57) + (texture-masks-index uint16 :offset 58) + (generic generic-tfragment :offset 60) + ) + ) + +;; definition for method 3 of type tfragment +(defmethod inspect ((this tfragment)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~1Tcolor-index: ~D~%" (-> this color-index)) + (format #t "~1Tdebug-data: #~%" (-> this debug-data)) + (format #t "~1Tcolor-indices: #x~X~%" (-> this color-indices)) + (format #t "~1Tcolors: #x~X~%" (-> this color-indices)) + (format #t "~1Tdma-chain[3] @ #x~X~%" (-> this dma-chain)) + (format #t "~1Tdma-common: #x~X~%" (-> this dma-common)) + (format #t "~1Tdma-level-0: #x~X~%" (-> this dma-common)) + (format #t "~1Tdma-base: #x~X~%" (-> this dma-base)) + (format #t "~1Tdma-level-1: #x~X~%" (-> this dma-level-1)) + (format #t "~1Tdma-qwc[4] @ #x~X~%" (-> this dma-qwc)) + (format #t "~1Tshader: #x~X~%" (-> this shader)) + (format #t "~1Tnum-shaders: ~D~%" (-> this num-shaders)) + (format #t "~1Tnum-base-colors: ~D~%" (-> this num-base-colors)) + (format #t "~1Tnum-level0-colors: ~D~%" (-> this num-level0-colors)) + (format #t "~1Tnum-level1-colors: ~D~%" (-> this num-level1-colors)) + (format #t "~1Tcolor-offset: ~D~%" (-> this color-offset)) + (format #t "~1Tcolor-count: ~D~%" (-> this color-count)) + (format #t "~1Ttexture-masks-index: ~D~%" (-> this texture-masks-index)) + (format #t "~1Tgeneric: #~%" (-> this generic)) + (label cfg-4) + this + ) + +;; definition of type drawable-inline-array-tfrag +(deftype drawable-inline-array-tfrag (drawable-inline-array) + "Array of tfragments" + ((data tfragment 1 :inline) + (pad uint32) + ) + ) + +;; definition of type drawable-inline-array-tfrag-trans +(deftype drawable-inline-array-tfrag-trans (drawable-inline-array-tfrag) + ((data2 tfragment 1 :inline) + (pad2 uint32) + ) + ) + +;; definition of type drawable-inline-array-tfrag-water +(deftype drawable-inline-array-tfrag-water (drawable-inline-array-tfrag) + ((data2 tfragment 1 :inline) + (pad2 uint32) + ) + ) + +;; definition of type drawable-tree-tfrag +(deftype drawable-tree-tfrag (drawable-tree) + "top level tfrag tree." + ((time-of-day-pal time-of-day-palette :offset 12) + (arrays drawable-inline-array :dynamic :offset 32) + ) + ) + +;; definition of type drawable-tree-tfrag-trans +(deftype drawable-tree-tfrag-trans (drawable-tree-tfrag) + () + ) + +;; definition of type drawable-tree-tfrag-water +(deftype drawable-tree-tfrag-water (drawable-tree-tfrag-trans) + () + ) + +;; definition of type tfrag-dists +(deftype tfrag-dists (structure) + "Distances for mesh level-of-detail blending for use on VU1." + ((data uint32 16) + (vector vector 4 :overlay-at (-> data 0)) + (k0s vector 2 :overlay-at (-> data 0)) + (k1s vector 2 :overlay-at (-> data 8)) + ) + ) + +;; definition for method 3 of type tfrag-dists +(defmethod inspect ((this tfrag-dists)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'tfrag-dists) + (format #t "~1Tdata[16] @ #x~X~%" (-> this data)) + (format #t "~1Tvector[4] @ #x~X~%" (-> this data)) + (format #t "~1Tk0s[2] @ #x~X~%" (-> this data)) + (format #t "~1Tk1s[2] @ #x~X~%" (-> this k1s)) + (label cfg-4) + this + ) + +;; definition of type tfrag-data +(deftype tfrag-data (structure) + "Constants for VU1 data memory for tfrag rendering." + ((data uint32 56) + (vector vector 14 :overlay-at (-> data 0)) + (fog vector :inline :overlay-at (-> data 0)) + (val vector :inline :overlay-at (-> data 4)) + (strgif gs-gif-tag :inline :overlay-at (-> data 8)) + (fangif gs-gif-tag :inline :overlay-at (-> data 12)) + (adgif gs-gif-tag :inline :overlay-at (-> data 16)) + (hvdf-offset vector :inline :overlay-at (-> data 20)) + (hmge-scale vector :inline :overlay-at (-> data 24)) + (invh-scale vector :inline :overlay-at (-> data 28)) + (ambient vector :inline :overlay-at (-> data 32)) + (guard vector :inline :overlay-at (-> data 36)) + (dists tfrag-dists :inline :overlay-at (-> data 40)) + (k0s uint128 2 :overlay-at (-> data 40)) + (k1s uint128 2 :overlay-at (-> data 48)) + ) + ) + +;; definition for method 3 of type tfrag-data +(defmethod inspect ((this tfrag-data)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'tfrag-data) + (format #t "~1Tdata[56] @ #x~X~%" (-> this data)) + (format #t "~1Tvector[14] @ #x~X~%" (-> this data)) + (format #t "~1Tfog: #~%" (-> this data)) + (format #t "~1Tval: #~%" (-> this val)) + (format #t "~1Tstrgif: #~%" (-> this strgif)) + (format #t "~1Tfangif: #~%" (-> this fangif)) + (format #t "~1Tadgif: #~%" (-> this adgif)) + (format #t "~1Thvdf-offset: #~%" (-> this hvdf-offset)) + (format #t "~1Thmge-scale: #~%" (-> this hmge-scale)) + (format #t "~1Tinvh-scale: #~%" (-> this invh-scale)) + (format #t "~1Tambient: #~%" (-> this ambient)) + (format #t "~1Tguard: #~%" (-> this guard)) + (format #t "~1Tdists: #~%" (-> this dists)) + (format #t "~1Tk0s[2] @ #x~X~%" (-> this dists)) + (format #t "~1Tk1s[2] @ #x~X~%" (-> this dists k1s)) + (label cfg-4) + this + ) + +;; definition of type tfrag-control +(deftype tfrag-control (structure) + "VU1 'control' data containing address and counters." + ((num-base-points uint32) + (num-shared-base-points uint32) + (num-level0-points uint32) + (num-shared-level0-points uint32) + (num-level1-points uint32) + (num-shared-level1-points uint32) + (ptr-vtxdata uint32) + (ptr-base-points uint32) + (ptr-shared-base-points uint32) + (ptr-level0-points uint32) + (ptr-shared-level0-points uint32) + (ptr-level1-points uint32) + (ptr-shared-level1-points uint32) + (ptr-draw-points uint32) + (ptr-interpolated-0 uint32) + (ptr-shared-interpolated-0 uint32) + (ptr-interpolated1 uint32) + (ptr-shared-interpolated1 uint32) + (ptr-strip-data uint32) + (ptr-texture-data uint32) + ) + ) + +;; definition for method 3 of type tfrag-control +(defmethod inspect ((this tfrag-control)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'tfrag-control) + (format #t "~1Tnum-base-points: ~D~%" (-> this num-base-points)) + (format #t "~1Tnum-shared-base-points: ~D~%" (-> this num-shared-base-points)) + (format #t "~1Tnum-level0-points: ~D~%" (-> this num-level0-points)) + (format #t "~1Tnum-shared-level0-points: ~D~%" (-> this num-shared-level0-points)) + (format #t "~1Tnum-level1-points: ~D~%" (-> this num-level1-points)) + (format #t "~1Tnum-shared-level1-points: ~D~%" (-> this num-shared-level1-points)) + (format #t "~1Tptr-vtxdata: ~D~%" (-> this ptr-vtxdata)) + (format #t "~1Tptr-base-points: ~D~%" (-> this ptr-base-points)) + (format #t "~1Tptr-shared-base-points: ~D~%" (-> this ptr-shared-base-points)) + (format #t "~1Tptr-level0-points: ~D~%" (-> this ptr-level0-points)) + (format #t "~1Tptr-shared-level0-points: ~D~%" (-> this ptr-shared-level0-points)) + (format #t "~1Tptr-level1-points: ~D~%" (-> this ptr-level1-points)) + (format #t "~1Tptr-shared-level1-points: ~D~%" (-> this ptr-shared-level1-points)) + (format #t "~1Tptr-draw-points: ~D~%" (-> this ptr-draw-points)) + (format #t "~1Tptr-interpolated-0: ~D~%" (-> this ptr-interpolated-0)) + (format #t "~1Tptr-shared-interpolated-0: ~D~%" (-> this ptr-shared-interpolated-0)) + (format #t "~1Tptr-interpolated1: ~D~%" (-> this ptr-interpolated1)) + (format #t "~1Tptr-shared-interpolated1: ~D~%" (-> this ptr-shared-interpolated1)) + (format #t "~1Tptr-strip-data: ~D~%" (-> this ptr-strip-data)) + (format #t "~1Tptr-texture-data: ~D~%" (-> this ptr-texture-data)) + (label cfg-4) + this + ) + +;; definition of type tfrag-stats +(deftype tfrag-stats (structure) + "TFRAG statistics computed on EE." + ((from int32) + (to int32) + (cnt int32) + (tris int32) + (tfaces int32) + (tfrags int32) + (dtris int32) + (base-verts int32) + (level0-verts int32) + (level1-verts int32) + (dma-cnt int32) + (dma-dta int32) + (dma-tex int32) + (strips int32) + (drawpoints int32) + (vif int32) + ) + ) + +;; definition for method 3 of type tfrag-stats +(defmethod inspect ((this tfrag-stats)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'tfrag-stats) + (format #t "~1Tfrom: ~D~%" (-> this from)) + (format #t "~1Tto: ~D~%" (-> this to)) + (format #t "~1Tcnt: ~D~%" (-> this cnt)) + (format #t "~1Ttris: ~D~%" (-> this tris)) + (format #t "~1Ttfaces: ~D~%" (-> this tfaces)) + (format #t "~1Ttfrags: ~D~%" (-> this tfrags)) + (format #t "~1Tdtris: ~D~%" (-> this dtris)) + (format #t "~1Tbase-verts: ~D~%" (-> this base-verts)) + (format #t "~1Tlevel0-verts: ~D~%" (-> this level0-verts)) + (format #t "~1Tlevel1-verts: ~D~%" (-> this level1-verts)) + (format #t "~1Tdma-cnt: ~D~%" (-> this dma-cnt)) + (format #t "~1Tdma-dta: ~D~%" (-> this dma-dta)) + (format #t "~1Tdma-tex: ~D~%" (-> this dma-tex)) + (format #t "~1Tstrips: ~D~%" (-> this strips)) + (format #t "~1Tdrawpoints: ~D~%" (-> this drawpoints)) + (format #t "~1Tvif: ~D~%" (-> this vif)) + (label cfg-4) + this + ) + +;; definition of type tfrag-packet +(deftype tfrag-packet (structure) + ((tag uint128 2) + ) + ) + +;; definition for method 3 of type tfrag-packet +(defmethod inspect ((this tfrag-packet)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'tfrag-packet) + (format #t "~1Ttag[2] @ #x~X~%" (-> this tag)) + (label cfg-4) + this + ) + +;; definition of type tfrag-work +(deftype tfrag-work (structure) + "Scratch space for generating TFRAG DMA." + ((base-tmpl dma-packet :inline) + (level-0-tmpl dma-packet :inline) + (common-tmpl dma-packet :inline) + (level-1-tmpl dma-packet :inline) + (color-tmpl dma-packet :inline) + (frag-dists vector :inline) + (min-dist vector :inline) + (color-ptr vector4w :inline) + (tr-stat-tfrag tr-stat) + (tr-stat-tfrag-scissor tr-stat) + (vu1-enable-tfrag int32) + (vu1-enable-tfrag-scissor int32) + (cur-vis-bits uint32) + (end-vis-bits uint32) + (src-ptr uint32) + (last-call uint32) + (dma-buffer basic) + (test-id uint32) + (wait-from-spr uint32) + (wait-to-spr uint32) + (near-wait-from-spr uint32) + (near-wait-to-spr uint32) + (max-fragment uint16) + (min-fragment uint16) + (texture-dists uint32) + ) + ) + +;; definition for method 3 of type tfrag-work +(defmethod inspect ((this tfrag-work)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'tfrag-work) + (format #t "~1Tbase-tmpl: #~%" (-> this base-tmpl)) + (format #t "~1Tlevel-0-tmpl: #~%" (-> this level-0-tmpl)) + (format #t "~1Tcommon-tmpl: #~%" (-> this common-tmpl)) + (format #t "~1Tlevel-1-tmpl: #~%" (-> this level-1-tmpl)) + (format #t "~1Tcolor-tmpl: #~%" (-> this color-tmpl)) + (format #t "~1Tfrag-dists: #~%" (-> this frag-dists)) + (format #t "~1Tmin-dist: #~%" (-> this min-dist)) + (format #t "~1Tcolor-ptr: #~%" (-> this color-ptr)) + (format #t "~1Ttr-stat-tfrag: #~%" (-> this tr-stat-tfrag)) + (format #t "~1Ttr-stat-tfrag-scissor: #~%" (-> this tr-stat-tfrag-scissor)) + (format #t "~1Tvu1-enable-tfrag: ~D~%" (-> this vu1-enable-tfrag)) + (format #t "~1Tvu1-enable-tfrag-scissor: ~D~%" (-> this vu1-enable-tfrag-scissor)) + (format #t "~1Tcur-vis-bits: ~D~%" (-> this cur-vis-bits)) + (format #t "~1Tend-vis-bits: ~D~%" (-> this end-vis-bits)) + (format #t "~1Tsrc-ptr: ~D~%" (-> this src-ptr)) + (format #t "~1Tlast-call: ~D~%" (-> this last-call)) + (format #t "~1Tdma-buffer: ~A~%" (-> this dma-buffer)) + (format #t "~1Ttest-id: ~D~%" (-> this test-id)) + (format #t "~1Twait-from-spr: ~D~%" (-> this wait-from-spr)) + (format #t "~1Twait-to-spr: ~D~%" (-> this wait-to-spr)) + (format #t "~1Tnear-wait-from-spr: ~D~%" (-> this near-wait-from-spr)) + (format #t "~1Tnear-wait-to-spr: ~D~%" (-> this near-wait-to-spr)) + (format #t "~1Tmax-fragment: ~D~%" (-> this max-fragment)) + (format #t "~1Tmin-fragment: ~D~%" (-> this min-fragment)) + (format #t "~1Ttexture-dists: #x~X~%" (-> this texture-dists)) + (label cfg-4) + this + ) + +;; definition of type tfrag-dma +(deftype tfrag-dma (structure) + "Memory layout for to/from scratchpad for tfrag." + ((banka tfragment 16 :inline) + (bankb tfragment 16 :inline) + (outa uint128 128) + (outb uint128 128) + (colors rgba 2047) + ) + ) + +;; definition for method 3 of type tfrag-dma +(defmethod inspect ((this tfrag-dma)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'tfrag-dma) + (format #t "~1Tbanka[16] @ #x~X~%" (-> this banka)) + (format #t "~1Tbankb[16] @ #x~X~%" (-> this bankb)) + (format #t "~1Touta[128] @ #x~X~%" (-> this outa)) + (format #t "~1Toutb[128] @ #x~X~%" (-> this outb)) + (format #t "~1Tcolors[2048] @ #x~X~%" (-> this colors)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/engine/gfx/tie/tie-h_REF.gc b/test/decompiler/reference/jak3/engine/gfx/tie/tie-h_REF.gc new file mode 100644 index 0000000000..424fef0dbb --- /dev/null +++ b/test/decompiler/reference/jak3/engine/gfx/tie/tie-h_REF.gc @@ -0,0 +1,669 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type tie-fragment-debug +(deftype tie-fragment-debug (structure) + "Optional debug information about a tie-fragment." + ((num-tris uint16) + (num-dverts uint16) + (debug-lines (array vector-array)) + ) + ) + +;; definition for method 3 of type tie-fragment-debug +(defmethod inspect ((this tie-fragment-debug)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'tie-fragment-debug) + (format #t "~1Tnum-tris: ~D~%" (-> this num-tris)) + (format #t "~1Tnum-dverts: ~D~%" (-> this num-dverts)) + (format #t "~1Tdebug-lines: ~A~%" (-> this debug-lines)) + (label cfg-4) + this + ) + +;; definition of type tie-fragment +(deftype tie-fragment (drawable) + "A mesh fragment of a TIE. This is a chunk of mesh that is rendered by VU1, stored as DMA chains." + ((gif-ref (inline-array adgif-shader) :overlay-at id) + (point-ref uint32 :offset 8) + (color-index uint16 :offset 12) + (base-colors uint8 :offset 14) + (tex-count uint16 :offset 32) + (gif-count uint16 :offset 34) + (vertex-count uint16 :offset 36) + (color-count uint16) + (dp-ref uint32) + (dp-qwc uint32) + (generic-ref uint32) + (generic-count uint16) + (normal-count uint16) + (normal-ref uint32) + (debug tie-fragment-debug) + ) + ) + +;; definition for method 3 of type tie-fragment +(defmethod inspect ((this tie-fragment)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~1Tgif-ref: #x~X~%" (-> this gif-ref)) + (format #t "~1Tpoint-ref: #x~X~%" (-> this point-ref)) + (format #t "~1Tcolor-index: ~D~%" (-> this color-index)) + (format #t "~1Tbase-colors: ~D~%" (-> this base-colors)) + (format #t "~1Ttex-count: ~D~%" (-> this tex-count)) + (format #t "~1Tgif-count: ~D~%" (-> this gif-count)) + (format #t "~1Tvertex-count: ~D~%" (-> this vertex-count)) + (format #t "~1Tcolor-count: ~D~%" (-> this color-count)) + (format #t "~1Tdp-ref: #x~X~%" (-> this dp-ref)) + (format #t "~1Tdp-qwc: ~D~%" (-> this dp-qwc)) + (format #t "~1Tgeneric-ref: #x~X~%" (-> this generic-ref)) + (format #t "~1Tgeneric-count: ~D~%" (-> this generic-count)) + (format #t "~1Tnormal-count: ~D~%" (-> this normal-count)) + (format #t "~1Tnormal-ref: #x~X~%" (-> this normal-ref)) + (format #t "~1Tdebug: #~%" (-> this debug)) + (label cfg-4) + this + ) + +;; definition of type instance-tie +(deftype instance-tie (instance) + "A TIE model instance." + ((color-indices uint32 :offset 8) + (bucket-ptr prototype-bucket-tie :offset 12) + (max-scale uint16 :overlay-at (-> origin data 3)) + (rmin-scale uint16 :overlay-at (-> origin data 11)) + ) + ) + +;; definition for method 3 of type instance-tie +(defmethod inspect ((this instance-tie)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~1Tbucket-index: ~D~%" (-> this bucket-index)) + (format #t "~1Torigin: #~%" (-> this origin)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Twind-index: ~D~%" (-> this wind-index)) + (format #t "~1Tcolor-indices: #x~X~%" (-> this color-indices)) + (format #t "~1Tbucket-ptr: ~A~%" (-> this bucket-ptr)) + (format #t "~1Tmax-scale: ~D~%" (-> this max-scale)) + (format #t "~1Trmin-scale: ~D~%" (-> this rmin-scale)) + (label cfg-4) + this + ) + +;; definition of type drawable-inline-array-instance-tie +(deftype drawable-inline-array-instance-tie (drawable-inline-array) + "Array of tie instances stored in the level." + ((data instance-tie 1 :inline) + (pad uint32) + ) + ) + +;; definition of type drawable-tree-instance-tie +(deftype drawable-tree-instance-tie (drawable-tree) + "Top-level drawable-tree for TIEs" + ((prototypes proxy-prototype-array-tie :offset 8) + ) + ) + +;; definition for method 3 of type drawable-tree-instance-tie +(defmethod inspect ((this drawable-tree-instance-tie)) + (when (not this) + (set! this this) + (goto cfg-7) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) + (dotimes (s5-0 (-> this length)) + (format #t "~T [~D]~1Tdata: ~A~%" s5-0 (-> this data s5-0)) + ) + (format #t "~1Tprototypes: ~A~%" (-> this prototypes)) + (label cfg-7) + this + ) + +;; definition of type prototype-tie +(deftype prototype-tie (drawable-inline-array) + "Prototype for a TIE: just an array of fragments." + ((data tie-fragment 1 :inline) + (pad uint32) + ) + ) + +;; definition of type tie-matrix +(deftype tie-matrix (structure) + "Per-instance matrix for TIE VU1 rendering." + ((mat matrix :inline) + (morph qword :inline) + (fog qword :inline) + (envmap-flag uint32 :overlay-at (-> fog data 0)) + (guard-flag uint32 :overlay-at (-> fog data 1)) + (vertex-alpha float :overlay-at (-> fog data 2)) + (fog-value float :overlay-at (-> fog data 3)) + (fixed-alpha float :overlay-at (-> morph data 1)) + ) + ) + +;; definition for method 3 of type tie-matrix +(defmethod inspect ((this tie-matrix)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'tie-matrix) + (format #t "~1Tmat: #~%" (-> this mat)) + (format #t "~1Tmorph: #~%" (-> this morph)) + (format #t "~1Tfog: #~%" (-> this fog)) + (format #t "~1Tenvmap-flag: ~D~%" (-> this envmap-flag)) + (format #t "~1Tguard-flag: ~D~%" (-> this guard-flag)) + (format #t "~1Tvertex-alpha: ~f~%" (-> this vertex-alpha)) + (format #t "~1Tfog-value: ~f~%" (-> this fog-value)) + (format #t "~1Tfixed-alpha: ~f~%" (-> this fixed-alpha)) + (label cfg-4) + this + ) + +;; definition of type instance-tie-work +(deftype instance-tie-work (structure) + "workspace for TIE instance DMA generation" + ((wind-const vector :inline) + (hmge-d vector :inline) + (hvdf-offset vector :inline) + (wind-force vector :inline) + (constant vector :inline) + (far-morph vector :inline) + (dist-test vector :inline) + (min-dist vector :inline) + (guard-plane plane 4 :inline) + (upload-color-0 dma-packet :inline) + (upload-color-1 dma-packet :inline) + (upload-color-2 dma-packet :inline) + (upload-color-ret dma-packet :inline) + (upload-color-temp dma-packet :inline) + (generic-color-0 dma-packet :inline) + (generic-color-1 dma-packet :inline) + (generic-color-end dma-packet :inline) + (envmap-color-0 dma-packet :inline) + (envmap-color-1 dma-packet :inline) + (tie-scissor-perspective-matrix matrix :inline) + (tod-env-color vector :inline) + (morph-temp vector :inline) + (fog-temp vector :inline) + (fade-temp float) + (wind-vectors uint32) + (test-id uint32) + (test-id2 uint32) + (dma-buffer basic) + (to-spr uint32) + (from-spr uint32) + (wind-work uint32) + (cur-vis-bits uint32) + (end-vis-bits uint32) + (refl-fade-fac float) + (refl-fade-end float) + (flags uint32) + (vanish-flag uint32) + (translucent-flag uint32) + (wait-from-spr uint32) + (wait-to-spr uint32) + (use-etie symbol) + (buffer-start uint32) + (buffer-end uint32) + (tfrag-dists uint32) + (alpha-dists uint32) + (water-dists uint32) + ) + ) + +;; definition for method 3 of type instance-tie-work +(defmethod inspect ((this instance-tie-work)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'instance-tie-work) + (format #t "~1Twind-const: #~%" (-> this wind-const)) + (format #t "~1Thmge-d: #~%" (-> this hmge-d)) + (format #t "~1Thvdf-offset: #~%" (-> this hvdf-offset)) + (format #t "~1Twind-force: #~%" (-> this wind-force)) + (format #t "~1Tconstant: #~%" (-> this constant)) + (format #t "~1Tfar-morph: #~%" (-> this far-morph)) + (format #t "~1Tdist-test: #~%" (-> this dist-test)) + (format #t "~1Tmin-dist: #~%" (-> this min-dist)) + (format #t "~1Tguard-plane[4] @ #x~X~%" (-> this guard-plane)) + (format #t "~1Tupload-color-0: #~%" (-> this upload-color-0)) + (format #t "~1Tupload-color-1: #~%" (-> this upload-color-1)) + (format #t "~1Tupload-color-2: #~%" (-> this upload-color-2)) + (format #t "~1Tupload-color-ret: #~%" (-> this upload-color-ret)) + (format #t "~1Tupload-color-temp: #~%" (-> this upload-color-temp)) + (format #t "~1Tgeneric-color-0: #~%" (-> this generic-color-0)) + (format #t "~1Tgeneric-color-1: #~%" (-> this generic-color-1)) + (format #t "~1Tgeneric-color-end: #~%" (-> this generic-color-end)) + (format #t "~1Tenvmap-color-0: #~%" (-> this envmap-color-0)) + (format #t "~1Tenvmap-color-1: #~%" (-> this envmap-color-1)) + (format #t "~1Ttie-scissor-perspective-matrix: #~%" (-> this tie-scissor-perspective-matrix)) + (format #t "~1Ttod-env-color: #~%" (-> this tod-env-color)) + (format #t "~1Tmorph-temp: #~%" (-> this morph-temp)) + (format #t "~1Tfog-temp: #~%" (-> this fog-temp)) + (format #t "~1Tfade-temp: ~f~%" (-> this fade-temp)) + (format #t "~1Twind-vectors: #x~X~%" (-> this wind-vectors)) + (format #t "~1Ttest-id: ~D~%" (-> this test-id)) + (format #t "~1Ttest-id2: ~D~%" (-> this test-id2)) + (format #t "~1Tdma-buffer: ~A~%" (-> this dma-buffer)) + (format #t "~1Tto-spr: ~D~%" (-> this to-spr)) + (format #t "~1Tfrom-spr: ~D~%" (-> this from-spr)) + (format #t "~1Twind-work: ~D~%" (-> this wind-work)) + (format #t "~1Tcur-vis-bits: ~D~%" (-> this cur-vis-bits)) + (format #t "~1Tend-vis-bits: ~D~%" (-> this end-vis-bits)) + (format #t "~1Trefl-fade-fac: ~f~%" (-> this refl-fade-fac)) + (format #t "~1Trefl-fade-end: ~f~%" (-> this refl-fade-end)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tvanish-flag: ~D~%" (-> this vanish-flag)) + (format #t "~1Ttranslucent-flag: ~D~%" (-> this translucent-flag)) + (format #t "~1Twait-from-spr: ~D~%" (-> this wait-from-spr)) + (format #t "~1Twait-to-spr: ~D~%" (-> this wait-to-spr)) + (format #t "~1Tuse-etie: ~A~%" (-> this use-etie)) + (format #t "~1Tbuffer-start: #x~X~%" (-> this buffer-start)) + (format #t "~1Tbuffer-end: #x~X~%" (-> this buffer-end)) + (format #t "~1Ttfrag-dists: #x~X~%" (-> this tfrag-dists)) + (format #t "~1Talpha-dists: #x~X~%" (-> this alpha-dists)) + (format #t "~1Twater-dists: #x~X~%" (-> this water-dists)) + (label cfg-4) + this + ) + +;; definition of type instance-tie-dma +(deftype instance-tie-dma (structure) + "Scratchpad memory layout for TIE instance DMA generation." + ((banka instance-tie 32 :inline) + (bankb instance-tie 32 :inline) + (outa uint128 256) + (outb uint128 256) + (work instance-tie-work :dynamic) + ) + ) + +;; definition for method 3 of type instance-tie-dma +(defmethod inspect ((this instance-tie-dma)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'instance-tie-dma) + (format #t "~1Tbanka[32] @ #x~X~%" (-> this banka)) + (format #t "~1Tbankb[32] @ #x~X~%" (-> this bankb)) + (format #t "~1Touta[256] @ #x~X~%" (-> this outa)) + (format #t "~1Toutb[256] @ #x~X~%" (-> this outb)) + (format #t "~1Twork: #~%" (-> this work 0)) + (label cfg-4) + this + ) + +;; definition of type prototype-tie-work +(deftype prototype-tie-work (structure) + "workspace for TIE protype DMA generation." + ((upload-flushe dma-packet :inline) + (upload-palette dma-packet :inline) + (upload-model-0 dma-packet :inline) + (upload-model-1 dma-packet :inline) + (upload-model-2 dma-packet :inline) + (upload-model-3 dma-packet :inline) + (upload-model-near-0 dma-packet :inline) + (upload-model-near-1 dma-packet :inline) + (upload-model-near-2 dma-packet :inline) + (upload-model-near-3 dma-packet :inline) + (upload-model-near-4 dma-packet :inline) + (envmap-palette dma-packet :inline) + (envmap-shader dma-packet :inline) + (upload-envmap-0 dma-packet :inline) + (upload-envmap-1 dma-packet :inline) + (upload-envmap-2 dma-packet :inline) + (upload-envmap-3 dma-packet :inline) + (upload-envmap-4 dma-packet :inline) + (upload-envmap-scissor-4 dma-packet :inline) + (generic-palette dma-packet :inline) + (generic-model-0 dma-packet :inline) + (generic-model-1 dma-packet :inline) + (generic-model-2 dma-packet :inline) + (model-next dma-packet :inline) + (clamp uint64) + (prototype-array basic) + (wait-from-spr uint32) + (wait-to-spr uint32) + (mood mood-context) + (last uint32 16 :offset 416) + (next uint32 16) + (count uint16 16) + (tie-last uint32 :overlay-at (-> last 0)) + (tie-next uint32 :overlay-at (-> next 0)) + (tie-count uint16 :overlay-at (-> count 0)) + (trans-last uint32 :overlay-at (-> last 1)) + (trans-next uint32 :overlay-at (-> next 1)) + (trans-count uint16 :overlay-at (-> count 1)) + (water-last uint32 :overlay-at (-> last 2)) + (water-next uint32 :overlay-at (-> next 2)) + (water-count uint16 :overlay-at (-> count 2)) + (scissor-last uint32 :overlay-at (-> last 3)) + (scissor-next uint32 :overlay-at (-> next 3)) + (scissor-count uint16 :overlay-at (-> count 3)) + (scissor-trans-last uint32 :overlay-at (-> last 4)) + (scissor-trans-next uint32 :overlay-at (-> next 4)) + (scissor-trans-count uint16 :overlay-at (-> count 4)) + (scissor-water-last uint32 :overlay-at (-> last 5)) + (scissor-water-next uint32 :overlay-at (-> next 5)) + (scissor-water-count uint16 :overlay-at (-> count 5)) + (envmap-last uint32 :overlay-at (-> last 6)) + (envmap-next uint32 :overlay-at (-> next 6)) + (envmap-count uint16 :overlay-at (-> count 6)) + (envmap-trans-last uint32 :overlay-at (-> last 7)) + (envmap-trans-next uint32 :overlay-at (-> next 7)) + (envmap-trans-count uint16 :overlay-at (-> count 7)) + (envmap-water-last uint32 :overlay-at (-> last 8)) + (envmap-water-next uint32 :overlay-at (-> next 8)) + (envmap-water-count uint16 :overlay-at (-> count 8)) + (envmap-scissor-last uint32 :overlay-at (-> last 9)) + (envmap-scissor-next uint32 :overlay-at (-> next 9)) + (envmap-scissor-count uint16 :overlay-at (-> count 9)) + (envmap-scissor-trans-last uint32 :overlay-at (-> last 10)) + (envmap-scissor-trans-next uint32 :overlay-at (-> next 10)) + (envmap-scissor-trans-count uint16 :overlay-at (-> count 10)) + (envmap-scissor-water-last uint32 :overlay-at (-> last 11)) + (envmap-scissor-water-next uint32 :overlay-at (-> next 11)) + (envmap-scissor-water-count uint16 :overlay-at (-> count 11)) + (generic-last uint32 :overlay-at (-> last 12)) + (generic-next uint32 :overlay-at (-> next 12)) + (generic-count uint16 :overlay-at (-> count 12)) + (generic-trans-last uint32 :overlay-at (-> last 13)) + (generic-trans-next uint32 :overlay-at (-> next 13)) + (generic-trans-count uint16 :overlay-at (-> count 13)) + (generic-water-last uint32 :overlay-at (-> last 14)) + (generic-water-next uint32 :overlay-at (-> next 14)) + (generic-water-count uint16 :overlay-at (-> count 14)) + (vanish-last uint32 :overlay-at (-> last 15)) + (vanish-next uint32 :overlay-at (-> next 15)) + (vanish-count uint16 :overlay-at (-> count 15)) + ) + ) + +;; definition for method 3 of type prototype-tie-work +(defmethod inspect ((this prototype-tie-work)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'prototype-tie-work) + (format #t "~1Tupload-flushe: #~%" (-> this upload-flushe)) + (format #t "~1Tupload-palette: #~%" (-> this upload-palette)) + (format #t "~1Tupload-model-0: #~%" (-> this upload-model-0)) + (format #t "~1Tupload-model-1: #~%" (-> this upload-model-1)) + (format #t "~1Tupload-model-2: #~%" (-> this upload-model-2)) + (format #t "~1Tupload-model-3: #~%" (-> this upload-model-3)) + (format #t "~1Tupload-model-near-0: #~%" (-> this upload-model-near-0)) + (format #t "~1Tupload-model-near-1: #~%" (-> this upload-model-near-1)) + (format #t "~1Tupload-model-near-2: #~%" (-> this upload-model-near-2)) + (format #t "~1Tupload-model-near-3: #~%" (-> this upload-model-near-3)) + (format #t "~1Tupload-model-near-4: #~%" (-> this upload-model-near-4)) + (format #t "~1Tenvmap-palette: #~%" (-> this envmap-palette)) + (format #t "~1Tenvmap-shader: #~%" (-> this envmap-shader)) + (format #t "~1Tupload-envmap-0: #~%" (-> this upload-envmap-0)) + (format #t "~1Tupload-envmap-1: #~%" (-> this upload-envmap-1)) + (format #t "~1Tupload-envmap-2: #~%" (-> this upload-envmap-2)) + (format #t "~1Tupload-envmap-3: #~%" (-> this upload-envmap-3)) + (format #t "~1Tupload-envmap-4: #~%" (-> this upload-envmap-4)) + (format #t "~1Tupload-envmap-scissor-4: #~%" (-> this upload-envmap-scissor-4)) + (format #t "~1Tgeneric-palette: #~%" (-> this generic-palette)) + (format #t "~1Tgeneric-model-0: #~%" (-> this generic-model-0)) + (format #t "~1Tgeneric-model-1: #~%" (-> this generic-model-1)) + (format #t "~1Tgeneric-model-2: #~%" (-> this generic-model-2)) + (format #t "~1Tmodel-next: #~%" (-> this model-next)) + (format #t "~1Tclamp: ~D~%" (-> this clamp)) + (format #t "~1Tprototype-array: ~A~%" (-> this prototype-array)) + (format #t "~1Twait-from-spr: ~D~%" (-> this wait-from-spr)) + (format #t "~1Twait-to-spr: ~D~%" (-> this wait-to-spr)) + (format #t "~1Tmood: #~%" (-> this mood)) + (format #t "~1Tlast[16] @ #x~X~%" (-> this last)) + (format #t "~1Tnext[16] @ #x~X~%" (-> this next)) + (format #t "~1Tcount[16] @ #x~X~%" (-> this count)) + (format #t "~1Ttie-last: #x~X~%" (-> this tie-last)) + (format #t "~1Ttie-next: #x~X~%" (-> this tie-next)) + (format #t "~1Ttie-count: ~D~%" (-> this tie-count)) + (format #t "~1Ttrans-last: #x~X~%" (-> this trans-last)) + (format #t "~1Ttrans-next: #x~X~%" (-> this trans-next)) + (format #t "~1Ttrans-count: ~D~%" (-> this trans-count)) + (format #t "~1Twater-last: #x~X~%" (-> this water-last)) + (format #t "~1Twater-next: #x~X~%" (-> this water-next)) + (format #t "~1Twater-count: ~D~%" (-> this water-count)) + (format #t "~1Tscissor-last: #x~X~%" (-> this scissor-last)) + (format #t "~1Tscissor-next: #x~X~%" (-> this scissor-next)) + (format #t "~1Tscissor-count: ~D~%" (-> this scissor-count)) + (format #t "~1Tscissor-trans-last: #x~X~%" (-> this scissor-trans-last)) + (format #t "~1Tscissor-trans-next: #x~X~%" (-> this scissor-trans-next)) + (format #t "~1Tscissor-trans-count: ~D~%" (-> this scissor-trans-count)) + (format #t "~1Tscissor-water-last: #x~X~%" (-> this scissor-water-last)) + (format #t "~1Tscissor-water-next: #x~X~%" (-> this scissor-water-next)) + (format #t "~1Tscissor-water-count: ~D~%" (-> this scissor-water-count)) + (format #t "~1Tenvmap-last: #x~X~%" (-> this envmap-last)) + (format #t "~1Tenvmap-next: #x~X~%" (-> this envmap-next)) + (format #t "~1Tenvmap-count: ~D~%" (-> this envmap-count)) + (format #t "~1Tenvmap-trans-last: #x~X~%" (-> this envmap-trans-last)) + (format #t "~1Tenvmap-trans-next: #x~X~%" (-> this envmap-trans-next)) + (format #t "~1Tenvmap-trans-count: ~D~%" (-> this envmap-trans-count)) + (format #t "~1Tenvmap-water-last: #x~X~%" (-> this envmap-water-last)) + (format #t "~1Tenvmap-water-next: #x~X~%" (-> this envmap-water-next)) + (format #t "~1Tenvmap-water-count: ~D~%" (-> this envmap-water-count)) + (format #t "~1Tenvmap-scissor-last: #x~X~%" (-> this envmap-scissor-last)) + (format #t "~1Tenvmap-scissor-next: #x~X~%" (-> this envmap-scissor-next)) + (format #t "~1Tenvmap-scissor-count: ~D~%" (-> this envmap-scissor-count)) + (format #t "~1Tenvmap-scissor-trans-last: #x~X~%" (-> this envmap-scissor-trans-last)) + (format #t "~1Tenvmap-scissor-trans-next: #x~X~%" (-> this envmap-scissor-trans-next)) + (format #t "~1Tenvmap-scissor-trans-count: ~D~%" (-> this envmap-scissor-trans-count)) + (format #t "~1Tenvmap-scissor-water-last: #x~X~%" (-> this envmap-scissor-water-last)) + (format #t "~1Tenvmap-scissor-water-next: #x~X~%" (-> this envmap-scissor-water-next)) + (format #t "~1Tenvmap-scissor-water-count: ~D~%" (-> this envmap-scissor-water-count)) + (format #t "~1Tgeneric-last: #x~X~%" (-> this generic-last)) + (format #t "~1Tgeneric-next: #x~X~%" (-> this generic-next)) + (format #t "~1Tgeneric-count: ~D~%" (-> this generic-count)) + (format #t "~1Tgeneric-trans-last: #x~X~%" (-> this generic-trans-last)) + (format #t "~1Tgeneric-trans-next: #x~X~%" (-> this generic-trans-next)) + (format #t "~1Tgeneric-trans-count: ~D~%" (-> this generic-trans-count)) + (format #t "~1Tgeneric-water-last: #x~X~%" (-> this generic-water-last)) + (format #t "~1Tgeneric-water-next: #x~X~%" (-> this generic-water-next)) + (format #t "~1Tgeneric-water-count: ~D~%" (-> this generic-water-count)) + (format #t "~1Tvanish-last: #x~X~%" (-> this vanish-last)) + (format #t "~1Tvanish-next: #x~X~%" (-> this vanish-next)) + (format #t "~1Tvanish-count: ~D~%" (-> this vanish-count)) + (label cfg-4) + this + ) + +;; definition of type prototype-tie-dma +(deftype prototype-tie-dma (structure) + ((colora rgba 256) + (colorb rgba 256) + (outa uint128 256) + (outb uint128 256) + (geometry uint32 4) + (next uint32 12) + (count uint16 12) + (counts uint32 4) + (palette-ptr uint32 :overlay-at (-> counts 2)) + (model-ptr uint32 :overlay-at (-> counts 3)) + (ret-ptr uint32) + (length uint32) + (flags uint32) + (dma-buffer basic) + (this-frag-count uint32) + (frag-count uint8 4) + (from-spr uint32) + (to-spr uint32) + (spr-out uint32) + (this-count uint32) + (scissor-geometry uint32 :overlay-at (-> geometry 0)) + (near-geometry uint32 :overlay-at (-> geometry 1)) + (mid-geometry uint32 :overlay-at (-> geometry 2)) + (far-geometry uint32 :overlay-at (-> geometry 3)) + (scissor-frag-count uint8 :overlay-at (-> frag-count 0)) + (near-frag-count uint8 :overlay-at (-> frag-count 1)) + (mid-frag-count uint8 :overlay-at (-> frag-count 2)) + (far-frag-count uint8 :overlay-at (-> frag-count 3)) + (tie-scissor-next uint32 :overlay-at (-> next 0)) + (tie-near-next uint32 :overlay-at (-> next 1)) + (tie-mid-next uint32 :overlay-at (-> next 2)) + (tie-far-next uint32 :overlay-at (-> next 3)) + (trans-scissor-next uint32 4 :overlay-at (-> next 0)) + (trans-near-next uint32 :overlay-at (-> next 1)) + (trans-mid-next uint32 :overlay-at (-> next 2)) + (trans-far-next uint32 :overlay-at (-> next 3)) + (water-scissor-next uint32 4 :overlay-at (-> next 0)) + (water-near-next uint32 :overlay-at (-> next 1)) + (water-mid-next uint32 :overlay-at (-> next 2)) + (water-far-next uint32 :overlay-at (-> next 3)) + (envmap-scissor-next uint32 4 :overlay-at (-> next 4)) + (envmap-near-next uint32 :overlay-at (-> next 5)) + (envmap-mid-next uint32 :overlay-at (-> next 6)) + (envmap-far-next uint32 :overlay-at (-> next 7)) + (generic-near-next uint32 :overlay-at (-> next 8)) + (generic-mid-next uint32 :overlay-at (-> next 9)) + (generic-far-next uint32 :overlay-at (-> next 10)) + (vanish-next uint32 :overlay-at (-> next 11)) + (tie-count uint16 :overlay-at (-> count 0)) + (tie-scissor-count uint16 :overlay-at (-> count 0)) + (tie-near-count uint16 :overlay-at (-> count 1)) + (tie-mid-count uint16 :overlay-at (-> count 2)) + (tie-far-count uint16 :overlay-at (-> count 3)) + (trans-count uint16 :overlay-at (-> count 0)) + (trans-scissor-count uint16 :overlay-at (-> count 0)) + (trans-near-count uint16 :overlay-at (-> count 1)) + (trans-mid-count uint16 :overlay-at (-> count 2)) + (trans-far-count uint16 :overlay-at (-> count 3)) + (water-count uint16 :overlay-at (-> count 0)) + (water-scissor-count uint16 :overlay-at (-> count 0)) + (water-near-count uint16 :overlay-at (-> count 1)) + (water-mid-count uint16 :overlay-at (-> count 2)) + (water-far-count uint16 :overlay-at (-> count 3)) + (envmap-count uint16 :overlay-at (-> count 4)) + (envmap-scissor-count uint16 :overlay-at (-> count 4)) + (envmap-near-count uint16 :overlay-at (-> count 5)) + (envmap-mid-count uint16 :overlay-at (-> count 6)) + (envmap-far-count uint16 :overlay-at (-> count 7)) + (generic-count uint16 :overlay-at (-> count 8)) + (generic-near-count uint16 :overlay-at (-> count 8)) + (generic-mid-count uint16 :overlay-at (-> count 9)) + (generic-far-count uint16 :overlay-at (-> count 10)) + (vanish-count uint16 :overlay-at (-> count 11)) + (next-clear uint32 3 :overlay-at (-> next 0)) + (count-clear uint16 3 :overlay-at (-> count 0)) + ) + ) + +;; definition for method 3 of type prototype-tie-dma +(defmethod inspect ((this prototype-tie-dma)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'prototype-tie-dma) + (format #t "~1Tcolora[256] @ #x~X~%" (-> this colora)) + (format #t "~1Tcolorb[256] @ #x~X~%" (-> this colorb)) + (format #t "~1Touta[256] @ #x~X~%" (-> this outa)) + (format #t "~1Toutb[256] @ #x~X~%" (-> this outb)) + (format #t "~1Tgeometry[4] @ #x~X~%" (-> this geometry)) + (format #t "~1Tnext[12] @ #x~X~%" (-> this next)) + (format #t "~1Tcount[12] @ #x~X~%" (-> this count)) + (format #t "~1Tcounts[4] @ #x~X~%" (-> this counts)) + (format #t "~1Tpalette-ptr: #x~X~%" (-> this palette-ptr)) + (format #t "~1Tmodel-ptr: #x~X~%" (-> this model-ptr)) + (format #t "~1Tret-ptr: #x~X~%" (-> this ret-ptr)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tdma-buffer: ~A~%" (-> this dma-buffer)) + (format #t "~1Tthis-frag-count: ~D~%" (-> this this-frag-count)) + (format #t "~1Tfrag-count[4] @ #x~X~%" (-> this frag-count)) + (format #t "~1Tfrom-spr: #x~X~%" (-> this from-spr)) + (format #t "~1Tto-spr: #x~X~%" (-> this to-spr)) + (format #t "~1Tspr-out: #x~X~%" (-> this spr-out)) + (format #t "~1Tthis-count: ~D~%" (-> this this-count)) + (format #t "~1Tscissor-geometry: #x~X~%" (-> this scissor-geometry)) + (format #t "~1Tnear-geometry: #x~X~%" (-> this near-geometry)) + (format #t "~1Tmid-geometry: #x~X~%" (-> this mid-geometry)) + (format #t "~1Tfar-geometry: #x~X~%" (-> this far-geometry)) + (format #t "~1Tscissor-frag-count: ~D~%" (-> this scissor-frag-count)) + (format #t "~1Tnear-frag-count: ~D~%" (-> this near-frag-count)) + (format #t "~1Tmid-frag-count: ~D~%" (-> this mid-frag-count)) + (format #t "~1Tfar-frag-count: ~D~%" (-> this far-frag-count)) + (format #t "~1Ttie-scissor-next: #x~X~%" (-> this tie-scissor-next)) + (format #t "~1Ttie-near-next: #x~X~%" (-> this tie-near-next)) + (format #t "~1Ttie-mid-next: #x~X~%" (-> this tie-mid-next)) + (format #t "~1Ttie-far-next: #x~X~%" (-> this tie-far-next)) + (format #t "~1Ttrans-scissor-next[4] @ #x~X~%" (-> this next)) + (format #t "~1Ttrans-near-next: #x~X~%" (-> this tie-near-next)) + (format #t "~1Ttrans-mid-next: #x~X~%" (-> this tie-mid-next)) + (format #t "~1Ttrans-far-next: #x~X~%" (-> this tie-far-next)) + (format #t "~1Twater-scissor-next[4] @ #x~X~%" (-> this next)) + (format #t "~1Twater-near-next: #x~X~%" (-> this tie-near-next)) + (format #t "~1Twater-mid-next: #x~X~%" (-> this tie-mid-next)) + (format #t "~1Twater-far-next: #x~X~%" (-> this tie-far-next)) + (format #t "~1Tenvmap-scissor-next[4] @ #x~X~%" (-> this envmap-scissor-next)) + (format #t "~1Tenvmap-near-next: #x~X~%" (-> this envmap-near-next)) + (format #t "~1Tenvmap-mid-next: #x~X~%" (-> this envmap-mid-next)) + (format #t "~1Tenvmap-far-next: #x~X~%" (-> this envmap-far-next)) + (format #t "~1Tgeneric-near-next: #x~X~%" (-> this generic-near-next)) + (format #t "~1Tgeneric-mid-next: #x~X~%" (-> this generic-mid-next)) + (format #t "~1Tgeneric-far-next: #x~X~%" (-> this generic-far-next)) + (format #t "~1Tvanish-next: #x~X~%" (-> this vanish-next)) + (format #t "~1Ttie-count: ~D~%" (-> this tie-count)) + (format #t "~1Ttie-scissor-count: ~D~%" (-> this tie-count)) + (format #t "~1Ttie-near-count: ~D~%" (-> this tie-near-count)) + (format #t "~1Ttie-mid-count: ~D~%" (-> this tie-mid-count)) + (format #t "~1Ttie-far-count: ~D~%" (-> this tie-far-count)) + (format #t "~1Ttrans-count: ~D~%" (-> this tie-count)) + (format #t "~1Ttrans-scissor-count: ~D~%" (-> this tie-count)) + (format #t "~1Ttrans-near-count: ~D~%" (-> this tie-near-count)) + (format #t "~1Ttrans-mid-count: ~D~%" (-> this tie-mid-count)) + (format #t "~1Ttrans-far-count: ~D~%" (-> this tie-far-count)) + (format #t "~1Twater-count: ~D~%" (-> this tie-count)) + (format #t "~1Twater-scissor-count: ~D~%" (-> this tie-count)) + (format #t "~1Twater-near-count: ~D~%" (-> this tie-near-count)) + (format #t "~1Twater-mid-count: ~D~%" (-> this tie-mid-count)) + (format #t "~1Twater-far-count: ~D~%" (-> this tie-far-count)) + (format #t "~1Tenvmap-count: ~D~%" (-> this envmap-count)) + (format #t "~1Tenvmap-scissor-count: ~D~%" (-> this envmap-count)) + (format #t "~1Tenvmap-near-count: ~D~%" (-> this envmap-near-count)) + (format #t "~1Tenvmap-mid-count: ~D~%" (-> this envmap-mid-count)) + (format #t "~1Tenvmap-far-count: ~D~%" (-> this envmap-far-count)) + (format #t "~1Tgeneric-count: ~D~%" (-> this generic-count)) + (format #t "~1Tgeneric-near-count: ~D~%" (-> this generic-count)) + (format #t "~1Tgeneric-mid-count: ~D~%" (-> this generic-mid-count)) + (format #t "~1Tgeneric-far-count: ~D~%" (-> this generic-far-count)) + (format #t "~1Tvanish-count: ~D~%" (-> this vanish-count)) + (format #t "~1Tnext-clear[3] @ #x~X~%" (-> this next)) + (format #t "~1Tcount-clear[3] @ #x~X~%" (-> this count)) + (label cfg-4) + this + ) + +;; definition for symbol *instance-tie-work-copy*, type instance-tie-work +(define *instance-tie-work-copy* (the-as instance-tie-work #f)) + +;; 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 74eaaf2564..a142910d13 100644 --- a/test/offline/config/jak3/config.jsonc +++ b/test/offline/config/jak3/config.jsonc @@ -5,7 +5,8 @@ ], "skip_compile_files": [ - "types-h" // weird array of types. + "types-h", // weird array of types. + "hfrag-h" // weird duplicate type ], "skip_compile_functions": [ @@ -58,7 +59,13 @@ "(method 9 texture-page-dir)", "set-dirty-mask!", "(method 3 generic-tie-interp-point)", // cache stuff - "invalidate-cache-line" + "invalidate-cache-line", + // multiple def + "(method 3 hfrag-poly4)", + "(method 3 hfrag-poly9)", + "(method 3 hfrag-poly25)", + "(method 3 hfrag-mip-packet)" + ], "skip_compile_states": {}