diff --git a/decompiler/config/jak3/all-types.gc b/decompiler/config/jak3/all-types.gc index 4f803282e8..8785788409 100644 --- a/decompiler/config/jak3/all-types.gc +++ b/decompiler/config/jak3/all-types.gc @@ -11271,7 +11271,7 @@ "Add this adgif shader to the linked list of shaders associated with the given texture ID. Will allocate the link array if it's not already." (function texture-id adgif-shader texture-page-dir-entry)) - (define-extern adgif-shader<-texture! (function adgif-shader texture adgif-shader)) +(define-extern adgif-shader<-texture! (function adgif-shader texture adgif-shader)) (define-extern adgif-shader-update! "Update k based on uv-dist" (function adgif-shader texture none)) (define-extern adgif-shader<-texture-with-update! (function adgif-shader texture adgif-shader)) (define-extern hack-texture "adjust some values of a texture, likely for debug." (function texture float)) @@ -11302,7 +11302,143 @@ ;; main-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +(declare-type debug-menu-context basic) + +;; +++main-h:collide-spec +(defenum collide-spec + :bitfield #t + :type uint32 + (cs0 0) + (cs1 1) + (cs2 2) + (cs3 3) + (cs4 4) + (cs5 5) + (cs6 6) + (cs7 7) + (cs8 8) + (cs9 9) + (cs10 10) + (cs11 11) + ) +;; ---main-h:collide-spec + +;; +++main-h:strip-lines-controls +(defenum strip-lines-controls + :type int64 + (none 0) + ; (strippable 1) + ; (convertible 2) + ; (good 3) + ; (edgeable 4) + ; (ordinary 8) + ; (color-mismatch 16) + ; (shader-mismatch 32) + ; (uv-mismatch 64) + ; (too-big 128) + ; (bad 240) + ; (all-edges 255) + ; (strips 256) + ; (frags 512) + ) +;; ---main-h:strip-lines-controls + +;; +++main-h:scene-controls +(defenum scene-controls + :type int64 + :bitfield #t + ; (channel) + ; (anim-name) + ; (dma-size) + ; (bounds-spheres) + ; (actors) + ; (actor-marks) + ; (special-fma-spheres) + ; (scene-controls-7) + ; (scene-controls-8) + ; (display-controls) + ) +;; ---main-h:scene-controls + +;; +++main-h:bot-marks-controls +(defenum bot-marks-controls + :type int64 + ; (all-off 0) + ; (course-spots 1) + ; (task-spots 2) + ; (all-on 3) + ; (bmc04 4) + ; (bmc05 5) + ; (bmc06 6) + ; (bmc07 7) + ; (bmc08 8) + ; (bmc09 9) + ; (bmc10 10) + ; (bmc11 11) + ; (bmc12 12) + ; (bmc13 13) + ; (bmc14 14) + ; (bmc15 15) + ; (bmc16 16) + ) +;; ---main-h:bot-marks-controls + +;; +++main-h:race-marks-controls +(defenum race-marks-controls + :type int64 + ; (all-off 0) + ; (path0-red 1) + ; (path1-green 2) + ; (path2-blue 4) + ; (path3-yellow 8) + ; (path4-cyan 16) + ; (path5-violet 32) + ; (path6-orange 64) + ; (path7-black 128) + ; (all-paths-on 255) + ; (rmc2040 2040) + ) +;; ---main-h:race-marks-controls + +;; +++main-h:race-selection +(defenum race-selection + :type int64 + ; (kiera-class3 0) + ; (kiera-class2 1) + ; (kiera-class1 2) + ; (errol 3) + ; (bush-class3 4) + ; (bush-class2 5) + ; (bush-class1 6) + ; (bush-errol 7) + ; (bush-port 8) + ; (bush-class3-reverse 9) + ; (bush-class2-reverse 10) + ; (bush-class1-reverse 11) + ) +;; ---main-h:race-selection + +;; +++main-h:subdivide-setting +(defenum subdivide-setting + :type int64 + (textured 0) + (outline 1) + (gouraud 2) + (hack 3)) +;; ---main-h:subdivide-setting + +;; +++main-h:ocean-height-hack +(defenum ocean-height-hack + :type int64 + ; (zero 1) + ; (far-below 2) + ; (sewer-start 3) + ; (sewer-hi 4) + ; (sewer-med 5) + ; (sewer-lo 6) + ) +;; ---main-h:ocean-height-hack + (deftype frame-stats (structure) ((field-time time-frame 2 :offset-assert 0) ;; guessed by decompiler (field int32 :offset-assert 16) @@ -11311,9 +11447,7 @@ :size-assert #x14 :flag-assert #x900000014 ) -|# -#| (deftype screen-filter (basic) ((draw? symbol :offset-assert 4) ;; guessed by decompiler (bucket int32 :offset-assert 8) ;; bucket-id @@ -11323,22 +11457,20 @@ (color-src vector :inline :offset-assert 48) (color-dest vector :inline :offset-assert 64) (extra vector :inline :offset-assert 80) - (speed float :offset-assert 80) - (current-interp float :offset-assert 84) + (speed float :offset-assert 80 :overlay-at (-> extra x)) + (current-interp float :offset-assert 84 :overlay-at (-> extra y)) (lock-vsync? basic :offset-assert 96) ) :method-count-assert 12 :size-assert #x64 :flag-assert #xc00000064 (:methods - (screen-filter-method-9 () none) ;; 9 ;; (draw (_type_) none) - (screen-filter-method-10 () none) ;; 10 ;; (setup (_type_ vector vector float bucket-id) none) - (screen-filter-method-11 () none) ;; 11 ;; (disable (_type_) none) + (draw (_type_) none) ;; 9 + (setup (_type_ vector vector float bucket-id) none) ;; 10 + (disable (_type_) none) ;; 11 ) ) -|# -#| (deftype col-rend (basic) ((draw? symbol :offset-assert 4) ;; guessed by decompiler (outline? symbol :offset-assert 8) ;; guessed by decompiler @@ -11359,134 +11491,134 @@ (col-rend-method-9 () none) ;; 9 ;; (col-rend-method-9 (_type_) none) ) ) -|# -;; (define-extern *stats-poly* object) ;; symbol -;; (define-extern *stats-memory* object) ;; symbol -;; (define-extern *stats-memory-short* object) ;; symbol -;; (define-extern *stats-memory-level-index* object) ;; int -;; (define-extern *stats-collide* object) ;; symbol -;; (define-extern *stats-bsp* object) ;; symbol -;; (define-extern *stats-buffer* object) ;; symbol -;; (define-extern *stats-target* object) ;; symbol +(define-extern *stats-poly* symbol) +(define-extern *stats-memory* symbol) +(define-extern *stats-memory-short* symbol) +(define-extern *stats-memory-level-index* int) +(define-extern *stats-collide* symbol) +(define-extern *stats-bsp* symbol) +(define-extern *stats-buffer* symbol) +(define-extern *stats-target* symbol) (define-extern *stats-profile-bars* symbol) -;; (define-extern *stats-perf* object) ;; symbol -;; (define-extern *artist-all-visible* object) ;; symbol -;; (define-extern *artist-flip-visible* object) ;; symbol -;; (define-extern *artist-fix-visible* object) ;; symbol -;; (define-extern *artist-fix-frustum* object) ;; symbol -;; (define-extern *artist-error-spheres* object) ;; symbol -;; (define-extern *artist-use-menu-subdiv* object) ;; symbol +(define-extern *stats-perf* symbol) +(define-extern *artist-all-visible* symbol) +(define-extern *artist-flip-visible* symbol) +(define-extern *artist-fix-visible* symbol) +(define-extern *artist-fix-frustum* symbol) +(define-extern *artist-error-spheres* symbol) +(define-extern *artist-use-menu-subdiv* symbol) (define-extern *display-profile* symbol) -;; (define-extern *display-sidekick-stats* object) ;; symbol -;; (define-extern *display-quad-stats* object) ;; symbol -;; (define-extern *display-tri-stats* object) ;; symbol -;; (define-extern *display-ground-stats* object) ;; symbol -;; (define-extern *display-collision-marks* object) ;; symbol -;; (define-extern *display-collide-cache* object) ;; symbol -;; (define-extern *display-render-collision* object) ;; symbol -;; (define-extern *display-hipri-collision-marks* object) ;; symbol -;; (define-extern *display-edge-collision-marks* object) ;; symbol -;; (define-extern *display-geo-marks* object) ;; symbol -;; (define-extern *display-target-marks* object) ;; symbol -;; (define-extern *target-rc-board-controls* object) ;; symbol -;; (define-extern *display-collide-history* object) ;; int -;; (define-extern *amy-cam* object) -;; (define-extern *display-xyz-axes* object) ;; symbol -;; (define-extern *display-cam-collide-history* object) ;; symbol -;; (define-extern *record-cam-collide-history* object) ;; symbol -;; (define-extern *display-cam-master-marks* object) ;; symbol -;; (define-extern *display-cam-other* object) ;; symbol -;; (define-extern *display-camera-marks* object) ;; symbol -;; (define-extern *camera-no-mip-correction* object) ;; symbol -;; (define-extern *camera-turbo-free* object) -;; (define-extern *display-cam-los-info* object) ;; symbol -;; (define-extern *display-cam-los-debug* object) ;; symbol -;; (define-extern *display-cam-los-marks* object) ;; symbol -;; (define-extern *display-cam-coll-marks* object) ;; symbol -;; (define-extern *display-camera-info* object) ;; symbol -;; (define-extern *display-camera-old-stats* object) ;; symbol -;; (define-extern *display-camera-last-attacker* object) ;; symbol -;; (define-extern *display-file-info* object) ;; symbol -;; (define-extern *display-actor-marks* object) ;; symbol -;; (define-extern *display-sprite-info* object) ;; symbol -;; (define-extern *display-sprite-marks* object) ;; symbol -;; (define-extern *display-sprite-spheres* object) ;; symbol -;; (define-extern *display-entity-errors* object) ;; symbol +(define-extern *display-sidekick-stats* symbol) +(define-extern *display-quad-stats* symbol) +(define-extern *display-tri-stats* symbol) +(define-extern *display-ground-stats* symbol) +(define-extern *display-collision-marks* symbol) +(define-extern *display-collide-cache* symbol) +(define-extern *display-render-collision* symbol) +(define-extern *display-hipri-collision-marks* symbol) +(define-extern *display-edge-collision-marks* symbol) +(define-extern *display-geo-marks* symbol) +(define-extern *display-target-marks* symbol) +(define-extern *target-rc-board-controls* symbol) +(define-extern *display-collide-history* int) +(define-extern *amy-cam* symbol) +(define-extern *display-xyz-axes* symbol) +(define-extern *display-cam-collide-history* symbol) +(define-extern *record-cam-collide-history* symbol) +(define-extern *display-cam-master-marks* symbol) +(define-extern *display-cam-other* symbol) +(define-extern *display-camera-marks* symbol) +(define-extern *camera-no-mip-correction* symbol) +(define-extern *camera-turbo-free* symbol) +(define-extern *display-cam-los-info* symbol) +(define-extern *display-cam-los-debug* symbol) +(define-extern *display-cam-los-marks* symbol) +(define-extern *display-cam-coll-marks* symbol) +(define-extern *display-camera-info* symbol) +(define-extern *display-camera-old-stats* symbol) +(define-extern *display-camera-last-attacker* symbol) +(define-extern *display-file-info* symbol) +(define-extern *display-actor-marks* symbol) +(define-extern *display-sprite-info* symbol) +(define-extern *display-sprite-marks* symbol) +(define-extern *display-sprite-spheres* symbol) +(define-extern *display-entity-errors* symbol) (define-extern *display-capture-mode* symbol) -;; (define-extern *display-instance-info* object) ;; symbol -;; (define-extern *display-deci-count* object) ;; symbol -;; (define-extern *sync-dma* object) ;; symbol -;; (define-extern *display-strip-lines* object) ;; strip-lines-controls -;; (define-extern *display-battle-marks* object) ;; symbol -;; (define-extern *display-joint-axes* object) ;; symbol -;; (define-extern *display-nav-marks* object) ;; symbol -;; (define-extern *display-nav-network* object) ;; symbol -;; (define-extern *display-path-marks* object) ;; symbol -;; (define-extern *display-vol-marks* object) ;; symbol -;; (define-extern *display-water-marks* object) ;; symbol -;; (define-extern *display-nav-mesh* object) ;; symbol -;; (define-extern *display-race-mesh* object) -;; (define-extern *display-actor-pointer* object) ;; symbol -;; (define-extern *display-actor-vis* object) ;; symbol -;; (define-extern *display-actor-graph* object) ;; symbol -;; (define-extern *display-traffic-height-map* object) ;; symbol -;; (define-extern *display-trail-graph* object) ;; symbol -;; (define-extern *display-color-bars* object) ;; symbol -;; (define-extern *display-bug-report* object) ;; symbol -;; (define-extern *display-level-border* object) ;; symbol -;; (define-extern *display-memcard-info* object) ;; symbol -;; (define-extern *display-split-boxes* object) ;; symbol -;; (define-extern *display-split-box-info* object) ;; symbol -;; (define-extern *display-texture-distances* object) ;; symbol -;; (define-extern *display-texture-download* object) ;; symbol -;; (define-extern *display-art-control* object) ;; symbol -;; (define-extern *display-gui-control* object) ;; symbol -;; (define-extern *display-level-spheres* object) ;; symbol -;; (define-extern *time-of-day-fast* object) ;; symbol -;; (define-extern *display-iop-info* object) ;; symbol -;; (define-extern *ambient-sound-class* object) ;; symbol -;; (define-extern *slow-frame-rate* object) ;; symbol -;; (define-extern *display-region-marks* object) ;; symbol -;; (define-extern *execute-regions* object) ;; symbol -;; (define-extern *debug-pause* object) ;; symbol -;; (define-extern *debug-view-anims* object) ;; symbol -;; (define-extern *debug-unkillable* object) ;; symbol -;; (define-extern *debug-player-vehicle-unkillable* object) -;; (define-extern *debug-actor* object) ;; object -;; (define-extern *gun-marks* object) ;; symbol -;; (define-extern *bug-report-output-mode* object) ;; symbol -;; (define-extern *display-scene-control* object) ;; scene-controls -;; (define-extern *display-bot-marks* object) ;; bot-marks-controls -;; (define-extern *display-race-marks* object) ;; race-marks-controls -;; (define-extern *race-record-path* object) ;; symbol -;; (define-extern *select-race* object) ;; race-selection -;; (define-extern *select-race-path* object) ;; int -;; (define-extern *bot-record-path* object) ;; int -;; (define-extern *subdivide-draw-mode* object) ;; subdivide-setting -;; (define-extern *subdivide-scissor-draw-mode* object) ;; subdivide-setting -;; (define-extern *subdivide-foreground-draw-mode* object) ;; subdivide-setting -;; (define-extern *subdivide-ocean-draw-mode* object) ;; subdivide-setting -;; (define-extern *ocean-height-hack* object) ;; ocean-height-hack +(define-extern *display-instance-info* symbol) +(define-extern *display-deci-count* symbol) +(define-extern *sync-dma* symbol) +(define-extern *display-strip-lines* strip-lines-controls) +(define-extern *display-battle-marks* symbol) +(define-extern *display-joint-axes* symbol) +(define-extern *display-nav-marks* symbol) +(define-extern *display-nav-network* symbol) +(define-extern *display-path-marks* symbol) +(define-extern *display-vol-marks* symbol) +(define-extern *display-water-marks* symbol) +(define-extern *display-nav-mesh* symbol) +(define-extern *display-race-mesh* symbol) +(define-extern *display-actor-pointer* symbol) +(define-extern *display-actor-vis* symbol) +(define-extern *display-actor-graph* symbol) +(define-extern *display-traffic-height-map* symbol) +(define-extern *display-trail-graph* symbol) +(define-extern *display-color-bars* symbol) +(define-extern *display-bug-report* symbol) +(define-extern *display-level-border* symbol) +(define-extern *display-memcard-info* symbol) +(define-extern *display-split-boxes* symbol) +(define-extern *display-split-box-info* symbol) +(define-extern *display-texture-distances* symbol) +(define-extern *display-texture-download* symbol) +(define-extern *display-art-control* symbol) +(define-extern *display-gui-control* symbol) +(define-extern *display-level-spheres* symbol) +(define-extern *time-of-day-fast* symbol) +(define-extern *display-iop-info* symbol) +(define-extern *ambient-sound-class* symbol) +(define-extern *slow-frame-rate* symbol) +(define-extern *display-region-marks* symbol) +(define-extern *execute-regions* symbol) +(define-extern *debug-pause* symbol) +(define-extern *debug-view-anims* symbol) +(define-extern *debug-unkillable* symbol) +(define-extern *debug-player-vehicle-unkillable* symbol) +(define-extern *debug-actor* object) +(define-extern *gun-marks* symbol) +(define-extern *bug-report-output-mode* symbol) +(define-extern *display-scene-control* scene-controls) +(define-extern *display-bot-marks* bot-marks-controls) +(define-extern *display-race-marks* race-marks-controls) +(define-extern *race-record-path* symbol) +(define-extern *select-race* race-selection) +(define-extern *select-race-path* int) +(define-extern *bot-record-path* int) +(define-extern *subdivide-draw-mode* subdivide-setting) +(define-extern *subdivide-scissor-draw-mode* subdivide-setting) +(define-extern *subdivide-foreground-draw-mode* subdivide-setting) +(define-extern *subdivide-ocean-draw-mode* subdivide-setting) +(define-extern *ocean-height-hack* ocean-height-hack) (define-extern *dproc* process) -;; (define-extern *run* object) ;; symbol -;; (define-extern *teleport* object) ;; symbol -;; (define-extern *teleport-count* object) ;; int -;; (define-extern *draw-hook* object) ;; (function none) -;; (define-extern *debug-hook* object) ;; pair -;; (define-extern *menu-hook* object) ;; (function debug-menu-context) -;; (define-extern *progress-hook* object) ;; (function none) -;; (define-extern *dma-timeout-hook* object) ;; (function none) -;; (define-extern *frame-stats* object) ;; frame-stats -;; (define-extern *col-rend* col-rend) ;; col-rend -;; (define-extern debug-actor? function) ;; (function object symbol) +(define-extern *run* symbol) +(define-extern *teleport* symbol) +(define-extern *teleport-count* int) +(define-extern *draw-hook* (function none)) +(define-extern *debug-hook* pair) +(define-extern *menu-hook* (function debug-menu-context)) +(define-extern *progress-hook* (function none)) +(define-extern *dma-timeout-hook* (function none)) +(define-extern *frame-stats* frame-stats) +(define-extern *col-rend* col-rend) +(define-extern debug-actor? (function object symbol)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; mspace-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype joint (basic) + "A joint from an animated skeleton. This defines the graph of the skeleton, and also the bind pose + used for the mesh data. The joints are shared between all instances of the same model." ((name basic :offset-assert 4) (number int32 :offset-assert 8) (parent joint :offset-assert 12) ;; guessed by decompiler @@ -11496,10 +11628,9 @@ :size-assert #x50 :flag-assert #x900000050 ) -|# -#| (deftype bone-cache (structure) + "Unused type. Existed in Jak 1, but wasn't used there." ((bone-matrix uint32 :offset-assert 0) (parent-matrix uint32 :offset-assert 4) (dummy uint32 :offset-assert 8) @@ -11509,32 +11640,33 @@ :size-assert #x10 :flag-assert #x900000010 ) -|# -#| (deftype bone (structure) + "The location and scale of a bone in an animated skeleton. Each instance of a skeleton + has its own copy of the bones. This data is used for collision checking or other gameplay math, + but, despite the name, isn't directly used in rendering." ((transform matrix :inline :offset-assert 0) - (position vector :inline :offset-assert 48) + (position vector :inline :offset 48) (scale vector :inline :offset-assert 64) ) :method-count-assert 9 :size-assert #x50 :flag-assert #x900000050 ) -|# -#| (deftype skeleton (inline-array-class) - ((data UNKNOWN :dynamic :offset-assert 16) + "Skeleton is an array of bones for the entire character. The bones are stored in an inline array so they can be + easily dma'd to the scratchpad later." + ((bones bone :inline :dynamic) ) :method-count-assert 14 :size-assert #x10 :flag-assert #xe00000010 ) -|# -#| (deftype cspace (structure) + "A cspace describes how to control a bone. It contains a reference to the joint, bone, and a callback function. + The callback function is used to take the joint transforms out of the joint animation, then update the bone." ((parent cspace :offset-assert 0) (joint joint :offset-assert 4) ;; guessed by decompiler (joint-num int16 :offset-assert 8) @@ -11549,13 +11681,11 @@ :flag-assert #xa00000020 ;; field param1 uses ~A with a signed load. field param2 uses ~A with a signed load. (:methods - (new (symbol type) _type_) ;; 0 ;; (new (symbol type drawable) _type_) - (cspace-method-9 () none) ;; 9 ;; (reset-and-assign-geo! (_type_ drawable) _type_) + (new (symbol type drawable) _type_) ;; 0 + (reset-and-assign-geo! (_type_ drawable) _type_) ;; 9 ) ) -|# -#| (deftype cspace-array (inline-array-class) ((data cspace :dynamic :offset-assert 16) ;; guessed by decompiler ) @@ -11563,15 +11693,19 @@ :size-assert #x10 :flag-assert #xe00000010 ) -|# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; drawable-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype drawable (basic) + "Base class for `drawable` scene graph system. + This base class is really abused in many ways, and the meaning of the various methods differ depending + on the exact type. Not even the ID and bsphere here are always populated. + This is used for very high level organization of different rendering data types, and also very low-level + culling/rendering optimizations. It supports both array-of-references and inline-array containers with precise + control over memory layout for use with DMA." ((id int16 :offset-assert 4) (bsphere vector :inline :offset-assert 16) ) @@ -11580,7 +11714,7 @@ :flag-assert #x1100000020 (:methods (drawable-method-9 () none) ;; 9 ;; (login (_type_) _type_) - (drawable-method-10 () none) ;; 10 ;; (draw (_type_ _type_ display-frame) none) + (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) (drawable-method-13 () none) ;; 13 ;; (collect-stats (_type_) none) @@ -11589,137 +11723,154 @@ (drawable-method-16 () none) ;; 16 ;; (collect-regions (_type_ sphere int region-prim-list) none) ) ) -|# -#| (deftype drawable-error (drawable) + "A drawable which just represents an error. When drawn, it simply displays a sphere with an error message." ((name string :offset-assert 32) ;; guessed by decompiler ) :method-count-assert 17 :size-assert #x24 :flag-assert #x1100000024 ) -|# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; drawable-group-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype drawable-group (drawable) - ((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. + "Base class for an array of references to other drawables. + These are typically used for very high-level organization of drawable." + ((length int16 :offset 6) + (data drawable :dynamic :offset-assert 32) ;; guessed by decompiler ) :method-count-assert 17 :size-assert #x20 :flag-assert #x1100000020 (:methods - (new (symbol type) _type_) ;; 0 ;; (new (symbol type int) _type_) + (new (symbol type int) _type_) ;; 0 ) ) -|# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; drawable-inline-array-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype drawable-inline-array (drawable) - ((length int16 :offset-assert 6) + ((length int16 :offset 6) ) :method-count-assert 17 :size-assert #x20 :flag-assert #x1100000020 ) -|# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; draw-node-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype draw-node (drawable) - ((child-count uint8 :offset-assert 6) - (flags uint8 :offset-assert 7) - (child drawable :offset-assert 8) ;; guessed by decompiler - (distance float :offset-assert 12) + "Node in a bounding volume heirarchy. This is a base class, and there are no children. + The child is a pointer to the start of inline array of drawables (note: not a drawable-inline-array, literally a bunch of plain drawables) + The size of this array is child-count. The type is either more draw-nodes, or, some other drawable like tfragment, depending on the flags. + Different renderers have different restrictions on the tree structure, like max child count, or if all children have the same depth. + Generally, tfrag/collide use a very rigid equal depth, max 8 children rule, but with shrub, anything goes. + This is a very awkward data structure to traverse, but it is designed for fast view frustum culling. + Note that there can be multiple ways to reach drawables in here in some cases - for example you can follow + this tree, or check one of the depth arrays found in tfrag. + " + ((child-count uint8 :offset 6) + (flags uint8 :offset 7) + (child drawable :offset 8) ;; guessed by decompiler + (distance float :offset 12) ) :method-count-assert 17 :size-assert #x20 :flag-assert #x1100000020 ;; field distance is a float printed as hex? ) -|# -;; (deftype drawable-inline-array-node (drawable-inline-array) -;; () -;; :flag-assert #x1100000044 -;; ) +(deftype drawable-inline-array-node (drawable-inline-array) + "Top level container for a BVH made of draw-nodes." + ((data draw-node 1 :inline) + (pad uint32) + ) + :flag-assert #x1100000044 + ) -#| (deftype draw-node-dma (structure) - ((banka draw-node 32 :offset-assert 4) ;; guessed by decompiler - (bankb draw-node 32 :offset-assert 1028) ;; guessed by decompiler + "DMA buffer layout for draw node culling routine, which copies draw-nodes directly to scratchpad in bulk. + This would not work with the memory layout of shrub." + ((banka draw-node 32 :inline :offset-assert 0) ;; guessed by decompiler + (bankb draw-node 32 :inline :offset-assert 1024) ;; guessed by decompiler ) :method-count-assert 9 :size-assert #x800 :flag-assert #x900000800 ) -|# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; drawable-tree-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (deftype drawable-tree (drawable-group) -;; () -;; :flag-assert #x1100000020 -;; ) +(deftype drawable-tree (drawable-group) + "A drawable tree is a container of drawables of a specific rendering type. + Instead of having a single large tree of mixed types, there will be a tree of tfrags, a tree of ties, etc. + The top-level tfrag tree will have a type that's a child of drawable-tree. + Generally, the object passed to a large renderer is a drawable-tree." + () + :flag-assert #x1100000020 + ) -;; (deftype drawable-tree-array (drawable-group) -;; () -;; :flag-assert #x1100000020 -;; ) +(deftype drawable-tree-array (drawable-group) + "Collection of drawable trees. This might have a tfrag tree, tie tree, etc." + () + :flag-assert #x1100000020 + ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; drawable-actor-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype drawable-actor (drawable) - ((actor entity-actor :offset-assert 8) ;; guessed by decompiler + "Wrapper around an entity-actor to put it in the drawable system. + Note that this is never used to actually draw actors - it is just used as a list of all entity-actors + for the entity/birth system." + ((actor entity-actor :offset 8) ;; guessed by decompiler ) :method-count-assert 17 :size-assert #x20 :flag-assert #x1100000020 ) -|# -;; (deftype drawable-tree-actor (drawable-tree) -;; () -;; :flag-assert #x1100000020 -;; ) +(deftype drawable-tree-actor (drawable-tree) + "Adapater for putting the actors in the tree-array." + () + :flag-assert #x1100000020 + ) -;; (deftype drawable-inline-array-actor (drawable-inline-array) -;; () -;; :flag-assert #x1100000044 -;; ) +(deftype drawable-inline-array-actor (drawable-inline-array) + "Array of drawable-actors." + ((data drawable-actor 1 :inline) + (pad uint8 4)) + :flag-assert #x1100000044 + ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; region-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +(declare-type region-prim-area structure) + (deftype region (structure) + "A region is a closed volume that you can, enter, exit, and be inside. + This stores a unique, and script functions for a single region. + These are stored separately from the actual geometry to allow the geometry to be smaller + and fit in scratchpad/cache better." ((id uint32 :offset-assert 0) (on-enter pair :offset-assert 4) ;; guessed by decompiler (on-inside pair :offset-assert 8) ;; guessed by decompiler @@ -11730,114 +11881,105 @@ :flag-assert #xa00000010 ;; field on-enter uses ~A with a signed load. field on-inside uses ~A with a signed load. field on-exit uses ~A with a signed load. (:methods - (region-method-9 () none) ;; 9 ;; (region-method-9 (_type_ vector) symbol) + (point-in-region-debug! "Debug check to see if point is in region. This is not efficient, since it has to find the parent geometry of this region." (_type_ vector) symbol) ;; 9 ) ) -|# -#| (deftype region-array (inline-array-class) - ((data region :dynamic :offset-assert 16) ;; guessed by decompiler + "Array of region." + ((data region :dynamic :inline :offset-assert 16) ;; guessed by decompiler ) :method-count-assert 14 :size-assert #x10 :flag-assert #xe00000010 ) -|# -#| (deftype drawable-region-prim (drawable) - ((region region :offset-assert 8) + "Base class for a region + geometry. + Note that all child classes of this must be 32-bytes." + ((region region :offset 8) ) :method-count-assert 20 :size-assert #x20 :flag-assert #x1400000020 (:methods - (drawable-region-prim-method-17 () none) ;; 17 ;; (debug-draw-region (_type_ int) none) - (drawable-region-prim-method-18 () none) ;; 18 ;; (track-region (_type_ region-prim-area) symbol) - (drawable-region-prim-method-19 () none) ;; 19 ;; (within-area? (_type_ region-prim-area) symbol) + (debug-draw-region (_type_ int) none) ;; 17 + (track-region (_type_ region-prim-area) symbol) ;; 18 + (within-area? (_type_ region-prim-area) symbol) ;; 19 ) ) -|# -#| (deftype drawable-tree-region-prim (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. - (name basic :offset-assert 4) - ) + "Top-level container for all regions of a level." + ((name basic :offset 8) + (data2 drawable-inline-array :dynamic :offset 32 :score 1)) :method-count-assert 19 :size-assert #x20 :flag-assert #x1300000020 (:methods - (drawable-tree-region-prim-method-17 () none) ;; 17 ;; (drawable-tree-region-prim-method-17 (_type_ vector) symbol) - (drawable-tree-region-prim-method-18 () none) ;; 18 ;; (debug-print (_type_ vector object) none) + (drawable-tree-region-prim-method-17 (_type_ vector) symbol) ;; 17 + (debug-print (_type_ vector object) none) ;; 18 ) ) -|# -;; (deftype drawable-inline-array-region-prim (drawable-inline-array) -;; () -;; :flag-assert #x1100000044 -;; ) +(deftype drawable-inline-array-region-prim (drawable-inline-array) + "Inline array of drawable-region-prim. This actually stores child classes, but they are + exactly the same size as the parent, so it's okay." + ((data drawable-region-prim 1 :inline :offset-assert 32) + (pad uint8 4)) + :flag-assert #x1100000044 + ) -#| (deftype drawable-region-sphere (drawable-region-prim) + "Region where the bsphere of the drawable is the volume." () :method-count-assert 20 :size-assert #x20 :flag-assert #x1400000020 ) -|# -#| (deftype region-face-data (structure) + "Data to store a single planar face, as a normal and list of vertices." ((normal vector :inline :offset-assert 0) - (normal-offset float :offset-assert 12) + (normal-offset float :offset-assert 12 :overlay-at (-> normal w)) (num-points uint32 :offset-assert 16) - (points vector :dynamic :offset-assert 32) ;; guessed by decompiler + (points vector :dynamic :inline :offset-assert 32) ;; guessed by decompiler ) :method-count-assert 9 :size-assert #x20 :flag-assert #x900000020 ) -|# -#| (deftype drawable-region-face (drawable-region-prim) - ((data region-face-data :offset-assert 12) + "A drawable-region which is just a face. Unclear if `on-inside` is used." + ((data region-face-data :offset 12) ) :method-count-assert 20 :size-assert #x20 :flag-assert #x1400000020 ) -|# -#| (deftype region-face-array (inline-array-class) - ((data drawable-region-face :dynamic :offset-assert 20) ;; guessed by decompiler + "An array of faces that hopefully make a closed volume." + ((data drawable-region-face :dynamic :inline :offset 16) ;; guessed by decompiler + (pad uint32) ) :method-count-assert 14 :size-assert #x14 :flag-assert #xe00000014 ) -|# -#| (deftype drawable-region-volume (drawable-region-prim) - ((faces region-face-array :offset-assert 12) ;; guessed by decompiler + "A drawable-region which is a bunch of faces that represent a closed volume." + ((faces region-face-array :offset 12) ;; guessed by decompiler ) :method-count-assert 20 :size-assert #x20 :flag-assert #x1400000020 ) -|# -#| (deftype region-prim-list (structure) + "A list of drawable-region-prim. This is the return type of queries like `which regions contain this point?`" ((num-items int32 :offset-assert 0) (items drawable-region-prim 320 :offset-assert 4) ;; guessed by decompiler ) @@ -11845,13 +11987,39 @@ :size-assert #x504 :flag-assert #x900000504 ) -|# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; traffic-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(declare-type nav-mesh basic) +(declare-type nav-branch structure) + +;; +++traffic-h:traffic-spawn-flags +(defenum traffic-spawn-flags + :type uint32 + :bitfield #t + ) +;; ---traffic-h:traffic-spawn-flags + +;; +++traffic-h:traffic-type +(defenum traffic-type + :type uint8 + (tt17 17) + (tt18 18) + (tt19 19) + (tt20 20) + (tt21 21) + (tt22 22) + (tt23 23) + (tt25 25) + (tt27 27) + (tt28 28) + (invalid #xffffffff) + ) +;; ---traffic-h:traffic-type + (deftype traffic-danger-info (structure) ((sphere sphere :inline :offset-assert 0) (velocity vector :inline :offset-assert 16) @@ -11878,12 +12046,11 @@ (:methods (try-creating-new-suppression-box (_type_) symbol) ;; 9 (create-or-update-suppression-box (_type_) symbol) ;; 10 - (has-valid-id? (_type_) none) ;; 11 + (has-valid-id? (_type_) symbol) ;; 11 (kill-suppression-box (_type_) none) ;; 12 ) ) -#| (deftype traffic-object-spawn-params (structure) ((object-type uint8 :offset-assert 0) ;; traffic-type (behavior uint64 :offset-assert 8) @@ -11893,7 +12060,7 @@ (position vector :inline :offset-assert 32) (rotation quaternion :inline :offset-assert 48) (velocity vector :inline :offset-assert 64) - (handle uint64 :offset-assert 80) ;; handle + (handle handle :offset-assert 80) ;; handle (handle-parent uint64 :offset-assert 88) (guard-type uint8 :offset-assert 96) (user-data uint32 :offset-assert 100) @@ -11905,29 +12072,26 @@ :size-assert #x74 :flag-assert #x900000074 ) -|# -#| (deftype traffic-info (structure) ((ctywide-level basic :offset-assert 0) (vehicle-level basic :offset-assert 4) (race-vehicle-level basic :offset-assert 8) - (traffic-object-levels UNKNOWN 29 :offset-assert 12) - (vehicle-levels UNKNOWN 44 :offset-assert 128) - (traffic-object-type-from-vehicle-type UNKNOWN 44 :offset-assert 304) + (traffic-object-levels level 29 :offset-assert 12) + (vehicle-levels level 44 :offset-assert 128) + (traffic-object-type-from-vehicle-type traffic-type 44 :offset-assert 304) (restore-speech-callback basic :offset-assert 348) ) :method-count-assert 9 :size-assert #x160 :flag-assert #x900000160 ) -|# (declare-type traffic-manager process) (declare-type vehicle-manager process) (define-extern *traffic-manager* traffic-manager) (define-extern *vehicle-manager* vehicle-manager) -;; (define-extern *traffic-info* object) +(define-extern *traffic-info* traffic-info) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; game-task-h ;; @@ -13135,28 +13299,28 @@ ;; generic-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype gsf-vertex (structure) + "Vertex used by generic. GSF = generic stripped fragment?" ((data uint32 8 :offset-assert 0) ;; guessed by decompiler - (byte uint8 32 :offset-assert 0) ;; guessed by decompiler - (quad uint128 2 :offset-assert 0) ;; guessed by decompiler - (vt qword :inline :offset-assert 0) - (pos vector3s :inline :offset-assert 0) - (tex vector2uh :inline :offset-assert 12) - (nrm vector3s :inline :offset-assert 16) - (nc qword :inline :offset-assert 16) - (clr vector4ub :inline :offset-assert 28) - (dtex vector2uh :inline :offset-assert 16) - (dclr vector4ub :inline :offset-assert 20) + (byte uint8 32 :offset 0) ;; guessed by decompiler + (quad uint128 2 :offset 0) ;; guessed by decompiler + (vt qword :inline :offset 0) + (pos vector3s :inline :offset 0) + (tex vector2uh :inline :offset 12) + (nrm vector3s :inline :offset 16) + (nc qword :inline :offset 16) + (clr vector4ub :inline :offset 28) + (dtex vector2uh :inline :offset 16) + (dclr vector4ub :inline :offset 20) ) :method-count-assert 9 :size-assert #x20 :flag-assert #x900000020 ) -|# -#| (deftype gsf-fx-vertex (structure) + "Color/texture data only. Possibly used to share with a gsf-vertex with + the same position/normal." ((clr vector4ub :inline :offset-assert 0) (tex vector2uh :inline :offset-assert 4) ) @@ -13164,10 +13328,9 @@ :size-assert #x8 :flag-assert #x900000008 ) -|# -#| (deftype gsf-header (structure) + "Header for generic data." ((num-strips uint8 :offset-assert 0) (num-new-vtxs uint8 :offset-assert 1) (num-dps uint16 :offset-assert 2) @@ -13178,9 +13341,7 @@ :size-assert #x10 :flag-assert #x900000010 ) -|# -#| (deftype gsf-ik (structure) ((index uint8 :offset-assert 0) (no-kick uint8 :offset-assert 1) @@ -13189,9 +13350,7 @@ :size-assert #x2 :flag-assert #x900000002 ) -|# -#| (deftype gsf-info (structure) ((ptr-iks uint32 :offset-assert 0) (ptr-verts uint32 :offset-assert 4) @@ -13202,22 +13361,18 @@ :size-assert #x10 :flag-assert #x900000010 ) -|# -#| (deftype gsf-buffer (structure) ((data uint8 8192 :offset-assert 0) ;; guessed by decompiler - (info gsf-info :inline :offset-assert 0) - (header gsf-header :inline :offset-assert 16) - (work-area uint8 :dynamic :offset-assert 32) ;; guessed by decompiler + (info gsf-info :inline :offset 0) + (header gsf-header :inline :offset 16) + (work-area uint8 :dynamic :offset 32) ;; guessed by decompiler ) :method-count-assert 9 :size-assert #x2000 :flag-assert #x900002000 ) -|# -#| (deftype generic-frag (structure) ((start-pos uint16 :offset-assert 0) (end-pos uint16 :offset-assert 2) @@ -13226,9 +13381,7 @@ :size-assert #x4 :flag-assert #x900000004 ) -|# -#| (deftype generic-strip (structure) ((pos uint16 :offset-assert 0) (len uint16 :offset-assert 2) @@ -13237,9 +13390,7 @@ :size-assert #x4 :flag-assert #x900000004 ) -|# -#| (deftype generic-envmap-saves (structure) ((index-mask vector4w :inline :offset-assert 0) (verts uint128 12 :offset-assert 16) ;; guessed by decompiler @@ -13249,9 +13400,7 @@ :size-assert #x110 :flag-assert #x900000110 ) -|# -#| (deftype generic-interp-job (structure) ((job-type uint16 :offset-assert 0) (num uint16 :offset-assert 2) @@ -13261,13 +13410,12 @@ (morph-z uint16 :offset-assert 12) (morph-w uint16 :offset-assert 14) ) + :pack-me :method-count-assert 9 :size-assert #x10 :flag-assert #x900000010 ) -|# -#| (deftype generic-saves (structure) ((ptr-dma uint32 :offset-assert 0) (ptr-vtxs uint32 :offset-assert 4) @@ -13300,24 +13448,20 @@ :size-assert #x170 :flag-assert #x900000170 ) -|# -#| (deftype generic-gif-tag (structure) ((data uint32 4 :offset-assert 0) ;; guessed by decompiler - (qword qword :inline :offset-assert 0) - (fan-prim gif-tag-prim :offset-assert 0) ;; guessed by decompiler - (str-prim gif-tag-prim :offset-assert 4) ;; guessed by decompiler - (regs gif-tag-regs-32 :offset-assert 8) ;; guessed by decompiler - (num-strips uint32 :offset-assert 12) + (qword qword :inline :offset 0) + (fan-prim gif-tag-prim :offset 0) ;; guessed by decompiler + (str-prim gif-tag-prim :offset 4) ;; guessed by decompiler + (regs gif-tag-regs-32 :offset 8) ;; guessed by decompiler + (num-strips uint32 :offset 12) ) :method-count-assert 9 :size-assert #x10 :flag-assert #x900000010 ) -|# -#| (deftype generic-envmap-consts (structure) ((consts vector :inline :offset-assert 0) (strgif generic-gif-tag :inline :offset-assert 16) @@ -13328,9 +13472,7 @@ :size-assert #x80 :flag-assert #x900000080 ) -|# -#| (deftype generic-consts (structure) ((dma-header dma-packet :inline :offset-assert 0) (vif-header uint32 4 :offset-assert 16) ;; guessed by decompiler @@ -13343,7 +13485,7 @@ (ztest-normal gs-adcmd :inline :offset-assert 176) (ztest-opaque gs-adcmd :inline :offset-assert 192) (adcmd-offsets uint8 16 :offset-assert 208) ;; guessed by decompiler - (adcmds UNKNOWN 4 :offset-assert 144) + ;(adcmds UNKNOWN 4 :offset-assert 144) (stcycle-tag uint32 :offset-assert 224) (unpack-vtx-tag uint32 :offset-assert 228) (unpack-clr-tag uint32 :offset-assert 232) @@ -13361,9 +13503,7 @@ :size-assert #x1b0 :flag-assert #x9000001b0 ) -|# -#| (deftype generic-storage (structure) ((data uint128 16 :offset-assert 0) ;; guessed by decompiler ) @@ -13371,7 +13511,6 @@ :size-assert #x100 :flag-assert #x900000100 ) -|# #| (deftype gsf-vertex-array (UNKNOWN) @@ -13393,7 +13532,23 @@ ) |# -;; (define-extern *gsf-buffer* object) ;; gsf-buffer +(deftype gsf-vertex-array (structure) + ((vtx gsf-vertex :dynamic :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x0 + :flag-assert #x900000000 + ) + +(deftype gsf-fx-vertex-array (structure) + ((data gsf-fx-vertex :dynamic :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x0 + :flag-assert #x900000000 + ) + +(define-extern *gsf-buffer* object) ;; gsf-buffer ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ocean-trans-tables ;; @@ -13440,7 +13595,6 @@ ;; cloth-art-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype cloth-pt (structure) ((pt vector :inline :offset-assert 0) (u float :offset-assert 16) @@ -13450,9 +13604,7 @@ :size-assert #x18 :flag-assert #x900000018 ) -|# -#| (deftype anchor-transform (structure) ((offset vector :inline :offset-assert 0) (joint-name basic :offset-assert 16) @@ -13463,9 +13615,7 @@ :size-assert #x18 :flag-assert #x900000018 ) -|# -#| (deftype sphere-transform (structure) ((offset vector :inline :offset-assert 0) (joint-name basic :offset-assert 16) @@ -13476,9 +13626,7 @@ :size-assert #x1a :flag-assert #x90000001a ) -|# -#| (deftype disc-transform (structure) ((offset vector :inline :offset-assert 0) (normal vector :inline :offset-assert 16) @@ -13492,49 +13640,39 @@ :size-assert #x2e :flag-assert #x90000002e ) -|# -#| (deftype anchor-transform-array (inline-array-class) - ((data UNKNOWN :dynamic :offset-assert 16) + ((data anchor-transform :dynamic :inline :offset-assert 16) ) :method-count-assert 14 :size-assert #x10 :flag-assert #xe00000010 ) -|# -#| (deftype sphere-transform-array (inline-array-class) - ((data UNKNOWN :dynamic :offset-assert 16) + ((data sphere-transform :dynamic :inline :offset-assert 16) ) :method-count-assert 14 :size-assert #x10 :flag-assert #xe00000010 ) -|# -#| (deftype disc-transform-array (inline-array-class) - ((data UNKNOWN :dynamic :offset-assert 16) + ((data disc-transform :dynamic :inline :offset-assert 16) ) :method-count-assert 14 :size-assert #x10 :flag-assert #xe00000010 ) -|# -#| (deftype cloth-thickness-array (inline-array-class) - ((data UNKNOWN :dynamic :offset-assert 16) + ((data uint8 :dynamic :offset-assert 16) ;; ?? ) :method-count-assert 14 :size-assert #x10 :flag-assert #xe00000010 ) -|# -#| (deftype cloth-params (structure) ((mesh int16 :offset-assert 0) (gravity-constant float :offset-assert 4) @@ -13562,9 +13700,7 @@ :size-assert #x58 :flag-assert #x900000058 ) -|# -#| (deftype cloth-base (basic) () :method-count-assert 11 @@ -13575,15 +13711,14 @@ (cloth-base-method-10 () none) ;; 10 ) ) -|# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; art-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype joint-anim (basic) + "Base class for all joint animations. These are animations that store joint transforms." ((name string :offset-assert 4) ;; guessed by decompiler (number int16 :offset-assert 8) (length int16 :offset-assert 10) @@ -13592,50 +13727,49 @@ :size-assert #xc :flag-assert #x90000000c ) -|# -;; (deftype joint-anim-matrix (joint-anim) -;; () -;; :flag-assert #x900000010 -;; ) +(deftype joint-anim-matrix (joint-anim) + "Joint animation which stores matrices directly. Not used." + ((data matrix :inline :dynamic :offset 16)) + :flag-assert #x900000010 + ) -#| (deftype joint-anim-transformq (joint-anim) - ((name string :offset-assert 0) ;; guessed by decompiler - (number int16 :offset-assert 4) - (length int16 :offset-assert 6) - (data transformq :dynamic :offset-assert 12) ;; guessed by decompiler - (UNKNOWN UNKNOWN :offset-assert -1) ;; field could not be read. + "Joint animation which stores transformq's directly. Not used." + ((data transformq :dynamic :inline :offset-assert 16) ;; guessed by decompiler ) :method-count-assert 9 :size-assert #x10 :flag-assert #x900000010 ) -|# -#| (deftype joint-anim-drawable (joint-anim) + "Mysterious unused joint animation type." ((data drawable :dynamic :offset-assert 12) ;; guessed by decompiler ) :method-count-assert 9 :size-assert #xc :flag-assert #x90000000c ) -|# -#| (deftype joint-anim-frame (structure) - ((matrices matrix 2 :offset-assert 0) ;; guessed by decompiler - (data transformq :dynamic :offset-assert 128) ;; guessed by decompiler + "Frame containing all joint transforms. Note that there are two special frames: align and prejoint. + The 'align' frame is used for the complicated animation alignment system, which allows the animation to move + a character, among other things. The prejoint is just the root of the skeleton. + The remaining transformq's are the joint transforms you'd expect." + ((matrices matrix 2 :inline :offset-assert 0) ;; guessed by decompiler + (data transformq :dynamic :inline :offset-assert 128) ;; guessed by decompiler ) + (:methods + (new (symbol type int) _type_) + ) :method-count-assert 9 :size-assert #x80 :flag-assert #x900000080 ) -|# -#| (deftype joint-anim-compressed-hdr (structure) + "Header for the compressed joint animation format." ((control-bits uint32 14 :offset-assert 0) ;; guessed by decompiler (num-joints uint32 :offset-assert 56) (matrix-bits uint32 :offset-assert 60) @@ -13644,38 +13778,32 @@ :size-assert #x40 :flag-assert #x900000040 ) -|# -#| (deftype joint-anim-compressed-fixed (structure) ((hdr joint-anim-compressed-hdr :inline :offset-assert 0) (offset-64 uint32 :offset-assert 64) (offset-32 uint32 :offset-assert 68) (offset-16 uint32 :offset-assert 72) (reserved uint32 :offset-assert 76) - (data vector 133 :offset-assert 80) ;; guessed by decompiler + (data vector 133 :inline :offset-assert 80) ;; guessed by decompiler ) :method-count-assert 9 :size-assert #x8a0 :flag-assert #x9000008a0 ) -|# -#| (deftype joint-anim-compressed-frame (structure) ((offset-64 uint32 :offset-assert 0) (offset-32 uint32 :offset-assert 4) (offset-16 uint32 :offset-assert 8) (reserved uint32 :offset-assert 12) - (data vector 133 :offset-assert 16) ;; guessed by decompiler + (data vector 133 :inline :offset-assert 16) ;; guessed by decompiler ) :method-count-assert 9 :size-assert #x860 :flag-assert #x900000860 ) -|# -#| (deftype joint-anim-compressed-control (structure) ((num-frames uint16 :offset-assert 0) (flags uint16 :offset-assert 2) @@ -13688,11 +13816,11 @@ :size-assert #x10 :flag-assert #x900000010 ) -|# -#| (deftype art (basic) - ((name string :offset-assert 8) ;; guessed by decompiler + "Base class for anything considered `art`. This is typically foreground model data. + This can be either an art container containing more arts, or an actual art thing (art-element)." + ((name string :offset 8) ;; guessed by decompiler (length int32 :offset-assert 12) (extra res-lump :offset-assert 16) ;; guessed by decompiler ) @@ -13707,30 +13835,31 @@ (art-method-13 () none) ;; 13 ) ) -|# -#| (deftype art-element (art) + "Base class Art which is not a container of more art." ((master-art-group-name basic :offset-assert 20) (master-art-group-index int32 :offset-assert 24) + (pad uint8 20) ) :method-count-assert 14 :size-assert #x30 :flag-assert #xe00000030 ) -|# -;; (deftype art-mesh-anim (art-element) -;; () -;; :flag-assert #xe00000030 -;; ) +(deftype art-mesh-anim (art-element) + "An unused mesh animation." + () + :flag-assert #xe00000030 + ) -#| +(declare-type merc-eye-anim-block structure) (deftype art-joint-anim (art-element) - ((eye-anim merc-eye-anim-block :offset-assert 28) - (blend-shape-anim (pointer int8) :offset-assert 32) ;; guessed by decompiler - (frames joint-anim-compressed-control :offset-assert 36) - (speed float :offset-assert 48) + "Art for a joint animation. Also contains the eye animation." + ((eye-anim merc-eye-anim-block :offset 28) + (blend-shape-anim (pointer int8) :offset 32) ;; guessed by decompiler + (frames joint-anim-compressed-control :offset 36) + (speed float :offset 48) (artist-base float :offset-assert 52) (artist-step float :offset-assert 56) ) @@ -13739,41 +13868,49 @@ :flag-assert #xe0000003c ;; field blend-shape-anim uses ~A with a signed load. ) -|# -;; (deftype art-group (art) -;; () -;; :flag-assert #x1000000020 -;; ) +(deftype art-group (art) + "Art which is a list of more art. The -ag files are an art group with all the art needed for a + actor, like the mesh, animations, shadow mesh, skeleton, etc." + ((info file-info :offset 4) + (data art-element :score -1 :dynamic :offset 32) ;; might just be art? + ) + :flag-assert #x1000000020 + (:methods + (unknown-0 () none) + (unknown-1 () none) + ) + ) -;; (deftype art-mesh-geo (art-element) -;; () -;; :flag-assert #xe00000030 -;; ) +(deftype art-mesh-geo (art-element) + "Unused art format for a mesh. This might have been for the renderer that came before merc." + () + :flag-assert #xe00000030 + ) -;; (deftype art-joint-geo (art-element) -;; () -;; :flag-assert #xe00000030 -;; ) +(deftype art-joint-geo (art-element) + "Collection of joints for an actor." + () + :flag-assert #xe00000030 + ) -#| (deftype art-cloth-geo (art-element) ((anchor-transforms basic :offset-assert 48) (sphere-transforms basic :offset-assert 52) (disc-transforms basic :offset-assert 56) (cloth-thickness basic :offset-assert 60) (thickness-scalar float :offset-assert 64) - (num-points int32 :offset-assert 12) - (mesh UNKNOWN :dynamic :offset-assert 80) + (num-points int32 :offset 12) + (mesh object :dynamic :offset 80) ;; todo ) :method-count-assert 14 :size-assert #x50 :flag-assert #xe00000050 ) -|# -#| (deftype art-joint-anim-manager-slot (structure) + "Record for an animation which is additionally compressed with LZO compression over the entire animation. + This is used for short, commonly used animations that always remain in RAM." ((anim art-joint-anim :offset-assert 0) ;; guessed by decompiler (comp-data uint32 :offset-assert 4) (time-stamp uint64 :offset-assert 8) @@ -13782,20 +13919,18 @@ :size-assert #x10 :flag-assert #x900000010 ) -|# -#| (deftype art-joint-anim-manager (basic) + "Cache for LZO decompression of animations." ((heap kheap :inline :offset-assert 16) (free-index int32 :offset-assert 32) - (slot art-joint-anim-manager-slot 64 :offset-assert 48) ;; guessed by decompiler - (UNKNOWN UNKNOWN :offset-assert -1) ;; field could not be read. + (slot art-joint-anim-manager-slot 64 :inline :offset-assert 48) ;; guessed by decompiler ) :method-count-assert 14 :size-assert #x430 :flag-assert #xe00000430 (:methods - (new (symbol type) _type_) ;; 0 ;; (new (symbol type int) _type_) + (new (symbol type int) _type_) ;; 0 ;; (new (symbol type int) _type_) (art-joint-anim-manager-method-9 () none) ;; 9 ;; (decompress (_type_ art-joint-anim) art-joint-anim) (art-joint-anim-manager-method-10 () none) ;; 10 ;; (update-time-stamp (_type_ art-joint-anim) art-joint-anim) (art-joint-anim-manager-method-11 () none) ;; 11 ;; (unload-from-slot (_type_ int) art-joint-anim) @@ -13803,20 +13938,15 @@ (art-joint-anim-manager-method-13 () none) ;; 13 ;; (unload-from-level (_type_ level) none) ) ) -|# -#| (deftype skeleton-group (art-group) - ((name string :offset-assert 8) ;; guessed by decompiler - (length int32 :offset-assert 12) - (extra res-lump :offset-assert 16) ;; guessed by decompiler - (info file-info :offset-assert 4) ;; guessed by decompiler - (data art-element :dynamic :offset-assert 32) ;; guessed by decompiler - (art-group-name string :offset-assert 32) ;; guessed by decompiler + "Unlike other art types, the skeleton-groups are defined in GOAL code. + This stores settings like the name of the art-group, shadow/level-of-detail settings, etc." + ((art-group-name string :offset-assert 32) ;; guessed by decompiler (jgeo int16 :offset-assert 36) ;; int32 (janim int16 :offset-assert 38) ;; int32 (bounds vector :inline :offset-assert 48) - (radius meters :offset-assert 60) + (radius meters :offset-assert 60 :overlay-at (-> bounds w)) (mgeo int16 6 :offset-assert 64) ;; guessed by decompiler (max-lod int32 :offset-assert 76) (lod-dist float 6 :offset-assert 80) ;; guessed by decompiler @@ -13838,22 +13968,22 @@ (skeleton-group-method-16 () none) ;; 16 ) ) -|# -#| +(declare-type merc-ctrl structure) (deftype lod-group (structure) + "A single level of detail mesh." ((geo merc-ctrl :offset-assert 0) ;; guessed by decompiler (dist meters :offset-assert 4) ) + :pack-me :method-count-assert 9 :size-assert #x8 :flag-assert #x900000008 ) -|# -#| (deftype lod-set (structure) - ((lod lod-group 6 :offset-assert 0) ;; guessed by decompiler + "All the different level-of-detail meshes for an actor." + ((lod lod-group 6 :inline :offset-assert 0) ;; guessed by decompiler (max-lod int8 :offset-assert 48) ) :method-count-assert 10 @@ -13863,13 +13993,61 @@ (lod-set-method-9 () none) ;; 9 ;; (setup-lods! (_type_ skeleton-group art-group entity) _type_) ) ) -|# -#| +(declare-type process-drawable process) + +(defenum draw-control-status + :type uint16 + :bitfield #t + (close-to-screen 0) + (no-draw 1) + (no-draw-temp) + (on-screen) + (uninited) + (no-draw-bounds) + (no-closest-distance) + (math-skel) + (force-vu1) + (no-draw-bounds2) + (force-fade) + (warp-cross-fade) + (lod-set) + (disable-fog) + (hud) + (no-bounds-check) + ) + +(defenum draw-control-data-format + :type uint8 + :bitfield #f + (pris 0) + (merc 1) + ) + +(defenum draw-control-global-effect + :type uint8 + :bitfield #t + (bit-0) + (bit-1) + (title-light) + (disable-envmap) + (rim-lights) + (rim-lights2) + (rim-lights3) + (no-textures) + ) + +(declare-type ripple-control basic) +(declare-type shadow-geo structure) +(declare-type shadow-control structure) + + (deftype draw-control (basic) + "The draw-control is a collection of all the stuff that the foreground rendering system needs to draw something. + Each process-drawable has a draw-control." ((process process-drawable :offset-assert 4) ;; guessed by decompiler (status draw-control-status :offset-assert 8) - (data-format uint8 :offset-assert 10) ;; draw-control-data-format + (data-format draw-control-data-format :offset-assert 10) ;; draw-control-data-format (global-effect draw-control-global-effect :offset-assert 11) (art-group art-group :offset-assert 12) ;; guessed by decompiler (jgeo art-joint-geo :offset-assert 16) ;; guessed by decompiler @@ -13877,14 +14055,14 @@ (dma-add-func (function process-drawable draw-control symbol object none) :offset-assert 24) ;; guessed by decompiler (skeleton skeleton :offset-assert 28) ;; guessed by decompiler (lod-set lod-set :inline :offset-assert 32) - (lod UNKNOWN 6 :offset-assert 32) - (max-lod int8 :offset-assert 80) + ;(lod UNKNOWN 6 :offset-assert 32) + (max-lod int8 :offset 80) (force-lod int8 :offset-assert 81) (cur-lod int8 :offset-assert 82) (desired-lod int8 :offset-assert 83) (ripple ripple-control :offset-assert 84) ;; guessed by decompiler (longest-edge meters :offset-assert 88) - (longest-edge? uint32 :offset-assert 88) + (longest-edge? uint32 :offset 88) (light-index uint8 :offset-assert 92) (shadow-mask uint8 :offset-assert 93) (level-index uint8 :offset-assert 94) @@ -13898,7 +14076,7 @@ (distance meters :offset-assert 112) (origin vector :inline :offset-assert 128) (bounds vector :inline :offset-assert 144) - (radius meters :offset-assert 156) + (radius meters :offset 156) (color-mult rgbaf :inline :offset-assert 160) (color-emissive rgbaf :inline :offset-assert 176) (effect-mask uint64 :offset-assert 192) @@ -13916,7 +14094,7 @@ ;; field draw-control-status is likely a value type. field draw-control-global-effect is likely a value type. (:methods (new (symbol type) _type_) ;; 0 ;; (new (symbol type process symbol) _type_) - (draw-control-method-9 () none) ;; 9 ;; (get-skeleton-origin (_type_) vector) + (get-skeleton-origin (_type_) vector) ;; 9 (draw-control-method-10 () none) ;; 10 ;; (lod-set! (_type_ int) none) (draw-control-method-11 () none) ;; 11 ;; (lods-assign! (_type_ lod-set) none) (draw-control-method-12 () none) ;; 12 ;; (setup-masks (_type_ int int) none) @@ -13925,28 +14103,27 @@ (draw-control-method-15 () none) ;; 15 ) ) -|# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; generic-vu1-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype pris-mtx (structure) + "Matrix for merc rendering. Named after the earlier 'pris' renderer. + Contains a transformation matrix for vertices, one for normals, and a scale. + This matrix is likely not used by generic VU1, but is used by the merc -> generic converter." ((data float 32 :offset-assert 0) ;; guessed by decompiler - (vector vector 8 :offset-assert 0) ;; guessed by decompiler - (t-mtx matrix :inline :offset-assert 0) - (n-mtx matrix3 :inline :offset-assert 64) - (scale vector :inline :offset-assert 112) + (vector vector 8 :offset 0) ;; guessed by decompiler + (t-mtx matrix :inline :offset 0) + (n-mtx matrix3 :inline :offset 64) + (scale vector :inline :offset 112) ) :method-count-assert 9 :size-assert #x80 :flag-assert #x900000080 ) -|# -#| (deftype generic-pris-mtx-save (structure) ((loc-mtx pris-mtx :inline :offset-assert 0) (par-mtx pris-mtx :inline :offset-assert 128) @@ -13956,12 +14133,11 @@ :size-assert #x180 :flag-assert #x900000180 ) -|# -#| (deftype generic-constants (structure) + "Constant data sent to VU1 for generic rendering." ((fog vector :inline :offset-assert 0) - (adgif qword :inline :offset-assert 16) ;; gs-gif-tag :inline + (adgif gs-gif-tag :inline :offset-assert 16) ;; :inline (hvdf-offset vector :inline :offset-assert 32) (hmge-scale vector :inline :offset-assert 48) (invh-scale vector :inline :offset-assert 64) @@ -13973,9 +14149,7 @@ :size-assert #x80 :flag-assert #x900000080 ) -|# -#| (deftype generic-shrub-constants (structure) ((shrub-giftag generic-gif-tag :inline :offset-assert 0) (shrub-adnop qword :inline :offset-assert 16) @@ -13984,38 +14158,32 @@ :size-assert #x20 :flag-assert #x900000020 ) -|# -#| (deftype gcf-shader (structure) ((adgif uint128 5 :offset-assert 0) ;; guessed by decompiler - (shader adgif-shader :inline :offset-assert 0) - (pos uint32 :offset-assert 12) - (num uint32 :offset-assert 28) + (shader adgif-shader :inline :offset 0) + (pos uint32 :offset 12) + (num uint32 :offset 28) ) :method-count-assert 9 :size-assert #x50 :flag-assert #x900000050 ) -|# -#| (deftype gcf-control (structure) ((matrix matrix :inline :offset-assert 0) (giftag generic-gif-tag :inline :offset-assert 64) - (adnops gs-adcmd 2 :offset-assert 80) ;; guessed by decompiler - (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) ;; guessed by decompiler + (num-strips uint32 :offset 76) + (num-dps uint32 :offset 92) + (kick-offset uint32 :offset 108) (shader gcf-shader :dynamic :offset-assert 112) ;; guessed by decompiler ) :method-count-assert 9 :size-assert #x70 :flag-assert #x900000070 ) -|# -#| (deftype gcf-vertex (structure) ((tex vector4w :inline :offset-assert 0) (clr gs-packed-rgba :inline :offset-assert 16) @@ -14025,7 +14193,6 @@ :size-assert #x30 :flag-assert #x900000030 ) -|# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -14634,10 +14801,9 @@ ;; generic-tie-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype generic-tie-instance (structure) ((matrix-tag dma-packet :inline :offset-assert 0) - (matrix-data vector 6 :offset-assert 16) ;; guessed by decompiler + (matrix-data vector 6 :inline :offset-assert 16) ;; guessed by decompiler (index-tag dma-packet :inline :offset-assert 112) (indices uint8 224 :offset-assert 128) ;; guessed by decompiler (end-tag dma-packet :inline :offset-assert 352) @@ -14646,16 +14812,14 @@ :size-assert #x170 :flag-assert #x900000170 ) -|# -#| (deftype generic-tie-input (structure) ((palette-tag dma-packet :inline :offset-assert 0) (palette rgba 128 :offset-assert 16) ;; guessed by decompiler (model-tag dma-packet :inline :offset-assert 528) - (model vector 146 :offset-assert 544) ;; guessed by decompiler + (model vector 146 :inline :offset-assert 544) ;; guessed by decompiler (matrix-tag dma-packet :inline :offset-assert 2880) - (matrix-data vector 6 :offset-assert 2896) ;; guessed by decompiler + (matrix-data vector 6 :inline :offset-assert 2896) ;; guessed by decompiler (index-tag dma-packet :inline :offset-assert 2992) (indices uint8 224 :offset-assert 3008) ;; guessed by decompiler (end-tag dma-packet :inline :offset-assert 3232) @@ -14664,9 +14828,7 @@ :size-assert #xcb0 :flag-assert #x900000cb0 ) -|# -#| (deftype generic-tie-run-control (structure) ((skip-bp2 uint8 :offset-assert 0) (skip-ips uint8 :offset-assert 1) @@ -14685,76 +14847,67 @@ :size-assert #xc :flag-assert #x90000000c ) -|# -#| (deftype generic-tie-base-point (structure) ((data uint16 8 :offset-assert 0) ;; guessed by decompiler - (quad uint128 :offset-assert 0) - (x int16 :offset-assert 0) - (y int16 :offset-assert 2) - (z int16 :offset-assert 4) - (d0 int16 :offset-assert 6) - (vtx uint64 :offset-assert 0) - (u int16 :offset-assert 8) - (v int16 :offset-assert 10) - (tex uint32 :offset-assert 8) - (w int16 :offset-assert 12) - (d1 int16 :offset-assert 14) + (quad uint128 :offset 0) + (x int16 :offset 0) + (y int16 :offset 2) + (z int16 :offset 4) + (d0 int16 :offset 6) + (vtx uint64 :offset 0) + (u int16 :offset 8) + (v int16 :offset 10) + (tex uint32 :offset 8) + (w int16 :offset 12) + (d1 int16 :offset 14) ) :method-count-assert 9 :size-assert #x10 :flag-assert #x900000010 ) -|# -#| (deftype generic-tie-bps (structure) - ((bp generic-tie-base-point 4 :offset-assert 0) ;; guessed by decompiler + ((bp generic-tie-base-point 4 :inline :offset-assert 0) ;; guessed by decompiler ) :method-count-assert 9 :size-assert #x40 :flag-assert #x900000040 ) -|# -#| (deftype generic-tie-interp-point (structure) ((data uint16 12 :offset-assert 0) ;; guessed by decompiler - (quad uint128 :offset-assert 0) - (x int16 :offset-assert 0) - (y int16 :offset-assert 2) - (z int16 :offset-assert 4) - (d0 int16 :offset-assert 6) - (vtx0 uint64 :offset-assert 0) - (dx int16 :offset-assert 8) - (dy int16 :offset-assert 10) - (dz int16 :offset-assert 12) - (unused int16 :offset-assert 14) - (vtx1 uint64 :offset-assert 8) - (u int16 :offset-assert 16) - (v int16 :offset-assert 18) - (tex uint32 :offset-assert 16) - (w int16 :offset-assert 20) - (d1 int16 :offset-assert 22) + ;(quad uint128 :offset 0) ;; misaligned? + (x int16 :offset 0) + (y int16 :offset 2) + (z int16 :offset 4) + (d0 int16 :offset 6) + (vtx0 uint64 :offset 0) + (dx int16 :offset 8) + (dy int16 :offset 10) + (dz int16 :offset 12) + (unused int16 :offset 14) + (vtx1 uint64 :offset 8) + (u int16 :offset 16) + (v int16 :offset 18) + (tex uint32 :offset 16) + (w int16 :offset 20) + (d1 int16 :offset 22) ) + :pack-me :method-count-assert 9 :size-assert #x18 :flag-assert #x900000018 ) -|# -#| (deftype generic-tie-ips (structure) - ((ip generic-tie-interp-point 2 :offset-assert 0) ;; guessed by decompiler + ((ip generic-tie-interp-point 2 :inline :offset-assert 0) ;; guessed by decompiler ) :method-count-assert 9 :size-assert #x30 :flag-assert #x900000030 ) -|# -#| (deftype generic-tie-header (structure) ((effect uint8 :offset-assert 0) (interp-table-size uint8 :offset-assert 1) @@ -14771,9 +14924,7 @@ :size-assert #x20 :flag-assert #x900000020 ) -|# -#| (deftype generic-tie-matrix (structure) ((matrix matrix :inline :offset-assert 0) (morph vector :inline :offset-assert 64) @@ -14783,9 +14934,7 @@ :size-assert #x60 :flag-assert #x900000060 ) -|# -#| (deftype generic-tie-normal (structure) ((x int8 :offset-assert 0) (y int8 :offset-assert 1) @@ -14796,9 +14945,7 @@ :size-assert #x4 :flag-assert #x900000004 ) -|# -#| (deftype generic-tie-control (structure) ((ptr-palette uint32 :offset-assert 0) (ptr-shaders uint32 :offset-assert 4) @@ -14820,9 +14967,7 @@ :size-assert #x3c :flag-assert #x90000003c ) -|# -#| (deftype generic-tie-stats (structure) ((num-bps uint32 :offset-assert 0) (num-ips uint32 :offset-assert 4) @@ -14838,22 +14983,19 @@ :size-assert #x24 :flag-assert #x900000024 ) -|# -#| (deftype generic-tie-calls (structure) ((generic-prepare-dma-double basic :offset-assert 0) (generic-envmap-dproc basic :offset-assert 4) (generic-interp-dproc basic :offset-assert 8) (generic-no-light-dproc basic :offset-assert 12) ) + :pack-me :method-count-assert 9 :size-assert #x10 :flag-assert #x900000010 ) -|# -#| (deftype generic-tie-shadow (structure) ((out-buf gsf-buffer :offset-assert 0) (cur-buf uint32 :offset-assert 4) @@ -14865,13 +15007,12 @@ (write-limit uint32 :offset-assert 28) (calls generic-tie-calls :inline :offset-assert 32) ) + :pack-me :method-count-assert 9 :size-assert #x30 :flag-assert #x900000030 ) -|# -#| (deftype generic-tie-work (structure) ((control generic-tie-control :inline :offset-assert 0) (interp-job generic-interp-job :inline :offset-assert 60) @@ -14885,7 +15026,6 @@ :size-assert #x1d50 :flag-assert #x900001d50 ) -|# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -46223,7 +46363,7 @@ ;; traffic-manager ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +(declare-type traffic-engine structure) (deftype traffic-manager (process) ((traffic-engine traffic-engine :offset-assert 128) ;; guessed by decompiler (fast-spawn symbol :offset-assert 132) ;; guessed by decompiler @@ -46247,7 +46387,6 @@ idle ;; 14, old: (idle () _type_ :state) ) ) -|# #| (deftype want-count-binding (structure) @@ -50190,39 +50329,8 @@ ;; vehicle-manager ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype vehicle-manager (process) - ((name basic :offset-assert 0) - (mask process-mask :offset-assert 4) - (clock basic :offset-assert 8) - (parent uint32 :offset-assert 12) - (brother uint32 :offset-assert 16) - (child uint32 :offset-assert 20) - (ppointer uint32 :offset-assert 24) - (self basic :offset-assert 28) - (pool basic :offset-assert 32) - (status basic :offset-assert 36) - (pid int32 :offset-assert 40) - (main-thread basic :offset-assert 44) - (top-thread basic :offset-assert 48) - (entity basic :offset-assert 52) - (level basic :offset-assert 56) - (state basic :offset-assert 60) - (prev-state basic :offset-assert 64) - (next-state basic :offset-assert 68) - (state-stack basic :offset-assert 72) - (trans-hook basic :offset-assert 76) - (post-hook basic :offset-assert 80) - (event-hook basic :offset-assert 84) - (allocated-length int32 :offset-assert 88) - (heap-base uint32 :offset-assert 92) - (heap-top uint32 :offset-assert 96) - (heap-cur uint32 :offset-assert 100) - (stack-frame-top basic :offset-assert 104) - (heap kheap :inline :offset-assert 92) - (connection-list connectable :inline :offset-assert 108) - (stack UNKNOWN :dynamic :offset-assert 124) - ) + () :method-count-assert 18 :size-assert #x80 :flag-assert #x1200000080 @@ -50235,7 +50343,6 @@ idle ;; 14 ) ) -|# ;; (define-extern *vehicle-rigid-body-queue* object) ;; (define-extern *vehicle-info* object) diff --git a/goal_src/jak3/engine/ai/traffic-h.gc b/goal_src/jak3/engine/ai/traffic-h.gc index 860b8b9da7..c3352e5ecd 100644 --- a/goal_src/jak3/engine/ai/traffic-h.gc +++ b/goal_src/jak3/engine/ai/traffic-h.gc @@ -5,5 +5,127 @@ ;; name in dgo: traffic-h ;; dgos: GAME +(declare-type traffic-manager process) +(declare-type vehicle-manager process) +(declare-type nav-mesh basic) +(declare-type nav-branch structure) + +;; +++traffic-h:traffic-spawn-flags +(defenum traffic-spawn-flags + :type uint32 + :bitfield #t + ) +;; ---traffic-h:traffic-spawn-flags + +;; +++traffic-h:traffic-type +(defenum traffic-type + :type uint8 + (tt17 17) + (tt18 18) + (tt19 19) + (tt20 20) + (tt21 21) + (tt22 22) + (tt23 23) + (tt25 25) + (tt27 27) + (tt28 28) + (invalid #xffffffff) + ) +;; ---traffic-h:traffic-type + ;; DECOMP BEGINS +(define *traffic-manager* (the-as traffic-manager #f)) + +(define *vehicle-manager* (the-as vehicle-manager #f)) + +(deftype traffic-danger-info (structure) + ((sphere sphere :inline) + (velocity vector :inline) + (handle handle) + (notify-radius float) + (danger-level float) + (decay-rate float) + (flags uint8) + (danger-type uint8) + ) + ) + + +(deftype traffic-suppression-params (structure) + ((bbox bounding-box :inline) + (duration time-frame) + (id int8) + ) + (:methods + (try-creating-new-suppression-box (_type_) symbol) + (create-or-update-suppression-box (_type_) symbol) + (has-valid-id? (_type_) symbol) + (kill-suppression-box (_type_) none) + ) + ) + + +(defmethod has-valid-id? ((this traffic-suppression-params)) + (!= (-> this id) -1) + ) + +(deftype traffic-object-spawn-params (structure) + ((object-type uint8) + (behavior uint64) + (id uint32) + (nav-mesh nav-mesh) + (nav-branch nav-branch) + (position vector :inline) + (rotation quaternion :inline) + (velocity vector :inline) + (handle handle) + (handle-parent uint64) + (guard-type uint8) + (user-data uint32) + (entity basic) + (flags traffic-spawn-flags) + (proc process) + ) + ) + + +(deftype traffic-info (structure) + ((ctywide-level basic) + (vehicle-level basic) + (race-vehicle-level basic) + (traffic-object-levels level 29) + (vehicle-levels level 44) + (traffic-object-type-from-vehicle-type traffic-type 44) + (restore-speech-callback basic) + ) + ) + + +(define *traffic-info* (new 'static 'traffic-info + :ctywide-level #f + :vehicle-level #f + :race-vehicle-level #f + :restore-speech-callback #f + ) + ) + +(let ((v1-5 *traffic-info*)) + (dotimes (a0-9 29) + (set! (-> v1-5 traffic-object-levels a0-9) #f) + ) + (dotimes (a0-12 44) + (set! (-> v1-5 vehicle-levels a0-12) #f) + (set! (-> v1-5 traffic-object-type-from-vehicle-type a0-12) (traffic-type invalid)) + ) + (set! (-> v1-5 traffic-object-type-from-vehicle-type 0) (traffic-type tt17)) + (set! (-> v1-5 traffic-object-type-from-vehicle-type 1) (traffic-type tt18)) + (set! (-> v1-5 traffic-object-type-from-vehicle-type 2) (traffic-type tt19)) + (set! (-> v1-5 traffic-object-type-from-vehicle-type 3) (traffic-type tt20)) + (set! (-> v1-5 traffic-object-type-from-vehicle-type 4) (traffic-type tt21)) + (set! (-> v1-5 traffic-object-type-from-vehicle-type 5) (traffic-type tt22)) + (set! (-> v1-5 traffic-object-type-from-vehicle-type 6) (traffic-type tt28)) + (set! (-> v1-5 traffic-object-type-from-vehicle-type 7) (traffic-type tt25)) + (set! (-> v1-5 traffic-object-type-from-vehicle-type 11) (traffic-type tt27)) + ) diff --git a/goal_src/jak3/engine/anim/mspace-h.gc b/goal_src/jak3/engine/anim/mspace-h.gc index ea447f6a3b..2da6e5d345 100644 --- a/goal_src/jak3/engine/anim/mspace-h.gc +++ b/goal_src/jak3/engine/anim/mspace-h.gc @@ -7,3 +7,83 @@ ;; DECOMP BEGINS +(deftype joint (basic) + "A joint from an animated skeleton. This defines the graph of the skeleton, and also the bind pose +used for the mesh data. The joints are shared between all instances of the same model." + ((name basic) + (number int32) + (parent joint) + (bind-pose matrix :inline) + ) + ) + + +(deftype bone-cache (structure) + "Unused type. Existed in Jak 1, but wasn't used there." + ((bone-matrix uint32) + (parent-matrix uint32) + (dummy uint32) + (frame uint32) + ) + ) + + +(deftype bone (structure) + "The location and scale of a bone in an animated skeleton. Each instance of a skeleton +has its own copy of the bones. This data is used for collision checking or other gameplay math, +but, despite the name, isn't directly used in rendering." + ((transform matrix :inline) + (position vector :inline :overlay-at (-> transform data 12)) + (scale vector :inline) + ) + ) + + +(deftype skeleton (inline-array-class) + "Skeleton is made of bones." + ((bones bone :inline :dynamic) + ) + ) + + +(set! (-> skeleton heap-base) (the-as uint 80)) + +(deftype cspace (structure) + "A cspace describes how to control a bone. It contains a reference to the joint, bone, and a callback function. +The callback function is used to take the joint transforms out of the joint animation, then update the bone." + ((parent cspace) + (joint joint) + (joint-num int16) + (geo drawable) + (bone bone) + (param0 (function cspace transformq none)) + (param1 basic) + (param2 basic) + ) + (:methods + (new (symbol type drawable) _type_) + (reset-and-assign-geo! (_type_ drawable) _type_) + ) + ) + + +(deftype cspace-array (inline-array-class) + ((data cspace :dynamic) + ) + ) + + +(set! (-> cspace-array heap-base) (the-as uint 32)) + +(defmethod print ((this cspace)) + (format + #t + "#" + (if (-> this joint) + (-> this joint name) + "nojoint" + ) + this + ) + this + ) diff --git a/goal_src/jak3/engine/common-obs/cloth-art-h.gc b/goal_src/jak3/engine/common-obs/cloth-art-h.gc index 3164c464da..96f999fea2 100644 --- a/goal_src/jak3/engine/common-obs/cloth-art-h.gc +++ b/goal_src/jak3/engine/common-obs/cloth-art-h.gc @@ -7,3 +7,106 @@ ;; DECOMP BEGINS +(deftype cloth-pt (structure) + ((pt vector :inline) + (u float) + (v float) + ) + ) + + +(deftype anchor-transform (structure) + ((offset vector :inline) + (joint-name basic) + (joint int16) + (constraint-index int16) + ) + ) + + +(deftype sphere-transform (structure) + ((offset vector :inline) + (joint-name basic) + (radius float) + (joint int16) + ) + ) + + +(deftype disc-transform (structure) + ((offset vector :inline) + (normal vector :inline) + (joint-name basic) + (radius float) + (joint int16) + (start-particle-index int16) + (end-particle-index int16) + ) + ) + + +(deftype anchor-transform-array (inline-array-class) + ((data anchor-transform :inline :dynamic) + ) + ) + + +(set! (-> anchor-transform-array heap-base) (the-as uint 32)) + +(deftype sphere-transform-array (inline-array-class) + ((data sphere-transform :inline :dynamic) + ) + ) + + +(set! (-> sphere-transform-array heap-base) (the-as uint 32)) + +(deftype disc-transform-array (inline-array-class) + ((data disc-transform :inline :dynamic) + ) + ) + + +(set! (-> disc-transform-array heap-base) (the-as uint 48)) + +(deftype cloth-thickness-array (inline-array-class) + ((data uint8 :dynamic) + ) + ) + + +(set! (-> cloth-thickness-array heap-base) (the-as uint 1)) + +(deftype cloth-params (structure) + ((mesh int16) + (gravity-constant float) + (wind-constant float) + (cloth-width uint16) + (num-sphere-constraints uint16) + (num-disc-constraints uint16) + (num-anchor-points uint16) + (flags uint64) + (tex-name basic) + (tex-name2 basic) + (tex-name3 basic) + (alt-tex-name basic) + (alt-tex-name2 basic) + (alt-tex-name3 basic) + (cloth-thickness float) + (initial-xform int16) + (drag float) + (ball-collision-radius float) + (num-iterations int8) + (timestep-frequency int8) + (secret-disable uint64) + ) + ) + + +(deftype cloth-base (basic) + () + (:methods + (cloth-base-method-9 () none) + (cloth-base-method-10 () none) + ) + ) diff --git a/goal_src/jak3/engine/data/art-h.gc b/goal_src/jak3/engine/data/art-h.gc index 5bd39cc2a9..03655f48bf 100644 --- a/goal_src/jak3/engine/data/art-h.gc +++ b/goal_src/jak3/engine/data/art-h.gc @@ -5,5 +5,379 @@ ;; name in dgo: art-h ;; dgos: GAME +(defenum draw-control-status + :type uint16 + :bitfield #t + (close-to-screen 0) + (no-draw 1) + (no-draw-temp) + (on-screen) + (uninited) + (no-draw-bounds) + (no-closest-distance) + (math-skel) + (force-vu1) + (no-draw-bounds2) + (force-fade) + (warp-cross-fade) + (lod-set) + (disable-fog) + (hud) + (no-bounds-check) + ) + +(defenum draw-control-data-format + :type uint8 + :bitfield #f + (pris 0) + (merc 1) + ) + +(defenum draw-control-global-effect + :type uint8 + :bitfield #t + (bit-0) + (bit-1) + (title-light) + (disable-envmap) + (rim-lights) + (rim-lights2) + (rim-lights3) + (no-textures) + ) + +(declare-type merc-eye-anim-block structure) +(declare-type merc-ctrl structure) +(declare-type process-drawable process) +(declare-type ripple-control basic) +(declare-type shadow-geo structure) +(declare-type shadow-control structure) ;; DECOMP BEGINS +(deftype joint-anim (basic) + "Base class for all joint animations. These are animations that store joint transforms." + ((name string) + (number int16) + (length int16) + ) + ) + + +(deftype joint-anim-matrix (joint-anim) + "Joint animation which stores matrices directly. Not used." + ((data matrix :inline :dynamic :offset 16) + ) + ) + +(deftype joint-anim-transformq (joint-anim) + "Joint animation which stores transformq's directly. Not used." + ((data transformq :inline :dynamic) + ) + ) + + +(deftype joint-anim-drawable (joint-anim) + "Mysterious unused joint animation type." + ((data drawable :dynamic) + ) + ) + + +(deftype joint-anim-frame (structure) + "Frame containing all joint transforms. Note that there are two special frames: align and prejoint. +The 'align' frame is used for the complicated animation alignment system, which allows the animation to move +a character, among other things. The prejoint is just the root of the skeleton. +The remaining transformq's are the joint transforms you'd expect." + ((matrices matrix 2 :inline) + (data transformq :inline :dynamic) + ) + (:methods + (new (symbol type int) _type_) + ) + ) + + +;; WARN: Return type mismatch structure vs joint-anim-frame. +(defmethod new joint-anim-frame ((allocation symbol) (type-to-make type) (arg0 int)) + (let ((v1-1 (max 0 (+ arg0 -2)))) + (the-as + joint-anim-frame + (new-dynamic-structure allocation type-to-make (the-as int (+ (-> type-to-make size) (* 48 v1-1)))) + ) + ) + ) + +(deftype joint-anim-compressed-hdr (structure) + "Header for the compressed joint animation format." + ((control-bits uint32 14) + (num-joints uint32) + (matrix-bits uint32) + ) + ) + + +(deftype joint-anim-compressed-fixed (structure) + ((hdr joint-anim-compressed-hdr :inline) + (offset-64 uint32) + (offset-32 uint32) + (offset-16 uint32) + (reserved uint32) + (data vector 133 :inline) + ) + ) + + +(deftype joint-anim-compressed-frame (structure) + ((offset-64 uint32) + (offset-32 uint32) + (offset-16 uint32) + (reserved uint32) + (data vector 133 :inline) + ) + ) + + +(deftype joint-anim-compressed-control (structure) + ((num-frames uint16) + (flags uint16) + (fixed-qwc uint32) + (frame-qwc uint32) + (fixed joint-anim-compressed-fixed) + (data joint-anim-compressed-frame :dynamic) + ) + ) + + +(deftype art (basic) + "Base class for anything considered `art`. This is typically foreground model data. +This can be either an art container containing more arts, or an actual art thing (art-element)." + ((name string :offset 8) + (length int32) + (extra res-lump) + ) + (:methods + (art-method-9 () none) + (art-method-10 () none) + (art-method-11 () none) + (art-method-12 () none) + (art-method-13 () none) + ) + ) + + +(deftype art-element (art) + "Base class Art which is not a container of more art." + ((master-art-group-name basic) + (master-art-group-index int32) + (pad uint8 20) + ) + ) + + +(deftype art-mesh-anim (art-element) + "An unused mesh animation." + () + ) + +(deftype art-joint-anim (art-element) + "Art for a joint animation. Also contains the eye animation." + ((eye-anim merc-eye-anim-block :overlay-at (-> pad 0)) + (blend-shape-anim (pointer int8) :overlay-at (-> pad 4)) + (frames joint-anim-compressed-control :overlay-at (-> pad 8)) + (speed float :offset 48) + (artist-base float) + (artist-step float) + ) + ) + + +(deftype art-group (art) + "Art which is a list of more art. The -ag files are an art group with all the art needed for a +actor, like the mesh, animations, shadow mesh, skeleton, etc." + ((info file-info :offset 4) + (data art-element :dynamic :offset 32) + ) + (:methods + (unknown-0 () none) + (unknown-1 () none) + ) + ) + +(deftype art-mesh-geo (art-element) + "Unused art format for a mesh. This might have been for the renderer that came before merc." + () + ) + +(deftype art-joint-geo (art-element) + "Collection of joints for an actor." + () + ) + +(deftype art-cloth-geo (art-element) + ((anchor-transforms basic) + (sphere-transforms basic) + (disc-transforms basic) + (cloth-thickness basic) + (thickness-scalar float) + (num-points int32 :overlay-at length) + (mesh object :dynamic :offset 80) + ) + ) + + +(defmethod relocate ((this art-cloth-geo) (arg0 int)) + this + ) + +(deftype art-joint-anim-manager-slot (structure) + "Record for an animation which is additionally compressed with LZO compression over the entire animation. +This is used for short, commonly used animations that always remain in RAM." + ((anim art-joint-anim) + (comp-data uint32) + (time-stamp uint64) + ) + ) + + +(deftype art-joint-anim-manager (basic) + "Cache for LZO decompression of animations." + ((heap kheap :inline) + (free-index int32) + (slot art-joint-anim-manager-slot 64 :inline) + ) + (:methods + (new (symbol type int) _type_) + (art-joint-anim-manager-method-9 () none) + (art-joint-anim-manager-method-10 () none) + (art-joint-anim-manager-method-11 () none) + (art-joint-anim-manager-method-12 () none) + (art-joint-anim-manager-method-13 () none) + ) + ) + + +(defmethod new art-joint-anim-manager ((allocation symbol) (type-to-make type) (arg0 int)) + (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (let ((s4-0 (-> gp-0 heap))) + (set! (-> s4-0 base) (kmalloc (the-as kheap (-> allocation value)) arg0 (kmalloc-flags) "heap")) + (set! (-> s4-0 current) (-> s4-0 base)) + (set! (-> s4-0 top-base) (&+ (-> s4-0 base) arg0)) + (set! (-> s4-0 top) (-> s4-0 top-base)) + ) + (dotimes (v1-6 64) + (set! (-> gp-0 slot v1-6 anim) #f) + ) + (set! (-> gp-0 free-index) 0) + gp-0 + ) + ) + +(deftype skeleton-group (art-group) + "Unlike other art types, the skeleton-groups are defined in GOAL code. +This stores settings like the name of the art-group, shadow/level-of-detail settings, etc." + ((art-group-name string) + (jgeo int16) + (janim int16) + (bounds vector :inline) + (radius meters :overlay-at (-> bounds data 3)) + (mgeo int16 6) + (max-lod int32) + (lod-dist float 6) + (longest-edge meters) + (texture-level int8) + (version int8) + (shadow int16) + (shadow-joint-index int8) + (origin-joint-index int8) + (sort int8) + (light-index uint8) + (clothing basic) + (global-effects uint8) + ) + (:methods + (skeleton-group-method-16 () none) + ) + ) + + +(deftype lod-group (structure) + "A single level of detail mesh." + ((geo merc-ctrl) + (dist meters) + ) + :pack-me + ) + + +(deftype lod-set (structure) + "All the different level-of-detail meshes for an actor." + ((lod lod-group 6 :inline) + (max-lod int8) + ) + (:methods + (lod-set-method-9 () none) + ) + ) + + +(deftype draw-control (basic) + "The draw-control is a collection of all the stuff that the foreground rendering system needs to draw something. +Each process-drawable has a draw-control." + ((process process-drawable) + (status draw-control-status) + (data-format draw-control-data-format) + (global-effect draw-control-global-effect) + (art-group art-group) + (jgeo art-joint-geo) + (mgeo merc-ctrl) + (dma-add-func (function process-drawable draw-control symbol object none)) + (skeleton skeleton) + (lod-set lod-set :inline) + (max-lod int8 :overlay-at (-> lod-set max-lod)) + (force-lod int8) + (cur-lod int8) + (desired-lod int8) + (ripple ripple-control) + (longest-edge meters) + (longest-edge? uint32 :overlay-at longest-edge) + (light-index uint8) + (shadow-mask uint8) + (level-index uint8) + (death-draw-overlap uint8) + (death-timer uint8) + (death-timer-org uint8) + (death-vertex-skip uint16) + (death-effect uint32) + (shadow shadow-geo) + (shadow-ctrl shadow-control) + (distance meters) + (origin vector :inline) + (bounds vector :inline) + (radius meters :overlay-at (-> bounds data 3)) + (color-mult rgbaf :inline) + (color-emissive rgbaf :inline) + (effect-mask uint64) + (seg-mask uint64) + (origin-joint-index uint8) + (shadow-joint-index uint8) + (force-fade uint8) + (default-texture-page uint8) + (shadow-values uint32) + (cloth-instances basic) + ) + (:methods + (new (symbol type) _type_) + (get-skeleton-origin (_type_) vector) + (draw-control-method-10 () none) + (draw-control-method-11 () none) + (draw-control-method-12 () none) + (draw-control-method-13 () none) + (draw-control-method-14 () none) + (draw-control-method-15 () none) + ) + ) + + +(defmethod get-skeleton-origin ((this draw-control)) + (-> this skeleton bones 0 transform trans) + ) diff --git a/goal_src/jak3/engine/draw/draw-node-h.gc b/goal_src/jak3/engine/draw/draw-node-h.gc index 8fc252cb36..27b1a47f51 100644 --- a/goal_src/jak3/engine/draw/draw-node-h.gc +++ b/goal_src/jak3/engine/draw/draw-node-h.gc @@ -7,3 +7,35 @@ ;; DECOMP BEGINS +(deftype draw-node (drawable) + "Node in a bounding volume heirarchy. This is a base class, and there are no children. +The child is a pointer to the start of inline array of drawables (note: not a drawable-inline-array, literally a bunch of plain drawables) +The size of this array is child-count. The type is either more draw-nodes, or, some other drawable like tfragment, depending on the flags. +Different renderers have different restrictions on the tree structure, like max child count, or if all children have the same depth. +Generally, tfrag/collide use a very rigid equal depth, max 8 children rule, but with shrub, anything goes. +This is a very awkward data structure to traverse, but it is designed for fast view frustum culling. +Note that there can be multiple ways to reach drawables in here in some cases - for example you can follow +this tree, or check one of the depth arrays found in tfrag. +" + ((child-count uint8 :offset 6) + (flags uint8 :offset 7) + (child drawable :offset 8) + (distance float :offset 12) + ) + ) + + +(deftype drawable-inline-array-node (drawable-inline-array) + "Top level container for a BVH made of draw-nodes." + ((data draw-node 1 :inline) + (pad uint32) + ) + ) + +(deftype draw-node-dma (structure) + "DMA buffer layout for draw node culling routine, which copies draw-nodes directly to scratchpad in bulk. +This would not work with the memory layout of shrub." + ((banka draw-node 32 :inline) + (bankb draw-node 32 :inline) + ) + ) diff --git a/goal_src/jak3/engine/draw/drawable-actor-h.gc b/goal_src/jak3/engine/draw/drawable-actor-h.gc index 31f89c7937..070aba53d6 100644 --- a/goal_src/jak3/engine/draw/drawable-actor-h.gc +++ b/goal_src/jak3/engine/draw/drawable-actor-h.gc @@ -7,3 +7,28 @@ ;; DECOMP BEGINS +(deftype drawable-actor (drawable) + "Wrapper around an entity-actor to put it in the drawable system. +Note that this is never used to actually draw actors - it is just used as a list of all entity-actors +for the entity/birth system." + ((actor entity-actor :offset 8) + ) + ) + + +(deftype drawable-tree-actor (drawable-tree) + "Adapater for putting the actors in the tree-array." + () + ) + +(deftype drawable-inline-array-actor (drawable-inline-array) + "Array of drawable-actors." + ((data drawable-actor 1 :inline) + (pad uint8 4) + ) + ) + +(defmethod draw ((this drawable-tree-actor) (arg0 drawable-tree-actor) (arg1 display-frame)) + 0 + (none) + ) diff --git a/goal_src/jak3/engine/draw/drawable-group-h.gc b/goal_src/jak3/engine/draw/drawable-group-h.gc index 9320badbf0..30d2e4ae78 100644 --- a/goal_src/jak3/engine/draw/drawable-group-h.gc +++ b/goal_src/jak3/engine/draw/drawable-group-h.gc @@ -7,3 +7,13 @@ ;; DECOMP BEGINS +(deftype drawable-group (drawable) + "Base class for an array of references to other drawables. +These are typically used for very high-level organization of drawable." + ((length int16 :offset 6) + (data drawable :dynamic) + ) + (:methods + (new (symbol type int) _type_) + ) + ) diff --git a/goal_src/jak3/engine/draw/drawable-h.gc b/goal_src/jak3/engine/draw/drawable-h.gc index 0007520697..2ad7ab865f 100644 --- a/goal_src/jak3/engine/draw/drawable-h.gc +++ b/goal_src/jak3/engine/draw/drawable-h.gc @@ -7,3 +7,31 @@ ;; DECOMP BEGINS +(deftype drawable (basic) + "Base class for `drawable` scene graph system. +This base class is really abused in many ways, and the meaning of the various methods differ depending +on the exact type. Not even the ID and bsphere here are always populated. +This is used for very high level organization of different rendering data types, and also very low-level +culling/rendering optimizations. It supports both array-of-references and inline-array containers with precise +control over memory layout for use with DMA." + ((id int16) + (bsphere vector :inline) + ) + (:methods + (drawable-method-9 () none) + (draw (_type_ _type_ display-frame) none) + (drawable-method-11 () none) + (drawable-method-12 () none) + (drawable-method-13 () none) + (drawable-method-14 () none) + (drawable-method-15 () none) + (drawable-method-16 () none) + ) + ) + + +(deftype drawable-error (drawable) + "A drawable which just represents an error. When drawn, it simply displays a sphere with an error message." + ((name string) + ) + ) diff --git a/goal_src/jak3/engine/draw/drawable-inline-array-h.gc b/goal_src/jak3/engine/draw/drawable-inline-array-h.gc index b669178896..0afe133a21 100644 --- a/goal_src/jak3/engine/draw/drawable-inline-array-h.gc +++ b/goal_src/jak3/engine/draw/drawable-inline-array-h.gc @@ -7,3 +7,7 @@ ;; DECOMP BEGINS +(deftype drawable-inline-array (drawable) + ((length int16 :offset 6) + ) + ) diff --git a/goal_src/jak3/engine/draw/drawable-tree-h.gc b/goal_src/jak3/engine/draw/drawable-tree-h.gc index db7b18b1ab..e109b3378b 100644 --- a/goal_src/jak3/engine/draw/drawable-tree-h.gc +++ b/goal_src/jak3/engine/draw/drawable-tree-h.gc @@ -7,3 +7,15 @@ ;; DECOMP BEGINS +(deftype drawable-tree (drawable-group) + "A drawable tree is a container of drawables of a specific rendering type. +Instead of having a single large tree of mixed types, there will be a tree of tfrags, a tree of ties, etc. +The top-level tfrag tree will have a type that's a child of drawable-tree. +Generally, the object passed to a large renderer is a drawable-tree." + () + ) + +(deftype drawable-tree-array (drawable-group) + "Collection of drawable trees. This might have a tfrag tree, tie tree, etc." + () + ) diff --git a/goal_src/jak3/engine/game/main-h.gc b/goal_src/jak3/engine/game/main-h.gc index 96b1f19e85..766f912de4 100644 --- a/goal_src/jak3/engine/game/main-h.gc +++ b/goal_src/jak3/engine/game/main-h.gc @@ -5,5 +5,443 @@ ;; name in dgo: main-h ;; dgos: GAME +(declare-type debug-menu-context basic) + +;; +++main-h:collide-spec +(defenum collide-spec + :bitfield #t + :type uint32 + (cs0 0) + (cs1 1) + (cs2 2) + (cs3 3) + (cs4 4) + (cs5 5) + (cs6 6) + (cs7 7) + (cs8 8) + (cs9 9) + (cs10 10) + (cs11 11) + ) +;; ---main-h:collide-spec + +;; +++main-h:strip-lines-controls +(defenum strip-lines-controls + :type int64 + (none 0) + ; (strippable 1) + ; (convertible 2) + ; (good 3) + ; (edgeable 4) + ; (ordinary 8) + ; (color-mismatch 16) + ; (shader-mismatch 32) + ; (uv-mismatch 64) + ; (too-big 128) + ; (bad 240) + ; (all-edges 255) + ; (strips 256) + ; (frags 512) + ) +;; ---main-h:strip-lines-controls + +;; +++main-h:scene-controls +(defenum scene-controls + :type int64 + :bitfield #t + ; (channel) + ; (anim-name) + ; (dma-size) + ; (bounds-spheres) + ; (actors) + ; (actor-marks) + ; (special-fma-spheres) + ; (scene-controls-7) + ; (scene-controls-8) + ; (display-controls) + ) +;; ---main-h:scene-controls + +;; +++main-h:bot-marks-controls +(defenum bot-marks-controls + :type int64 + ; (all-off 0) + ; (course-spots 1) + ; (task-spots 2) + ; (all-on 3) + ; (bmc04 4) + ; (bmc05 5) + ; (bmc06 6) + ; (bmc07 7) + ; (bmc08 8) + ; (bmc09 9) + ; (bmc10 10) + ; (bmc11 11) + ; (bmc12 12) + ; (bmc13 13) + ; (bmc14 14) + ; (bmc15 15) + ; (bmc16 16) + ) +;; ---main-h:bot-marks-controls + +;; +++main-h:race-marks-controls +(defenum race-marks-controls + :type int64 + ; (all-off 0) + ; (path0-red 1) + ; (path1-green 2) + ; (path2-blue 4) + ; (path3-yellow 8) + ; (path4-cyan 16) + ; (path5-violet 32) + ; (path6-orange 64) + ; (path7-black 128) + ; (all-paths-on 255) + ; (rmc2040 2040) + ) +;; ---main-h:race-marks-controls + +;; +++main-h:race-selection +(defenum race-selection + :type int64 + ; (kiera-class3 0) + ; (kiera-class2 1) + ; (kiera-class1 2) + ; (errol 3) + ; (bush-class3 4) + ; (bush-class2 5) + ; (bush-class1 6) + ; (bush-errol 7) + ; (bush-port 8) + ; (bush-class3-reverse 9) + ; (bush-class2-reverse 10) + ; (bush-class1-reverse 11) + ) +;; ---main-h:race-selection + +;; +++main-h:subdivide-setting +(defenum subdivide-setting + :type int64 + (textured 0) + (outline 1) + (gouraud 2) + (hack 3)) +;; ---main-h:subdivide-setting + +;; +++main-h:ocean-height-hack +(defenum ocean-height-hack + :type int64 + ; (zero 1) + ; (far-below 2) + ; (sewer-start 3) + ; (sewer-hi 4) + ; (sewer-med 5) + ; (sewer-lo 6) + ) +;; ---main-h:ocean-height-hack + ;; DECOMP BEGINS +(define *stats-poly* #f) + +(define *stats-memory* #f) + +(define *stats-memory-short* #f) + +(define *stats-memory-level-index* 0) + +(define *stats-collide* #f) + +(define *stats-bsp* #f) + +(define *stats-buffer* #f) + +(define *stats-target* #f) + +(define *stats-profile-bars* #f) + +(define *stats-perf* #f) + +(define *artist-all-visible* #f) + +(define *artist-flip-visible* #f) + +(define *artist-fix-visible* #f) + +(define *artist-fix-frustum* #f) + +(define *artist-error-spheres* #f) + +(define *artist-use-menu-subdiv* #f) + +(define *display-profile* #t) + +(define *display-sidekick-stats* #f) + +(define *display-quad-stats* #f) + +(define *display-tri-stats* #f) + +(define *display-ground-stats* #f) + +(define *display-collision-marks* #f) + +(define *display-collide-cache* #f) + +(define *display-render-collision* #f) + +(define *display-hipri-collision-marks* #f) + +(define *display-edge-collision-marks* #f) + +(define *display-geo-marks* #f) + +(define *display-target-marks* #f) + +(define *target-rc-board-controls* #f) + +(define *display-collide-history* 0) + +(define *amy-cam* #f) + +(define *display-xyz-axes* #f) + +(define *display-cam-collide-history* #f) + +(define *record-cam-collide-history* #f) + +(define *display-cam-master-marks* #f) + +(define *display-cam-other* #f) + +(define *display-camera-marks* #f) + +(define *camera-no-mip-correction* #f) + +(define *camera-turbo-free* #f) + +(define *display-cam-los-info* #f) + +(define *display-cam-los-debug* #f) + +(define *display-cam-los-marks* #f) + +(define *display-cam-coll-marks* #f) + +(define *display-camera-info* #f) + +(define *display-camera-old-stats* #f) + +(define *display-camera-last-attacker* #f) + +(define *display-file-info* #f) + +(define *display-actor-marks* #f) + +(define *display-sprite-info* #f) + +(define *display-sprite-marks* #f) + +(define *display-sprite-spheres* #f) + +(define *display-entity-errors* #t) + +(define *display-capture-mode* #f) + +(define *display-instance-info* #f) + +(define *display-deci-count* #f) + +(define *sync-dma* #f) + +(define *display-strip-lines* (the-as strip-lines-controls 0)) + +(define *display-battle-marks* #f) + +(define *display-joint-axes* #f) + +(define *display-nav-marks* #f) + +(define *display-nav-network* #f) + +(define *display-path-marks* #f) + +(define *display-vol-marks* #f) + +(define *display-water-marks* #f) + +(define *display-nav-mesh* #f) + +(define *display-race-mesh* #f) + +(define *display-actor-pointer* #f) + +(define *display-actor-vis* #f) + +(define *display-actor-graph* #f) + +(define *display-traffic-height-map* #f) + +(define *display-trail-graph* #f) + +(define *display-color-bars* #f) + +(define *display-bug-report* #f) + +(define *display-level-border* #f) + +(define *display-memcard-info* #f) + +(define *display-split-boxes* #f) + +(define *display-split-box-info* #f) + +(define *display-texture-distances* #f) + +(define *display-texture-download* #f) + +(define *display-art-control* #f) + +(define *display-gui-control* #f) + +(define *display-level-spheres* #f) + +(define *time-of-day-fast* #f) + +(define *display-iop-info* #f) + +(define *ambient-sound-class* #t) + +(define *slow-frame-rate* #f) + +(define *display-region-marks* #f) + +(define *execute-regions* #t) + +(define *debug-pause* #f) + +(define *debug-view-anims* #f) + +(define *debug-unkillable* #f) + +(define *debug-player-vehicle-unkillable* #f) + +(define *debug-actor* (the-as object #f)) + +(define *gun-marks* #f) + +(define *bug-report-output-mode* (if *debug-segment* + 'file-stream + '*stdcon* + ) + ) + +(define *display-scene-control* (the-as scene-controls 0)) + +(define *display-bot-marks* (the-as bot-marks-controls 0)) + +(define *display-race-marks* (the-as race-marks-controls 0)) + +(define *race-record-path* #f) + +(define *select-race* (the-as race-selection 0)) + +(define *select-race-path* 0) + +(define *bot-record-path* -1) + +(define *subdivide-draw-mode* (the-as subdivide-setting 0)) + +(define *subdivide-scissor-draw-mode* (the-as subdivide-setting 0)) + +(define *subdivide-foreground-draw-mode* (the-as subdivide-setting 0)) + +(define *subdivide-ocean-draw-mode* (the-as subdivide-setting 0)) + +(define *ocean-height-hack* (the-as ocean-height-hack 0)) + +(define-perm *dproc* process #f) + +(define *run* #f) + +(define *teleport* #f) + +(define *teleport-count* 0) + +(define *draw-hook* nothing) + +(define *debug-hook* '()) + +(define *menu-hook* (the-as (function debug-menu-context) nothing)) + +(define *progress-hook* nothing) + +(define *dma-timeout-hook* nothing) + +(deftype frame-stats (structure) + ((field-time time-frame 2) + (field int32) + ) + ) + + +(define *frame-stats* (new 'static 'frame-stats)) + +(deftype screen-filter (basic) + ((draw? symbol) + (bucket int32) + (depth int32) + (ztest uint64) + (color vector :inline) + (color-src vector :inline) + (color-dest vector :inline) + (extra vector :inline) + (speed float :overlay-at (-> extra data 0)) + (current-interp float :overlay-at (-> extra data 1)) + (lock-vsync? basic) + ) + (:methods + (draw (_type_) none) + (setup (_type_ vector vector float bucket-id) none) + (disable (_type_) none) + ) + ) + + +(deftype col-rend (basic) + ((draw? symbol) + (outline? symbol) + (show-back-faces? symbol) + (show-normals? symbol) + (ghost-hidden? symbol) + (show-only uint32) + (cspec collide-spec) + (track uint8) + (bbox-radius float) + (bbox-center vector :inline) + (camera-to-bbox-dist float) + ) + (:methods + (col-rend-method-9 () none) + ) + ) + + +(define *col-rend* (new 'static 'col-rend + :draw? #f + :outline? #t + :show-back-faces? #t + :show-normals? #f + :ghost-hidden? #t + :cspec (collide-spec cs3 cs4 cs5) + :track #x1 + :bbox-radius 24576.0 + :camera-to-bbox-dist 65536.0 + ) + ) + +(defun-debug debug-actor? ((arg0 object)) + (= arg0 *debug-actor*) + ) diff --git a/goal_src/jak3/engine/gfx/background/tie/generic-tie-h.gc b/goal_src/jak3/engine/gfx/background/tie/generic-tie-h.gc index f7610df683..73713d70f4 100644 --- a/goal_src/jak3/engine/gfx/background/tie/generic-tie-h.gc +++ b/goal_src/jak3/engine/gfx/background/tie/generic-tie-h.gc @@ -7,3 +7,197 @@ ;; DECOMP BEGINS +(deftype generic-tie-instance (structure) + ((matrix-tag dma-packet :inline) + (matrix-data vector 6 :inline) + (index-tag dma-packet :inline) + (indices uint8 224) + (end-tag dma-packet :inline) + ) + ) + + +(deftype generic-tie-input (structure) + ((palette-tag dma-packet :inline) + (palette rgba 128) + (model-tag dma-packet :inline) + (model vector 146 :inline) + (matrix-tag dma-packet :inline) + (matrix-data vector 6 :inline) + (index-tag dma-packet :inline) + (indices uint8 224) + (end-tag dma-packet :inline) + ) + ) + + +(deftype generic-tie-run-control (structure) + ((skip-bp2 uint8) + (skip-ips uint8) + (gifbuf-skip uint8) + (strips uint8) + (target-bp1 uint8) + (target-bp2 uint8) + (target-ip1 uint8) + (target-ip2 uint8) + (target-bps uint8) + (target-ips uint8) + (is-generic uint8) + (reserved uint8) + ) + ) + + +(deftype generic-tie-base-point (structure) + ((data uint16 8) + (quad uint128 :overlay-at (-> data 0)) + (x int16 :overlay-at (-> data 0)) + (y int16 :overlay-at (-> data 1)) + (z int16 :overlay-at (-> data 2)) + (d0 int16 :overlay-at (-> data 3)) + (vtx uint64 :overlay-at (-> data 0)) + (u int16 :overlay-at (-> data 4)) + (v int16 :overlay-at (-> data 5)) + (tex uint32 :overlay-at (-> data 4)) + (w int16 :overlay-at (-> data 6)) + (d1 int16 :overlay-at (-> data 7)) + ) + ) + + +(deftype generic-tie-bps (structure) + ((bp generic-tie-base-point 4 :inline) + ) + ) + + +(deftype generic-tie-interp-point (structure) + ((data uint16 12) + (x int16 :overlay-at (-> data 0)) + (y int16 :overlay-at (-> data 1)) + (z int16 :overlay-at (-> data 2)) + (d0 int16 :overlay-at (-> data 3)) + (vtx0 uint64 :overlay-at (-> data 0)) + (dx int16 :overlay-at (-> data 4)) + (dy int16 :overlay-at (-> data 5)) + (dz int16 :overlay-at (-> data 6)) + (unused int16 :overlay-at (-> data 7)) + (vtx1 uint64 :overlay-at (-> data 4)) + (u int16 :overlay-at (-> data 8)) + (v int16 :overlay-at (-> data 9)) + (tex uint32 :overlay-at (-> data 8)) + (w int16 :overlay-at (-> data 10)) + (d1 int16 :overlay-at (-> data 11)) + ) + :pack-me + ) + +;; ERROR: failed type prop at 19: Could not figure out load: (set! a2 (l.q gp)) + +(deftype generic-tie-ips (structure) + ((ip generic-tie-interp-point 2 :inline) + ) + ) + + +(deftype generic-tie-header (structure) + ((effect uint8) + (interp-table-size uint8) + (num-bps uint8) + (num-ips uint8) + (tint-color uint32) + (index-table-offset uint16) + (kick-table-offset uint16) + (normal-table-offset uint16) + (interp-table-offset uint16) + (gsf-header gsf-header :inline) + ) + ) + + +(deftype generic-tie-matrix (structure) + ((matrix matrix :inline) + (morph vector :inline) + (fog qword :inline) + ) + ) + + +(deftype generic-tie-normal (structure) + ((x int8) + (y int8) + (z int8) + (dummy int8) + ) + ) + + +(deftype generic-tie-control (structure) + ((ptr-palette uint32) + (ptr-shaders uint32) + (ptr-runctrl generic-tie-run-control) + (ptr-verts uint32) + (ptr-generic generic-tie-header) + (ptr-dps uint32) + (ptr-kicks uint32) + (ptr-normals uint32) + (ptr-interp uint32) + (ptr-mtxs generic-tie-matrix) + (ptr-cinds uint32) + (next-instance uint32) + (next-model uint32) + (next-is-model uint32) + (tie-type uint32) + ) + ) + + +(deftype generic-tie-stats (structure) + ((num-bps uint32) + (num-ips uint32) + (num-dps uint32) + (num-shaders uint32) + (num-models uint32) + (num-instances uint32) + (num-waits uint32) + (num-qwc uint32) + (max-qwc uint32) + ) + ) + + +(deftype generic-tie-calls (structure) + ((generic-prepare-dma-double basic) + (generic-envmap-dproc basic) + (generic-interp-dproc basic) + (generic-no-light-dproc basic) + ) + :pack-me + ) + + +(deftype generic-tie-shadow (structure) + ((out-buf gsf-buffer) + (cur-buf uint32) + (tie-type int32) + (ptr-inst uint32) + (ptr-buf uint32) + (inst-xor int32) + (end-of-chain uint32) + (write-limit uint32) + (calls generic-tie-calls :inline) + ) + :pack-me + ) + + +(deftype generic-tie-work (structure) + ((control generic-tie-control :inline) + (interp-job generic-interp-job :inline) + (shadow generic-tie-shadow :inline) + (input-a generic-tie-input :inline) + (input-b generic-tie-input :inline) + (inst-buf generic-tie-instance :inline) + (palette-buf rgba 128) + ) + ) diff --git a/goal_src/jak3/engine/gfx/generic/generic-h.gc b/goal_src/jak3/engine/gfx/generic/generic-h.gc index 4cfb183d48..2b7bff11d2 100644 --- a/goal_src/jak3/engine/gfx/generic/generic-h.gc +++ b/goal_src/jak3/engine/gfx/generic/generic-h.gc @@ -7,3 +7,202 @@ ;; DECOMP BEGINS +(deftype gsf-vertex (structure) + "Vertex used by generic. GSF = generic stripped fragment?" + ((data uint32 8) + (byte uint8 32 :overlay-at (-> data 0)) + (quad uint128 2 :overlay-at (-> data 0)) + (vt qword :inline :overlay-at (-> data 0)) + (pos vector3s :inline :overlay-at (-> data 0)) + (tex vector2uh :inline :overlay-at (-> data 3)) + (nrm vector3s :inline :overlay-at (-> data 4)) + (nc qword :inline :overlay-at (-> data 4)) + (clr vector4ub :inline :overlay-at (-> data 7)) + (dtex vector2uh :inline :overlay-at (-> data 4)) + (dclr vector4ub :inline :overlay-at (-> data 5)) + ) + ) + + +(deftype gsf-vertex-array (structure) + ((vtx gsf-vertex :dynamic) + ) + ) + + +(deftype gsf-fx-vertex (structure) + "Color/texture data only. Possibly used to share with a gsf-vertex with +the same position/normal." + ((clr vector4ub :inline) + (tex vector2uh :inline) + ) + ) + + +(deftype gsf-fx-vertex-array (structure) + ((data gsf-fx-vertex :dynamic) + ) + ) + + +(deftype gsf-header (structure) + "Header for generic data." + ((num-strips uint8) + (num-new-vtxs uint8) + (num-dps uint16) + (num-vtxs uint16) + (strip-table uint8 10) + ) + ) + + +(deftype gsf-ik (structure) + ((index uint8) + (no-kick uint8) + ) + ) + + +(deftype gsf-info (structure) + ((ptr-iks uint32) + (ptr-verts uint32) + (ptr-fx uint32) + (dummy2 uint32) + ) + ) + + +(deftype gsf-buffer (structure) + ((data uint8 8192) + (info gsf-info :inline :overlay-at (-> data 0)) + (header gsf-header :inline :overlay-at (-> data 16)) + (work-area uint8 :dynamic :overlay-at (-> data 32)) + ) + ) + + +(deftype generic-frag (structure) + ((start-pos uint16) + (end-pos uint16) + ) + ) + + +(deftype generic-strip (structure) + ((pos uint16) + (len uint16) + ) + ) + + +(deftype generic-envmap-saves (structure) + ((index-mask vector4w :inline) + (verts uint128 12) + (kicks uint128 4) + ) + ) + + +(deftype generic-interp-job (structure) + ((job-type uint16) + (num uint16) + (first uint16) + (pad uint16) + (ptr-data uint32) + (morph-z uint16) + (morph-w uint16) + ) + :pack-me + ) + + +(deftype generic-saves (structure) + ((ptr-dma uint32) + (ptr-vtxs uint32) + (ptr-clrs uint32) + (ptr-texs uint32) + (ptr-env-clrs uint32) + (ptr-env-texs uint32) + (cur-outbuf uint32) + (ptr-fx-buf uint32) + (xor-outbufs uint32) + (num-dps uint32) + (qwc uint32) + (gsf-buf gsf-buffer) + (ptr-shaders uint32) + (ptr-env-shader uint32) + (is-envmap uint16) + (is-translucent uint16) + (basep uint32) + (ptr-interp-job generic-interp-job) + (gifbuf-adr uint32) + (inbuf-adr uint32) + (fade-val uint32) + (time-of-day-color rgba) + (to-vu0-waits uint32) + (to-spr-waits uint32) + (from-spr-waits uint32) + (envmap generic-envmap-saves :inline) + ) + ) + + +(deftype generic-gif-tag (structure) + ((data uint32 4) + (qword qword :inline :overlay-at (-> data 0)) + (fan-prim gif-tag-prim :overlay-at (-> data 0)) + (str-prim gif-tag-prim :overlay-at (-> data 1)) + (regs gif-tag-regs-32 :overlay-at (-> data 2)) + (num-strips uint32 :overlay-at (-> data 3)) + ) + ) + + +(deftype generic-envmap-consts (structure) + ((consts vector :inline) + (strgif generic-gif-tag :inline) + (colors vector4w :inline) + (shader adgif-shader :inline) + ) + ) + + +(deftype generic-consts (structure) + ((dma-header dma-packet :inline) + (vif-header uint32 4) + (dma-ref-vtxs dma-packet :inline) + (dma-cnt-call dma-packet :inline) + (matrix matrix :inline) + (base-strgif generic-gif-tag :inline) + (alpha-opaque gs-adcmd :inline) + (alpha-translucent gs-adcmd :inline) + (ztest-normal gs-adcmd :inline) + (ztest-opaque gs-adcmd :inline) + (adcmd-offsets uint8 16) + (stcycle-tag uint32) + (unpack-vtx-tag uint32) + (unpack-clr-tag uint32) + (unpack-tex-tag uint32) + (mscal-tag uint32) + (flush-tag uint32) + (reset-cycle-tag uint32) + (dummy0 uint32) + (dma-tag-cnt uint64) + (envmap generic-envmap-consts :inline) + (light-consts vector :inline) + (texture-offset uint16 8) + ) + ) + + +(deftype generic-storage (structure) + ((data uint128 16) + ) + ) + + +(kmemopen global "gsf-buffer") + +(define *gsf-buffer* (the-as object (kmalloc global 9216 (kmalloc-flags align-64) "malloc"))) + +(kmemclose) diff --git a/goal_src/jak3/engine/gfx/generic/generic-vu1-h.gc b/goal_src/jak3/engine/gfx/generic/generic-vu1-h.gc index af0f7eb3b3..946b1f1de1 100644 --- a/goal_src/jak3/engine/gfx/generic/generic-vu1-h.gc +++ b/goal_src/jak3/engine/gfx/generic/generic-vu1-h.gc @@ -7,3 +7,72 @@ ;; DECOMP BEGINS +(deftype pris-mtx (structure) + "Matrix for merc rendering. Named after the earlier 'pris' renderer. +Contains a transformation matrix for vertices, one for normals, and a scale. +This matrix is likely not used by generic VU1, but is used by the merc -> generic converter." + ((data float 32) + (vector vector 8 :overlay-at (-> data 0)) + (t-mtx matrix :inline :overlay-at (-> data 0)) + (n-mtx matrix3 :inline :overlay-at (-> data 16)) + (scale vector :inline :overlay-at (-> data 28)) + ) + ) + + +(deftype generic-pris-mtx-save (structure) + ((loc-mtx pris-mtx :inline) + (par-mtx pris-mtx :inline) + (dif-mtx pris-mtx :inline) + ) + ) + + +(deftype generic-constants (structure) + "Constant data sent to VU1 for generic rendering." + ((fog vector :inline) + (adgif gs-gif-tag :inline) + (hvdf-offset vector :inline) + (hmge-scale vector :inline) + (invh-scale vector :inline) + (guard vector :inline) + (flush qword :inline) + (stores qword :inline) + ) + ) + + +(deftype generic-shrub-constants (structure) + ((shrub-giftag generic-gif-tag :inline) + (shrub-adnop qword :inline) + ) + ) + + +(deftype gcf-shader (structure) + ((adgif uint128 5) + (shader adgif-shader :inline :overlay-at (-> adgif 0)) + (pos uint32 :offset 12) + (num uint32 :offset 28) + ) + ) + + +(deftype 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 :dynamic) + ) + ) + + +(deftype gcf-vertex (structure) + ((tex vector4w :inline) + (clr gs-packed-rgba :inline) + (pos gs-packed-xyzw :inline) + ) + ) diff --git a/goal_src/jak3/engine/level/region-h.gc b/goal_src/jak3/engine/level/region-h.gc index f3a4adbc3f..d498d1576a 100644 --- a/goal_src/jak3/engine/level/region-h.gc +++ b/goal_src/jak3/engine/level/region-h.gc @@ -5,5 +5,111 @@ ;; name in dgo: region-h ;; dgos: GAME +(declare-type region-prim-area structure) + ;; DECOMP BEGINS +(deftype region (structure) + "A region is a closed volume that you can, enter, exit, and be inside. +This stores a unique, and script functions for a single region. +These are stored separately from the actual geometry to allow the geometry to be smaller +and fit in scratchpad/cache better." + ((id uint32) + (on-enter pair) + (on-inside pair) + (on-exit pair) + ) + (:methods + (point-in-region-debug! (_type_ vector) symbol) + ) + ) + + +(deftype region-array (inline-array-class) + "Array of region." + ((data region :inline :dynamic) + ) + ) + + +(set! (-> region-array heap-base) (the-as uint 16)) + +(deftype drawable-region-prim (drawable) + "Base class for a region + geometry. +Note that all child classes of this must be 32-bytes." + ((region region :offset 8) + ) + (:methods + (debug-draw-region (_type_ int) none) + (track-region (_type_ region-prim-area) symbol) + (within-area? (_type_ region-prim-area) symbol) + ) + ) + + +(deftype drawable-tree-region-prim (drawable-tree) + "Top-level container for all regions of a level." + ((name basic :offset 8) + (data2 drawable-inline-array :dynamic :offset 32) + ) + (:methods + (drawable-tree-region-prim-method-17 (_type_ vector) symbol) + (debug-print (_type_ vector object) none) + ) + ) + + +(deftype drawable-inline-array-region-prim (drawable-inline-array) + "Inline array of drawable-region-prim. This actually stores child classes, but they are +exactly the same size as the parent, so it's okay." + ((data drawable-region-prim 1 :inline) + (pad uint8 4) + ) + ) + +(deftype drawable-region-sphere (drawable-region-prim) + "Region where the bsphere of the drawable is the volume." + () + ) + + +(deftype region-face-data (structure) + "Data to store a single planar face, as a normal and list of vertices." + ((normal vector :inline) + (normal-offset float :overlay-at (-> normal data 3)) + (num-points uint32) + (points vector :inline :dynamic) + ) + ) + + +(deftype drawable-region-face (drawable-region-prim) + "A drawable-region which is just a face. Unclear if `on-inside` is used." + ((data region-face-data :offset 12) + ) + ) + + +(deftype region-face-array (inline-array-class) + "An array of faces that hopefully make a closed volume." + ((data drawable-region-face :inline :dynamic :offset 16) + (pad uint32) + ) + ) + + +(set! (-> region-face-array heap-base) (the-as uint 32)) + +(deftype drawable-region-volume (drawable-region-prim) + "A drawable-region which is a bunch of faces that represent a closed volume." + ((faces region-face-array :offset 12) + ) + ) + + +(deftype region-prim-list (structure) + "A list of drawable-region-prim. This is the return type of queries like `which regions contain this point?`" + ((num-items int32) + (items drawable-region-prim 320) + ) + ) diff --git a/test/decompiler/reference/jak3/engine/ai/traffic-h_REF.gc b/test/decompiler/reference/jak3/engine/ai/traffic-h_REF.gc new file mode 100644 index 0000000000..6a3138c0d5 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/ai/traffic-h_REF.gc @@ -0,0 +1,189 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *traffic-manager*, type traffic-manager +(define *traffic-manager* (the-as traffic-manager #f)) + +;; definition for symbol *vehicle-manager*, type vehicle-manager +(define *vehicle-manager* (the-as vehicle-manager #f)) + +;; definition of type traffic-danger-info +(deftype traffic-danger-info (structure) + ((sphere sphere :inline) + (velocity vector :inline) + (handle handle) + (notify-radius float) + (danger-level float) + (decay-rate float) + (flags uint8) + (danger-type uint8) + ) + ) + +;; definition for method 3 of type traffic-danger-info +(defmethod inspect ((this traffic-danger-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'traffic-danger-info) + (format #t "~1Tsphere: #~%" (-> this sphere)) + (format #t "~1Tvelocity: #~%" (-> this velocity)) + (format #t "~1Thandle: ~D~%" (-> this handle)) + (format #t "~1Tnotify-radius: ~f~%" (-> this notify-radius)) + (format #t "~1Tdanger-level: ~f~%" (-> this danger-level)) + (format #t "~1Tdecay-rate: ~f~%" (-> this decay-rate)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tdanger-type: ~D~%" (-> this danger-type)) + (label cfg-4) + this + ) + +;; definition of type traffic-suppression-params +(deftype traffic-suppression-params (structure) + ((bbox bounding-box :inline) + (duration time-frame) + (id int8) + ) + (:methods + (try-creating-new-suppression-box (_type_) symbol) + (create-or-update-suppression-box (_type_) symbol) + (has-valid-id? (_type_) symbol) + (kill-suppression-box (_type_) none) + ) + ) + +;; definition for method 3 of type traffic-suppression-params +(defmethod inspect ((this traffic-suppression-params)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'traffic-suppression-params) + (format #t "~1Tbbox: #~%" (-> this bbox)) + (format #t "~1Tduration: ~D~%" (-> this duration)) + (format #t "~1Tid: ~D~%" (-> this id)) + (label cfg-4) + this + ) + +;; definition for method 11 of type traffic-suppression-params +(defmethod has-valid-id? ((this traffic-suppression-params)) + (!= (-> this id) -1) + ) + +;; definition of type traffic-object-spawn-params +(deftype traffic-object-spawn-params (structure) + ((object-type uint8) + (behavior uint64) + (id uint32) + (nav-mesh nav-mesh) + (nav-branch nav-branch) + (position vector :inline) + (rotation quaternion :inline) + (velocity vector :inline) + (handle handle) + (handle-parent uint64) + (guard-type uint8) + (user-data uint32) + (entity basic) + (flags traffic-spawn-flags) + (proc process) + ) + ) + +;; definition for method 3 of type traffic-object-spawn-params +(defmethod inspect ((this traffic-object-spawn-params)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'traffic-object-spawn-params) + (format #t "~1Tobject-type: ~D~%" (-> this object-type)) + (format #t "~1Tbehavior: ~D~%" (-> this behavior)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tnav-mesh: ~A~%" (-> this nav-mesh)) + (format #t "~1Tnav-branch: ~A~%" (-> this nav-branch)) + (format #t "~1Tposition: #~%" (-> this position)) + (format #t "~1Trotation: #~%" (-> this rotation)) + (format #t "~1Tvelocity: #~%" (-> this velocity)) + (format #t "~1Thandle: ~D~%" (-> this handle)) + (format #t "~1Thandle-parent: ~D~%" (-> this handle-parent)) + (format #t "~1Tguard-type: ~D~%" (-> this guard-type)) + (format #t "~1Tuser-data: ~D~%" (-> this user-data)) + (format #t "~1Tentity: ~A~%" (-> this entity)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tproc: ~A~%" (-> this proc)) + (label cfg-4) + this + ) + +;; definition of type traffic-info +(deftype traffic-info (structure) + ((ctywide-level basic) + (vehicle-level basic) + (race-vehicle-level basic) + (traffic-object-levels level 29) + (vehicle-levels level 44) + (traffic-object-type-from-vehicle-type traffic-type 44) + (restore-speech-callback basic) + ) + ) + +;; definition for method 3 of type traffic-info +(defmethod inspect ((this traffic-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'traffic-info) + (format #t "~1Tctywide-level: ~A~%" (-> this ctywide-level)) + (format #t "~1Tvehicle-level: ~A~%" (-> this vehicle-level)) + (format #t "~1Trace-vehicle-level: ~A~%" (-> this race-vehicle-level)) + (format #t "~1Ttraffic-object-levels[29] @ #x~X~%" (-> this traffic-object-levels)) + (format #t "~1Tvehicle-levels[44] @ #x~X~%" (-> this vehicle-levels)) + (format + #t + "~1Ttraffic-object-type-from-vehicle-type[44] @ #x~X~%" + (-> this traffic-object-type-from-vehicle-type) + ) + (format #t "~1Trestore-speech-callback: ~A~%" (-> this restore-speech-callback)) + (label cfg-4) + this + ) + +;; definition for symbol *traffic-info*, type traffic-info +(define *traffic-info* (new 'static 'traffic-info + :ctywide-level #f + :vehicle-level #f + :race-vehicle-level #f + :restore-speech-callback #f + ) + ) + +;; failed to figure out what this is: +(let ((v1-5 *traffic-info*)) + (dotimes (a0-9 29) + (set! (-> v1-5 traffic-object-levels a0-9) #f) + ) + (dotimes (a0-12 44) + (set! (-> v1-5 vehicle-levels a0-12) #f) + (set! (-> v1-5 traffic-object-type-from-vehicle-type a0-12) (traffic-type invalid)) + ) + (set! (-> v1-5 traffic-object-type-from-vehicle-type 0) (traffic-type tt17)) + (set! (-> v1-5 traffic-object-type-from-vehicle-type 1) (traffic-type tt18)) + (set! (-> v1-5 traffic-object-type-from-vehicle-type 2) (traffic-type tt19)) + (set! (-> v1-5 traffic-object-type-from-vehicle-type 3) (traffic-type tt20)) + (set! (-> v1-5 traffic-object-type-from-vehicle-type 4) (traffic-type tt21)) + (set! (-> v1-5 traffic-object-type-from-vehicle-type 5) (traffic-type tt22)) + (set! (-> v1-5 traffic-object-type-from-vehicle-type 6) (traffic-type tt28)) + (set! (-> v1-5 traffic-object-type-from-vehicle-type 7) (traffic-type tt25)) + (set! (-> v1-5 traffic-object-type-from-vehicle-type 11) (traffic-type tt27)) + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/engine/anim/mspace-h_REF.gc b/test/decompiler/reference/jak3/engine/anim/mspace-h_REF.gc new file mode 100644 index 0000000000..007e4a1714 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/anim/mspace-h_REF.gc @@ -0,0 +1,185 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type joint +(deftype joint (basic) + "A joint from an animated skeleton. This defines the graph of the skeleton, and also the bind pose +used for the mesh data. The joints are shared between all instances of the same model." + ((name basic) + (number int32) + (parent joint) + (bind-pose matrix :inline) + ) + ) + +;; definition for method 3 of type joint +(defmethod inspect ((this joint)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tnumber: ~D~%" (-> this number)) + (format #t "~1Tparent: ~A~%" (-> this parent)) + (format #t "~1Tbind-pose: #~%" (-> this bind-pose)) + (label cfg-4) + this + ) + +;; definition of type bone-cache +(deftype bone-cache (structure) + "Unused type. Existed in Jak 1, but wasn't used there." + ((bone-matrix uint32) + (parent-matrix uint32) + (dummy uint32) + (frame uint32) + ) + ) + +;; definition for method 3 of type bone-cache +(defmethod inspect ((this bone-cache)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'bone-cache) + (format #t "~1Tbone-matrix: ~D~%" (-> this bone-matrix)) + (format #t "~1Tparent-matrix: ~D~%" (-> this parent-matrix)) + (format #t "~1Tdummy: ~D~%" (-> this dummy)) + (format #t "~1Tframe: ~D~%" (-> this frame)) + (label cfg-4) + this + ) + +;; definition of type bone +(deftype bone (structure) + "The location and scale of a bone in an animated skeleton. Each instance of a skeleton +has its own copy of the bones. This data is used for collision checking or other gameplay math, +but, despite the name, isn't directly used in rendering." + ((transform matrix :inline) + (position vector :inline :overlay-at (-> transform data 12)) + (scale vector :inline) + ) + ) + +;; definition for method 3 of type bone +(defmethod inspect ((this bone)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'bone) + (format #t "~1Ttransform: #~%" (-> this transform)) + (format #t "~1Tposition: #~%" (-> this transform trans)) + (format #t "~1Tscale: #~%" (-> this scale)) + (label cfg-4) + this + ) + +;; definition of type skeleton +(deftype skeleton (inline-array-class) + "Skeleton is an array of bones for the entire character. The bones are stored in an inline array so they can be +easily dma'd to the scratchpad later." + ((bones bone :inline :dynamic) + ) + ) + +;; definition for method 3 of type skeleton +(defmethod inspect ((this skeleton)) + (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 bones)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(set! (-> skeleton heap-base) (the-as uint 80)) + +;; definition of type cspace +(deftype cspace (structure) + "A cspace describes how to control a bone. It contains a reference to the joint, bone, and a callback function. +The callback function is used to take the joint transforms out of the joint animation, then update the bone." + ((parent cspace) + (joint joint) + (joint-num int16) + (geo drawable) + (bone bone) + (param0 (function cspace transformq none)) + (param1 basic) + (param2 basic) + ) + (:methods + (new (symbol type drawable) _type_) + (reset-and-assign-geo! (_type_ drawable) _type_) + ) + ) + +;; definition for method 3 of type cspace +(defmethod inspect ((this cspace)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'cspace) + (format #t "~1Tparent: #~%" (-> this parent)) + (format #t "~1Tjoint: ~A~%" (-> this joint)) + (format #t "~1Tjoint-num: ~D~%" (-> this joint-num)) + (format #t "~1Tgeo: ~A~%" (-> this geo)) + (format #t "~1Tbone: #~%" (-> this bone)) + (format #t "~1Tparam0: ~A~%" (-> this param0)) + (format #t "~1Tparam1: ~A~%" (-> this param1)) + (format #t "~1Tparam2: ~A~%" (-> this param2)) + (label cfg-4) + this + ) + +;; definition of type cspace-array +(deftype cspace-array (inline-array-class) + ((data cspace :dynamic) + ) + ) + +;; definition for method 3 of type cspace-array +(defmethod inspect ((this cspace-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! (-> cspace-array heap-base) (the-as uint 32)) + +;; definition for method 2 of type cspace +(defmethod print ((this cspace)) + (format + #t + "#" + (if (-> this joint) + (-> this joint name) + "nojoint" + ) + this + ) + this + ) + +;; 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_objs/cloth-art-h_REF.gc new file mode 100644 index 0000000000..d0c1d1dbc8 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/common_objs/cloth-art-h_REF.gc @@ -0,0 +1,279 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type cloth-pt +(deftype cloth-pt (structure) + ((pt vector :inline) + (u float) + (v float) + ) + ) + +;; definition for method 3 of type cloth-pt +(defmethod inspect ((this cloth-pt)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'cloth-pt) + (format #t "~1Tpt: #~%" (-> this pt)) + (format #t "~1Tu: ~f~%" (-> this u)) + (format #t "~1Tv: ~f~%" (-> this v)) + (label cfg-4) + this + ) + +;; definition of type anchor-transform +(deftype anchor-transform (structure) + ((offset vector :inline) + (joint-name basic) + (joint int16) + (constraint-index int16) + ) + ) + +;; definition for method 3 of type anchor-transform +(defmethod inspect ((this anchor-transform)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'anchor-transform) + (format #t "~1Toffset: #~%" (-> this offset)) + (format #t "~1Tjoint-name: ~A~%" (-> this joint-name)) + (format #t "~1Tjoint: ~D~%" (-> this joint)) + (format #t "~1Tconstraint-index: ~D~%" (-> this constraint-index)) + (label cfg-4) + this + ) + +;; definition of type sphere-transform +(deftype sphere-transform (structure) + ((offset vector :inline) + (joint-name basic) + (radius float) + (joint int16) + ) + ) + +;; definition for method 3 of type sphere-transform +(defmethod inspect ((this sphere-transform)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'sphere-transform) + (format #t "~1Toffset: #~%" (-> this offset)) + (format #t "~1Tjoint-name: ~A~%" (-> this joint-name)) + (format #t "~1Tradius: ~f~%" (-> this radius)) + (format #t "~1Tjoint: ~D~%" (-> this joint)) + (label cfg-4) + this + ) + +;; definition of type disc-transform +(deftype disc-transform (structure) + ((offset vector :inline) + (normal vector :inline) + (joint-name basic) + (radius float) + (joint int16) + (start-particle-index int16) + (end-particle-index int16) + ) + ) + +;; definition for method 3 of type disc-transform +(defmethod inspect ((this disc-transform)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'disc-transform) + (format #t "~1Toffset: #~%" (-> this offset)) + (format #t "~1Tnormal: #~%" (-> this normal)) + (format #t "~1Tjoint-name: ~A~%" (-> this joint-name)) + (format #t "~1Tradius: ~f~%" (-> this radius)) + (format #t "~1Tjoint: ~D~%" (-> this joint)) + (format #t "~1Tstart-particle-index: ~D~%" (-> this start-particle-index)) + (format #t "~1Tend-particle-index: ~D~%" (-> this end-particle-index)) + (label cfg-4) + this + ) + +;; definition of type anchor-transform-array +(deftype anchor-transform-array (inline-array-class) + ((data anchor-transform :inline :dynamic) + ) + ) + +;; definition for method 3 of type anchor-transform-array +(defmethod inspect ((this anchor-transform-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! (-> anchor-transform-array heap-base) (the-as uint 32)) + +;; definition of type sphere-transform-array +(deftype sphere-transform-array (inline-array-class) + ((data sphere-transform :inline :dynamic) + ) + ) + +;; definition for method 3 of type sphere-transform-array +(defmethod inspect ((this sphere-transform-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! (-> sphere-transform-array heap-base) (the-as uint 32)) + +;; definition of type disc-transform-array +(deftype disc-transform-array (inline-array-class) + ((data disc-transform :inline :dynamic) + ) + ) + +;; definition for method 3 of type disc-transform-array +(defmethod inspect ((this disc-transform-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! (-> disc-transform-array heap-base) (the-as uint 48)) + +;; definition of type cloth-thickness-array +(deftype cloth-thickness-array (inline-array-class) + ((data uint8 :dynamic) + ) + ) + +;; definition for method 3 of type cloth-thickness-array +(defmethod inspect ((this cloth-thickness-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! (-> cloth-thickness-array heap-base) (the-as uint 1)) + +;; definition of type cloth-params +(deftype cloth-params (structure) + ((mesh int16) + (gravity-constant float) + (wind-constant float) + (cloth-width uint16) + (num-sphere-constraints uint16) + (num-disc-constraints uint16) + (num-anchor-points uint16) + (flags uint64) + (tex-name basic) + (tex-name2 basic) + (tex-name3 basic) + (alt-tex-name basic) + (alt-tex-name2 basic) + (alt-tex-name3 basic) + (cloth-thickness float) + (initial-xform int16) + (drag float) + (ball-collision-radius float) + (num-iterations int8) + (timestep-frequency int8) + (secret-disable uint64) + ) + ) + +;; definition for method 3 of type cloth-params +(defmethod inspect ((this cloth-params)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'cloth-params) + (format #t "~1Tmesh: ~D~%" (-> this mesh)) + (format #t "~1Tgravity-constant: ~f~%" (-> this gravity-constant)) + (format #t "~1Twind-constant: ~f~%" (-> this wind-constant)) + (format #t "~1Tcloth-width: ~D~%" (-> this cloth-width)) + (format #t "~1Tnum-sphere-constraints: ~D~%" (-> this num-sphere-constraints)) + (format #t "~1Tnum-disc-constraints: ~D~%" (-> this num-disc-constraints)) + (format #t "~1Tnum-anchor-points: ~D~%" (-> this num-anchor-points)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Ttex-name: ~A~%" (-> this tex-name)) + (format #t "~1Ttex-name2: ~A~%" (-> this tex-name2)) + (format #t "~1Ttex-name3: ~A~%" (-> this tex-name3)) + (format #t "~1Talt-tex-name: ~A~%" (-> this alt-tex-name)) + (format #t "~1Talt-tex-name2: ~A~%" (-> this alt-tex-name2)) + (format #t "~1Talt-tex-name3: ~A~%" (-> this alt-tex-name3)) + (format #t "~1Tcloth-thickness: ~f~%" (-> this cloth-thickness)) + (format #t "~1Tinitial-xform: ~D~%" (-> this initial-xform)) + (format #t "~1Tdrag: ~f~%" (-> this drag)) + (format #t "~1Tball-collision-radius: ~f~%" (-> this ball-collision-radius)) + (format #t "~1Tnum-iterations: ~D~%" (-> this num-iterations)) + (format #t "~1Ttimestep-frequency: ~D~%" (-> this timestep-frequency)) + (format #t "~1Tsecret-disable: ~D~%" (-> this secret-disable)) + (label cfg-4) + this + ) + +;; definition of type cloth-base +(deftype cloth-base (basic) + () + (:methods + (cloth-base-method-9 () none) + (cloth-base-method-10 () none) + ) + ) + +;; definition for method 3 of type cloth-base +(defmethod inspect ((this cloth-base)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/engine/data/art-h_REF.gc b/test/decompiler/reference/jak3/engine/data/art-h_REF.gc new file mode 100644 index 0000000000..d377e60a18 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/data/art-h_REF.gc @@ -0,0 +1,785 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type joint-anim +(deftype joint-anim (basic) + "Base class for all joint animations. These are animations that store joint transforms." + ((name string) + (number int16) + (length int16) + ) + ) + +;; definition for method 3 of type joint-anim +(defmethod inspect ((this joint-anim)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tnumber: ~D~%" (-> this number)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (label cfg-4) + this + ) + +;; definition of type joint-anim-matrix +(deftype joint-anim-matrix (joint-anim) + "Joint animation which stores matrices directly. Not used." + ((data matrix :inline :dynamic :offset 16) + ) + ) + +;; definition of type joint-anim-transformq +(deftype joint-anim-transformq (joint-anim) + "Joint animation which stores transformq's directly. Not used." + ((data transformq :inline :dynamic) + ) + ) + +;; definition for method 3 of type joint-anim-transformq +(defmethod inspect ((this joint-anim-transformq)) + (when (not this) + (set! this this) + (goto cfg-7) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tnumber: ~D~%" (-> this number)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) + (dotimes (s5-0 (-> this length)) + (format #t "~T [~D]~1Tdata: ~`transformq`P~%" s5-0 (-> this data s5-0)) + ) + (label cfg-7) + this + ) + +;; definition of type joint-anim-drawable +(deftype joint-anim-drawable (joint-anim) + "Mysterious unused joint animation type." + ((data drawable :dynamic) + ) + ) + +;; definition for method 3 of type joint-anim-drawable +(defmethod inspect ((this joint-anim-drawable)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tnumber: ~D~%" (-> this number)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) + (label cfg-4) + this + ) + +;; definition of type joint-anim-frame +(deftype joint-anim-frame (structure) + "Frame containing all joint transforms. Note that there are two special frames: align and prejoint. +The 'align' frame is used for the complicated animation alignment system, which allows the animation to move +a character, among other things. The prejoint is just the root of the skeleton. +The remaining transformq's are the joint transforms you'd expect." + ((matrices matrix 2 :inline) + (data transformq :inline :dynamic) + ) + (:methods + (new (symbol type int) _type_) + ) + ) + +;; definition for method 3 of type joint-anim-frame +(defmethod inspect ((this joint-anim-frame)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'joint-anim-frame) + (format #t "~1Tmatrices[2] @ #x~X~%" (-> this matrices)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) + (label cfg-4) + this + ) + +;; definition for method 0 of type joint-anim-frame +;; WARN: Return type mismatch structure vs joint-anim-frame. +(defmethod new joint-anim-frame ((allocation symbol) (type-to-make type) (arg0 int)) + (let ((v1-1 (max 0 (+ arg0 -2)))) + (the-as + joint-anim-frame + (new-dynamic-structure allocation type-to-make (the-as int (+ (-> type-to-make size) (* 48 v1-1)))) + ) + ) + ) + +;; definition of type joint-anim-compressed-hdr +(deftype joint-anim-compressed-hdr (structure) + "Header for the compressed joint animation format." + ((control-bits uint32 14) + (num-joints uint32) + (matrix-bits uint32) + ) + ) + +;; definition for method 3 of type joint-anim-compressed-hdr +(defmethod inspect ((this joint-anim-compressed-hdr)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'joint-anim-compressed-hdr) + (format #t "~1Tcontrol-bits[14] @ #x~X~%" (-> this control-bits)) + (format #t "~1Tnum-joints: ~D~%" (-> this num-joints)) + (format #t "~1Tmatrix-bits: ~D~%" (-> this matrix-bits)) + (label cfg-4) + this + ) + +;; definition of type joint-anim-compressed-fixed +(deftype joint-anim-compressed-fixed (structure) + ((hdr joint-anim-compressed-hdr :inline) + (offset-64 uint32) + (offset-32 uint32) + (offset-16 uint32) + (reserved uint32) + (data vector 133 :inline) + ) + ) + +;; definition for method 3 of type joint-anim-compressed-fixed +(defmethod inspect ((this joint-anim-compressed-fixed)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'joint-anim-compressed-fixed) + (format #t "~1Thdr: #~%" (-> this hdr)) + (format #t "~1Toffset-64: ~D~%" (-> this offset-64)) + (format #t "~1Toffset-32: ~D~%" (-> this offset-32)) + (format #t "~1Toffset-16: ~D~%" (-> this offset-16)) + (format #t "~1Treserved: ~D~%" (-> this reserved)) + (format #t "~1Tdata[133] @ #x~X~%" (-> this data)) + (label cfg-4) + this + ) + +;; definition of type joint-anim-compressed-frame +(deftype joint-anim-compressed-frame (structure) + ((offset-64 uint32) + (offset-32 uint32) + (offset-16 uint32) + (reserved uint32) + (data vector 133 :inline) + ) + ) + +;; definition for method 3 of type joint-anim-compressed-frame +(defmethod inspect ((this joint-anim-compressed-frame)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'joint-anim-compressed-frame) + (format #t "~1Toffset-64: ~D~%" (-> this offset-64)) + (format #t "~1Toffset-32: ~D~%" (-> this offset-32)) + (format #t "~1Toffset-16: ~D~%" (-> this offset-16)) + (format #t "~1Treserved: ~D~%" (-> this reserved)) + (format #t "~1Tdata[133] @ #x~X~%" (-> this data)) + (label cfg-4) + this + ) + +;; definition of type joint-anim-compressed-control +(deftype joint-anim-compressed-control (structure) + ((num-frames uint16) + (flags uint16) + (fixed-qwc uint32) + (frame-qwc uint32) + (fixed joint-anim-compressed-fixed) + (data joint-anim-compressed-frame :dynamic) + ) + ) + +;; definition for method 3 of type joint-anim-compressed-control +(defmethod inspect ((this joint-anim-compressed-control)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'joint-anim-compressed-control) + (format #t "~1Tnum-frames: ~D~%" (-> this num-frames)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tfixed-qwc: ~D~%" (-> this fixed-qwc)) + (format #t "~1Tframe-qwc: ~D~%" (-> this frame-qwc)) + (format #t "~1Tfixed: #~%" (-> this fixed)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) + (label cfg-4) + this + ) + +;; definition of type art +(deftype art (basic) + "Base class for anything considered `art`. This is typically foreground model data. +This can be either an art container containing more arts, or an actual art thing (art-element)." + ((name string :offset 8) + (length int32) + (extra res-lump) + ) + (:methods + (art-method-9 () none) + (art-method-10 () none) + (art-method-11 () none) + (art-method-12 () none) + (art-method-13 () none) + ) + ) + +;; definition for method 3 of type art +(defmethod inspect ((this art)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Textra: ~A~%" (-> this extra)) + (label cfg-4) + this + ) + +;; definition of type art-element +(deftype art-element (art) + "Base class Art which is not a container of more art." + ((master-art-group-name basic) + (master-art-group-index int32) + (pad uint8 20) + ) + ) + +;; definition for method 3 of type art-element +(defmethod inspect ((this art-element)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Textra: ~A~%" (-> this extra)) + (format #t "~1Tmaster-art-group-name: ~A~%" (-> this master-art-group-name)) + (format #t "~1Tmaster-art-group-index: ~D~%" (-> this master-art-group-index)) + (label cfg-4) + this + ) + +;; definition of type art-mesh-anim +(deftype art-mesh-anim (art-element) + "An unused mesh animation." + () + ) + +;; definition of type art-joint-anim +(deftype art-joint-anim (art-element) + "Art for a joint animation. Also contains the eye animation." + ((eye-anim merc-eye-anim-block :overlay-at (-> pad 0)) + (blend-shape-anim (pointer int8) :overlay-at (-> pad 4)) + (frames joint-anim-compressed-control :overlay-at (-> pad 8)) + (speed float :offset 48) + (artist-base float) + (artist-step float) + ) + ) + +;; definition for method 3 of type art-joint-anim +(defmethod inspect ((this art-joint-anim)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Textra: ~A~%" (-> this extra)) + (format #t "~1Tmaster-art-group-name: ~A~%" (-> this master-art-group-name)) + (format #t "~1Tmaster-art-group-index: ~D~%" (-> this master-art-group-index)) + (format #t "~1Teye-anim: ~`merc-eye-anim-block`P~%" (-> this eye-anim)) + (format #t "~1Tblend-shape-anim: ~A~%" (-> this blend-shape-anim)) + (format #t "~1Tframes: #~%" (-> this frames)) + (format #t "~1Tspeed: ~f~%" (-> this speed)) + (format #t "~1Tartist-base: ~f~%" (-> this artist-base)) + (format #t "~1Tartist-step: ~f~%" (-> this artist-step)) + (label cfg-4) + this + ) + +;; definition of type art-group +(deftype art-group (art) + "Art which is a list of more art. The -ag files are an art group with all the art needed for a +actor, like the mesh, animations, shadow mesh, skeleton, etc." + ((info file-info :offset 4) + (data art-element :dynamic :offset 32) + ) + (:methods + (unknown-0 () none) + (unknown-1 () none) + ) + ) + +;; definition of type art-mesh-geo +(deftype art-mesh-geo (art-element) + "Unused art format for a mesh. This might have been for the renderer that came before merc." + () + ) + +;; definition of type art-joint-geo +(deftype art-joint-geo (art-element) + "Collection of joints for an actor." + () + ) + +;; definition of type art-cloth-geo +(deftype art-cloth-geo (art-element) + ((anchor-transforms basic) + (sphere-transforms basic) + (disc-transforms basic) + (cloth-thickness basic) + (thickness-scalar float) + (num-points int32 :overlay-at length) + (mesh object :dynamic :offset 80) + ) + ) + +;; definition for method 3 of type art-cloth-geo +(defmethod inspect ((this art-cloth-geo)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Textra: ~A~%" (-> this extra)) + (format #t "~1Tmaster-art-group-name: ~A~%" (-> this master-art-group-name)) + (format #t "~1Tmaster-art-group-index: ~D~%" (-> this master-art-group-index)) + (format #t "~1Tanchor-transforms: ~A~%" (-> this anchor-transforms)) + (format #t "~1Tsphere-transforms: ~A~%" (-> this sphere-transforms)) + (format #t "~1Tdisc-transforms: ~A~%" (-> this disc-transforms)) + (format #t "~1Tcloth-thickness: ~A~%" (-> this cloth-thickness)) + (format #t "~1Tthickness-scalar: ~f~%" (-> this thickness-scalar)) + (format #t "~1Tnum-points: ~D~%" (-> this length)) + (format #t "~1Tmesh[0] @ #x~X~%" (-> this mesh)) + (label cfg-4) + this + ) + +;; definition for method 7 of type art-cloth-geo +(defmethod relocate ((this art-cloth-geo) (arg0 int)) + this + ) + +;; definition of type art-joint-anim-manager-slot +(deftype art-joint-anim-manager-slot (structure) + "Record for an animation which is additionally compressed with LZO compression over the entire animation. +This is used for short, commonly used animations that always remain in RAM." + ((anim art-joint-anim) + (comp-data uint32) + (time-stamp uint64) + ) + ) + +;; definition for method 3 of type art-joint-anim-manager-slot +(defmethod inspect ((this art-joint-anim-manager-slot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'art-joint-anim-manager-slot) + (format #t "~1Tanim: ~A~%" (-> this anim)) + (format #t "~1Tcomp-data: #x~X~%" (-> this comp-data)) + (format #t "~1Ttime-stamp: ~D~%" (-> this time-stamp)) + (label cfg-4) + this + ) + +;; definition of type art-joint-anim-manager +(deftype art-joint-anim-manager (basic) + "Cache for LZO decompression of animations." + ((heap kheap :inline) + (free-index int32) + (slot art-joint-anim-manager-slot 64 :inline) + ) + (:methods + (new (symbol type int) _type_) + (art-joint-anim-manager-method-9 () none) + (art-joint-anim-manager-method-10 () none) + (art-joint-anim-manager-method-11 () none) + (art-joint-anim-manager-method-12 () none) + (art-joint-anim-manager-method-13 () none) + ) + ) + +;; definition for method 3 of type art-joint-anim-manager +(defmethod inspect ((this art-joint-anim-manager)) + (when (not this) + (set! this this) + (goto cfg-7) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Theap: #~%" (-> this heap)) + (format #t "~1Tfree-index: ~D~%" (-> this free-index)) + (format #t "~1Tslot[64] @ #x~X~%" (-> this slot)) + (dotimes (s5-0 64) + (format #t "~T [~D]~1Tslot: ~`art-joint-anim-manager-slot`P~%" s5-0 (-> this slot s5-0)) + ) + (label cfg-7) + this + ) + +;; definition for method 0 of type art-joint-anim-manager +(defmethod new art-joint-anim-manager ((allocation symbol) (type-to-make type) (arg0 int)) + (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (let ((s4-0 (-> gp-0 heap))) + (set! (-> s4-0 base) (kmalloc (the-as kheap (-> allocation value)) arg0 (kmalloc-flags) "heap")) + (set! (-> s4-0 current) (-> s4-0 base)) + (set! (-> s4-0 top-base) (&+ (-> s4-0 base) arg0)) + (set! (-> s4-0 top) (-> s4-0 top-base)) + ) + (dotimes (v1-6 64) + (set! (-> gp-0 slot v1-6 anim) #f) + ) + (set! (-> gp-0 free-index) 0) + gp-0 + ) + ) + +;; definition of type skeleton-group +(deftype skeleton-group (art-group) + "Unlike other art types, the skeleton-groups are defined in GOAL code. +This stores settings like the name of the art-group, shadow/level-of-detail settings, etc." + ((art-group-name string) + (jgeo int16) + (janim int16) + (bounds vector :inline) + (radius meters :overlay-at (-> bounds data 3)) + (mgeo int16 6) + (max-lod int32) + (lod-dist float 6) + (longest-edge meters) + (texture-level int8) + (version int8) + (shadow int16) + (shadow-joint-index int8) + (origin-joint-index int8) + (sort int8) + (light-index uint8) + (clothing basic) + (global-effects uint8) + ) + (:methods + (skeleton-group-method-16 () none) + ) + ) + +;; definition for method 3 of type skeleton-group +(defmethod inspect ((this skeleton-group)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Textra: ~A~%" (-> this extra)) + (format #t "~1Tinfo: ~A~%" (-> this info)) + (format #t "~1Tdata[0] @ #x~X~%" (&-> this art-group-name)) + (format #t "~1Tart-group-name: ~A~%" (-> this art-group-name)) + (format #t "~1Tjgeo: ~D~%" (-> this jgeo)) + (format #t "~1Tjanim: ~D~%" (-> this janim)) + (format #t "~1Tbounds: ~`vector`P~%" (-> this bounds)) + (format #t "~1Tradius: (meters ~m)~%" (-> this bounds w)) + (format #t "~1Tmgeo[6] @ #x~X~%" (-> this mgeo)) + (format #t "~1Tmax-lod: ~D~%" (-> this max-lod)) + (format #t "~1Tlod-dist[6] @ #x~X~%" (-> this lod-dist)) + (format #t "~1Tlongest-edge: (meters ~m)~%" (-> this longest-edge)) + (format #t "~1Ttexture-level: ~D~%" (-> this texture-level)) + (format #t "~1Tversion: ~D~%" (-> this version)) + (format #t "~1Tshadow: ~D~%" (-> this shadow)) + (format #t "~1Tshadow-joint-index: ~D~%" (-> this shadow-joint-index)) + (format #t "~1Torigin-joint-index: ~D~%" (-> this origin-joint-index)) + (format #t "~1Tsort: ~D~%" (-> this sort)) + (format #t "~1Tlight-index: ~D~%" (-> this light-index)) + (format #t "~1Tclothing: ~A~%" (-> this clothing)) + (format #t "~1Tglobal-effects: ~D~%" (-> this global-effects)) + (label cfg-4) + this + ) + +;; definition of type lod-group +(deftype lod-group (structure) + "A single level of detail mesh." + ((geo merc-ctrl) + (dist meters) + ) + :pack-me + ) + +;; definition for method 3 of type lod-group +(defmethod inspect ((this lod-group)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'lod-group) + (format #t "~1Tgeo: ~A~%" (-> this geo)) + (format #t "~1Tdist: (meters ~m)~%" (-> this dist)) + (label cfg-4) + this + ) + +;; definition of type lod-set +(deftype lod-set (structure) + "All the different level-of-detail meshes for an actor." + ((lod lod-group 6 :inline) + (max-lod int8) + ) + (:methods + (lod-set-method-9 () none) + ) + ) + +;; definition for method 3 of type lod-set +(defmethod inspect ((this lod-set)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'lod-set) + (format #t "~1Tlod[6] @ #x~X~%" (-> this lod)) + (format #t "~1Tmax-lod: ~D~%" (-> this max-lod)) + (label cfg-4) + this + ) + +;; definition of type draw-control +(deftype draw-control (basic) + "The draw-control is a collection of all the stuff that the foreground rendering system needs to draw something. +Each process-drawable has a draw-control." + ((process process-drawable) + (status draw-control-status) + (data-format draw-control-data-format) + (global-effect draw-control-global-effect) + (art-group art-group) + (jgeo art-joint-geo) + (mgeo merc-ctrl) + (dma-add-func (function process-drawable draw-control symbol object none)) + (skeleton skeleton) + (lod-set lod-set :inline) + (max-lod int8 :overlay-at (-> lod-set max-lod)) + (force-lod int8) + (cur-lod int8) + (desired-lod int8) + (ripple ripple-control) + (longest-edge meters) + (longest-edge? uint32 :overlay-at longest-edge) + (light-index uint8) + (shadow-mask uint8) + (level-index uint8) + (death-draw-overlap uint8) + (death-timer uint8) + (death-timer-org uint8) + (death-vertex-skip uint16) + (death-effect uint32) + (shadow shadow-geo) + (shadow-ctrl shadow-control) + (distance meters) + (origin vector :inline) + (bounds vector :inline) + (radius meters :overlay-at (-> bounds data 3)) + (color-mult rgbaf :inline) + (color-emissive rgbaf :inline) + (effect-mask uint64) + (seg-mask uint64) + (origin-joint-index uint8) + (shadow-joint-index uint8) + (force-fade uint8) + (default-texture-page uint8) + (shadow-values uint32) + (cloth-instances basic) + ) + (:methods + (new (symbol type) _type_) + (get-skeleton-origin (_type_) vector) + (draw-control-method-10 () none) + (draw-control-method-11 () none) + (draw-control-method-12 () none) + (draw-control-method-13 () none) + (draw-control-method-14 () none) + (draw-control-method-15 () none) + ) + ) + +;; definition for method 3 of type draw-control +(defmethod inspect ((this draw-control)) + (when (not this) + (set! this this) + (goto cfg-57) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprocess: ~A~%" (-> this process)) + (format #t "~1Tstatus: #x~X : (draw-control-status " (-> this status)) + (let ((s5-0 (-> this status))) + (if (= (logand s5-0 (draw-control-status no-draw-temp)) (draw-control-status no-draw-temp)) + (format #t "no-draw-temp ") + ) + (if (= (logand s5-0 (draw-control-status lod-set)) (draw-control-status lod-set)) + (format #t "lod-set ") + ) + (if (= (logand s5-0 (draw-control-status no-draw-bounds2)) (draw-control-status no-draw-bounds2)) + (format #t "no-draw-bounds2 ") + ) + (if (= (logand s5-0 (draw-control-status math-skel)) (draw-control-status math-skel)) + (format #t "math-skel ") + ) + (if (= (logand s5-0 (draw-control-status force-vu1)) (draw-control-status force-vu1)) + (format #t "force-vu1 ") + ) + (if (= (logand s5-0 (draw-control-status warp-cross-fade)) (draw-control-status warp-cross-fade)) + (format #t "warp-cross-fade ") + ) + (if (= (logand s5-0 (draw-control-status disable-fog)) (draw-control-status disable-fog)) + (format #t "disable-fog ") + ) + (if (= (logand s5-0 (draw-control-status no-bounds-check)) (draw-control-status no-bounds-check)) + (format #t "no-bounds-check ") + ) + (if (= (logand s5-0 (draw-control-status no-closest-distance)) (draw-control-status no-closest-distance)) + (format #t "no-closest-distance ") + ) + (if (= (logand s5-0 (draw-control-status hud)) (draw-control-status hud)) + (format #t "hud ") + ) + (if (= (logand s5-0 (draw-control-status no-draw)) (draw-control-status no-draw)) + (format #t "no-draw ") + ) + (if (= (logand s5-0 (draw-control-status on-screen)) (draw-control-status on-screen)) + (format #t "on-screen ") + ) + (if (= (logand s5-0 (draw-control-status close-to-screen)) (draw-control-status close-to-screen)) + (format #t "close-to-screen ") + ) + (if (= (logand s5-0 (draw-control-status force-fade)) (draw-control-status force-fade)) + (format #t "force-fade ") + ) + (if (= (logand s5-0 (draw-control-status no-draw-bounds)) (draw-control-status no-draw-bounds)) + (format #t "no-draw-bounds ") + ) + (if (= (logand s5-0 (draw-control-status uninited)) (draw-control-status uninited)) + (format #t "uninited ") + ) + ) + (format #t ")~%") + (let ((t9-20 format) + (a0-37 #t) + (a1-20 "~1Tdata-format: #x~X : ~S~%") + (a2-3 (-> this data-format)) + (v1-50 (-> this data-format)) + ) + (t9-20 a0-37 a1-20 a2-3 (cond + ((= v1-50 (draw-control-data-format merc)) + "merc" + ) + ((= v1-50 (draw-control-data-format pris)) + "pris" + ) + (else + "*unknown*" + ) + ) + ) + ) + (format #t "~1Tglobal-effect: #x~X : (draw-control-global-effect " (-> this global-effect)) + (let ((s5-1 (-> this global-effect))) + (if (= (logand s5-1 (draw-control-global-effect title-light)) (draw-control-global-effect title-light)) + (format #t "title-light ") + ) + (if (= (logand s5-1 (draw-control-global-effect bit-1)) (draw-control-global-effect bit-1)) + (format #t "bit-1 ") + ) + (if (= (logand s5-1 (draw-control-global-effect rim-lights3)) (draw-control-global-effect rim-lights3)) + (format #t "rim-lights3 ") + ) + (if (= (logand s5-1 (draw-control-global-effect disable-envmap)) (draw-control-global-effect disable-envmap)) + (format #t "disable-envmap ") + ) + (if (= (logand s5-1 (draw-control-global-effect rim-lights2)) (draw-control-global-effect rim-lights2)) + (format #t "rim-lights2 ") + ) + (if (= (logand s5-1 (draw-control-global-effect no-textures)) (draw-control-global-effect no-textures)) + (format #t "no-textures ") + ) + (if (= (logand s5-1 (draw-control-global-effect bit-0)) (draw-control-global-effect bit-0)) + (format #t "bit-0 ") + ) + (if (= (logand s5-1 (draw-control-global-effect rim-lights)) (draw-control-global-effect rim-lights)) + (format #t "rim-lights ") + ) + ) + (format #t ")~%") + (format #t "~1Tart-group: ~A~%" (-> this art-group)) + (format #t "~1Tjgeo: ~A~%" (-> this jgeo)) + (format #t "~1Tmgeo: ~A~%" (-> this mgeo)) + (format #t "~1Tdma-add-func: ~A~%" (-> this dma-add-func)) + (format #t "~1Tskeleton: ~A~%" (-> this skeleton)) + (format #t "~1Tlod-set: #~%" (-> this lod-set)) + (format #t "~1Tlod[6] @ #x~X~%" (-> this lod-set)) + (format #t "~1Tmax-lod: ~D~%" (-> this lod-set max-lod)) + (format #t "~1Tforce-lod: ~D~%" (-> this force-lod)) + (format #t "~1Tcur-lod: ~D~%" (-> this cur-lod)) + (format #t "~1Tdesired-lod: ~D~%" (-> this desired-lod)) + (format #t "~1Tripple: ~A~%" (-> this ripple)) + (format #t "~1Tlongest-edge: (meters ~m)~%" (-> this longest-edge)) + (format #t "~1Tlongest-edge?: ~D~%" (-> this longest-edge)) + (format #t "~1Tlight-index: ~D~%" (-> this light-index)) + (format #t "~1Tshadow-mask: ~D~%" (-> this shadow-mask)) + (format #t "~1Tlevel-index: ~D~%" (-> this level-index)) + (format #t "~1Tdeath-draw-overlap: ~D~%" (-> this death-draw-overlap)) + (format #t "~1Tdeath-timer: ~D~%" (-> this death-timer)) + (format #t "~1Tdeath-timer-org: ~D~%" (-> this death-timer-org)) + (format #t "~1Tdeath-vertex-skip: ~D~%" (-> this death-vertex-skip)) + (format #t "~1Tdeath-effect: ~D~%" (-> this death-effect)) + (format #t "~1Tshadow: ~A~%" (-> this shadow)) + (format #t "~1Tshadow-ctrl: ~A~%" (-> this shadow-ctrl)) + (format #t "~1Tdistance: (meters ~m)~%" (-> this distance)) + (format #t "~1Torigin: ~`vector`P~%" (-> this origin)) + (format #t "~1Tbounds: ~`vector`P~%" (-> this bounds)) + (format #t "~1Tradius: (meters ~m)~%" (-> this bounds w)) + (format #t "~1Tcolor-mult: #~%" (-> this color-mult)) + (format #t "~1Tcolor-emissive: #~%" (-> this color-emissive)) + (format #t "~1Teffect-mask: #x~X~%" (-> this effect-mask)) + (format #t "~1Tseg-mask: #x~X~%" (-> this seg-mask)) + (format #t "~1Torigin-joint-index: ~D~%" (-> this origin-joint-index)) + (format #t "~1Tshadow-joint-index: ~D~%" (-> this shadow-joint-index)) + (format #t "~1Tforce-fade: ~D~%" (-> this force-fade)) + (format #t "~1Tdefault-texture-page: ~D~%" (-> this default-texture-page)) + (format #t "~1Tshadow-values: ~D~%" (-> this shadow-values)) + (format #t "~1Tcloth-instances: ~A~%" (-> this cloth-instances)) + (label cfg-57) + this + ) + +;; definition for method 9 of type draw-control +(defmethod get-skeleton-origin ((this draw-control)) + (-> this skeleton bones 0 transform trans) + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/engine/draw/draw-node-h_REF.gc b/test/decompiler/reference/jak3/engine/draw/draw-node-h_REF.gc new file mode 100644 index 0000000000..5f02c686e4 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/draw/draw-node-h_REF.gc @@ -0,0 +1,74 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type draw-node +(deftype draw-node (drawable) + "Node in a bounding volume heirarchy. This is a base class, and there are no children. +The child is a pointer to the start of inline array of drawables (note: not a drawable-inline-array, literally a bunch of plain drawables) +The size of this array is child-count. The type is either more draw-nodes, or, some other drawable like tfragment, depending on the flags. +Different renderers have different restrictions on the tree structure, like max child count, or if all children have the same depth. +Generally, tfrag/collide use a very rigid equal depth, max 8 children rule, but with shrub, anything goes. +This is a very awkward data structure to traverse, but it is designed for fast view frustum culling. +Note that there can be multiple ways to reach drawables in here in some cases - for example you can follow +this tree, or check one of the depth arrays found in tfrag. +" + ((child-count uint8 :offset 6) + (flags uint8 :offset 7) + (child drawable :offset 8) + (distance float :offset 12) + ) + ) + +;; definition for method 3 of type draw-node +(defmethod inspect ((this draw-node)) + (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 "~1Tchild-count: ~D~%" (-> this child-count)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tchild: #x~X~%" (-> this child)) + (format #t "~1Tdistance: #x~X~%" (-> this distance)) + (label cfg-4) + this + ) + +;; definition of type drawable-inline-array-node +(deftype drawable-inline-array-node (drawable-inline-array) + "Top level container for a BVH made of draw-nodes." + ((data draw-node 1 :inline) + (pad uint32) + ) + ) + +;; definition of type draw-node-dma +(deftype draw-node-dma (structure) + "DMA buffer layout for draw node culling routine, which copies draw-nodes directly to scratchpad in bulk. +This would not work with the memory layout of shrub." + ((banka draw-node 32 :inline) + (bankb draw-node 32 :inline) + ) + ) + +;; definition for method 3 of type draw-node-dma +(defmethod inspect ((this draw-node-dma)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'draw-node-dma) + (format #t "~1Tbanka[32] @ #x~X~%" (-> this banka)) + (format #t "~1Tbankb[32] @ #x~X~%" (-> this bankb)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/engine/draw/drawable-actor-h_REF.gc b/test/decompiler/reference/jak3/engine/draw/drawable-actor-h_REF.gc new file mode 100644 index 0000000000..910a5838b4 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/draw/drawable-actor-h_REF.gc @@ -0,0 +1,50 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type drawable-actor +(deftype drawable-actor (drawable) + "Wrapper around an entity-actor to put it in the drawable system. +Note that this is never used to actually draw actors - it is just used as a list of all entity-actors +for the entity/birth system." + ((actor entity-actor :offset 8) + ) + ) + +;; definition for method 3 of type drawable-actor +(defmethod inspect ((this drawable-actor)) + (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 "~1Tactor: ~A~%" (-> this actor)) + (label cfg-4) + this + ) + +;; definition of type drawable-tree-actor +(deftype drawable-tree-actor (drawable-tree) + "Adapater for putting the actors in the tree-array." + () + ) + +;; definition of type drawable-inline-array-actor +(deftype drawable-inline-array-actor (drawable-inline-array) + "Array of drawable-actors." + ((data drawable-actor 1 :inline) + (pad uint8 4) + ) + ) + +;; definition for method 10 of type drawable-tree-actor +;; WARN: Return type mismatch int vs none. +(defmethod draw ((this drawable-tree-actor) (arg0 drawable-tree-actor) (arg1 display-frame)) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/draw/drawable-group-h_REF.gc b/test/decompiler/reference/jak3/engine/draw/drawable-group-h_REF.gc new file mode 100644 index 0000000000..5ff66b8209 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/draw/drawable-group-h_REF.gc @@ -0,0 +1,39 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type drawable-group +(deftype drawable-group (drawable) + "Base class for an array of references to other drawables. +These are typically used for very high-level organization of drawable." + ((length int16 :offset 6) + (data drawable :dynamic) + ) + (:methods + (new (symbol type int) _type_) + ) + ) + +;; definition for method 3 of type drawable-group +(defmethod inspect ((this drawable-group)) + (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)) + ) + (label cfg-7) + this + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/engine/draw/drawable-h_REF.gc b/test/decompiler/reference/jak3/engine/draw/drawable-h_REF.gc new file mode 100644 index 0000000000..bf1dd7f467 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/draw/drawable-h_REF.gc @@ -0,0 +1,66 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type drawable +(deftype drawable (basic) + "Base class for `drawable` scene graph system. +This base class is really abused in many ways, and the meaning of the various methods differ depending +on the exact type. Not even the ID and bsphere here are always populated. +This is used for very high level organization of different rendering data types, and also very low-level +culling/rendering optimizations. It supports both array-of-references and inline-array containers with precise +control over memory layout for use with DMA." + ((id int16) + (bsphere vector :inline) + ) + (:methods + (drawable-method-9 () none) + (draw (_type_ _type_ display-frame) none) + (drawable-method-11 () none) + (drawable-method-12 () none) + (drawable-method-13 () none) + (drawable-method-14 () none) + (drawable-method-15 () none) + (drawable-method-16 () none) + ) + ) + +;; definition for method 3 of type drawable +(defmethod inspect ((this drawable)) + (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)) + (label cfg-4) + this + ) + +;; definition of type drawable-error +(deftype drawable-error (drawable) + "A drawable which just represents an error. When drawn, it simply displays a sphere with an error message." + ((name string) + ) + ) + +;; definition for method 3 of type drawable-error +(defmethod inspect ((this drawable-error)) + (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 "~1Tname: ~A~%" (-> this name)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/engine/draw/drawable-inline-array-h_REF.gc b/test/decompiler/reference/jak3/engine/draw/drawable-inline-array-h_REF.gc new file mode 100644 index 0000000000..eae834268e --- /dev/null +++ b/test/decompiler/reference/jak3/engine/draw/drawable-inline-array-h_REF.gc @@ -0,0 +1,29 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type drawable-inline-array +(deftype drawable-inline-array (drawable) + ((length int16 :offset 6) + ) + ) + +;; definition for method 3 of type drawable-inline-array +(defmethod inspect ((this drawable-inline-array)) + (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 "~1Tlength: ~D~%" (-> this length)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/engine/draw/drawable-tree-h_REF.gc b/test/decompiler/reference/jak3/engine/draw/drawable-tree-h_REF.gc new file mode 100644 index 0000000000..e52fa79674 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/draw/drawable-tree-h_REF.gc @@ -0,0 +1,24 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type drawable-tree +(deftype drawable-tree (drawable-group) + "A drawable tree is a container of drawables of a specific rendering type. +Instead of having a single large tree of mixed types, there will be a tree of tfrags, a tree of ties, etc. +The top-level tfrag tree will have a type that's a child of drawable-tree. +Generally, the object passed to a large renderer is a drawable-tree." + () + ) + +;; definition of type drawable-tree-array +(deftype drawable-tree-array (drawable-group) + "Collection of drawable trees. This might have a tfrag tree, tie tree, etc." + () + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/engine/game/main-h_REF.gc b/test/decompiler/reference/jak3/engine/game/main-h_REF.gc new file mode 100644 index 0000000000..cdba76e74a --- /dev/null +++ b/test/decompiler/reference/jak3/engine/game/main-h_REF.gc @@ -0,0 +1,487 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *stats-poly*, type symbol +(define *stats-poly* #f) + +;; definition for symbol *stats-memory*, type symbol +(define *stats-memory* #f) + +;; definition for symbol *stats-memory-short*, type symbol +(define *stats-memory-short* #f) + +;; definition for symbol *stats-memory-level-index*, type int +(define *stats-memory-level-index* 0) + +;; definition for symbol *stats-collide*, type symbol +(define *stats-collide* #f) + +;; definition for symbol *stats-bsp*, type symbol +(define *stats-bsp* #f) + +;; definition for symbol *stats-buffer*, type symbol +(define *stats-buffer* #f) + +;; definition for symbol *stats-target*, type symbol +(define *stats-target* #f) + +;; definition for symbol *stats-profile-bars*, type symbol +(define *stats-profile-bars* #f) + +;; definition for symbol *stats-perf*, type symbol +(define *stats-perf* #f) + +;; definition for symbol *artist-all-visible*, type symbol +(define *artist-all-visible* #f) + +;; definition for symbol *artist-flip-visible*, type symbol +(define *artist-flip-visible* #f) + +;; definition for symbol *artist-fix-visible*, type symbol +(define *artist-fix-visible* #f) + +;; definition for symbol *artist-fix-frustum*, type symbol +(define *artist-fix-frustum* #f) + +;; definition for symbol *artist-error-spheres*, type symbol +(define *artist-error-spheres* #f) + +;; definition for symbol *artist-use-menu-subdiv*, type symbol +(define *artist-use-menu-subdiv* #f) + +;; definition for symbol *display-profile*, type symbol +(define *display-profile* #t) + +;; definition for symbol *display-sidekick-stats*, type symbol +(define *display-sidekick-stats* #f) + +;; definition for symbol *display-quad-stats*, type symbol +(define *display-quad-stats* #f) + +;; definition for symbol *display-tri-stats*, type symbol +(define *display-tri-stats* #f) + +;; definition for symbol *display-ground-stats*, type symbol +(define *display-ground-stats* #f) + +;; definition for symbol *display-collision-marks*, type symbol +(define *display-collision-marks* #f) + +;; definition for symbol *display-collide-cache*, type symbol +(define *display-collide-cache* #f) + +;; definition for symbol *display-render-collision*, type symbol +(define *display-render-collision* #f) + +;; definition for symbol *display-hipri-collision-marks*, type symbol +(define *display-hipri-collision-marks* #f) + +;; definition for symbol *display-edge-collision-marks*, type symbol +(define *display-edge-collision-marks* #f) + +;; definition for symbol *display-geo-marks*, type symbol +(define *display-geo-marks* #f) + +;; definition for symbol *display-target-marks*, type symbol +(define *display-target-marks* #f) + +;; definition for symbol *target-rc-board-controls*, type symbol +(define *target-rc-board-controls* #f) + +;; definition for symbol *display-collide-history*, type int +(define *display-collide-history* 0) + +;; definition for symbol *amy-cam*, type symbol +(define *amy-cam* #f) + +;; definition for symbol *display-xyz-axes*, type symbol +(define *display-xyz-axes* #f) + +;; definition for symbol *display-cam-collide-history*, type symbol +(define *display-cam-collide-history* #f) + +;; definition for symbol *record-cam-collide-history*, type symbol +(define *record-cam-collide-history* #f) + +;; definition for symbol *display-cam-master-marks*, type symbol +(define *display-cam-master-marks* #f) + +;; definition for symbol *display-cam-other*, type symbol +(define *display-cam-other* #f) + +;; definition for symbol *display-camera-marks*, type symbol +(define *display-camera-marks* #f) + +;; definition for symbol *camera-no-mip-correction*, type symbol +(define *camera-no-mip-correction* #f) + +;; definition for symbol *camera-turbo-free*, type symbol +(define *camera-turbo-free* #f) + +;; definition for symbol *display-cam-los-info*, type symbol +(define *display-cam-los-info* #f) + +;; definition for symbol *display-cam-los-debug*, type symbol +(define *display-cam-los-debug* #f) + +;; definition for symbol *display-cam-los-marks*, type symbol +(define *display-cam-los-marks* #f) + +;; definition for symbol *display-cam-coll-marks*, type symbol +(define *display-cam-coll-marks* #f) + +;; definition for symbol *display-camera-info*, type symbol +(define *display-camera-info* #f) + +;; definition for symbol *display-camera-old-stats*, type symbol +(define *display-camera-old-stats* #f) + +;; definition for symbol *display-camera-last-attacker*, type symbol +(define *display-camera-last-attacker* #f) + +;; definition for symbol *display-file-info*, type symbol +(define *display-file-info* #f) + +;; definition for symbol *display-actor-marks*, type symbol +(define *display-actor-marks* #f) + +;; definition for symbol *display-sprite-info*, type symbol +(define *display-sprite-info* #f) + +;; definition for symbol *display-sprite-marks*, type symbol +(define *display-sprite-marks* #f) + +;; definition for symbol *display-sprite-spheres*, type symbol +(define *display-sprite-spheres* #f) + +;; definition for symbol *display-entity-errors*, type symbol +(define *display-entity-errors* #t) + +;; definition for symbol *display-capture-mode*, type symbol +(define *display-capture-mode* #f) + +;; definition for symbol *display-instance-info*, type symbol +(define *display-instance-info* #f) + +;; definition for symbol *display-deci-count*, type symbol +(define *display-deci-count* #f) + +;; definition for symbol *sync-dma*, type symbol +(define *sync-dma* #f) + +;; definition for symbol *display-strip-lines*, type strip-lines-controls +(define *display-strip-lines* (the-as strip-lines-controls 0)) + +;; definition for symbol *display-battle-marks*, type symbol +(define *display-battle-marks* #f) + +;; definition for symbol *display-joint-axes*, type symbol +(define *display-joint-axes* #f) + +;; definition for symbol *display-nav-marks*, type symbol +(define *display-nav-marks* #f) + +;; definition for symbol *display-nav-network*, type symbol +(define *display-nav-network* #f) + +;; definition for symbol *display-path-marks*, type symbol +(define *display-path-marks* #f) + +;; definition for symbol *display-vol-marks*, type symbol +(define *display-vol-marks* #f) + +;; definition for symbol *display-water-marks*, type symbol +(define *display-water-marks* #f) + +;; definition for symbol *display-nav-mesh*, type symbol +(define *display-nav-mesh* #f) + +;; definition for symbol *display-race-mesh*, type symbol +(define *display-race-mesh* #f) + +;; definition for symbol *display-actor-pointer*, type symbol +(define *display-actor-pointer* #f) + +;; definition for symbol *display-actor-vis*, type symbol +(define *display-actor-vis* #f) + +;; definition for symbol *display-actor-graph*, type symbol +(define *display-actor-graph* #f) + +;; definition for symbol *display-traffic-height-map*, type symbol +(define *display-traffic-height-map* #f) + +;; definition for symbol *display-trail-graph*, type symbol +(define *display-trail-graph* #f) + +;; definition for symbol *display-color-bars*, type symbol +(define *display-color-bars* #f) + +;; definition for symbol *display-bug-report*, type symbol +(define *display-bug-report* #f) + +;; definition for symbol *display-level-border*, type symbol +(define *display-level-border* #f) + +;; definition for symbol *display-memcard-info*, type symbol +(define *display-memcard-info* #f) + +;; definition for symbol *display-split-boxes*, type symbol +(define *display-split-boxes* #f) + +;; definition for symbol *display-split-box-info*, type symbol +(define *display-split-box-info* #f) + +;; definition for symbol *display-texture-distances*, type symbol +(define *display-texture-distances* #f) + +;; definition for symbol *display-texture-download*, type symbol +(define *display-texture-download* #f) + +;; definition for symbol *display-art-control*, type symbol +(define *display-art-control* #f) + +;; definition for symbol *display-gui-control*, type symbol +(define *display-gui-control* #f) + +;; definition for symbol *display-level-spheres*, type symbol +(define *display-level-spheres* #f) + +;; definition for symbol *time-of-day-fast*, type symbol +(define *time-of-day-fast* #f) + +;; definition for symbol *display-iop-info*, type symbol +(define *display-iop-info* #f) + +;; definition for symbol *ambient-sound-class*, type symbol +(define *ambient-sound-class* #t) + +;; definition for symbol *slow-frame-rate*, type symbol +(define *slow-frame-rate* #f) + +;; definition for symbol *display-region-marks*, type symbol +(define *display-region-marks* #f) + +;; definition for symbol *execute-regions*, type symbol +(define *execute-regions* #t) + +;; definition for symbol *debug-pause*, type symbol +(define *debug-pause* #f) + +;; definition for symbol *debug-view-anims*, type symbol +(define *debug-view-anims* #f) + +;; definition for symbol *debug-unkillable*, type symbol +(define *debug-unkillable* #f) + +;; definition for symbol *debug-player-vehicle-unkillable*, type symbol +(define *debug-player-vehicle-unkillable* #f) + +;; definition for symbol *debug-actor*, type object +(define *debug-actor* (the-as object #f)) + +;; definition for symbol *gun-marks*, type symbol +(define *gun-marks* #f) + +;; definition for symbol *bug-report-output-mode*, type symbol +(define *bug-report-output-mode* (if *debug-segment* + 'file-stream + '*stdcon* + ) + ) + +;; definition for symbol *display-scene-control*, type scene-controls +(define *display-scene-control* (the-as scene-controls 0)) + +;; definition for symbol *display-bot-marks*, type bot-marks-controls +(define *display-bot-marks* (the-as bot-marks-controls 0)) + +;; definition for symbol *display-race-marks*, type race-marks-controls +(define *display-race-marks* (the-as race-marks-controls 0)) + +;; definition for symbol *race-record-path*, type symbol +(define *race-record-path* #f) + +;; definition for symbol *select-race*, type race-selection +(define *select-race* (the-as race-selection 0)) + +;; definition for symbol *select-race-path*, type int +(define *select-race-path* 0) + +;; definition for symbol *bot-record-path*, type int +(define *bot-record-path* -1) + +;; definition for symbol *subdivide-draw-mode*, type subdivide-setting +(define *subdivide-draw-mode* (the-as subdivide-setting 0)) + +;; definition for symbol *subdivide-scissor-draw-mode*, type subdivide-setting +(define *subdivide-scissor-draw-mode* (the-as subdivide-setting 0)) + +;; definition for symbol *subdivide-foreground-draw-mode*, type subdivide-setting +(define *subdivide-foreground-draw-mode* (the-as subdivide-setting 0)) + +;; definition for symbol *subdivide-ocean-draw-mode*, type subdivide-setting +(define *subdivide-ocean-draw-mode* (the-as subdivide-setting 0)) + +;; definition for symbol *ocean-height-hack*, type ocean-height-hack +(define *ocean-height-hack* (the-as ocean-height-hack 0)) + +;; definition (perm) for symbol *dproc*, type process +(define-perm *dproc* process #f) + +;; definition for symbol *run*, type symbol +(define *run* #f) + +;; definition for symbol *teleport*, type symbol +(define *teleport* #f) + +;; definition for symbol *teleport-count*, type int +(define *teleport-count* 0) + +;; definition for symbol *draw-hook*, type (function none) +(define *draw-hook* nothing) + +;; definition for symbol *debug-hook*, type pair +(define *debug-hook* '()) + +;; definition for symbol *menu-hook*, type (function debug-menu-context) +(define *menu-hook* (the-as (function debug-menu-context) nothing)) + +;; definition for symbol *progress-hook*, type (function none) +(define *progress-hook* nothing) + +;; definition for symbol *dma-timeout-hook*, type (function none) +(define *dma-timeout-hook* nothing) + +;; definition of type frame-stats +(deftype frame-stats (structure) + ((field-time time-frame 2) + (field int32) + ) + ) + +;; definition for method 3 of type frame-stats +(defmethod inspect ((this frame-stats)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'frame-stats) + (format #t "~1Tfield-time[2] @ #x~X~%" (-> this field-time)) + (format #t "~1Tfield: ~D~%" (-> this field)) + (label cfg-4) + this + ) + +;; definition for symbol *frame-stats*, type frame-stats +(define *frame-stats* (new 'static 'frame-stats)) + +;; definition of type screen-filter +(deftype screen-filter (basic) + ((draw? symbol) + (bucket int32) + (depth int32) + (ztest uint64) + (color vector :inline) + (color-src vector :inline) + (color-dest vector :inline) + (extra vector :inline) + (speed float :overlay-at (-> extra data 0)) + (current-interp float :overlay-at (-> extra data 1)) + (lock-vsync? basic) + ) + (:methods + (draw (_type_) none) + (setup (_type_ vector vector float bucket-id) none) + (disable (_type_) none) + ) + ) + +;; definition for method 3 of type screen-filter +(defmethod inspect ((this screen-filter)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tdraw?: ~A~%" (-> this draw?)) + (format #t "~1Tbucket: ~D~%" (-> this bucket)) + (format #t "~1Tdepth: #x~X~%" (-> this depth)) + (format #t "~1Tztest: #x~X~%" (-> this ztest)) + (format #t "~1Tcolor: #~%" (-> this color)) + (format #t "~1Tcolor-src: #~%" (-> this color-src)) + (format #t "~1Tcolor-dest: #~%" (-> this color-dest)) + (format #t "~1Textra: #~%" (-> this extra)) + (format #t "~1Tspeed: ~f~%" (-> this extra x)) + (format #t "~1Tcurrent-interp: ~f~%" (-> this extra y)) + (format #t "~1Tlock-vsync?: ~A~%" (-> this lock-vsync?)) + (label cfg-4) + this + ) + +;; definition of type col-rend +(deftype col-rend (basic) + ((draw? symbol) + (outline? symbol) + (show-back-faces? symbol) + (show-normals? symbol) + (ghost-hidden? symbol) + (show-only uint32) + (cspec collide-spec) + (track uint8) + (bbox-radius float) + (bbox-center vector :inline) + (camera-to-bbox-dist float) + ) + (:methods + (col-rend-method-9 () none) + ) + ) + +;; definition for method 3 of type col-rend +(defmethod inspect ((this col-rend)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tdraw?: ~A~%" (-> this draw?)) + (format #t "~1Toutline?: ~A~%" (-> this outline?)) + (format #t "~1Tshow-back-faces?: ~A~%" (-> this show-back-faces?)) + (format #t "~1Tshow-normals?: ~A~%" (-> this show-normals?)) + (format #t "~1Tghost-hidden?: ~A~%" (-> this ghost-hidden?)) + (format #t "~1Tshow-only: ~D~%" (-> this show-only)) + (format #t "~1Tcspec: ~D~%" (-> this cspec)) + (format #t "~1Ttrack: ~D~%" (-> this track)) + (format #t "~1Tbbox-radius: ~f~%" (-> this bbox-radius)) + (format #t "~1Tbbox-center: #~%" (-> this bbox-center)) + (format #t "~1Tcamera-to-bbox-dist: ~f~%" (-> this camera-to-bbox-dist)) + (label cfg-4) + this + ) + +;; definition for symbol *col-rend*, type col-rend +(define *col-rend* (new 'static 'col-rend + :draw? #f + :outline? #t + :show-back-faces? #t + :show-normals? #f + :ghost-hidden? #t + :cspec (collide-spec cs3 cs4 cs5) + :track #x1 + :bbox-radius 24576.0 + :camera-to-bbox-dist 65536.0 + ) + ) + +;; definition (debug) for function debug-actor? +(defun-debug debug-actor? ((arg0 object)) + (= arg0 *debug-actor*) + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/engine/gfx/generic/generic-h_REF.gc b/test/decompiler/reference/jak3/engine/gfx/generic/generic-h_REF.gc new file mode 100644 index 0000000000..100556a24f --- /dev/null +++ b/test/decompiler/reference/jak3/engine/gfx/generic/generic-h_REF.gc @@ -0,0 +1,501 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type gsf-vertex +(deftype gsf-vertex (structure) + "Vertex used by generic. GSF = generic stripped fragment?" + ((data uint32 8) + (byte uint8 32 :overlay-at (-> data 0)) + (quad uint128 2 :overlay-at (-> data 0)) + (vt qword :inline :overlay-at (-> data 0)) + (pos vector3s :inline :overlay-at (-> data 0)) + (tex vector2uh :inline :overlay-at (-> data 3)) + (nrm vector3s :inline :overlay-at (-> data 4)) + (nc qword :inline :overlay-at (-> data 4)) + (clr vector4ub :inline :overlay-at (-> data 7)) + (dtex vector2uh :inline :overlay-at (-> data 4)) + (dclr vector4ub :inline :overlay-at (-> data 5)) + ) + ) + +;; definition for method 3 of type gsf-vertex +(defmethod inspect ((this gsf-vertex)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'gsf-vertex) + (format #t "~1Tdata[8] @ #x~X~%" (-> this data)) + (format #t "~1Tbyte[32] @ #x~X~%" (-> this data)) + (format #t "~1Tquad[2] @ #x~X~%" (-> this data)) + (format #t "~1Tvt: #~%" (-> this data)) + (format #t "~1Tpos: #~%" (-> this data)) + (format #t "~1Ttex: #~%" (&-> this vt vector4w w)) + (format #t "~1Tnrm: #~%" (-> this nrm)) + (format #t "~1Tnc: #~%" (-> this nrm)) + (format #t "~1Tclr: #~%" (&-> this nc vector4w w)) + (format #t "~1Tdtex: #~%" (-> this nrm)) + (format #t "~1Tdclr: #~%" (&-> this nrm y)) + (label cfg-4) + this + ) + +;; definition of type gsf-vertex-array +(deftype gsf-vertex-array (structure) + ((vtx gsf-vertex :dynamic) + ) + ) + +;; definition for method 3 of type gsf-vertex-array +(defmethod inspect ((this gsf-vertex-array)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'gsf-vertex-array) + (format #t "~1Tvtx[0] @ #x~X~%" (-> this vtx)) + (label cfg-4) + this + ) + +;; definition of type gsf-fx-vertex +(deftype gsf-fx-vertex (structure) + "Color/texture data only. Possibly used to share with a gsf-vertex with +the same position/normal." + ((clr vector4ub :inline) + (tex vector2uh :inline) + ) + ) + +;; definition for method 3 of type gsf-fx-vertex +(defmethod inspect ((this gsf-fx-vertex)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'gsf-fx-vertex) + (format #t "~1Tclr: #~%" (-> this clr)) + (format #t "~1Ttex: #~%" (-> this tex)) + (label cfg-4) + this + ) + +;; definition of type gsf-fx-vertex-array +(deftype gsf-fx-vertex-array (structure) + ((data gsf-fx-vertex :dynamic) + ) + ) + +;; definition for method 3 of type gsf-fx-vertex-array +(defmethod inspect ((this gsf-fx-vertex-array)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'gsf-fx-vertex-array) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) + (label cfg-4) + this + ) + +;; definition of type gsf-header +(deftype gsf-header (structure) + "Header for generic data." + ((num-strips uint8) + (num-new-vtxs uint8) + (num-dps uint16) + (num-vtxs uint16) + (strip-table uint8 10) + ) + ) + +;; definition for method 3 of type gsf-header +(defmethod inspect ((this gsf-header)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'gsf-header) + (format #t "~1Tnum-strips: ~D~%" (-> this num-strips)) + (format #t "~1Tnum-new-vtxs: ~D~%" (-> this num-new-vtxs)) + (format #t "~1Tnum-dps: ~D~%" (-> this num-dps)) + (format #t "~1Tnum-vtxs: ~D~%" (-> this num-vtxs)) + (format #t "~1Tstrip-table[10] @ #x~X~%" (-> this strip-table)) + (label cfg-4) + this + ) + +;; definition of type gsf-ik +(deftype gsf-ik (structure) + ((index uint8) + (no-kick uint8) + ) + ) + +;; definition for method 3 of type gsf-ik +(defmethod inspect ((this gsf-ik)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'gsf-ik) + (format #t "~1Tindex: ~D~%" (-> this index)) + (format #t "~1Tno-kick: ~D~%" (-> this no-kick)) + (label cfg-4) + this + ) + +;; definition of type gsf-info +(deftype gsf-info (structure) + ((ptr-iks uint32) + (ptr-verts uint32) + (ptr-fx uint32) + (dummy2 uint32) + ) + ) + +;; definition for method 3 of type gsf-info +(defmethod inspect ((this gsf-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'gsf-info) + (format #t "~1Tptr-iks: #x~X~%" (-> this ptr-iks)) + (format #t "~1Tptr-verts: #x~X~%" (-> this ptr-verts)) + (format #t "~1Tptr-fx: #x~X~%" (-> this ptr-fx)) + (format #t "~1Tdummy2: ~D~%" (-> this dummy2)) + (label cfg-4) + this + ) + +;; definition of type gsf-buffer +(deftype gsf-buffer (structure) + ((data uint8 8192) + (info gsf-info :inline :overlay-at (-> data 0)) + (header gsf-header :inline :overlay-at (-> data 16)) + (work-area uint8 :dynamic :overlay-at (-> data 32)) + ) + ) + +;; definition for method 3 of type gsf-buffer +(defmethod inspect ((this gsf-buffer)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'gsf-buffer) + (format #t "~1Tdata[8192] @ #x~X~%" (-> this data)) + (format #t "~1Tinfo: #~%" (-> this data)) + (format #t "~1Theader: #~%" (-> this header)) + (format #t "~1Twork-area[0] @ #x~X~%" (-> this work-area)) + (label cfg-4) + this + ) + +;; definition of type generic-frag +(deftype generic-frag (structure) + ((start-pos uint16) + (end-pos uint16) + ) + ) + +;; definition for method 3 of type generic-frag +(defmethod inspect ((this generic-frag)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'generic-frag) + (format #t "~1Tstart-pos: ~D~%" (-> this start-pos)) + (format #t "~1Tend-pos: ~D~%" (-> this end-pos)) + (label cfg-4) + this + ) + +;; definition of type generic-strip +(deftype generic-strip (structure) + ((pos uint16) + (len uint16) + ) + ) + +;; definition for method 3 of type generic-strip +(defmethod inspect ((this generic-strip)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'generic-strip) + (format #t "~1Tpos: ~D~%" (-> this pos)) + (format #t "~1Tlen: ~D~%" (-> this len)) + (label cfg-4) + this + ) + +;; definition of type generic-envmap-saves +(deftype generic-envmap-saves (structure) + ((index-mask vector4w :inline) + (verts uint128 12) + (kicks uint128 4) + ) + ) + +;; definition for method 3 of type generic-envmap-saves +(defmethod inspect ((this generic-envmap-saves)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'generic-envmap-saves) + (format #t "~1Tindex-mask: #~%" (-> this index-mask)) + (format #t "~1Tverts[12] @ #x~X~%" (-> this verts)) + (format #t "~1Tkicks[4] @ #x~X~%" (-> this kicks)) + (label cfg-4) + this + ) + +;; definition of type generic-interp-job +(deftype generic-interp-job (structure) + ((job-type uint16) + (num uint16) + (first uint16) + (pad uint16) + (ptr-data uint32) + (morph-z uint16) + (morph-w uint16) + ) + :pack-me + ) + +;; definition for method 3 of type generic-interp-job +(defmethod inspect ((this generic-interp-job)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'generic-interp-job) + (format #t "~1Tjob-type: ~D~%" (-> this job-type)) + (format #t "~1Tnum: ~D~%" (-> this num)) + (format #t "~1Tfirst: ~D~%" (-> this first)) + (format #t "~1Tpad: ~D~%" (-> this pad)) + (format #t "~1Tptr-data: #x~X~%" (-> this ptr-data)) + (format #t "~1Tmorph-z: ~D~%" (-> this morph-z)) + (format #t "~1Tmorph-w: ~D~%" (-> this morph-w)) + (label cfg-4) + this + ) + +;; definition of type generic-saves +(deftype generic-saves (structure) + ((ptr-dma uint32) + (ptr-vtxs uint32) + (ptr-clrs uint32) + (ptr-texs uint32) + (ptr-env-clrs uint32) + (ptr-env-texs uint32) + (cur-outbuf uint32) + (ptr-fx-buf uint32) + (xor-outbufs uint32) + (num-dps uint32) + (qwc uint32) + (gsf-buf gsf-buffer) + (ptr-shaders uint32) + (ptr-env-shader uint32) + (is-envmap uint16) + (is-translucent uint16) + (basep uint32) + (ptr-interp-job generic-interp-job) + (gifbuf-adr uint32) + (inbuf-adr uint32) + (fade-val uint32) + (time-of-day-color rgba) + (to-vu0-waits uint32) + (to-spr-waits uint32) + (from-spr-waits uint32) + (envmap generic-envmap-saves :inline) + ) + ) + +;; definition for method 3 of type generic-saves +(defmethod inspect ((this generic-saves)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'generic-saves) + (format #t "~1Tptr-dma: #x~X~%" (-> this ptr-dma)) + (format #t "~1Tptr-vtxs: #x~X~%" (-> this ptr-vtxs)) + (format #t "~1Tptr-clrs: #x~X~%" (-> this ptr-clrs)) + (format #t "~1Tptr-texs: #x~X~%" (-> this ptr-texs)) + (format #t "~1Tptr-env-clrs: #x~X~%" (-> this ptr-env-clrs)) + (format #t "~1Tptr-env-texs: #x~X~%" (-> this ptr-env-texs)) + (format #t "~1Tcur-outbuf: #x~X~%" (-> this cur-outbuf)) + (format #t "~1Tptr-fx-buf: ~D~%" (-> this ptr-fx-buf)) + (format #t "~1Txor-outbufs: ~D~%" (-> this xor-outbufs)) + (format #t "~1Tnum-dps: ~D~%" (-> this num-dps)) + (format #t "~1Tqwc: ~D~%" (-> this qwc)) + (format #t "~1Tgsf-buf: #~%" (-> this gsf-buf)) + (format #t "~1Tptr-shaders: #x~X~%" (-> this ptr-shaders)) + (format #t "~1Tptr-env-shader: ~D~%" (-> this ptr-env-shader)) + (format #t "~1Tis-envmap: ~D~%" (-> this is-envmap)) + (format #t "~1Tis-translucent: ~D~%" (-> this is-translucent)) + (format #t "~1Tbasep: #x~X~%" (-> this basep)) + (format #t "~1Tptr-interp-job: #~%" (-> this ptr-interp-job)) + (format #t "~1Tgifbuf-adr: ~D~%" (-> this gifbuf-adr)) + (format #t "~1Tinbuf-adr: ~D~%" (-> this inbuf-adr)) + (format #t "~1Tfade-val: ~D~%" (-> this fade-val)) + (format #t "~1Ttime-of-day-color: ~D~%" (-> this time-of-day-color)) + (format #t "~1Tto-vu0-waits: ~D~%" (-> this to-vu0-waits)) + (format #t "~1Tto-spr-waits: ~D~%" (-> this to-spr-waits)) + (format #t "~1Tfrom-spr-waits: ~D~%" (-> this from-spr-waits)) + (format #t "~1Tenvmap: #~%" (-> this envmap)) + (label cfg-4) + this + ) + +;; definition of type generic-gif-tag +(deftype generic-gif-tag (structure) + ((data uint32 4) + (qword qword :inline :overlay-at (-> data 0)) + (fan-prim gif-tag-prim :overlay-at (-> data 0)) + (str-prim gif-tag-prim :overlay-at (-> data 1)) + (regs gif-tag-regs-32 :overlay-at (-> data 2)) + (num-strips uint32 :overlay-at (-> data 3)) + ) + ) + +;; definition for method 3 of type generic-gif-tag +(defmethod inspect ((this generic-gif-tag)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'generic-gif-tag) + (format #t "~1Tdata[4] @ #x~X~%" (-> this data)) + (format #t "~1Tqword: #~%" (-> this data)) + (format #t "~1Tfan-prim: ~D~%" (-> this fan-prim)) + (format #t "~1Tstr-prim: ~D~%" (-> this str-prim)) + (format #t "~1Tregs: ~D~%" (-> this regs)) + (format #t "~1Tnum-strips: ~D~%" (-> this num-strips)) + (label cfg-4) + this + ) + +;; definition of type generic-envmap-consts +(deftype generic-envmap-consts (structure) + ((consts vector :inline) + (strgif generic-gif-tag :inline) + (colors vector4w :inline) + (shader adgif-shader :inline) + ) + ) + +;; definition for method 3 of type generic-envmap-consts +(defmethod inspect ((this generic-envmap-consts)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'generic-envmap-consts) + (format #t "~1Tconsts: #~%" (-> this consts)) + (format #t "~1Tstrgif: #~%" (-> this strgif)) + (format #t "~1Tcolors: #~%" (-> this colors)) + (format #t "~1Tshader: #~%" (-> this shader)) + (label cfg-4) + this + ) + +;; definition of type generic-consts +(deftype generic-consts (structure) + ((dma-header dma-packet :inline) + (vif-header uint32 4) + (dma-ref-vtxs dma-packet :inline) + (dma-cnt-call dma-packet :inline) + (matrix matrix :inline) + (base-strgif generic-gif-tag :inline) + (alpha-opaque gs-adcmd :inline) + (alpha-translucent gs-adcmd :inline) + (ztest-normal gs-adcmd :inline) + (ztest-opaque gs-adcmd :inline) + (adcmd-offsets uint8 16) + (stcycle-tag uint32) + (unpack-vtx-tag uint32) + (unpack-clr-tag uint32) + (unpack-tex-tag uint32) + (mscal-tag uint32) + (flush-tag uint32) + (reset-cycle-tag uint32) + (dummy0 uint32) + (dma-tag-cnt uint64) + (envmap generic-envmap-consts :inline) + (light-consts vector :inline) + (texture-offset uint16 8) + ) + ) + +;; definition for method 3 of type generic-consts +(defmethod inspect ((this generic-consts)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'generic-consts) + (format #t "~1Tdma-header: #~%" (-> this dma-header)) + (format #t "~1Tvif-header[4] @ #x~X~%" (-> this vif-header)) + (format #t "~1Tdma-ref-vtxs: #~%" (-> this dma-ref-vtxs)) + (format #t "~1Tdma-cnt-call: #~%" (-> this dma-cnt-call)) + (format #t "~1Tmatrix: #~%" (-> this matrix)) + (format #t "~1Tbase-strgif: #~%" (-> this base-strgif)) + (format #t "~1Talpha-opaque: #~%" (-> this alpha-opaque)) + (format #t "~1Talpha-translucent: #~%" (-> this alpha-translucent)) + (format #t "~1Tztest-normal: #~%" (-> this ztest-normal)) + (format #t "~1Tztest-opaque: #~%" (-> this ztest-opaque)) + (format #t "~1Tadcmd-offsets[16] @ #x~X~%" (-> this adcmd-offsets)) + (format #t "~1Tadcmds[4] @ #x~X~%" (-> this alpha-opaque)) + (format #t "~1Tstcycle-tag: ~D~%" (-> this stcycle-tag)) + (format #t "~1Tunpack-vtx-tag: ~D~%" (-> this unpack-vtx-tag)) + (format #t "~1Tunpack-clr-tag: ~D~%" (-> this unpack-clr-tag)) + (format #t "~1Tunpack-tex-tag: ~D~%" (-> this unpack-tex-tag)) + (format #t "~1Tmscal-tag: ~D~%" (-> this mscal-tag)) + (format #t "~1Tflush-tag: ~D~%" (-> this flush-tag)) + (format #t "~1Treset-cycle-tag: ~D~%" (-> this reset-cycle-tag)) + (format #t "~1Tdummy0: ~D~%" (-> this dummy0)) + (format #t "~1Tdma-tag-cnt: ~D~%" (-> this dma-tag-cnt)) + (format #t "~1Tenvmap: #~%" (-> this envmap)) + (format #t "~1Tlight-consts: #~%" (-> this light-consts)) + (format #t "~1Ttexture-offset[8] @ #x~X~%" (-> this texture-offset)) + (label cfg-4) + this + ) + +;; definition of type generic-storage +(deftype generic-storage (structure) + ((data uint128 16) + ) + ) + +;; definition for method 3 of type generic-storage +(defmethod inspect ((this generic-storage)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'generic-storage) + (format #t "~1Tdata[16] @ #x~X~%" (-> this data)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(kmemopen global "gsf-buffer") + +;; definition for symbol *gsf-buffer*, type object +(define *gsf-buffer* (the-as object (kmalloc global 9216 (kmalloc-flags align-64) "malloc"))) + +;; failed to figure out what this is: +(kmemclose) + + + + diff --git a/test/decompiler/reference/jak3/engine/gfx/generic/generic-vu1-h_REF.gc b/test/decompiler/reference/jak3/engine/gfx/generic/generic-vu1-h_REF.gc new file mode 100644 index 0000000000..791c7184b4 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/gfx/generic/generic-vu1-h_REF.gc @@ -0,0 +1,189 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type pris-mtx +(deftype pris-mtx (structure) + "Matrix for merc rendering. Named after the earlier 'pris' renderer. +Contains a transformation matrix for vertices, one for normals, and a scale. +This matrix is likely not used by generic VU1, but is used by the merc -> generic converter." + ((data float 32) + (vector vector 8 :overlay-at (-> data 0)) + (t-mtx matrix :inline :overlay-at (-> data 0)) + (n-mtx matrix3 :inline :overlay-at (-> data 16)) + (scale vector :inline :overlay-at (-> data 28)) + ) + ) + +;; definition for method 3 of type pris-mtx +(defmethod inspect ((this pris-mtx)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'pris-mtx) + (format #t "~1Tdata[32] @ #x~X~%" (-> this data)) + (format #t "~1Tvector[8] @ #x~X~%" (-> this data)) + (format #t "~1Tt-mtx: #~%" (-> this data)) + (format #t "~1Tn-mtx: #~%" (-> this n-mtx)) + (format #t "~1Tscale: #~%" (-> this scale)) + (label cfg-4) + this + ) + +;; definition of type generic-pris-mtx-save +(deftype generic-pris-mtx-save (structure) + ((loc-mtx pris-mtx :inline) + (par-mtx pris-mtx :inline) + (dif-mtx pris-mtx :inline) + ) + ) + +;; definition for method 3 of type generic-pris-mtx-save +(defmethod inspect ((this generic-pris-mtx-save)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'generic-pris-mtx-save) + (format #t "~1Tloc-mtx: #~%" (-> this loc-mtx)) + (format #t "~1Tpar-mtx: #~%" (-> this par-mtx)) + (format #t "~1Tdif-mtx: #~%" (-> this dif-mtx)) + (label cfg-4) + this + ) + +;; definition of type generic-constants +(deftype generic-constants (structure) + "Constant data sent to VU1 for generic rendering." + ((fog vector :inline) + (adgif gs-gif-tag :inline) + (hvdf-offset vector :inline) + (hmge-scale vector :inline) + (invh-scale vector :inline) + (guard vector :inline) + (flush qword :inline) + (stores qword :inline) + ) + ) + +;; definition for method 3 of type generic-constants +(defmethod inspect ((this generic-constants)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'generic-constants) + (format #t "~1Tfog: #~%" (-> this fog)) + (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 "~1Tguard: #~%" (-> this guard)) + (format #t "~1Tflush: #~%" (-> this flush)) + (format #t "~1Tstores: #~%" (-> this stores)) + (label cfg-4) + this + ) + +;; definition of type generic-shrub-constants +(deftype generic-shrub-constants (structure) + ((shrub-giftag generic-gif-tag :inline) + (shrub-adnop qword :inline) + ) + ) + +;; definition for method 3 of type generic-shrub-constants +(defmethod inspect ((this generic-shrub-constants)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'generic-shrub-constants) + (format #t "~1Tshrub-giftag: #~%" (-> this shrub-giftag)) + (format #t "~1Tshrub-adnop: #~%" (-> this shrub-adnop)) + (label cfg-4) + this + ) + +;; definition of type gcf-shader +(deftype gcf-shader (structure) + ((adgif uint128 5) + (shader adgif-shader :inline :overlay-at (-> adgif 0)) + (pos uint32 :offset 12) + (num uint32 :offset 28) + ) + ) + +;; definition for method 3 of type gcf-shader +(defmethod inspect ((this gcf-shader)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'gcf-shader) + (format #t "~1Tadgif[5] @ #x~X~%" (-> this adgif)) + (format #t "~1Tshader: #~%" (-> this adgif)) + (format #t "~1Tpos: ~D~%" (-> this pos)) + (format #t "~1Tnum: ~D~%" (-> this num)) + (label cfg-4) + this + ) + +;; definition of type gcf-control +(deftype 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 :dynamic) + ) + ) + +;; definition for method 3 of type gcf-control +(defmethod inspect ((this gcf-control)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this '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[0] @ #x~X~%" (-> this shader)) + (label cfg-4) + this + ) + +;; definition of type gcf-vertex +(deftype gcf-vertex (structure) + ((tex vector4w :inline) + (clr gs-packed-rgba :inline) + (pos gs-packed-xyzw :inline) + ) + ) + +;; definition for method 3 of type gcf-vertex +(defmethod inspect ((this gcf-vertex)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'gcf-vertex) + (format #t "~1Ttex: #~%" (-> this tex)) + (format #t "~1Tclr: #~%" (-> this clr)) + (format #t "~1Tpos: #~%" (-> this pos)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/engine/gfx/tie/generic-tie-h_REF.gc b/test/decompiler/reference/jak3/engine/gfx/tie/generic-tie-h_REF.gc new file mode 100644 index 0000000000..b4ea1340ca --- /dev/null +++ b/test/decompiler/reference/jak3/engine/gfx/tie/generic-tie-h_REF.gc @@ -0,0 +1,657 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type generic-tie-instance +(deftype generic-tie-instance (structure) + ((matrix-tag dma-packet :inline) + (matrix-data vector 6 :inline) + (index-tag dma-packet :inline) + (indices uint8 224) + (end-tag dma-packet :inline) + ) + ) + +;; definition for method 3 of type generic-tie-instance +(defmethod inspect ((this generic-tie-instance)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'generic-tie-instance) + (format #t "~1Tmatrix-tag: #~%" (-> this matrix-tag)) + (format #t "~1Tmatrix-data[6] @ #x~X~%" (-> this matrix-data)) + (format #t "~1Tindex-tag: #~%" (-> this index-tag)) + (format #t "~1Tindices[224] @ #x~X~%" (-> this indices)) + (format #t "~1Tend-tag: #~%" (-> this end-tag)) + (label cfg-4) + this + ) + +;; definition of type generic-tie-input +(deftype generic-tie-input (structure) + ((palette-tag dma-packet :inline) + (palette rgba 128) + (model-tag dma-packet :inline) + (model vector 146 :inline) + (matrix-tag dma-packet :inline) + (matrix-data vector 6 :inline) + (index-tag dma-packet :inline) + (indices uint8 224) + (end-tag dma-packet :inline) + ) + ) + +;; definition for method 3 of type generic-tie-input +(defmethod inspect ((this generic-tie-input)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'generic-tie-input) + (format #t "~1Tpalette-tag: #~%" (-> this palette-tag)) + (format #t "~1Tpalette[128] @ #x~X~%" (-> this palette)) + (format #t "~1Tmodel-tag: #~%" (-> this model-tag)) + (format #t "~1Tmodel[146] @ #x~X~%" (-> this model)) + (format #t "~1Tmatrix-tag: #~%" (-> this matrix-tag)) + (format #t "~1Tmatrix-data[6] @ #x~X~%" (-> this matrix-data)) + (format #t "~1Tindex-tag: #~%" (-> this index-tag)) + (format #t "~1Tindices[224] @ #x~X~%" (-> this indices)) + (format #t "~1Tend-tag: #~%" (-> this end-tag)) + (label cfg-4) + this + ) + +;; definition of type generic-tie-run-control +(deftype generic-tie-run-control (structure) + ((skip-bp2 uint8) + (skip-ips uint8) + (gifbuf-skip uint8) + (strips uint8) + (target-bp1 uint8) + (target-bp2 uint8) + (target-ip1 uint8) + (target-ip2 uint8) + (target-bps uint8) + (target-ips uint8) + (is-generic uint8) + (reserved uint8) + ) + ) + +;; definition for method 3 of type generic-tie-run-control +(defmethod inspect ((this generic-tie-run-control)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'generic-tie-run-control) + (format #t "~1Tskip-bp2: ~D~%" (-> this skip-bp2)) + (format #t "~1Tskip-ips: ~D~%" (-> this skip-ips)) + (format #t "~1Tgifbuf-skip: ~D~%" (-> this gifbuf-skip)) + (format #t "~1Tstrips: ~D~%" (-> this strips)) + (format #t "~1Ttarget-bp1: ~D~%" (-> this target-bp1)) + (format #t "~1Ttarget-bp2: ~D~%" (-> this target-bp2)) + (format #t "~1Ttarget-ip1: ~D~%" (-> this target-ip1)) + (format #t "~1Ttarget-ip2: ~D~%" (-> this target-ip2)) + (format #t "~1Ttarget-bps: ~D~%" (-> this target-bps)) + (format #t "~1Ttarget-ips: ~D~%" (-> this target-ips)) + (format #t "~1Tis-generic: ~D~%" (-> this is-generic)) + (format #t "~1Treserved: ~D~%" (-> this reserved)) + (label cfg-4) + this + ) + +;; definition of type generic-tie-base-point +(deftype generic-tie-base-point (structure) + ((data uint16 8) + (quad uint128 :overlay-at (-> data 0)) + (x int16 :overlay-at (-> data 0)) + (y int16 :overlay-at (-> data 1)) + (z int16 :overlay-at (-> data 2)) + (d0 int16 :overlay-at (-> data 3)) + (vtx uint64 :overlay-at (-> data 0)) + (u int16 :overlay-at (-> data 4)) + (v int16 :overlay-at (-> data 5)) + (tex uint32 :overlay-at (-> data 4)) + (w int16 :overlay-at (-> data 6)) + (d1 int16 :overlay-at (-> data 7)) + ) + ) + +;; definition for method 3 of type generic-tie-base-point +;; INFO: Used lq/sq +(defmethod inspect ((this generic-tie-base-point)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'generic-tie-base-point) + (format #t "~1Tdata[8] @ #x~X~%" (-> this data)) + (format #t "~1Tquad: ~D~%" (-> this quad)) + (format #t "~1Tx: ~D~%" (-> this x)) + (format #t "~1Ty: ~D~%" (-> this y)) + (format #t "~1Tz: ~D~%" (-> this z)) + (format #t "~1Td0: ~D~%" (-> this d0)) + (format #t "~1Tvtx: ~D~%" (-> this vtx)) + (format #t "~1Tu: ~D~%" (-> this u)) + (format #t "~1Tv: ~D~%" (-> this v)) + (format #t "~1Ttex: ~D~%" (-> this tex)) + (format #t "~1Tw: ~D~%" (-> this w)) + (format #t "~1Td1: ~D~%" (-> this d1)) + (label cfg-4) + this + ) + +;; definition of type generic-tie-bps +(deftype generic-tie-bps (structure) + ((bp generic-tie-base-point 4 :inline) + ) + ) + +;; definition for method 3 of type generic-tie-bps +(defmethod inspect ((this generic-tie-bps)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'generic-tie-bps) + (format #t "~1Tbp[4] @ #x~X~%" (-> this bp)) + (label cfg-4) + this + ) + +;; definition of type generic-tie-interp-point +(deftype generic-tie-interp-point (structure) + ((data uint16 12) + (x int16 :overlay-at (-> data 0)) + (y int16 :overlay-at (-> data 1)) + (z int16 :overlay-at (-> data 2)) + (d0 int16 :overlay-at (-> data 3)) + (vtx0 uint64 :overlay-at (-> data 0)) + (dx int16 :overlay-at (-> data 4)) + (dy int16 :overlay-at (-> data 5)) + (dz int16 :overlay-at (-> data 6)) + (unused int16 :overlay-at (-> data 7)) + (vtx1 uint64 :overlay-at (-> data 4)) + (u int16 :overlay-at (-> data 8)) + (v int16 :overlay-at (-> data 9)) + (tex uint32 :overlay-at (-> data 8)) + (w int16 :overlay-at (-> data 10)) + (d1 int16 :overlay-at (-> data 11)) + ) + :pack-me + ) + +;; definition for method 3 of type generic-tie-interp-point +;; INFO: Used lq/sq +;; ERROR: failed type prop at 19: Could not figure out load: (set! a2 (l.q gp)) +(defmethod inspect ((a0-0 generic-tie-interp-point)) + (local-vars + (v0-0 object) + (v0-1 object) + (v0-2 none) + (v0-3 none) + (v0-4 none) + (v0-5 none) + (v0-6 none) + (v0-7 none) + (v0-8 none) + (v0-9 none) + (v0-10 none) + (v0-11 none) + (v0-12 none) + (v0-13 none) + (v0-14 none) + (v0-15 none) + (v0-16 none) + (v0-17 none) + (v0-18 generic-tie-interp-point) + (a0-1 symbol) + (a0-2 symbol) + (a0-3 symbol) + (a0-4 none) + (a0-5 none) + (a0-6 none) + (a0-7 none) + (a0-8 none) + (a0-9 none) + (a0-10 none) + (a0-11 none) + (a0-12 none) + (a0-13 none) + (a0-14 none) + (a0-15 none) + (a0-16 none) + (a0-17 none) + (a0-18 none) + (a1-0 string) + (a1-1 string) + (a1-2 string) + (a1-3 none) + (a1-4 none) + (a1-5 none) + (a1-6 none) + (a1-7 none) + (a1-8 none) + (a1-9 none) + (a1-10 none) + (a1-11 none) + (a1-12 none) + (a1-13 none) + (a1-14 none) + (a1-15 none) + (a1-16 none) + (a1-17 none) + (a2-0 generic-tie-interp-point) + (a2-1 (pointer uint16)) + (a2-2 none) + (a2-3 none) + (a2-4 none) + (a2-5 none) + (a2-6 none) + (a2-7 none) + (a2-8 none) + (a2-9 none) + (a2-10 none) + (a2-11 none) + (a2-12 none) + (a2-13 none) + (a2-14 none) + (a2-15 none) + (a2-16 none) + (a2-17 none) + (a3-0 symbol) + (t9-0 (function _varargs_ object)) + (t9-1 (function _varargs_ object)) + (t9-2 (function _varargs_ object)) + (t9-3 none) + (t9-4 none) + (t9-5 none) + (t9-6 none) + (t9-7 none) + (t9-8 none) + (t9-9 none) + (t9-10 none) + (t9-11 none) + (t9-12 none) + (t9-13 none) + (t9-14 none) + (t9-15 none) + (t9-16 none) + (t9-17 none) + ) + (if (begin (not a0-0)) + (begin (set! a0-0 a0-0) (goto cfg-4)) + ) + (set! t9-0 format) + (set! a0-1 #t) + (set! a1-0 L144) + (set! a2-0 a0-0) + (set! a3-0 'generic-tie-interp-point) + (call! a0-1 a1-0 a2-0 a3-0) + (set! t9-1 format) + (set! a0-2 #t) + (set! a1-1 L109) + (set! a2-1 (-> a0-0 data)) + (call! a0-2 a1-1 a2-1) + (set! t9-2 format) + (set! a0-3 #t) + (set! a1-2 L121) + (set! a2-2 (the-as none (l.q a0-0))) + (call!) + (set! t9-3 (the-as none format)) + (set! a0-4 (the-as none #t)) + (set! a1-3 (the-as none L120)) + (set! a2-3 (the-as none (-> a0-0 x))) + (call!) + (set! t9-4 (the-as none format)) + (set! a0-5 (the-as none #t)) + (set! a1-4 (the-as none L119)) + (set! a2-4 (the-as none (-> a0-0 y))) + (call!) + (set! t9-5 (the-as none format)) + (set! a0-6 (the-as none #t)) + (set! a1-5 (the-as none L118)) + (set! a2-5 (the-as none (-> a0-0 z))) + (call!) + (set! t9-6 (the-as none format)) + (set! a0-7 (the-as none #t)) + (set! a1-6 (the-as none L117)) + (set! a2-6 (the-as none (-> a0-0 d0))) + (call!) + (set! t9-7 (the-as none format)) + (set! a0-8 (the-as none #t)) + (set! a1-7 (the-as none L108)) + (set! a2-7 (the-as none (-> a0-0 vtx0))) + (call!) + (set! t9-8 (the-as none format)) + (set! a0-9 (the-as none #t)) + (set! a1-8 (the-as none L107)) + (set! a2-8 (the-as none (-> a0-0 dx))) + (call!) + (set! t9-9 (the-as none format)) + (set! a0-10 (the-as none #t)) + (set! a1-9 (the-as none L106)) + (set! a2-9 (the-as none (-> a0-0 dy))) + (call!) + (set! t9-10 (the-as none format)) + (set! a0-11 (the-as none #t)) + (set! a1-10 (the-as none L105)) + (set! a2-10 (the-as none (-> a0-0 dz))) + (call!) + (set! t9-11 (the-as none format)) + (set! a0-12 (the-as none #t)) + (set! a1-11 (the-as none L104)) + (set! a2-11 (the-as none (-> a0-0 unused))) + (call!) + (set! t9-12 (the-as none format)) + (set! a0-13 (the-as none #t)) + (set! a1-12 (the-as none L103)) + (set! a2-12 (the-as none (-> a0-0 vtx1))) + (call!) + (set! t9-13 (the-as none format)) + (set! a0-14 (the-as none #t)) + (set! a1-13 (the-as none L115)) + (set! a2-13 (the-as none (-> a0-0 u))) + (call!) + (set! t9-14 (the-as none format)) + (set! a0-15 (the-as none #t)) + (set! a1-14 (the-as none L114)) + (set! a2-14 (the-as none (-> a0-0 v))) + (call!) + (set! t9-15 (the-as none format)) + (set! a0-16 (the-as none #t)) + (set! a1-15 (the-as none L113)) + (set! a2-15 (the-as none (-> a0-0 tex))) + (call!) + (set! t9-16 (the-as none format)) + (set! a0-17 (the-as none #t)) + (set! a1-16 (the-as none L112)) + (set! a2-16 (the-as none (-> a0-0 w))) + (call!) + (set! t9-17 (the-as none format)) + (set! a0-18 (the-as none #t)) + (set! a1-17 (the-as none L111)) + (set! a2-17 (the-as none (-> a0-0 d1))) + (call!) + (label cfg-4) + (set! v0-18 a0-0) + (ret-value v0-18) + ) + +;; definition of type generic-tie-ips +(deftype generic-tie-ips (structure) + ((ip generic-tie-interp-point 2 :inline) + ) + ) + +;; definition for method 3 of type generic-tie-ips +(defmethod inspect ((this generic-tie-ips)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'generic-tie-ips) + (format #t "~1Tip[2] @ #x~X~%" (-> this ip)) + (label cfg-4) + this + ) + +;; definition of type generic-tie-header +(deftype generic-tie-header (structure) + ((effect uint8) + (interp-table-size uint8) + (num-bps uint8) + (num-ips uint8) + (tint-color uint32) + (index-table-offset uint16) + (kick-table-offset uint16) + (normal-table-offset uint16) + (interp-table-offset uint16) + (gsf-header gsf-header :inline) + ) + ) + +;; definition for method 3 of type generic-tie-header +(defmethod inspect ((this generic-tie-header)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'generic-tie-header) + (format #t "~1Teffect: ~D~%" (-> this effect)) + (format #t "~1Tinterp-table-size: ~D~%" (-> this interp-table-size)) + (format #t "~1Tnum-bps: ~D~%" (-> this num-bps)) + (format #t "~1Tnum-ips: ~D~%" (-> this num-ips)) + (format #t "~1Ttint-color: ~D~%" (-> this tint-color)) + (format #t "~1Tindex-table-offset: ~D~%" (-> this index-table-offset)) + (format #t "~1Tkick-table-offset: ~D~%" (-> this kick-table-offset)) + (format #t "~1Tnormal-table-offset: ~D~%" (-> this normal-table-offset)) + (format #t "~1Tinterp-table-offset: ~D~%" (-> this interp-table-offset)) + (format #t "~1Tgsf-header: #~%" (-> this gsf-header)) + (label cfg-4) + this + ) + +;; definition of type generic-tie-matrix +(deftype generic-tie-matrix (structure) + ((matrix matrix :inline) + (morph vector :inline) + (fog qword :inline) + ) + ) + +;; definition for method 3 of type generic-tie-matrix +(defmethod inspect ((this generic-tie-matrix)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'generic-tie-matrix) + (format #t "~1Tmatrix: #~%" (-> this matrix)) + (format #t "~1Tmorph: #~%" (-> this morph)) + (format #t "~1Tfog: #~%" (-> this fog)) + (label cfg-4) + this + ) + +;; definition of type generic-tie-normal +(deftype generic-tie-normal (structure) + ((x int8) + (y int8) + (z int8) + (dummy int8) + ) + ) + +;; definition for method 3 of type generic-tie-normal +(defmethod inspect ((this generic-tie-normal)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'generic-tie-normal) + (format #t "~1Tx: ~D~%" (-> this x)) + (format #t "~1Ty: ~D~%" (-> this y)) + (format #t "~1Tz: ~D~%" (-> this z)) + (format #t "~1Tdummy: ~D~%" (-> this dummy)) + (label cfg-4) + this + ) + +;; definition of type generic-tie-control +(deftype generic-tie-control (structure) + ((ptr-palette uint32) + (ptr-shaders uint32) + (ptr-runctrl generic-tie-run-control) + (ptr-verts uint32) + (ptr-generic generic-tie-header) + (ptr-dps uint32) + (ptr-kicks uint32) + (ptr-normals uint32) + (ptr-interp uint32) + (ptr-mtxs generic-tie-matrix) + (ptr-cinds uint32) + (next-instance uint32) + (next-model uint32) + (next-is-model uint32) + (tie-type uint32) + ) + ) + +;; definition for method 3 of type generic-tie-control +(defmethod inspect ((this generic-tie-control)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'generic-tie-control) + (format #t "~1Tptr-palette: #x~X~%" (-> this ptr-palette)) + (format #t "~1Tptr-shaders: #x~X~%" (-> this ptr-shaders)) + (format #t "~1Tptr-runctrl: #~%" (-> this ptr-runctrl)) + (format #t "~1Tptr-verts: #x~X~%" (-> this ptr-verts)) + (format #t "~1Tptr-generic: #~%" (-> this ptr-generic)) + (format #t "~1Tptr-dps: #x~X~%" (-> this ptr-dps)) + (format #t "~1Tptr-kicks: #x~X~%" (-> this ptr-kicks)) + (format #t "~1Tptr-normals: #x~X~%" (-> this ptr-normals)) + (format #t "~1Tptr-interp: #x~X~%" (-> this ptr-interp)) + (format #t "~1Tptr-mtxs: #~%" (-> this ptr-mtxs)) + (format #t "~1Tptr-cinds: #x~X~%" (-> this ptr-cinds)) + (format #t "~1Tnext-instance: #x~X~%" (-> this next-instance)) + (format #t "~1Tnext-model: #x~X~%" (-> this next-model)) + (format #t "~1Tnext-is-model: ~D~%" (-> this next-is-model)) + (format #t "~1Ttie-type: ~D~%" (-> this tie-type)) + (label cfg-4) + this + ) + +;; definition of type generic-tie-stats +(deftype generic-tie-stats (structure) + ((num-bps uint32) + (num-ips uint32) + (num-dps uint32) + (num-shaders uint32) + (num-models uint32) + (num-instances uint32) + (num-waits uint32) + (num-qwc uint32) + (max-qwc uint32) + ) + ) + +;; definition for method 3 of type generic-tie-stats +(defmethod inspect ((this generic-tie-stats)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'generic-tie-stats) + (format #t "~1Tnum-bps: ~D~%" (-> this num-bps)) + (format #t "~1Tnum-ips: ~D~%" (-> this num-ips)) + (format #t "~1Tnum-dps: ~D~%" (-> this num-dps)) + (format #t "~1Tnum-shaders: ~D~%" (-> this num-shaders)) + (format #t "~1Tnum-models: ~D~%" (-> this num-models)) + (format #t "~1Tnum-instances: ~D~%" (-> this num-instances)) + (format #t "~1Tnum-waits: ~D~%" (-> this num-waits)) + (format #t "~1Tnum-qwc: ~D~%" (-> this num-qwc)) + (format #t "~1Tmax-qwc: ~D~%" (-> this max-qwc)) + (label cfg-4) + this + ) + +;; definition of type generic-tie-calls +(deftype generic-tie-calls (structure) + ((generic-prepare-dma-double basic) + (generic-envmap-dproc basic) + (generic-interp-dproc basic) + (generic-no-light-dproc basic) + ) + :pack-me + ) + +;; definition for method 3 of type generic-tie-calls +(defmethod inspect ((this generic-tie-calls)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'generic-tie-calls) + (format #t "~1Tgeneric-prepare-dma-double: ~A~%" (-> this generic-prepare-dma-double)) + (format #t "~1Tgeneric-envmap-dproc: ~A~%" (-> this generic-envmap-dproc)) + (format #t "~1Tgeneric-interp-dproc: ~A~%" (-> this generic-interp-dproc)) + (format #t "~1Tgeneric-no-light-dproc: ~A~%" (-> this generic-no-light-dproc)) + (label cfg-4) + this + ) + +;; definition of type generic-tie-shadow +(deftype generic-tie-shadow (structure) + ((out-buf gsf-buffer) + (cur-buf uint32) + (tie-type int32) + (ptr-inst uint32) + (ptr-buf uint32) + (inst-xor int32) + (end-of-chain uint32) + (write-limit uint32) + (calls generic-tie-calls :inline) + ) + :pack-me + ) + +;; definition for method 3 of type generic-tie-shadow +(defmethod inspect ((this generic-tie-shadow)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'generic-tie-shadow) + (format #t "~1Tout-buf: #~%" (-> this out-buf)) + (format #t "~1Tcur-buf: #x~X~%" (-> this cur-buf)) + (format #t "~1Ttie-type: ~D~%" (-> this tie-type)) + (format #t "~1Tptr-inst: #x~X~%" (-> this ptr-inst)) + (format #t "~1Tptr-buf: #x~X~%" (-> this ptr-buf)) + (format #t "~1Tinst-xor: ~D~%" (-> this inst-xor)) + (format #t "~1Tend-of-chain: ~D~%" (-> this end-of-chain)) + (format #t "~1Twrite-limit: ~D~%" (-> this write-limit)) + (format #t "~1Tcalls: #~%" (-> this calls)) + (label cfg-4) + this + ) + +;; definition of type generic-tie-work +(deftype generic-tie-work (structure) + ((control generic-tie-control :inline) + (interp-job generic-interp-job :inline) + (shadow generic-tie-shadow :inline) + (input-a generic-tie-input :inline) + (input-b generic-tie-input :inline) + (inst-buf generic-tie-instance :inline) + (palette-buf rgba 128) + ) + ) + +;; definition for method 3 of type generic-tie-work +(defmethod inspect ((this generic-tie-work)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'generic-tie-work) + (format #t "~1Tcontrol: #~%" (-> this control)) + (format #t "~1Tinterp-job: #~%" (-> this interp-job)) + (format #t "~1Tshadow: #~%" (-> this shadow)) + (format #t "~1Tinput-a: #~%" (-> this input-a)) + (format #t "~1Tinput-b: #~%" (-> this input-b)) + (format #t "~1Tinst-buf: #~%" (-> this inst-buf)) + (format #t "~1Tpalette-buf[128] @ #x~X~%" (-> this palette-buf)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/engine/level/region-h_REF.gc b/test/decompiler/reference/jak3/engine/level/region-h_REF.gc new file mode 100644 index 0000000000..62dec25d5d --- /dev/null +++ b/test/decompiler/reference/jak3/engine/level/region-h_REF.gc @@ -0,0 +1,266 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type region +(deftype region (structure) + "A region is a closed volume that you can, enter, exit, and be inside. +This stores a unique, and script functions for a single region. +These are stored separately from the actual geometry to allow the geometry to be smaller +and fit in scratchpad/cache better." + ((id uint32) + (on-enter pair) + (on-inside pair) + (on-exit pair) + ) + (:methods + (point-in-region-debug! (_type_ vector) symbol) + ) + ) + +;; definition for method 3 of type region +(defmethod inspect ((this region)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'region) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Ton-enter: ~A~%" (-> this on-enter)) + (format #t "~1Ton-inside: ~A~%" (-> this on-inside)) + (format #t "~1Ton-exit: ~A~%" (-> this on-exit)) + (label cfg-4) + this + ) + +;; definition of type region-array +(deftype region-array (inline-array-class) + "Array of region." + ((data region :inline :dynamic) + ) + ) + +;; definition for method 3 of type region-array +(defmethod inspect ((this region-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! (-> region-array heap-base) (the-as uint 16)) + +;; definition of type drawable-region-prim +(deftype drawable-region-prim (drawable) + "Base class for a region + geometry. +Note that all child classes of this must be 32-bytes." + ((region region :offset 8) + ) + (:methods + (debug-draw-region (_type_ int) none) + (track-region (_type_ region-prim-area) symbol) + (within-area? (_type_ region-prim-area) symbol) + ) + ) + +;; definition for method 3 of type drawable-region-prim +(defmethod inspect ((this drawable-region-prim)) + (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 "~1Tregion: #~%" (-> this region)) + (label cfg-4) + this + ) + +;; definition of type drawable-tree-region-prim +(deftype drawable-tree-region-prim (drawable-tree) + "Top-level container for all regions of a level." + ((name basic :offset 8) + (data2 drawable-inline-array :dynamic :offset 32) + ) + (:methods + (drawable-tree-region-prim-method-17 (_type_ vector) symbol) + (debug-print (_type_ vector object) none) + ) + ) + +;; definition for method 3 of type drawable-tree-region-prim +(defmethod inspect ((this drawable-tree-region-prim)) + (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 data2)) + (dotimes (s5-0 (-> this length)) + (format #t "~T [~D]~1Tdata: ~A~%" s5-0 (-> this data2 s5-0)) + ) + (format #t "~1Tname: ~A~%" (-> this name)) + (label cfg-7) + this + ) + +;; definition of type drawable-inline-array-region-prim +(deftype drawable-inline-array-region-prim (drawable-inline-array) + "Inline array of drawable-region-prim. This actually stores child classes, but they are +exactly the same size as the parent, so it's okay." + ((data drawable-region-prim 1 :inline) + (pad uint8 4) + ) + ) + +;; definition of type drawable-region-sphere +(deftype drawable-region-sphere (drawable-region-prim) + "Region where the bsphere of the drawable is the volume." + () + ) + +;; definition for method 3 of type drawable-region-sphere +(defmethod inspect ((this drawable-region-sphere)) + (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 "~1Tregion: #~%" (-> this region)) + (label cfg-4) + this + ) + +;; definition of type region-face-data +(deftype region-face-data (structure) + "Data to store a single planar face, as a normal and list of vertices." + ((normal vector :inline) + (normal-offset float :overlay-at (-> normal data 3)) + (num-points uint32) + (points vector :inline :dynamic) + ) + ) + +;; definition for method 3 of type region-face-data +(defmethod inspect ((this region-face-data)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'region-face-data) + (format #t "~1Tnormal: #~%" (-> this normal)) + (format #t "~1Tnormal-offset: ~f~%" (-> this normal w)) + (format #t "~1Tnum-points: ~D~%" (-> this num-points)) + (format #t "~1Tpoints[0] @ #x~X~%" (-> this points)) + (label cfg-4) + this + ) + +;; definition of type drawable-region-face +(deftype drawable-region-face (drawable-region-prim) + "A drawable-region which is just a face. Unclear if `on-inside` is used." + ((data region-face-data :offset 12) + ) + ) + +;; definition for method 3 of type drawable-region-face +(defmethod inspect ((this drawable-region-face)) + (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 "~1Tregion: #~%" (-> this region)) + (format #t "~1Tdata: #~%" (-> this data)) + (label cfg-4) + this + ) + +;; definition of type region-face-array +(deftype region-face-array (inline-array-class) + "An array of faces that hopefully make a closed volume." + ((data drawable-region-face :inline :dynamic :offset 16) + (pad uint32) + ) + ) + +;; definition for method 3 of type region-face-array +(defmethod inspect ((this region-face-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! (-> region-face-array heap-base) (the-as uint 32)) + +;; definition of type drawable-region-volume +(deftype drawable-region-volume (drawable-region-prim) + "A drawable-region which is a bunch of faces that represent a closed volume." + ((faces region-face-array :offset 12) + ) + ) + +;; definition for method 3 of type drawable-region-volume +(defmethod inspect ((this drawable-region-volume)) + (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 "~1Tregion: #~%" (-> this region)) + (format #t "~1Tfaces: ~A~%" (-> this faces)) + (label cfg-4) + this + ) + +;; definition of type region-prim-list +(deftype region-prim-list (structure) + "A list of drawable-region-prim. This is the return type of queries like `which regions contain this point?`" + ((num-items int32) + (items drawable-region-prim 320) + ) + ) + +;; definition for method 3 of type region-prim-list +(defmethod inspect ((this region-prim-list)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'region-prim-list) + (format #t "~1Tnum-items: ~D~%" (-> this num-items)) + (format #t "~1Titems[320] @ #x~X~%" (-> this items)) + (label cfg-4) + this + ) + +;; 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 8ddf6f7c7c..63222abf2b 100644 --- a/test/offline/config/jak3/config.jsonc +++ b/test/offline/config/jak3/config.jsonc @@ -55,7 +55,8 @@ // sky (multiple definition) "(method 3 sky-vertex)", // texture - "(method 9 texture-page-dir)", "set-dirty-mask!" + "(method 9 texture-page-dir)", "set-dirty-mask!", + "(method 3 generic-tie-interp-point)" ], "skip_compile_states": {}