mirror of
https://github.com/open-goal/jak-project
synced 2026-06-06 11:47:44 -04:00
[jak3] More headers again again (#3359)
collide-cache-h, collide-h, projectile-h, background-h, subdivide-h, hfrag-h, shrubbery-h, tfrag-h, tie-h
This commit is contained in:
+592
-621
File diff suppressed because it is too large
Load Diff
@@ -335,5 +335,18 @@
|
||||
"joint-mod-blend-world-callback": [[[1, 150], "gp", "joint-mod-blend-world"]],
|
||||
"(top-level-login eye-h)": [[77, "a3", "eye-control"]],
|
||||
"entity-actor-lookup": [["_stack_", 16, "res-tag"]],
|
||||
"entity-actor-count": [["_stack_", 16, "res-tag"]]
|
||||
"entity-actor-count": [["_stack_", 16, "res-tag"]],
|
||||
"(method 3 collide-query)": [[116, "f0", "float"], [137, "f0", "float"]],
|
||||
"shrubbery-login-post-texture": [
|
||||
[[13, 15], "a3", "qword"],
|
||||
[16, "a3", "pointer"],
|
||||
[24, "a3", "pointer"],
|
||||
[[17, 23], "a3", "qword"],
|
||||
[[13, 23], "a1", "qword"],
|
||||
[14, "a2", "qword"],
|
||||
[[27, 29], "a3", "qword"],
|
||||
[[27, 29], "a1", "qword"],
|
||||
[[35, 37], "a3", "qword"],
|
||||
[[35, 37], "a2", "qword"]
|
||||
]
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
;; name in dgo: cam-interface-h
|
||||
;; dgos: GAME
|
||||
|
||||
(define-extern math-camera-matrix (function matrix))
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
(define-perm *camera-init-mat* matrix #f)
|
||||
|
||||
@@ -5,5 +5,143 @@
|
||||
;; name in dgo: collide-cache-h
|
||||
;; dgos: GAME
|
||||
|
||||
(defenum prim-type
|
||||
:type int8
|
||||
(prim -2)
|
||||
(sphere -1)
|
||||
(group 0)
|
||||
(mesh 1)
|
||||
(fake-prim 2)
|
||||
)
|
||||
|
||||
(declare-type collide-cache-prim structure)
|
||||
(declare-type collide-using-spheres-params structure)
|
||||
(declare-type instance-tie structure)
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
(deftype collide-puss-sphere (structure)
|
||||
"A query sphere from the user for the porbe-using-spheres query.
|
||||
This is used internally by the collide-cache implementation."
|
||||
((bsphere sphere :inline)
|
||||
(bbox4w bounding-box4w :inline)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype collide-puss-work (structure)
|
||||
"Scratchpad memory map for probe-using-spheres query."
|
||||
((closest-pt vector :inline)
|
||||
(tri-normal vector :inline)
|
||||
(tri-bbox4w bounding-box4w :inline)
|
||||
(spheres-bbox4w bounding-box4w :inline)
|
||||
(spheres collide-puss-sphere 64 :inline)
|
||||
)
|
||||
(:methods
|
||||
(check-mesh-prim-against-spheres (_type_ collide-cache-prim collide-using-spheres-params) symbol)
|
||||
(check-sphere-prim-against-spheres (_type_ collide-cache-prim collide-using-spheres-params) symbol)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype collide-cache-tri (structure)
|
||||
"A single triangle inside the collision cache.
|
||||
Contains a reference back to the source object (like a collide-shape or water-control), and the prim itself."
|
||||
((vertex vector 3 :inline)
|
||||
(extra-quad uint8 16)
|
||||
(pat pat-surface :overlay-at (-> extra-quad 0))
|
||||
(collide-ptr basic :overlay-at (-> extra-quad 4))
|
||||
(prim-index uint16 :overlay-at (-> extra-quad 8))
|
||||
(user16 uint16 :overlay-at (-> extra-quad 10))
|
||||
(user32 uint32 :overlay-at (-> extra-quad 12))
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype collide-cache-prim (structure)
|
||||
"A primitive inside the collide-cache.
|
||||
This can represent a sphere, a triangle mesh, or a group of other primitives within a bounding sphere."
|
||||
((prim-core collide-prim-core :inline)
|
||||
(extra-quad uint8 16)
|
||||
(ccache collide-cache :overlay-at (-> extra-quad 0))
|
||||
(prim collide-shape-prim :overlay-at (-> extra-quad 4))
|
||||
(first-tri uint16 :overlay-at (-> extra-quad 8))
|
||||
(num-tris uint16 :overlay-at (-> extra-quad 10))
|
||||
(unused uint8 4 :overlay-at (-> extra-quad 12))
|
||||
(world-sphere vector :inline :overlay-at (-> prim-core world-sphere))
|
||||
(collide-as collide-spec :overlay-at (-> prim-core collide-as))
|
||||
(action collide-action :overlay-at (-> prim-core action))
|
||||
(prim-type prim-type :overlay-at (-> prim-core prim-type))
|
||||
)
|
||||
(:methods
|
||||
(collide-cache-prim-method-9 () none)
|
||||
(collide-cache-prim-method-10 () none)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype collide-cache (basic)
|
||||
"The collide-cache is a structure to accelerate collision queries.
|
||||
In particular, it helps with queries where you don't know what you might hit.
|
||||
It can detect collision with the background geometry, foreground dynamic collision shapes (spheres and meshes), and water.
|
||||
To use it, it must first be 'filled' with geometry. Then you can manually inspect the geometry, or use one of the queries.
|
||||
The supported queries are 'line-sphere' (raycast) and 'spheres' (check if intersecting anything).
|
||||
It is not useful for ollision queries against a specific foreground object, like 'am I on top of platform X right now?'."
|
||||
((num-tris int32)
|
||||
(num-prims int32)
|
||||
(ignore-mask pat-surface)
|
||||
(ignore-processes process 2)
|
||||
(collide-box bounding-box :inline)
|
||||
(collide-box4w bounding-box4w :inline)
|
||||
(collide-with collide-spec)
|
||||
(unused uint32)
|
||||
(prims collide-cache-prim 100 :inline)
|
||||
(tris collide-cache-tri 461 :inline)
|
||||
)
|
||||
(:methods
|
||||
(collide-cache-method-9 () none)
|
||||
(collide-cache-method-10 () none)
|
||||
(collide-cache-method-11 () none)
|
||||
(collide-cache-method-12 () none)
|
||||
(collide-cache-method-13 () none)
|
||||
(collide-cache-method-14 () none)
|
||||
(collide-cache-method-15 () none)
|
||||
(collide-cache-method-16 () none)
|
||||
(collide-cache-method-17 () none)
|
||||
(collide-cache-method-18 () none)
|
||||
(collide-cache-method-19 () none)
|
||||
(collide-cache-method-20 () none)
|
||||
(collide-cache-method-21 () none)
|
||||
(collide-cache-method-22 () none)
|
||||
(collide-cache-method-23 () none)
|
||||
(collide-cache-method-24 () none)
|
||||
(collide-cache-method-25 () none)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype collide-list-item (structure)
|
||||
"Entry on the broad-phase collision list.
|
||||
Can represent instanced collision, as a TIE instance, or a single non-instanced mesh fragment."
|
||||
((mesh instance-tie)
|
||||
(inst basic)
|
||||
)
|
||||
:pack-me
|
||||
)
|
||||
|
||||
|
||||
(deftype collide-list (structure)
|
||||
"List of items returned by the broad-phase collision query."
|
||||
((num-items int32)
|
||||
(items collide-list-item 256 :inline :offset 16)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(kmemopen global "collide-cache-buffers")
|
||||
|
||||
(define-perm *collide-cache* collide-cache (new 'global 'collide-cache))
|
||||
|
||||
(define-perm *collide-list* collide-list (new 'global 'collide-list))
|
||||
|
||||
(kmemclose)
|
||||
|
||||
@@ -7,3 +7,48 @@
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
(deftype collide-query (structure)
|
||||
"Very general collision-query structure. The meaning is different depending on where it used.
|
||||
This has both inputs from the user, and collision results."
|
||||
((best-other-tri collide-tri-result :inline)
|
||||
(best-my-tri collide-tri-result :inline :overlay-at best-other-tri)
|
||||
(ignore-processes process-tree 2)
|
||||
(ignore-process0 process-tree :overlay-at (-> ignore-processes 0))
|
||||
(ignore-process1 process-tree :overlay-at (-> ignore-processes 1))
|
||||
(ignore-pat pat-surface)
|
||||
(collide-with collide-spec)
|
||||
(overlay-params uint32 3 :offset 112)
|
||||
(bbox bounding-box :inline)
|
||||
(bbox4w bounding-box4w :inline)
|
||||
(bsphere sphere :inline)
|
||||
(start-pos vector :inline)
|
||||
(move-dist vector :inline)
|
||||
(rlength vector :inline)
|
||||
(exit-planes plane 2)
|
||||
(radius float :offset 268)
|
||||
(inv-mat matrix :inline :offset 288)
|
||||
(spheres (inline-array sphere) :overlay-at (-> overlay-params 0))
|
||||
(num-spheres uint32 :overlay-at (-> overlay-params 1))
|
||||
(solid-only symbol :overlay-at (-> overlay-params 2))
|
||||
(best-dist float :overlay-at spheres)
|
||||
(best-other-prim collide-shape-prim :overlay-at num-spheres)
|
||||
(best-my-prim collide-shape-prim :overlay-at solid-only)
|
||||
(move-vec vector :inline :overlay-at move-dist)
|
||||
(best-u float :overlay-at best-dist)
|
||||
(action-mask collide-action :offset 352)
|
||||
(local-box4w bounding-box4w :inline)
|
||||
(search-box bounding-box4w :inline)
|
||||
(search-vector vector4w :inline)
|
||||
(instance-mat matrix :inline)
|
||||
(instance-ptr basic)
|
||||
(x-addr uint32)
|
||||
(x-step uint32)
|
||||
(y-addr uint32)
|
||||
(y-step uint32)
|
||||
(z-addr uint32)
|
||||
(z-step uint32)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(define *collide-test-flag* #f)
|
||||
|
||||
@@ -18,7 +18,7 @@ control over memory layout for use with DMA."
|
||||
(bsphere vector :inline)
|
||||
)
|
||||
(:methods
|
||||
(drawable-method-9 () none)
|
||||
(login (_type_) _type_)
|
||||
(draw (_type_ _type_ display-frame) none)
|
||||
(drawable-method-11 () none)
|
||||
(drawable-method-12 () none)
|
||||
|
||||
@@ -7,3 +7,25 @@
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
(deftype background-work (basic)
|
||||
"List of all things for the background renderer to draw."
|
||||
((tfrag-tree-count int32)
|
||||
(tfrag-trees drawable-tree-tfrag 11)
|
||||
(tfrag-levels level 11)
|
||||
(tfrag-trans-tree-count int32)
|
||||
(tfrag-trans-trees drawable-tree-tfrag-trans 11)
|
||||
(tfrag-trans-levels level 11)
|
||||
(tfrag-water-tree-count int32)
|
||||
(tfrag-water-trees drawable-tree-tfrag-water 11)
|
||||
(tfrag-water-levels level 11)
|
||||
(shrub-tree-count int32)
|
||||
(shrub-trees drawable-tree-instance-shrub 11)
|
||||
(shrub-levels level 11)
|
||||
(tie-tree-count int32)
|
||||
(tie-trees drawable-tree-instance-tie 11)
|
||||
(tie-levels level 11)
|
||||
(tie-generic basic 11)
|
||||
(tie-generic-trans basic 11)
|
||||
(wait-to-vu0 uint32)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -7,3 +7,434 @@
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
(deftype adgif-shader-array (inline-array-class)
|
||||
((data adgif-shader :inline :dynamic)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(set! (-> adgif-shader-array heap-base) (the-as uint 80))
|
||||
|
||||
(deftype hfrag-montage (structure)
|
||||
((data uint16 16)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype hfrag-bucket (structure)
|
||||
((next uint32)
|
||||
(count uint16)
|
||||
(vertex-count uint16)
|
||||
(next-scissor uint32)
|
||||
(count-scissor uint16)
|
||||
(vertex-count-scissor uint16)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype hfrag-packed-index (uint16)
|
||||
()
|
||||
)
|
||||
|
||||
(deftype hfrag-vertex (structure)
|
||||
((height uint16)
|
||||
(packed-index hfrag-packed-index)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype hfrag-vert-index (structure)
|
||||
((pos vector2ub :inline)
|
||||
(index0 uint16 :offset 2)
|
||||
(index1 uint16 :offset 4)
|
||||
(index2 uint16 :offset 6)
|
||||
)
|
||||
:pack-me
|
||||
)
|
||||
|
||||
|
||||
(deftype hfrag-poly4 (structure)
|
||||
((data hfrag-vert-index 4 :inline)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
|
||||
(deftype hfrag-poly9 (structure)
|
||||
((data hfrag-vert-index 9 :inline)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
|
||||
(deftype hfrag-poly25 (structure)
|
||||
((data hfrag-vert-index 25 :inline)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
|
||||
(deftype hfrag-poly4-chain (structure)
|
||||
((tag dma-packet :inline)
|
||||
(verts vector4w-3 4 :inline)
|
||||
(next dma-packet :inline :offset 208)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype hfrag-poly9-chain (structure)
|
||||
((tag dma-packet :inline)
|
||||
(verts vector4w-3 12 :inline)
|
||||
(next dma-packet :inline :offset 592)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype hfrag-poly25-chain (structure)
|
||||
((tag dma-packet :inline)
|
||||
(verts vector4w-3 40 :inline)
|
||||
(next dma-packet :inline)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype hfrag-cache-vertex (structure)
|
||||
((color vector4w :inline)
|
||||
(pos vector :inline)
|
||||
(clip uint32 :overlay-at (-> pos data 3))
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype hfrag-cache-line (structure)
|
||||
((data hfrag-cache-vertex 9 :inline)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype hfrag-visbits (structure)
|
||||
((data uint8 128)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype hfrag-gcf-control (structure)
|
||||
((matrix matrix :inline)
|
||||
(giftag generic-gif-tag :inline)
|
||||
(adnops gs-adcmd 2 :inline)
|
||||
(num-strips uint32 :overlay-at (-> giftag data 3))
|
||||
(num-dps uint32 :overlay-at (-> adnops 0 word 3))
|
||||
(kick-offset uint32 :offset 108)
|
||||
(shader gcf-shader :inline)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype hfrag-gcf-ctrl (structure)
|
||||
((tag dma-packet :inline)
|
||||
(control hfrag-gcf-control :inline)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype hfrag-init-packet (structure)
|
||||
((init-tmpl dma-packet :inline)
|
||||
(init-data uint32 8)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype hfrag-sprite-coord (structure)
|
||||
((pos0 vector4w :inline)
|
||||
(pos1 vector4w :inline)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype hfrag-montage-coord (structure)
|
||||
((stq0 vector4 :inline)
|
||||
(stq1 vector4 :inline)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype hfrag-sprite-packet (structure)
|
||||
((sprite-tmpl dma-gif-packet :inline)
|
||||
(color vector4w :inline)
|
||||
(tex0 vector :inline)
|
||||
(pos0 vector4w :inline)
|
||||
(tex1 vector :inline)
|
||||
(pos1 vector4w :inline)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype hfrag-tex-data (structure)
|
||||
((quad qword 3 :inline)
|
||||
(prims uint64 6 :overlay-at quad)
|
||||
(reg-0 uint8 :overlay-at (-> quad 0 data 2))
|
||||
(reg-1 uint8 :overlay-at (-> prims 3))
|
||||
(reg-2 uint8 :overlay-at (-> prims 5))
|
||||
(tex0 uint64 :overlay-at (-> quad 0 data 0))
|
||||
(tex1 uint64 :overlay-at (-> prims 2))
|
||||
(texflush uint64 :overlay-at (-> prims 4))
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
; (deftype hfrag-mip-packet (structure)
|
||||
; ((mip-tmpl dma-gif-packet :inline)
|
||||
; (tex0-1 vector :inline)
|
||||
; (tex1-1 vector :inline)
|
||||
; (texflush vector :inline)
|
||||
; (color vector4w :inline)
|
||||
; (tex0 vector :inline)
|
||||
; (pos0 vector :inline)
|
||||
; (tex1 vector :inline)
|
||||
; (pos1 vector :inline)
|
||||
; )
|
||||
; )
|
||||
|
||||
|
||||
(deftype hfrag-adgif-packet (structure)
|
||||
((adgif-tmpl dma-gif-packet :inline)
|
||||
(adgif-data adgif-shader :inline)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype hfrag-adgif-packet2 (structure)
|
||||
((adgif-tmpl dma-gif-packet :inline)
|
||||
(adgif-data adgif-shader :inline)
|
||||
(texflush uint128)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype hfrag-frame (structure)
|
||||
((quad qword 4 :inline :offset 0)
|
||||
(prims uint64 8 :overlay-at quad)
|
||||
(reg-0 uint8 :overlay-at (-> prims 1))
|
||||
(reg-1 uint8 :overlay-at (-> prims 3))
|
||||
(reg-2 uint8 :overlay-at (-> prims 5))
|
||||
(reg-3 uint8 :overlay-at (-> prims 7))
|
||||
(frame uint64 :overlay-at (-> prims 0))
|
||||
(scissor uint64 :overlay-at (-> prims 2))
|
||||
(xyoffset uint64 :overlay-at (-> prims 4))
|
||||
(test uint64 :overlay-at (-> prims 6))
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype hfrag-frame-packet (structure)
|
||||
((frame-tmpl dma-gif-packet :inline)
|
||||
(frame-data hfrag-frame :inline)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype hfragment (drawable)
|
||||
((start-corner vector :inline)
|
||||
(spheres uint32)
|
||||
(visids uint32)
|
||||
(shaders (inline-array adgif-shader))
|
||||
(colors basic)
|
||||
(montage uint32)
|
||||
(buckets-far uint32)
|
||||
(buckets-mid uint32)
|
||||
(buckets-near uint32)
|
||||
(verts uint32)
|
||||
(pat-array uint32)
|
||||
(pat-length uint16)
|
||||
(num-buckets-far uint16)
|
||||
(num-buckets-mid uint16)
|
||||
(num-buckets-near uint16)
|
||||
(size uint32 :overlay-at (-> start-corner data 3))
|
||||
)
|
||||
(:methods
|
||||
(hfragment-method-17 () none)
|
||||
(hfragment-method-18 () none)
|
||||
(hfragment-method-19 () none)
|
||||
(hfragment-method-20 () none)
|
||||
(hfragment-method-21 () none)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(defmethod login ((this hfragment))
|
||||
"Initialize the object after it is loaded."
|
||||
(dotimes (s5-0 3)
|
||||
(adgif-shader-login (-> this shaders s5-0))
|
||||
(if (> s5-0 0)
|
||||
(set! (-> this shaders s5-0 tex0 tcc) 0)
|
||||
)
|
||||
(set! (-> this shaders 1 tex0 cbp) 3904)
|
||||
(set! (-> this shaders 2 tex0 cbp) 3904)
|
||||
)
|
||||
this
|
||||
)
|
||||
|
||||
(deftype hfrag-dma (structure)
|
||||
((banka uint32 340)
|
||||
(bankb uint32 340)
|
||||
(outa uint128 227)
|
||||
(outb uint128 227)
|
||||
(cache hfrag-cache-line 8 :inline)
|
||||
(colors rgba 1024)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype hfrag-work (structure)
|
||||
((far-chaina dma-packet 6 :inline)
|
||||
(far-chainb dma-packet 6 :inline)
|
||||
(mid-chaina dma-packet 10 :inline)
|
||||
(mid-chainb dma-packet 10 :inline)
|
||||
(near-chaina dma-packet 18 :inline)
|
||||
(near-chainb dma-packet 18 :inline)
|
||||
(poly4-tmpl dma-packet 3 :inline)
|
||||
(poly9-tmpl dma-packet 3 :inline)
|
||||
(poly25-tmpl dma-packet 3 :inline)
|
||||
(init-tmpl dma-packet 3 :inline)
|
||||
(control-tmpl dma-packet 2 :inline :offset 1376)
|
||||
(heights4-tmpl dma-packet 2 :inline)
|
||||
(colors4-tmpl dma-packet 2 :inline)
|
||||
(heights9-tmpl dma-packet 2 :inline)
|
||||
(colors9-tmpl dma-packet 2 :inline)
|
||||
(heights25-tmpl dma-packet 2 :inline)
|
||||
(colors25-tmpl dma-packet 2 :inline)
|
||||
(init-vu1-tmpl dma-packet 2 :inline)
|
||||
(next-tmpl dma-packet :inline :offset 1696)
|
||||
(call-tmpl dma-packet :inline)
|
||||
(ret-tmpl dma-packet :inline)
|
||||
(next-scissor-tmpl dma-packet :inline)
|
||||
(ret-scissor-tmpl dma-packet :inline)
|
||||
(frame-tmpl dma-gif-packet :inline)
|
||||
(frames hfrag-frame 5 :inline)
|
||||
(adgif-tmpl dma-gif-packet :inline)
|
||||
(adgif-tmpl2 dma-gif-packet :inline)
|
||||
(sprite-tmpl dma-gif-packet :inline)
|
||||
(mip-tmpl dma-gif-packet :inline)
|
||||
(color uint128 6)
|
||||
(far-data hfrag-sprite-coord :inline)
|
||||
(near-data vector4w-2 16 :inline)
|
||||
(mip-data vector4w-3 7 :inline :offset 2896)
|
||||
(tex-data hfrag-tex-data 5 :offset 3120)
|
||||
(tex uint128 6 :offset 3360)
|
||||
(montage-tex-coords uint128 128 :offset 3456)
|
||||
(giftag generic-gif-tag :inline :offset 7552)
|
||||
(call-abort dma-packet :inline)
|
||||
(call-abort-vu1 dma-packet :inline)
|
||||
(shader-far adgif-shader :inline)
|
||||
(shader-mid adgif-shader :inline)
|
||||
(shader-near adgif-shader :inline)
|
||||
(stq uint128 9)
|
||||
(shader adgif-shader :inline)
|
||||
(constants vector :inline)
|
||||
(pos-temp vector4w :inline)
|
||||
(trans-temp vector :inline :overlay-at (-> pos-temp data 0))
|
||||
(dists vector :inline)
|
||||
(rdists vector :inline)
|
||||
(call-poly4-near uint32)
|
||||
(call-poly9-mid uint32)
|
||||
(call-poly9-near uint32)
|
||||
(call-poly25-far uint32)
|
||||
(call-poly25-mid uint32)
|
||||
(dma-buffer basic)
|
||||
(base uint32)
|
||||
(wait-to-spr uint32)
|
||||
(wait-from-spr uint32)
|
||||
(buffer-end uint32)
|
||||
(subdiv-index uint32)
|
||||
(scissor basic)
|
||||
(chain-ptr uint32)
|
||||
(chain-ptr-next uint32)
|
||||
(near-dist float)
|
||||
(far-dist float)
|
||||
(to-spr uint32)
|
||||
(from-spr uint32)
|
||||
(lowres-flag basic)
|
||||
(hfrag hfragment :inline)
|
||||
(next-far int16)
|
||||
(next-far-mid int16)
|
||||
(next-mid int16)
|
||||
(next-near-mid int16)
|
||||
(next-near int16)
|
||||
(next-far-scissor int16)
|
||||
(next-near-mid-scissor int16)
|
||||
(next-near-scissor int16)
|
||||
(count-far int16)
|
||||
(count-far-mid int16)
|
||||
(count-mid int16)
|
||||
(count-near-mid int16)
|
||||
(count-near int16)
|
||||
(count-far-scissor int16)
|
||||
(count-near-mid-scissor int16)
|
||||
(count-near-scissor int16)
|
||||
(size-far int32)
|
||||
(size-far-mid int32)
|
||||
(size-mid int32)
|
||||
(size-near-mid int32)
|
||||
(size-near int32)
|
||||
(size-far-scissor int32)
|
||||
(size-near-mid-scissor int32)
|
||||
(size-near-scissor int32)
|
||||
(size-texture int32)
|
||||
(poly-far hfrag-poly25)
|
||||
(poly-mid25 uint32)
|
||||
(poly-mid uint32)
|
||||
(poly-near uint32)
|
||||
(far-texture uint32)
|
||||
(near-textures uint16 16)
|
||||
(draw-table uint16 1024 :offset 8456)
|
||||
(corners uint128 1024)
|
||||
)
|
||||
(:methods
|
||||
(hfrag-work-method-9 () none)
|
||||
(hfrag-work-method-10 () none)
|
||||
(hfrag-work-method-11 () none)
|
||||
(hfrag-work-method-12 () none)
|
||||
(hfrag-work-method-13 () none)
|
||||
(hfrag-work-method-14 () none)
|
||||
(hfrag-work-method-15 () none)
|
||||
(hfrag-work-method-16 () none)
|
||||
(hfrag-work-method-17 () none)
|
||||
(hfrag-work-method-18 () none)
|
||||
(hfrag-work-method-19 () none)
|
||||
(hfrag-work-method-20 () none)
|
||||
(hfrag-work-method-21 () none)
|
||||
(hfrag-work-method-22 () none)
|
||||
(hfrag-work-method-23 () none)
|
||||
(hfrag-work-method-24 () none)
|
||||
(hfrag-work-method-25 () none)
|
||||
(hfrag-work-method-26 () none)
|
||||
(hfrag-work-method-27 () none)
|
||||
(hfrag-work-method-28 () none)
|
||||
(hfrag-work-method-29 () none)
|
||||
(hfrag-work-method-30 () none)
|
||||
(hfrag-work-method-31 () none)
|
||||
(hfrag-work-method-32 () none)
|
||||
(hfrag-work-method-33 () none)
|
||||
(hfrag-work-method-34 () none)
|
||||
(hfrag-work-method-35 () none)
|
||||
)
|
||||
)
|
||||
|
||||
(deftype hfrag-mip-packet (structure)
|
||||
((mip-tmpl dma-gif-packet :inline)
|
||||
(tex0-1 vector :inline)
|
||||
(tex1-1 vector :inline)
|
||||
(texflush vector :inline)
|
||||
(color vector4w :inline)
|
||||
(tex0 vector :inline)
|
||||
(pos0 vector :inline)
|
||||
(tex1 vector :inline)
|
||||
(pos1 vector :inline)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype hfrag-mip-packet-array (structure)
|
||||
((data hfrag-mip-packet 6 :inline)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -7,3 +7,150 @@
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
(deftype subdivide-settings (basic)
|
||||
"Input settings for distances for switching mesh level of details.
|
||||
These are set by the level code and read by rendering code."
|
||||
((dist float 5)
|
||||
(meters float 5)
|
||||
(close float 12)
|
||||
(far float 12)
|
||||
)
|
||||
(:methods
|
||||
(new (symbol type float float) _type_)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(defmethod new subdivide-settings ((allocation symbol) (type-to-make type) (arg0 float) (arg1 float))
|
||||
(let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size)))))
|
||||
(dotimes (v1-2 10)
|
||||
(set! (-> v0-0 close v1-2) arg0)
|
||||
(set! (-> v0-0 far v1-2) arg1)
|
||||
)
|
||||
v0-0
|
||||
)
|
||||
)
|
||||
|
||||
(deftype subdivide-dists (structure)
|
||||
"Unused subdivide distances. Internally, tfrag/tie figure these out instead."
|
||||
((data uint32 32 :offset 0)
|
||||
(vector vector 8 :overlay-at (-> data 0))
|
||||
(k0s uint128 4 :overlay-at (-> data 0))
|
||||
(k1s uint128 4 :overlay-at (-> data 16))
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype terrain-stats (structure)
|
||||
"Desptie the name `terrain-stats`, these are more general triangle stats for all renderers."
|
||||
((pris tr-stat :inline)
|
||||
(tie-generic tr-stat :inline)
|
||||
(tie-vanish tr-stat :inline)
|
||||
(tie tr-stat :inline)
|
||||
(tie-scissor tr-stat :inline)
|
||||
(tie-envmap tr-stat :inline)
|
||||
(tie-envmap-scissor tr-stat :inline)
|
||||
(tie-trans tr-stat :inline)
|
||||
(tie-scissor-trans tr-stat :inline)
|
||||
(tie-envmap-trans tr-stat :inline)
|
||||
(tie-envmap-scissor-trans tr-stat :inline)
|
||||
(tie-water tr-stat :inline)
|
||||
(tie-scissor-water tr-stat :inline)
|
||||
(tie-envmap-water tr-stat :inline)
|
||||
(tie-envmap-scissor-water tr-stat :inline)
|
||||
(shrub-near tr-stat :inline)
|
||||
(shrub tr-stat :inline)
|
||||
(tfrag-scissor tr-stat :inline)
|
||||
(tfrag tr-stat :inline)
|
||||
(billboard tr-stat :inline)
|
||||
(tfrag-trans tr-stat :inline)
|
||||
(tfrag-scissor-trans tr-stat :inline)
|
||||
(tfrag-water tr-stat :inline)
|
||||
(tfrag-scissor-water tr-stat :inline)
|
||||
(trans-pris tr-stat :inline)
|
||||
(trans-shrub tr-stat :inline)
|
||||
(ocean-mid tr-stat :inline)
|
||||
(ocean-near tr-stat :inline)
|
||||
(shadow tr-stat :inline)
|
||||
(hfrag tr-stat :inline)
|
||||
(total tr-stat :inline)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype background-area (structure)
|
||||
"Scratchpad memory layout for most background rendering
|
||||
This uses the full scratchpad so it should only be used when the stack isn't on the scratchpad (rendering code).
|
||||
Interestingly, dma-area went from a union of all the -dma types to a plain array of bytes in jak 3."
|
||||
((dma-area uint8 14336)
|
||||
(vis-list uint8 2048)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype foreground-area (structure)
|
||||
"Scratchpad memory layout for most foreground rendering."
|
||||
((generic-work generic-work :inline :offset 0)
|
||||
(foreground-work foreground-work :inline :offset 0)
|
||||
(joint-work joint-work :inline :offset 0)
|
||||
(bone-mem bone-memory :inline :offset 0)
|
||||
(shadow-work shadow-work :inline :offset 0)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype region-prim-area (structure)
|
||||
"Scratchpad memory layout for regions."
|
||||
((region-prim-list region-prim-list :inline)
|
||||
(pos vector :inline)
|
||||
(ray vector :inline :offset 1328)
|
||||
(region-enter-count int32 :offset 1360)
|
||||
(region-enter-list region 320)
|
||||
(region-enter-prim-list drawable-region-sphere 320)
|
||||
(region-exit-count int32)
|
||||
(region-exit-list region 320)
|
||||
(region-exit-prim-list drawable-region-sphere 320)
|
||||
(region-inside-count int32)
|
||||
(region-inside-list region 320)
|
||||
(region-inside-prim-list drawable-region-sphere 320)
|
||||
(region-start-count int32)
|
||||
(region-start-list region 320)
|
||||
(region-start-prim-list drawable-region-sphere 320)
|
||||
)
|
||||
(:methods
|
||||
(region-prim-area-method-9 () none)
|
||||
(region-prim-area-method-10 () none)
|
||||
(region-prim-area-method-11 () none)
|
||||
(region-prim-area-method-12 () none)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype sprite-area (structure)
|
||||
"Scratchpad memory layout for sprites."
|
||||
((clock-data vector 22 :inline)
|
||||
(buffer uint8 :dynamic)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype work-area (structure)
|
||||
"All scratchpad memory layouts."
|
||||
((background background-area :inline :offset 0)
|
||||
(foreground foreground-area :inline :offset 0)
|
||||
(region-prim region-prim-area :inline :offset 0)
|
||||
(sprite sprite-area :inline :offset 0)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype terrain-context (structure)
|
||||
"Useless wrapper around work-area. (this added some stuff in jak 1)"
|
||||
((work work-area :inline)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(define *terrain-stats* (new 'global 'terrain-stats))
|
||||
|
||||
(define *collide-stats* (new 'global 'collide-stats))
|
||||
|
||||
@@ -7,3 +7,210 @@
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
(deftype tfragment-stats (structure)
|
||||
"Triangle and vertex stats for a single tfragment."
|
||||
((num-tris uint16 4)
|
||||
(num-dverts uint16 4)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype tfragment-debug-data (structure)
|
||||
"Optional debug information (stats, lines) for a tfragment."
|
||||
((stats tfragment-stats :inline)
|
||||
(debug-lines (array vector-array))
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype generic-tfragment (structure)
|
||||
"Unused. Could have been a way to render tfrag's through generic."
|
||||
((dummy int32)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype tfragment (drawable)
|
||||
"A tfrag mesh fragment. This is just references to DMA data, plus some metadata."
|
||||
((color-index uint16 :offset 6)
|
||||
(debug-data tfragment-debug-data :offset 8)
|
||||
(color-indices uint32 :offset 12)
|
||||
(colors uint32 :overlay-at color-indices)
|
||||
(dma-chain uint32 3 :offset 32)
|
||||
(dma-common uint32 :overlay-at (-> dma-chain 0))
|
||||
(dma-level-0 uint32 :overlay-at dma-common)
|
||||
(dma-base uint32 :overlay-at (-> dma-chain 1))
|
||||
(dma-level-1 uint32 :overlay-at (-> dma-chain 2))
|
||||
(dma-qwc uint8 4 :offset 44)
|
||||
(shader (inline-array adgif-shader) :offset 48)
|
||||
(num-shaders uint8 :offset 52)
|
||||
(num-base-colors uint8 :offset 53)
|
||||
(num-level0-colors uint8 :offset 54)
|
||||
(num-level1-colors uint8 :offset 55)
|
||||
(color-offset uint8 :offset 56)
|
||||
(color-count uint8 :offset 57)
|
||||
(texture-masks-index uint16 :offset 58)
|
||||
(generic generic-tfragment :offset 60)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype drawable-inline-array-tfrag (drawable-inline-array)
|
||||
"Array of tfragments"
|
||||
((data tfragment 1 :inline)
|
||||
(pad uint32)
|
||||
)
|
||||
)
|
||||
|
||||
(deftype drawable-inline-array-tfrag-trans (drawable-inline-array-tfrag)
|
||||
((data2 tfragment 1 :inline)
|
||||
(pad2 uint32)
|
||||
)
|
||||
)
|
||||
|
||||
(deftype drawable-inline-array-tfrag-water (drawable-inline-array-tfrag)
|
||||
((data2 tfragment 1 :inline)
|
||||
(pad2 uint32)
|
||||
)
|
||||
)
|
||||
|
||||
(deftype drawable-tree-tfrag (drawable-tree)
|
||||
"top level tfrag tree."
|
||||
((time-of-day-pal time-of-day-palette :offset 12)
|
||||
(arrays drawable-inline-array :dynamic :offset 32)
|
||||
)
|
||||
)
|
||||
|
||||
(deftype drawable-tree-tfrag-trans (drawable-tree-tfrag)
|
||||
()
|
||||
)
|
||||
|
||||
(deftype drawable-tree-tfrag-water (drawable-tree-tfrag-trans)
|
||||
()
|
||||
)
|
||||
|
||||
(deftype tfrag-dists (structure)
|
||||
"Distances for mesh level-of-detail blending for use on VU1."
|
||||
((data uint32 16)
|
||||
(vector vector 4 :overlay-at (-> data 0))
|
||||
(k0s vector 2 :overlay-at (-> data 0))
|
||||
(k1s vector 2 :overlay-at (-> data 8))
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype tfrag-data (structure)
|
||||
"Constants for VU1 data memory for tfrag rendering."
|
||||
((data uint32 56)
|
||||
(vector vector 14 :overlay-at (-> data 0))
|
||||
(fog vector :inline :overlay-at (-> data 0))
|
||||
(val vector :inline :overlay-at (-> data 4))
|
||||
(strgif gs-gif-tag :inline :overlay-at (-> data 8))
|
||||
(fangif gs-gif-tag :inline :overlay-at (-> data 12))
|
||||
(adgif gs-gif-tag :inline :overlay-at (-> data 16))
|
||||
(hvdf-offset vector :inline :overlay-at (-> data 20))
|
||||
(hmge-scale vector :inline :overlay-at (-> data 24))
|
||||
(invh-scale vector :inline :overlay-at (-> data 28))
|
||||
(ambient vector :inline :overlay-at (-> data 32))
|
||||
(guard vector :inline :overlay-at (-> data 36))
|
||||
(dists tfrag-dists :inline :overlay-at (-> data 40))
|
||||
(k0s uint128 2 :overlay-at (-> data 40))
|
||||
(k1s uint128 2 :overlay-at (-> data 48))
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype tfrag-control (structure)
|
||||
"VU1 'control' data containing address and counters."
|
||||
((num-base-points uint32)
|
||||
(num-shared-base-points uint32)
|
||||
(num-level0-points uint32)
|
||||
(num-shared-level0-points uint32)
|
||||
(num-level1-points uint32)
|
||||
(num-shared-level1-points uint32)
|
||||
(ptr-vtxdata uint32)
|
||||
(ptr-base-points uint32)
|
||||
(ptr-shared-base-points uint32)
|
||||
(ptr-level0-points uint32)
|
||||
(ptr-shared-level0-points uint32)
|
||||
(ptr-level1-points uint32)
|
||||
(ptr-shared-level1-points uint32)
|
||||
(ptr-draw-points uint32)
|
||||
(ptr-interpolated-0 uint32)
|
||||
(ptr-shared-interpolated-0 uint32)
|
||||
(ptr-interpolated1 uint32)
|
||||
(ptr-shared-interpolated1 uint32)
|
||||
(ptr-strip-data uint32)
|
||||
(ptr-texture-data uint32)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype tfrag-stats (structure)
|
||||
"TFRAG statistics computed on EE."
|
||||
((from int32)
|
||||
(to int32)
|
||||
(cnt int32)
|
||||
(tris int32)
|
||||
(tfaces int32)
|
||||
(tfrags int32)
|
||||
(dtris int32)
|
||||
(base-verts int32)
|
||||
(level0-verts int32)
|
||||
(level1-verts int32)
|
||||
(dma-cnt int32)
|
||||
(dma-dta int32)
|
||||
(dma-tex int32)
|
||||
(strips int32)
|
||||
(drawpoints int32)
|
||||
(vif int32)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype tfrag-packet (structure)
|
||||
((tag uint128 2)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype tfrag-work (structure)
|
||||
"Scratch space for generating TFRAG DMA."
|
||||
((base-tmpl dma-packet :inline)
|
||||
(level-0-tmpl dma-packet :inline)
|
||||
(common-tmpl dma-packet :inline)
|
||||
(level-1-tmpl dma-packet :inline)
|
||||
(color-tmpl dma-packet :inline)
|
||||
(frag-dists vector :inline)
|
||||
(min-dist vector :inline)
|
||||
(color-ptr vector4w :inline)
|
||||
(tr-stat-tfrag tr-stat)
|
||||
(tr-stat-tfrag-scissor tr-stat)
|
||||
(vu1-enable-tfrag int32)
|
||||
(vu1-enable-tfrag-scissor int32)
|
||||
(cur-vis-bits uint32)
|
||||
(end-vis-bits uint32)
|
||||
(src-ptr uint32)
|
||||
(last-call uint32)
|
||||
(dma-buffer basic)
|
||||
(test-id uint32)
|
||||
(wait-from-spr uint32)
|
||||
(wait-to-spr uint32)
|
||||
(near-wait-from-spr uint32)
|
||||
(near-wait-to-spr uint32)
|
||||
(max-fragment uint16)
|
||||
(min-fragment uint16)
|
||||
(texture-dists uint32)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype tfrag-dma (structure)
|
||||
"Memory layout for to/from scratchpad for tfrag."
|
||||
((banka tfragment 16 :inline)
|
||||
(bankb tfragment 16 :inline)
|
||||
(outa uint128 128)
|
||||
(outb uint128 128)
|
||||
(colors rgba 2047)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -7,3 +7,308 @@
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
(deftype tie-fragment-debug (structure)
|
||||
"Optional debug information about a tie-fragment."
|
||||
((num-tris uint16)
|
||||
(num-dverts uint16)
|
||||
(debug-lines (array vector-array))
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype tie-fragment (drawable)
|
||||
"A mesh fragment of a TIE. This is a chunk of mesh that is rendered by VU1, stored as DMA chains."
|
||||
((gif-ref (inline-array adgif-shader) :overlay-at id)
|
||||
(point-ref uint32 :offset 8)
|
||||
(color-index uint16 :offset 12)
|
||||
(base-colors uint8 :offset 14)
|
||||
(tex-count uint16 :offset 32)
|
||||
(gif-count uint16 :offset 34)
|
||||
(vertex-count uint16 :offset 36)
|
||||
(color-count uint16)
|
||||
(dp-ref uint32)
|
||||
(dp-qwc uint32)
|
||||
(generic-ref uint32)
|
||||
(generic-count uint16)
|
||||
(normal-count uint16)
|
||||
(normal-ref uint32)
|
||||
(debug tie-fragment-debug)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype instance-tie (instance)
|
||||
"A TIE model instance."
|
||||
((color-indices uint32 :offset 8)
|
||||
(bucket-ptr prototype-bucket-tie :offset 12)
|
||||
(max-scale uint16 :overlay-at (-> origin data 3))
|
||||
(rmin-scale uint16 :overlay-at (-> origin data 11))
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype drawable-inline-array-instance-tie (drawable-inline-array)
|
||||
"Array of tie instances stored in the level."
|
||||
((data instance-tie 1 :inline)
|
||||
(pad uint32)
|
||||
)
|
||||
)
|
||||
|
||||
(deftype drawable-tree-instance-tie (drawable-tree)
|
||||
"Top-level drawable-tree for TIEs"
|
||||
((prototypes proxy-prototype-array-tie :offset 8)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype prototype-tie (drawable-inline-array)
|
||||
"Prototype for a TIE: just an array of fragments."
|
||||
((data tie-fragment 1 :inline)
|
||||
(pad uint32)
|
||||
)
|
||||
)
|
||||
|
||||
(deftype tie-matrix (structure)
|
||||
"Per-instance matrix for TIE VU1 rendering."
|
||||
((mat matrix :inline)
|
||||
(morph qword :inline)
|
||||
(fog qword :inline)
|
||||
(envmap-flag uint32 :overlay-at (-> fog data 0))
|
||||
(guard-flag uint32 :overlay-at (-> fog data 1))
|
||||
(vertex-alpha float :overlay-at (-> fog data 2))
|
||||
(fog-value float :overlay-at (-> fog data 3))
|
||||
(fixed-alpha float :overlay-at (-> morph data 1))
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype instance-tie-work (structure)
|
||||
"workspace for TIE instance DMA generation"
|
||||
((wind-const vector :inline)
|
||||
(hmge-d vector :inline)
|
||||
(hvdf-offset vector :inline)
|
||||
(wind-force vector :inline)
|
||||
(constant vector :inline)
|
||||
(far-morph vector :inline)
|
||||
(dist-test vector :inline)
|
||||
(min-dist vector :inline)
|
||||
(guard-plane plane 4 :inline)
|
||||
(upload-color-0 dma-packet :inline)
|
||||
(upload-color-1 dma-packet :inline)
|
||||
(upload-color-2 dma-packet :inline)
|
||||
(upload-color-ret dma-packet :inline)
|
||||
(upload-color-temp dma-packet :inline)
|
||||
(generic-color-0 dma-packet :inline)
|
||||
(generic-color-1 dma-packet :inline)
|
||||
(generic-color-end dma-packet :inline)
|
||||
(envmap-color-0 dma-packet :inline)
|
||||
(envmap-color-1 dma-packet :inline)
|
||||
(tie-scissor-perspective-matrix matrix :inline)
|
||||
(tod-env-color vector :inline)
|
||||
(morph-temp vector :inline)
|
||||
(fog-temp vector :inline)
|
||||
(fade-temp float)
|
||||
(wind-vectors uint32)
|
||||
(test-id uint32)
|
||||
(test-id2 uint32)
|
||||
(dma-buffer basic)
|
||||
(to-spr uint32)
|
||||
(from-spr uint32)
|
||||
(wind-work uint32)
|
||||
(cur-vis-bits uint32)
|
||||
(end-vis-bits uint32)
|
||||
(refl-fade-fac float)
|
||||
(refl-fade-end float)
|
||||
(flags uint32)
|
||||
(vanish-flag uint32)
|
||||
(translucent-flag uint32)
|
||||
(wait-from-spr uint32)
|
||||
(wait-to-spr uint32)
|
||||
(use-etie symbol)
|
||||
(buffer-start uint32)
|
||||
(buffer-end uint32)
|
||||
(tfrag-dists uint32)
|
||||
(alpha-dists uint32)
|
||||
(water-dists uint32)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype instance-tie-dma (structure)
|
||||
"Scratchpad memory layout for TIE instance DMA generation."
|
||||
((banka instance-tie 32 :inline)
|
||||
(bankb instance-tie 32 :inline)
|
||||
(outa uint128 256)
|
||||
(outb uint128 256)
|
||||
(work instance-tie-work :dynamic)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype prototype-tie-work (structure)
|
||||
"workspace for TIE protype DMA generation."
|
||||
((upload-flushe dma-packet :inline)
|
||||
(upload-palette dma-packet :inline)
|
||||
(upload-model-0 dma-packet :inline)
|
||||
(upload-model-1 dma-packet :inline)
|
||||
(upload-model-2 dma-packet :inline)
|
||||
(upload-model-3 dma-packet :inline)
|
||||
(upload-model-near-0 dma-packet :inline)
|
||||
(upload-model-near-1 dma-packet :inline)
|
||||
(upload-model-near-2 dma-packet :inline)
|
||||
(upload-model-near-3 dma-packet :inline)
|
||||
(upload-model-near-4 dma-packet :inline)
|
||||
(envmap-palette dma-packet :inline)
|
||||
(envmap-shader dma-packet :inline)
|
||||
(upload-envmap-0 dma-packet :inline)
|
||||
(upload-envmap-1 dma-packet :inline)
|
||||
(upload-envmap-2 dma-packet :inline)
|
||||
(upload-envmap-3 dma-packet :inline)
|
||||
(upload-envmap-4 dma-packet :inline)
|
||||
(upload-envmap-scissor-4 dma-packet :inline)
|
||||
(generic-palette dma-packet :inline)
|
||||
(generic-model-0 dma-packet :inline)
|
||||
(generic-model-1 dma-packet :inline)
|
||||
(generic-model-2 dma-packet :inline)
|
||||
(model-next dma-packet :inline)
|
||||
(clamp uint64)
|
||||
(prototype-array basic)
|
||||
(wait-from-spr uint32)
|
||||
(wait-to-spr uint32)
|
||||
(mood mood-context)
|
||||
(last uint32 16 :offset 416)
|
||||
(next uint32 16)
|
||||
(count uint16 16)
|
||||
(tie-last uint32 :overlay-at (-> last 0))
|
||||
(tie-next uint32 :overlay-at (-> next 0))
|
||||
(tie-count uint16 :overlay-at (-> count 0))
|
||||
(trans-last uint32 :overlay-at (-> last 1))
|
||||
(trans-next uint32 :overlay-at (-> next 1))
|
||||
(trans-count uint16 :overlay-at (-> count 1))
|
||||
(water-last uint32 :overlay-at (-> last 2))
|
||||
(water-next uint32 :overlay-at (-> next 2))
|
||||
(water-count uint16 :overlay-at (-> count 2))
|
||||
(scissor-last uint32 :overlay-at (-> last 3))
|
||||
(scissor-next uint32 :overlay-at (-> next 3))
|
||||
(scissor-count uint16 :overlay-at (-> count 3))
|
||||
(scissor-trans-last uint32 :overlay-at (-> last 4))
|
||||
(scissor-trans-next uint32 :overlay-at (-> next 4))
|
||||
(scissor-trans-count uint16 :overlay-at (-> count 4))
|
||||
(scissor-water-last uint32 :overlay-at (-> last 5))
|
||||
(scissor-water-next uint32 :overlay-at (-> next 5))
|
||||
(scissor-water-count uint16 :overlay-at (-> count 5))
|
||||
(envmap-last uint32 :overlay-at (-> last 6))
|
||||
(envmap-next uint32 :overlay-at (-> next 6))
|
||||
(envmap-count uint16 :overlay-at (-> count 6))
|
||||
(envmap-trans-last uint32 :overlay-at (-> last 7))
|
||||
(envmap-trans-next uint32 :overlay-at (-> next 7))
|
||||
(envmap-trans-count uint16 :overlay-at (-> count 7))
|
||||
(envmap-water-last uint32 :overlay-at (-> last 8))
|
||||
(envmap-water-next uint32 :overlay-at (-> next 8))
|
||||
(envmap-water-count uint16 :overlay-at (-> count 8))
|
||||
(envmap-scissor-last uint32 :overlay-at (-> last 9))
|
||||
(envmap-scissor-next uint32 :overlay-at (-> next 9))
|
||||
(envmap-scissor-count uint16 :overlay-at (-> count 9))
|
||||
(envmap-scissor-trans-last uint32 :overlay-at (-> last 10))
|
||||
(envmap-scissor-trans-next uint32 :overlay-at (-> next 10))
|
||||
(envmap-scissor-trans-count uint16 :overlay-at (-> count 10))
|
||||
(envmap-scissor-water-last uint32 :overlay-at (-> last 11))
|
||||
(envmap-scissor-water-next uint32 :overlay-at (-> next 11))
|
||||
(envmap-scissor-water-count uint16 :overlay-at (-> count 11))
|
||||
(generic-last uint32 :overlay-at (-> last 12))
|
||||
(generic-next uint32 :overlay-at (-> next 12))
|
||||
(generic-count uint16 :overlay-at (-> count 12))
|
||||
(generic-trans-last uint32 :overlay-at (-> last 13))
|
||||
(generic-trans-next uint32 :overlay-at (-> next 13))
|
||||
(generic-trans-count uint16 :overlay-at (-> count 13))
|
||||
(generic-water-last uint32 :overlay-at (-> last 14))
|
||||
(generic-water-next uint32 :overlay-at (-> next 14))
|
||||
(generic-water-count uint16 :overlay-at (-> count 14))
|
||||
(vanish-last uint32 :overlay-at (-> last 15))
|
||||
(vanish-next uint32 :overlay-at (-> next 15))
|
||||
(vanish-count uint16 :overlay-at (-> count 15))
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype prototype-tie-dma (structure)
|
||||
((colora rgba 256)
|
||||
(colorb rgba 256)
|
||||
(outa uint128 256)
|
||||
(outb uint128 256)
|
||||
(geometry uint32 4)
|
||||
(next uint32 12)
|
||||
(count uint16 12)
|
||||
(counts uint32 4)
|
||||
(palette-ptr uint32 :overlay-at (-> counts 2))
|
||||
(model-ptr uint32 :overlay-at (-> counts 3))
|
||||
(ret-ptr uint32)
|
||||
(length uint32)
|
||||
(flags uint32)
|
||||
(dma-buffer basic)
|
||||
(this-frag-count uint32)
|
||||
(frag-count uint8 4)
|
||||
(from-spr uint32)
|
||||
(to-spr uint32)
|
||||
(spr-out uint32)
|
||||
(this-count uint32)
|
||||
(scissor-geometry uint32 :overlay-at (-> geometry 0))
|
||||
(near-geometry uint32 :overlay-at (-> geometry 1))
|
||||
(mid-geometry uint32 :overlay-at (-> geometry 2))
|
||||
(far-geometry uint32 :overlay-at (-> geometry 3))
|
||||
(scissor-frag-count uint8 :overlay-at (-> frag-count 0))
|
||||
(near-frag-count uint8 :overlay-at (-> frag-count 1))
|
||||
(mid-frag-count uint8 :overlay-at (-> frag-count 2))
|
||||
(far-frag-count uint8 :overlay-at (-> frag-count 3))
|
||||
(tie-scissor-next uint32 :overlay-at (-> next 0))
|
||||
(tie-near-next uint32 :overlay-at (-> next 1))
|
||||
(tie-mid-next uint32 :overlay-at (-> next 2))
|
||||
(tie-far-next uint32 :overlay-at (-> next 3))
|
||||
(trans-scissor-next uint32 4 :overlay-at (-> next 0))
|
||||
(trans-near-next uint32 :overlay-at (-> next 1))
|
||||
(trans-mid-next uint32 :overlay-at (-> next 2))
|
||||
(trans-far-next uint32 :overlay-at (-> next 3))
|
||||
(water-scissor-next uint32 4 :overlay-at (-> next 0))
|
||||
(water-near-next uint32 :overlay-at (-> next 1))
|
||||
(water-mid-next uint32 :overlay-at (-> next 2))
|
||||
(water-far-next uint32 :overlay-at (-> next 3))
|
||||
(envmap-scissor-next uint32 4 :overlay-at (-> next 4))
|
||||
(envmap-near-next uint32 :overlay-at (-> next 5))
|
||||
(envmap-mid-next uint32 :overlay-at (-> next 6))
|
||||
(envmap-far-next uint32 :overlay-at (-> next 7))
|
||||
(generic-near-next uint32 :overlay-at (-> next 8))
|
||||
(generic-mid-next uint32 :overlay-at (-> next 9))
|
||||
(generic-far-next uint32 :overlay-at (-> next 10))
|
||||
(vanish-next uint32 :overlay-at (-> next 11))
|
||||
(tie-count uint16 :overlay-at (-> count 0))
|
||||
(tie-scissor-count uint16 :overlay-at (-> count 0))
|
||||
(tie-near-count uint16 :overlay-at (-> count 1))
|
||||
(tie-mid-count uint16 :overlay-at (-> count 2))
|
||||
(tie-far-count uint16 :overlay-at (-> count 3))
|
||||
(trans-count uint16 :overlay-at (-> count 0))
|
||||
(trans-scissor-count uint16 :overlay-at (-> count 0))
|
||||
(trans-near-count uint16 :overlay-at (-> count 1))
|
||||
(trans-mid-count uint16 :overlay-at (-> count 2))
|
||||
(trans-far-count uint16 :overlay-at (-> count 3))
|
||||
(water-count uint16 :overlay-at (-> count 0))
|
||||
(water-scissor-count uint16 :overlay-at (-> count 0))
|
||||
(water-near-count uint16 :overlay-at (-> count 1))
|
||||
(water-mid-count uint16 :overlay-at (-> count 2))
|
||||
(water-far-count uint16 :overlay-at (-> count 3))
|
||||
(envmap-count uint16 :overlay-at (-> count 4))
|
||||
(envmap-scissor-count uint16 :overlay-at (-> count 4))
|
||||
(envmap-near-count uint16 :overlay-at (-> count 5))
|
||||
(envmap-mid-count uint16 :overlay-at (-> count 6))
|
||||
(envmap-far-count uint16 :overlay-at (-> count 7))
|
||||
(generic-count uint16 :overlay-at (-> count 8))
|
||||
(generic-near-count uint16 :overlay-at (-> count 8))
|
||||
(generic-mid-count uint16 :overlay-at (-> count 9))
|
||||
(generic-far-count uint16 :overlay-at (-> count 10))
|
||||
(vanish-count uint16 :overlay-at (-> count 11))
|
||||
(next-clear uint32 3 :overlay-at (-> next 0))
|
||||
(count-clear uint16 3 :overlay-at (-> count 0))
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(define *instance-tie-work-copy* (the-as instance-tie-work #f))
|
||||
|
||||
@@ -7,3 +7,238 @@
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
(deftype billboard (drawable)
|
||||
"A billboard for shrubbery in the distance. This is simple a quad that faces the camera.
|
||||
The only data needed is the texture/mode. The location is determined by bsphere."
|
||||
((flat adgif-shader :inline)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype shrub-view-data (structure)
|
||||
"Camera and general settings for shrubbery VU1 program."
|
||||
((data uint128 3)
|
||||
(texture-giftag gs-gif-tag :inline :overlay-at (-> data 0))
|
||||
(consts vector :inline :overlay-at (-> data 1))
|
||||
(fog-clamp vector :inline :overlay-at (-> data 2))
|
||||
(tex-start-ptr int32 :overlay-at (-> data 1))
|
||||
(gifbufsum float :overlay-at (-> data 1))
|
||||
(mtx-buf-ptr int32 :overlay-at (-> consts y))
|
||||
(exp23 float :overlay-at mtx-buf-ptr)
|
||||
(fog-0 float :overlay-at (-> consts z))
|
||||
(fog-1 float :overlay-at (-> consts w))
|
||||
(fog-min float :overlay-at (-> data 2))
|
||||
(fog-max float :overlay-at (-> fog-clamp y))
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype shrubbery (drawable)
|
||||
"Prototype (mesh/geometry) for a shrub. not _really_ a drawable in any way, as it
|
||||
overwrites all the normal drawable fields."
|
||||
((textures (inline-array adgif-shader) :overlay-at id)
|
||||
(header qword :offset 8)
|
||||
(obj-qwc uint8 :offset 12)
|
||||
(vtx-qwc uint8 :offset 13)
|
||||
(col-qwc uint8 :offset 14)
|
||||
(stq-qwc uint8 :offset 15)
|
||||
(obj uint32 :overlay-at (-> bsphere data 0))
|
||||
(vtx uint32 :overlay-at (-> bsphere data 1))
|
||||
(col uint32 :overlay-at (-> bsphere data 2))
|
||||
(stq uint32 :overlay-at (-> bsphere data 3))
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype instance-shrubbery (instance)
|
||||
"Instance of a shrub."
|
||||
((flat-normal vector :inline)
|
||||
(flat-hwidth float :overlay-at (-> flat-normal data 3))
|
||||
(color uint32 :offset 8)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype drawable-inline-array-instance-shrub (drawable-inline-array)
|
||||
"Array of shrub instances stored in the level data."
|
||||
((data instance-shrubbery 1 :inline)
|
||||
(pad uint32)
|
||||
)
|
||||
)
|
||||
|
||||
(deftype drawable-tree-instance-shrub (drawable-tree)
|
||||
"Drawable-tree for the shrubs."
|
||||
()
|
||||
)
|
||||
|
||||
(deftype generic-shrub-fragment (drawable)
|
||||
"Shrub data, converted into the format for generic.
|
||||
The shrub renderer doesn't support clipping, so it falls back to generic.
|
||||
This requires storing the data for all shrubs prototype twice!"
|
||||
((textures (inline-array adgif-shader) :overlay-at id)
|
||||
(vtx-cnt uint32 :offset 8)
|
||||
(cnt-qwc uint8 :offset 12)
|
||||
(vtx-qwc uint8 :offset 13)
|
||||
(col-qwc uint8 :offset 14)
|
||||
(stq-qwc uint8 :offset 15)
|
||||
(cnt uint32 :overlay-at (-> bsphere data 0))
|
||||
(vtx uint32 :overlay-at (-> bsphere data 1))
|
||||
(col uint32 :overlay-at (-> bsphere data 2))
|
||||
(stq uint32 :overlay-at (-> bsphere data 3))
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype prototype-shrubbery (drawable-inline-array)
|
||||
"Array of shrub prototypes."
|
||||
((data shrubbery 1 :inline)
|
||||
(pad uint32)
|
||||
)
|
||||
)
|
||||
|
||||
(deftype prototype-trans-shrubbery (prototype-shrubbery)
|
||||
"Array of transparent shrub prototypes."
|
||||
()
|
||||
)
|
||||
|
||||
(deftype prototype-generic-shrub (drawable-group)
|
||||
()
|
||||
)
|
||||
|
||||
(deftype shrubbery-matrix (structure)
|
||||
"Instance matrix for a shrub, contains interpolated color."
|
||||
((mat matrix :inline)
|
||||
(color qword :inline)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
;; WARN: Return type mismatch symbol vs none.
|
||||
(defun shrubbery-login-post-texture ((arg0 shrubbery))
|
||||
"Do some weird fix-up to the shrubbery textures. this is likely to present normal-looking adgifs to the texture system, but then we scramble them up for easier consumption by VU1."
|
||||
(let* ((v1-1 (-> arg0 header data 0))
|
||||
(a1-1 (the-as object (+ (the-as uint (-> arg0 header)) (* (+ (-> arg0 header data 1) 1) 16))))
|
||||
(a2-5 (the-as object (+ (the-as int a1-1) (* v1-1 64))))
|
||||
(a3-0 (the-as object (-> arg0 textures)))
|
||||
)
|
||||
(dotimes (a0-1 (the-as int v1-1))
|
||||
(set! (-> (the-as qword a2-5) quad) (-> (the-as qword a3-0) quad))
|
||||
(let ((a2-6 (the-as object (+ (the-as int a2-5) 16)))
|
||||
(a3-1 (the-as object (&+ (the-as pointer a3-0) 16)))
|
||||
)
|
||||
(set! (-> (the-as qword a1-1) vector4w x) (the-as int (-> (the-as qword a3-1) data 0)))
|
||||
(set! (-> (the-as qword a1-1) vector4w y) (the-as int (-> (the-as qword a3-1) data 1)))
|
||||
(set! (-> (the-as qword a1-1) vector4w z) (the-as int (-> (the-as qword a3-1) data 2)))
|
||||
(set! a1-1 (+ (the-as int a1-1) 16))
|
||||
(let ((a3-2 (the-as object (&+ (the-as pointer a3-1) 16))))
|
||||
(dotimes (t0-4 3)
|
||||
(set! (-> (the-as qword a1-1) quad) (-> (the-as qword a3-2) quad))
|
||||
(set! a1-1 (+ (the-as int a1-1) 16))
|
||||
(set! a3-2 (&+ (the-as pointer a3-2) 16))
|
||||
)
|
||||
(set! (-> (the-as qword a2-6) quad) (-> (the-as qword a3-2) quad))
|
||||
(set! a2-5 (+ (the-as int a2-6) 16))
|
||||
(set! a3-0 (&+ (the-as pointer a3-2) 80))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
(define *shrub-state* 0)
|
||||
|
||||
(deftype shrub-near-packet (structure)
|
||||
"DMA templates for generic rendering of shrubs."
|
||||
((matrix-tmpl dma-packet :inline)
|
||||
(header-tmpl dma-packet :inline)
|
||||
(stq-tmpl dma-packet :inline)
|
||||
(color-tmpl dma-packet :inline)
|
||||
(vertex-tmpl dma-packet :inline)
|
||||
(mscal-tmpl dma-packet :inline)
|
||||
(init-tmpl dma-packet :inline)
|
||||
(init-data qword 8)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype instance-shrub-work (structure)
|
||||
"Scratchpad layout for generating shrub DMA."
|
||||
((dummy qword 3 :inline)
|
||||
(chaina qword 8 :inline)
|
||||
(chainb qword 8 :inline)
|
||||
(colors rgba 1024)
|
||||
(matrix-tmpl qword 20 :inline)
|
||||
(count-tmpl vector4w 20 :inline)
|
||||
(mscalf-tmpl dma-packet :inline)
|
||||
(mscalf-ret-tmpl dma-packet :inline)
|
||||
(adgif-tmpl dma-gif-packet :inline)
|
||||
(billboard-tmpl dma-gif-packet :inline)
|
||||
(billboard-const vector :inline)
|
||||
(shrub-near-packets shrub-near-packet 6 :inline)
|
||||
(dma-ref dma-packet :inline)
|
||||
(dma-end dma-packet :inline)
|
||||
(wind-const vector :inline)
|
||||
(constants vector :inline)
|
||||
(color-constant vector4w :inline)
|
||||
(hmge-d vector :inline)
|
||||
(hvdf-offset vector :inline)
|
||||
(wind-force vector :inline)
|
||||
(color vector :inline)
|
||||
(bb-color vector :inline)
|
||||
(min-dist vector :inline)
|
||||
(temp-vec vector :inline)
|
||||
(guard-plane plane 4 :inline)
|
||||
(plane plane 4 :inline)
|
||||
(last uint32 4)
|
||||
(next uint32 4)
|
||||
(count uint16 4)
|
||||
(mod-count uint16 4)
|
||||
(wind-vectors uint32)
|
||||
(instance-ptr uint32)
|
||||
(chain-ptr uint32)
|
||||
(chain-ptr-next uint32)
|
||||
(stack-ptr uint32)
|
||||
(bucket-ptr uint32)
|
||||
(src-ptr uint32)
|
||||
(to-spr uint32)
|
||||
(from-spr uint32)
|
||||
(shrub-count uint32)
|
||||
(stack-ptr2 uint32 :overlay-at stack-ptr)
|
||||
(node uint32 6 :offset 6428)
|
||||
(length uint32 6)
|
||||
(prototypes uint32)
|
||||
(bucket-ptr2 uint32 :overlay-at bucket-ptr)
|
||||
(start-bank uint8 20 :offset 6484)
|
||||
(buffer-index uint32)
|
||||
(current-spr uint32)
|
||||
(current-mem uint32)
|
||||
(current-shrub-near-packet uint32)
|
||||
(current-shrub-near-trans-packet uint32)
|
||||
(to-spr2 uint32 :overlay-at to-spr)
|
||||
(dma-buffer basic :offset 6528)
|
||||
(near-last uint32)
|
||||
(near-next uint32)
|
||||
(near-count uint32)
|
||||
(near-trans-last uint32)
|
||||
(near-trans-next uint32)
|
||||
(near-trans-count uint32)
|
||||
(last-shrubs uint32)
|
||||
(chains uint32)
|
||||
(flags uint32)
|
||||
(node-count uint32)
|
||||
(inst-count uint32)
|
||||
(wait-from-spr uint32)
|
||||
(wait-to-spr uint32)
|
||||
(texture-dists uint32)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype instance-shrub-dma (structure)
|
||||
((instancea uint128 325)
|
||||
(instanceb uint128 325)
|
||||
(outa uint128 128)
|
||||
(outb uint128 128)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -5,5 +5,219 @@
|
||||
;; name in dgo: sparticle-launcher-h
|
||||
;; dgos: GAME
|
||||
|
||||
(declare-type sprite-vec-data-3d structure)
|
||||
(declare-type sparticle-cpuinfo structure)
|
||||
(declare-type sparticle-system structure)
|
||||
|
||||
(defenum sp-field-id
|
||||
:type uint16
|
||||
)
|
||||
|
||||
(defenum sp-flag
|
||||
:type uint16
|
||||
)
|
||||
|
||||
(defenum sp-group-item-flag
|
||||
:bitfield #t
|
||||
:type uint16
|
||||
)
|
||||
|
||||
(defenum sp-launch-state-flags
|
||||
:bitfield #t
|
||||
:type uint16
|
||||
)
|
||||
|
||||
(defenum sp-group-flag
|
||||
:bitfield #t
|
||||
:type uint16
|
||||
)
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
(deftype sparticle-birthinfo (structure)
|
||||
"Used internally by the sparticle code."
|
||||
((sprite uint32)
|
||||
(anim int32)
|
||||
(anim-speed float)
|
||||
(birth-func basic)
|
||||
(joint-ppoint int32)
|
||||
(num-to-birth float)
|
||||
(sound basic)
|
||||
(dataf float 1 :overlay-at sprite)
|
||||
(data uint32 1 :overlay-at sprite)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype sp-field-init-spec (structure)
|
||||
"Part of a particle definition - how to initialize a field of a particle."
|
||||
((field sp-field-id)
|
||||
(flags sp-flag)
|
||||
(initial-valuef float)
|
||||
(random-rangef float)
|
||||
(random-multf float)
|
||||
(initial-value int32 :overlay-at initial-valuef)
|
||||
(random-range int32 :overlay-at random-rangef)
|
||||
(random-mult int32 :overlay-at random-multf)
|
||||
(func symbol :overlay-at initial-valuef)
|
||||
(tex texture-id :overlay-at initial-valuef)
|
||||
(pntr pointer :overlay-at initial-valuef)
|
||||
(object basic :overlay-at initial-valuef)
|
||||
(sym symbol :overlay-at initial-valuef)
|
||||
(sound sound-spec :overlay-at initial-valuef)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype sparticle-launcher (basic)
|
||||
"A definition of a single particle, as a list of init specs."
|
||||
((birthaccum float)
|
||||
(soundaccum float)
|
||||
(init-specs (inline-array sp-field-init-spec))
|
||||
)
|
||||
(:methods
|
||||
(get-field-spec-by-id (_type_ sp-field-id) sp-field-init-spec)
|
||||
(setup-special-textures (_type_ string) none)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype sparticle-group-item (structure)
|
||||
"A reference to a single sparticle-launcher (by ID) and some parameters for using it."
|
||||
((launcher uint32)
|
||||
(fade-after meters)
|
||||
(falloff-to meters)
|
||||
(flags sp-group-item-flag)
|
||||
(period uint16)
|
||||
(length uint16)
|
||||
(offset int16)
|
||||
(hour-mask uint32)
|
||||
(binding uint32)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype sparticle-launch-state (structure)
|
||||
"The state associated with a launcher of a given sparticle."
|
||||
((group-item sparticle-group-item)
|
||||
(flags sp-launch-state-flags)
|
||||
(randomize uint16)
|
||||
(center vector)
|
||||
(sprite3d sprite-vec-data-3d)
|
||||
(sprite sparticle-cpuinfo)
|
||||
(offset uint32)
|
||||
(accum float)
|
||||
(spawn-time uint32)
|
||||
(control sparticle-launch-control)
|
||||
(swarm basic :overlay-at offset)
|
||||
(seed uint32 :overlay-at accum)
|
||||
(time uint32 :overlay-at spawn-time)
|
||||
(spec basic :overlay-at sprite)
|
||||
(id uint32 :overlay-at sprite3d)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype sparticle-launch-group (basic)
|
||||
"Definition of multiple a particle-group, which is a collection of particle effects."
|
||||
((length int16)
|
||||
(duration uint16)
|
||||
(linger-duration uint16)
|
||||
(flags sp-group-flag)
|
||||
(name string)
|
||||
(launcher (inline-array sparticle-group-item))
|
||||
(rotate-x degrees)
|
||||
(rotate-y degrees)
|
||||
(rotate-z degrees)
|
||||
(scale-x float)
|
||||
(scale-y float)
|
||||
(scale-z float)
|
||||
(bounds sphere :inline)
|
||||
)
|
||||
(:methods
|
||||
(create-launch-control (_type_ process) sparticle-launch-control)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(define *launch-matrix* (matrix-identity! (new 'global 'matrix)))
|
||||
|
||||
(deftype sparticle-launch-control (inline-array-class)
|
||||
"Top-level type containing all the state needed to launch a particle group.
|
||||
These are typically owned by a process, and allocated on the process heap.
|
||||
These refer to static particle definitions, and then spawn particles that are tracked by the
|
||||
particle system itself. This type just holds the launching-related state."
|
||||
((group sparticle-launch-group)
|
||||
(proc process-drawable)
|
||||
(local-clock int32)
|
||||
(fade float)
|
||||
(matrix int8)
|
||||
(state-mode uint8 3)
|
||||
(state-counter uint32)
|
||||
(local-space-binding particle-local-space-info :overlay-at fade)
|
||||
(last-spawn-frame int32)
|
||||
(last-spawn-time int32)
|
||||
(origin matrix :inline)
|
||||
(center vector :inline :overlay-at (-> origin data 12))
|
||||
(data sparticle-launch-state :inline :dynamic)
|
||||
)
|
||||
(:methods
|
||||
(sparticle-launch-control-method-14 () none)
|
||||
(sparticle-launch-control-method-15 () none)
|
||||
(sparticle-launch-control-method-16 () none)
|
||||
(sparticle-launch-control-method-17 () none)
|
||||
(sparticle-launch-control-method-18 () none)
|
||||
(sparticle-launch-control-method-19 () none)
|
||||
(sparticle-launch-control-method-20 () none)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(set! (-> sparticle-launch-control heap-base) (the-as uint 48))
|
||||
|
||||
(deftype sparticle-subsampler (basic)
|
||||
((spt-num float)
|
||||
(sp-system sparticle-system)
|
||||
(sp-launcher sparticle-launcher)
|
||||
(spawn-mat matrix :inline)
|
||||
(inited? basic)
|
||||
)
|
||||
(:methods
|
||||
(new (symbol type sparticle-system sparticle-launcher float) _type_)
|
||||
(sparticle-subsampler-method-9 () none)
|
||||
(sparticle-subsampler-method-10 () none)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(defmethod new sparticle-subsampler ((allocation symbol) (type-to-make type) (arg0 sparticle-system) (arg1 sparticle-launcher) (arg2 float))
|
||||
(let ((s3-0 (object-new allocation type-to-make (the-as int (-> type-to-make size)))))
|
||||
(if (zero? s3-0)
|
||||
(go process-drawable-art-error "sparticle-subsampler")
|
||||
)
|
||||
(set! (-> s3-0 sp-launcher) arg1)
|
||||
(set! (-> s3-0 inited?) #f)
|
||||
(set! (-> s3-0 sp-system) arg0)
|
||||
(set! (-> s3-0 spt-num) arg2)
|
||||
(matrix-identity! (-> s3-0 spawn-mat))
|
||||
s3-0
|
||||
)
|
||||
)
|
||||
|
||||
(defun compute-rot-in-screenspace ((arg0 vector))
|
||||
"Unclear what this does, but I'm not actually sure it makes sense. Unused"
|
||||
0.0
|
||||
(let ((a0-1 (-> (math-camera-matrix) fvec)))
|
||||
0.0
|
||||
(let ((v1-0 (new 'stack-no-clear 'vector)))
|
||||
(let ((f0-3 (vector-dot a0-1 arg0)))
|
||||
(vector-float*! v1-0 a0-1 f0-3)
|
||||
)
|
||||
(vector-! arg0 arg0 v1-0)
|
||||
)
|
||||
)
|
||||
(let ((a2-1 (matrix-transpose! (new 'stack-no-clear 'matrix) (math-camera-matrix))))
|
||||
(vector-matrix*! arg0 arg0 a2-1)
|
||||
)
|
||||
(the float (sar (shl (the int (atan (-> arg0 y) (* -1.0 (-> arg0 x)))) 48) 48))
|
||||
)
|
||||
|
||||
+252
@@ -0,0 +1,252 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; definition of type collide-puss-sphere
|
||||
(deftype collide-puss-sphere (structure)
|
||||
"A query sphere from the user for the porbe-using-spheres query.
|
||||
This is used internally by the collide-cache implementation."
|
||||
((bsphere sphere :inline)
|
||||
(bbox4w bounding-box4w :inline)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type collide-puss-sphere
|
||||
(defmethod inspect ((this collide-puss-sphere))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'collide-puss-sphere)
|
||||
(format #t "~1Tbsphere: #<sphere @ #x~X>~%" (-> this bsphere))
|
||||
(format #t "~1Tbbox4w: #<bounding-box4w @ #x~X>~%" (-> this bbox4w))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type collide-puss-work
|
||||
(deftype collide-puss-work (structure)
|
||||
"Scratchpad memory map for probe-using-spheres query."
|
||||
((closest-pt vector :inline)
|
||||
(tri-normal vector :inline)
|
||||
(tri-bbox4w bounding-box4w :inline)
|
||||
(spheres-bbox4w bounding-box4w :inline)
|
||||
(spheres collide-puss-sphere 64 :inline)
|
||||
)
|
||||
(:methods
|
||||
(check-mesh-prim-against-spheres (_type_ collide-cache-prim collide-using-spheres-params) symbol)
|
||||
(check-sphere-prim-against-spheres (_type_ collide-cache-prim collide-using-spheres-params) symbol)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type collide-puss-work
|
||||
(defmethod inspect ((this collide-puss-work))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'collide-puss-work)
|
||||
(format #t "~1Tclosest-pt: #<vector @ #x~X>~%" (-> this closest-pt))
|
||||
(format #t "~1Ttri-normal: #<vector @ #x~X>~%" (-> this tri-normal))
|
||||
(format #t "~1Ttri-bbox4w: #<bounding-box4w @ #x~X>~%" (-> this tri-bbox4w))
|
||||
(format #t "~1Tspheres-bbox4w: #<bounding-box4w @ #x~X>~%" (-> this spheres-bbox4w))
|
||||
(format #t "~1Tspheres[64] @ #x~X~%" (-> this spheres))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type collide-cache-tri
|
||||
(deftype collide-cache-tri (structure)
|
||||
"A single triangle inside the collision cache.
|
||||
Contains a reference back to the source object (like a collide-shape or water-control), and the prim itself."
|
||||
((vertex vector 3 :inline)
|
||||
(extra-quad uint8 16)
|
||||
(pat pat-surface :overlay-at (-> extra-quad 0))
|
||||
(collide-ptr basic :overlay-at (-> extra-quad 4))
|
||||
(prim-index uint16 :overlay-at (-> extra-quad 8))
|
||||
(user16 uint16 :overlay-at (-> extra-quad 10))
|
||||
(user32 uint32 :overlay-at (-> extra-quad 12))
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type collide-cache-tri
|
||||
(defmethod inspect ((this collide-cache-tri))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'collide-cache-tri)
|
||||
(format #t "~1Tvertex[3] @ #x~X~%" (-> this vertex))
|
||||
(format #t "~1Textra-quad[16] @ #x~X~%" (-> this extra-quad))
|
||||
(format #t "~1Tpat: ~D~%" (-> this pat))
|
||||
(format #t "~1Tcollide-ptr: ~A~%" (-> this collide-ptr))
|
||||
(format #t "~1Tprim-index: ~D~%" (-> this prim-index))
|
||||
(format #t "~1Tuser16: ~D~%" (-> this user16))
|
||||
(format #t "~1Tuser32: ~D~%" (-> this user32))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type collide-cache-prim
|
||||
(deftype collide-cache-prim (structure)
|
||||
"A primitive inside the collide-cache.
|
||||
This can represent a sphere, a triangle mesh, or a group of other primitives within a bounding sphere."
|
||||
((prim-core collide-prim-core :inline)
|
||||
(extra-quad uint8 16)
|
||||
(ccache collide-cache :overlay-at (-> extra-quad 0))
|
||||
(prim collide-shape-prim :overlay-at (-> extra-quad 4))
|
||||
(first-tri uint16 :overlay-at (-> extra-quad 8))
|
||||
(num-tris uint16 :overlay-at (-> extra-quad 10))
|
||||
(unused uint8 4 :overlay-at (-> extra-quad 12))
|
||||
(world-sphere vector :inline :overlay-at (-> prim-core world-sphere))
|
||||
(collide-as collide-spec :overlay-at (-> prim-core collide-as))
|
||||
(action collide-action :overlay-at (-> prim-core action))
|
||||
(prim-type prim-type :overlay-at (-> prim-core prim-type))
|
||||
)
|
||||
(:methods
|
||||
(collide-cache-prim-method-9 () none)
|
||||
(collide-cache-prim-method-10 () none)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type collide-cache-prim
|
||||
(defmethod inspect ((this collide-cache-prim))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'collide-cache-prim)
|
||||
(format #t "~1Tprim-core: #<collide-prim-core @ #x~X>~%" (-> this prim-core))
|
||||
(format #t "~1Textra-quad[16] @ #x~X~%" (-> this extra-quad))
|
||||
(format #t "~1Tccache: ~A~%" (-> this ccache))
|
||||
(format #t "~1Tprim: ~A~%" (-> this prim))
|
||||
(format #t "~1Tfirst-tri: ~D~%" (-> this first-tri))
|
||||
(format #t "~1Tnum-tris: ~D~%" (-> this num-tris))
|
||||
(format #t "~1Tunused[4] @ #x~X~%" (-> this unused))
|
||||
(format #t "~1Tworld-sphere: ~`vector`P~%" (-> this prim-core))
|
||||
(format #t "~1Tcollide-as: ~D~%" (-> this prim-core collide-as))
|
||||
(format #t "~1Taction: ~D~%" (-> this prim-core action))
|
||||
(format #t "~1Tprim-type: ~D~%" (-> this prim-core prim-type))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type collide-cache
|
||||
(deftype collide-cache (basic)
|
||||
"The collide-cache is a structure to accelerate collision queries.
|
||||
In particular, it helps with queries where you don't know what you might hit.
|
||||
It can detect collision with the background geometry, foreground dynamic collision shapes (spheres and meshes), and water.
|
||||
To use it, it must first be 'filled' with geometry. Then you can manually inspect the geometry, or use one of the queries.
|
||||
The supported queries are 'line-sphere' (raycast) and 'spheres' (check if intersecting anything).
|
||||
It is not useful for ollision queries against a specific foreground object, like 'am I on top of platform X right now?'."
|
||||
((num-tris int32)
|
||||
(num-prims int32)
|
||||
(ignore-mask pat-surface)
|
||||
(ignore-processes process 2)
|
||||
(collide-box bounding-box :inline)
|
||||
(collide-box4w bounding-box4w :inline)
|
||||
(collide-with collide-spec)
|
||||
(unused uint32)
|
||||
(prims collide-cache-prim 100 :inline)
|
||||
(tris collide-cache-tri 461 :inline)
|
||||
)
|
||||
(:methods
|
||||
(collide-cache-method-9 () none)
|
||||
(collide-cache-method-10 () none)
|
||||
(collide-cache-method-11 () none)
|
||||
(collide-cache-method-12 () none)
|
||||
(collide-cache-method-13 () none)
|
||||
(collide-cache-method-14 () none)
|
||||
(collide-cache-method-15 () none)
|
||||
(collide-cache-method-16 () none)
|
||||
(collide-cache-method-17 () none)
|
||||
(collide-cache-method-18 () none)
|
||||
(collide-cache-method-19 () none)
|
||||
(collide-cache-method-20 () none)
|
||||
(collide-cache-method-21 () none)
|
||||
(collide-cache-method-22 () none)
|
||||
(collide-cache-method-23 () none)
|
||||
(collide-cache-method-24 () none)
|
||||
(collide-cache-method-25 () none)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type collide-cache
|
||||
(defmethod inspect ((this collide-cache))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this (-> this type))
|
||||
(format #t "~1Tnum-tris: ~D~%" (-> this num-tris))
|
||||
(format #t "~1Tnum-prims: ~D~%" (-> this num-prims))
|
||||
(format #t "~1Tignore-mask: ~D~%" (-> this ignore-mask))
|
||||
(format #t "~1Tignore-processes[2] @ #x~X~%" (-> this ignore-processes))
|
||||
(format #t "~1Tcollide-box: #<bounding-box @ #x~X>~%" (-> this collide-box))
|
||||
(format #t "~1Tcollide-box4w: #<bounding-box4w @ #x~X>~%" (-> this collide-box4w))
|
||||
(format #t "~1Tcollide-with: ~D~%" (-> this collide-with))
|
||||
(format #t "~1Tunused: ~D~%" (-> this unused))
|
||||
(format #t "~1Tprims[100] @ #x~X~%" (-> this prims))
|
||||
(format #t "~1Ttris[461] @ #x~X~%" (-> this tris))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type collide-list-item
|
||||
(deftype collide-list-item (structure)
|
||||
"Entry on the broad-phase collision list.
|
||||
Can represent instanced collision, as a TIE instance, or a single non-instanced mesh fragment."
|
||||
((mesh instance-tie)
|
||||
(inst basic)
|
||||
)
|
||||
:pack-me
|
||||
)
|
||||
|
||||
;; definition for method 3 of type collide-list-item
|
||||
(defmethod inspect ((this collide-list-item))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'collide-list-item)
|
||||
(format #t "~1Tmesh: ~A~%" (-> this mesh))
|
||||
(format #t "~1Tinst: ~A~%" (-> this inst))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type collide-list
|
||||
(deftype collide-list (structure)
|
||||
"List of items returned by the broad-phase collision query."
|
||||
((num-items int32)
|
||||
(items collide-list-item 256 :inline :offset 16)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type collide-list
|
||||
(defmethod inspect ((this collide-list))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'collide-list)
|
||||
(format #t "~1Tnum-items: ~D~%" (-> this num-items))
|
||||
(format #t "~1Titems[256] @ #x~X~%" (-> this items))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(kmemopen global "collide-cache-buffers")
|
||||
|
||||
;; definition (perm) for symbol *collide-cache*, type collide-cache
|
||||
(define-perm *collide-cache* collide-cache (new 'global 'collide-cache))
|
||||
|
||||
;; definition (perm) for symbol *collide-list*, type collide-list
|
||||
(define-perm *collide-list* collide-list (new 'global 'collide-list))
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(kmemclose)
|
||||
|
||||
|
||||
|
||||
|
||||
+104
@@ -0,0 +1,104 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; definition of type collide-query
|
||||
(deftype collide-query (structure)
|
||||
"Very general collision-query structure. The meaning is different depending on where it used.
|
||||
This has both inputs from the user, and collision results."
|
||||
((best-other-tri collide-tri-result :inline)
|
||||
(best-my-tri collide-tri-result :inline :overlay-at best-other-tri)
|
||||
(ignore-processes process-tree 2)
|
||||
(ignore-process0 process-tree :overlay-at (-> ignore-processes 0))
|
||||
(ignore-process1 process-tree :overlay-at (-> ignore-processes 1))
|
||||
(ignore-pat pat-surface)
|
||||
(collide-with collide-spec)
|
||||
(overlay-params uint32 3 :offset 112)
|
||||
(bbox bounding-box :inline)
|
||||
(bbox4w bounding-box4w :inline)
|
||||
(bsphere sphere :inline)
|
||||
(start-pos vector :inline)
|
||||
(move-dist vector :inline)
|
||||
(rlength vector :inline)
|
||||
(exit-planes plane 2)
|
||||
(radius float :offset 268)
|
||||
(inv-mat matrix :inline :offset 288)
|
||||
(spheres (inline-array sphere) :overlay-at (-> overlay-params 0))
|
||||
(num-spheres uint32 :overlay-at (-> overlay-params 1))
|
||||
(solid-only symbol :overlay-at (-> overlay-params 2))
|
||||
(best-dist float :overlay-at spheres)
|
||||
(best-other-prim collide-shape-prim :overlay-at num-spheres)
|
||||
(best-my-prim collide-shape-prim :overlay-at solid-only)
|
||||
(move-vec vector :inline :overlay-at move-dist)
|
||||
(best-u float :overlay-at best-dist)
|
||||
(action-mask collide-action :offset 352)
|
||||
(local-box4w bounding-box4w :inline)
|
||||
(search-box bounding-box4w :inline)
|
||||
(search-vector vector4w :inline)
|
||||
(instance-mat matrix :inline)
|
||||
(instance-ptr basic)
|
||||
(x-addr uint32)
|
||||
(x-step uint32)
|
||||
(y-addr uint32)
|
||||
(y-step uint32)
|
||||
(z-addr uint32)
|
||||
(z-step uint32)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type collide-query
|
||||
(defmethod inspect ((this collide-query))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'collide-query)
|
||||
(format #t "~1Tbest-other-tri: #<collide-tri-result @ #x~X>~%" (-> this best-other-tri))
|
||||
(format #t "~1Tbest-my-tri: #<collide-tri-result @ #x~X>~%" (-> this best-other-tri))
|
||||
(format #t "~1Tignore-processes[2] @ #x~X~%" (-> this ignore-processes))
|
||||
(format #t "~1Tignore-process0: ~A~%" (-> this ignore-process0))
|
||||
(format #t "~1Tignore-process1: ~A~%" (-> this ignore-process1))
|
||||
(format #t "~1Tignore-pat: ~D~%" (-> this ignore-pat))
|
||||
(format #t "~1Tcollide-with: ~D~%" (-> this collide-with))
|
||||
(format #t "~1Toverlay-params[3] @ #x~X~%" (-> this overlay-params))
|
||||
(format #t "~1Tbbox: #<bounding-box @ #x~X>~%" (-> this bbox))
|
||||
(format #t "~1Tbbox4w: #<bounding-box4w @ #x~X>~%" (-> this bbox4w))
|
||||
(format #t "~1Tbsphere: #<sphere @ #x~X>~%" (-> this bsphere))
|
||||
(format #t "~1Tstart-pos: #<vector @ #x~X>~%" (-> this start-pos))
|
||||
(format #t "~1Tmove-dist: #<vector @ #x~X>~%" (-> this move-dist))
|
||||
(format #t "~1Trlength: #<vector @ #x~X>~%" (-> this rlength))
|
||||
(format #t "~1Texit-planes[2] @ #x~X~%" (-> this exit-planes))
|
||||
(format #t "~1Tradius: ~f~%" (-> this radius))
|
||||
(format #t "~1Tinv-mat: #<matrix @ #x~X>~%" (-> this inv-mat))
|
||||
(format #t "~1Tspheres: #x~X~%" (-> this spheres))
|
||||
(format #t "~1Tnum-spheres: ~D~%" (-> this num-spheres))
|
||||
(format #t "~1Tsolid-only: ~A~%" (-> this solid-only))
|
||||
(format #t "~1Tbest-dist: ~f~%" (the-as float (-> this spheres)))
|
||||
(format #t "~1Tbest-other-prim: ~A~%" (-> this num-spheres))
|
||||
(format #t "~1Tbest-my-prim: ~A~%" (-> this solid-only))
|
||||
(format #t "~1Tmove-vec: #<vector @ #x~X>~%" (-> this move-dist))
|
||||
(format #t "~1Tbest-u: ~f~%" (the-as float (-> this spheres)))
|
||||
(format #t "~1Taction-mask: ~D~%" (-> this action-mask))
|
||||
(format #t "~1Tlocal-box4w: #<bounding-box4w @ #x~X>~%" (-> this local-box4w))
|
||||
(format #t "~1Tsearch-box: #<bounding-box4w @ #x~X>~%" (-> this search-box))
|
||||
(format #t "~1Tsearch-vector: #<vector4w @ #x~X>~%" (-> this search-vector))
|
||||
(format #t "~1Tinstance-mat: #<matrix @ #x~X>~%" (-> this instance-mat))
|
||||
(format #t "~1Tinstance-ptr: ~A~%" (-> this instance-ptr))
|
||||
(format #t "~1Tx-addr: ~D~%" (-> this x-addr))
|
||||
(format #t "~1Tx-step: ~D~%" (-> this x-step))
|
||||
(format #t "~1Ty-addr: ~D~%" (-> this y-addr))
|
||||
(format #t "~1Ty-step: ~D~%" (-> this y-step))
|
||||
(format #t "~1Tz-addr: ~D~%" (-> this z-addr))
|
||||
(format #t "~1Tz-step: ~D~%" (-> this z-step))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition for symbol *collide-test-flag*, type symbol
|
||||
(define *collide-test-flag* #f)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
0
|
||||
|
||||
|
||||
|
||||
|
||||
Generated
Vendored
Generated
Vendored
Generated
Vendored
+1
-5
@@ -13,7 +13,7 @@ control over memory layout for use with DMA."
|
||||
(bsphere vector :inline)
|
||||
)
|
||||
(:methods
|
||||
(drawable-method-9 () none)
|
||||
(login (_type_) _type_)
|
||||
(draw (_type_ _type_ display-frame) none)
|
||||
(drawable-method-11 () none)
|
||||
(drawable-method-12 () none)
|
||||
@@ -60,7 +60,3 @@ control over memory layout for use with DMA."
|
||||
|
||||
;; failed to figure out what this is:
|
||||
0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; definition of type background-work
|
||||
(deftype background-work (basic)
|
||||
"List of all things for the background renderer to draw."
|
||||
((tfrag-tree-count int32)
|
||||
(tfrag-trees drawable-tree-tfrag 11)
|
||||
(tfrag-levels level 11)
|
||||
(tfrag-trans-tree-count int32)
|
||||
(tfrag-trans-trees drawable-tree-tfrag-trans 11)
|
||||
(tfrag-trans-levels level 11)
|
||||
(tfrag-water-tree-count int32)
|
||||
(tfrag-water-trees drawable-tree-tfrag-water 11)
|
||||
(tfrag-water-levels level 11)
|
||||
(shrub-tree-count int32)
|
||||
(shrub-trees drawable-tree-instance-shrub 11)
|
||||
(shrub-levels level 11)
|
||||
(tie-tree-count int32)
|
||||
(tie-trees drawable-tree-instance-tie 11)
|
||||
(tie-levels level 11)
|
||||
(tie-generic basic 11)
|
||||
(tie-generic-trans basic 11)
|
||||
(wait-to-vu0 uint32)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type background-work
|
||||
(defmethod inspect ((this background-work))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this (-> this type))
|
||||
(format #t "~1Ttfrag-tree-count: ~D~%" (-> this tfrag-tree-count))
|
||||
(format #t "~1Ttfrag-trees[11] @ #x~X~%" (-> this tfrag-trees))
|
||||
(format #t "~1Ttfrag-levels[11] @ #x~X~%" (-> this tfrag-levels))
|
||||
(format #t "~1Ttfrag-trans-tree-count: ~D~%" (-> this tfrag-trans-tree-count))
|
||||
(format #t "~1Ttfrag-trans-trees[11] @ #x~X~%" (-> this tfrag-trans-trees))
|
||||
(format #t "~1Ttfrag-trans-levels[11] @ #x~X~%" (-> this tfrag-trans-levels))
|
||||
(format #t "~1Ttfrag-water-tree-count: ~D~%" (-> this tfrag-water-tree-count))
|
||||
(format #t "~1Ttfrag-water-trees[11] @ #x~X~%" (-> this tfrag-water-trees))
|
||||
(format #t "~1Ttfrag-water-levels[11] @ #x~X~%" (-> this tfrag-water-levels))
|
||||
(format #t "~1Tshrub-tree-count: ~D~%" (-> this shrub-tree-count))
|
||||
(format #t "~1Tshrub-trees[11] @ #x~X~%" (-> this shrub-trees))
|
||||
(format #t "~1Tshrub-levels[11] @ #x~X~%" (-> this shrub-levels))
|
||||
(format #t "~1Ttie-tree-count: ~D~%" (-> this tie-tree-count))
|
||||
(format #t "~1Ttie-trees[11] @ #x~X~%" (-> this tie-trees))
|
||||
(format #t "~1Ttie-levels[11] @ #x~X~%" (-> this tie-levels))
|
||||
(format #t "~1Ttie-generic[11] @ #x~X~%" (-> this tie-generic))
|
||||
(format #t "~1Ttie-generic-trans[11] @ #x~X~%" (-> this tie-generic-trans))
|
||||
(format #t "~1Twait-to-vu0: ~D~%" (-> this wait-to-vu0))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
0
|
||||
|
||||
|
||||
|
||||
|
||||
+327
@@ -0,0 +1,327 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; definition of type subdivide-settings
|
||||
(deftype subdivide-settings (basic)
|
||||
"Input settings for distances for switching mesh level of details.
|
||||
These are set by the level code and read by rendering code."
|
||||
((dist float 5)
|
||||
(meters float 5)
|
||||
(close float 12)
|
||||
(far float 12)
|
||||
)
|
||||
(:methods
|
||||
(new (symbol type float float) _type_)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type subdivide-settings
|
||||
(defmethod inspect ((this subdivide-settings))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this (-> this type))
|
||||
(format #t "~1Tdist[5] @ #x~X~%" (-> this dist))
|
||||
(format #t "~1Tmeters[5] @ #x~X~%" (-> this meters))
|
||||
(format #t "~1Tclose[12] @ #x~X~%" (-> this close))
|
||||
(format #t "~1Tfar[12] @ #x~X~%" (-> this far))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition for method 0 of type subdivide-settings
|
||||
(defmethod new subdivide-settings ((allocation symbol) (type-to-make type) (arg0 float) (arg1 float))
|
||||
(let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size)))))
|
||||
(dotimes (v1-2 10)
|
||||
(set! (-> v0-0 close v1-2) arg0)
|
||||
(set! (-> v0-0 far v1-2) arg1)
|
||||
)
|
||||
v0-0
|
||||
)
|
||||
)
|
||||
|
||||
;; definition of type subdivide-dists
|
||||
(deftype subdivide-dists (structure)
|
||||
"Unused subdivide distances. Internally, tfrag/tie figure these out instead."
|
||||
((data uint32 32 :offset 0)
|
||||
(vector vector 8 :overlay-at (-> data 0))
|
||||
(k0s uint128 4 :overlay-at (-> data 0))
|
||||
(k1s uint128 4 :overlay-at (-> data 16))
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type subdivide-dists
|
||||
(defmethod inspect ((this subdivide-dists))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'subdivide-dists)
|
||||
(format #t "~1Tdata[32] @ #x~X~%" (-> this data))
|
||||
(format #t "~1Tvector[8] @ #x~X~%" (-> this data))
|
||||
(format #t "~1Tk0s[4] @ #x~X~%" (-> this data))
|
||||
(format #t "~1Tk1s[4] @ #x~X~%" (-> this k1s))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type terrain-stats
|
||||
(deftype terrain-stats (structure)
|
||||
"Desptie the name `terrain-stats`, these are more general triangle stats for all renderers."
|
||||
((pris tr-stat :inline)
|
||||
(tie-generic tr-stat :inline)
|
||||
(tie-vanish tr-stat :inline)
|
||||
(tie tr-stat :inline)
|
||||
(tie-scissor tr-stat :inline)
|
||||
(tie-envmap tr-stat :inline)
|
||||
(tie-envmap-scissor tr-stat :inline)
|
||||
(tie-trans tr-stat :inline)
|
||||
(tie-scissor-trans tr-stat :inline)
|
||||
(tie-envmap-trans tr-stat :inline)
|
||||
(tie-envmap-scissor-trans tr-stat :inline)
|
||||
(tie-water tr-stat :inline)
|
||||
(tie-scissor-water tr-stat :inline)
|
||||
(tie-envmap-water tr-stat :inline)
|
||||
(tie-envmap-scissor-water tr-stat :inline)
|
||||
(shrub-near tr-stat :inline)
|
||||
(shrub tr-stat :inline)
|
||||
(tfrag-scissor tr-stat :inline)
|
||||
(tfrag tr-stat :inline)
|
||||
(billboard tr-stat :inline)
|
||||
(tfrag-trans tr-stat :inline)
|
||||
(tfrag-scissor-trans tr-stat :inline)
|
||||
(tfrag-water tr-stat :inline)
|
||||
(tfrag-scissor-water tr-stat :inline)
|
||||
(trans-pris tr-stat :inline)
|
||||
(trans-shrub tr-stat :inline)
|
||||
(ocean-mid tr-stat :inline)
|
||||
(ocean-near tr-stat :inline)
|
||||
(shadow tr-stat :inline)
|
||||
(hfrag tr-stat :inline)
|
||||
(total tr-stat :inline)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type terrain-stats
|
||||
(defmethod inspect ((this terrain-stats))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'terrain-stats)
|
||||
(format #t "~1Tpris: #<tr-stat @ #x~X>~%" (-> this pris))
|
||||
(format #t "~1Ttie-generic: #<tr-stat @ #x~X>~%" (-> this tie-generic))
|
||||
(format #t "~1Ttie-vanish: #<tr-stat @ #x~X>~%" (-> this tie-vanish))
|
||||
(format #t "~1Ttie: #<tr-stat @ #x~X>~%" (-> this tie))
|
||||
(format #t "~1Ttie-scissor: #<tr-stat @ #x~X>~%" (-> this tie-scissor))
|
||||
(format #t "~1Ttie-envmap: #<tr-stat @ #x~X>~%" (-> this tie-envmap))
|
||||
(format #t "~1Ttie-envmap-scissor: #<tr-stat @ #x~X>~%" (-> this tie-envmap-scissor))
|
||||
(format #t "~1Ttie-trans: #<tr-stat @ #x~X>~%" (-> this tie-trans))
|
||||
(format #t "~1Ttie-scissor-trans: #<tr-stat @ #x~X>~%" (-> this tie-scissor-trans))
|
||||
(format #t "~1Ttie-envmap-trans: #<tr-stat @ #x~X>~%" (-> this tie-envmap-trans))
|
||||
(format #t "~1Ttie-envmap-scissor-trans: #<tr-stat @ #x~X>~%" (-> this tie-envmap-scissor-trans))
|
||||
(format #t "~1Ttie-water: #<tr-stat @ #x~X>~%" (-> this tie-water))
|
||||
(format #t "~1Ttie-scissor-water: #<tr-stat @ #x~X>~%" (-> this tie-scissor-water))
|
||||
(format #t "~1Ttie-envmap-water: #<tr-stat @ #x~X>~%" (-> this tie-envmap-water))
|
||||
(format #t "~1Ttie-envmap-scissor-water: #<tr-stat @ #x~X>~%" (-> this tie-envmap-scissor-water))
|
||||
(format #t "~1Tshrub-near: #<tr-stat @ #x~X>~%" (-> this shrub-near))
|
||||
(format #t "~1Tshrub: #<tr-stat @ #x~X>~%" (-> this shrub))
|
||||
(format #t "~1Ttfrag-scissor: #<tr-stat @ #x~X>~%" (-> this tfrag-scissor))
|
||||
(format #t "~1Ttfrag: #<tr-stat @ #x~X>~%" (-> this tfrag))
|
||||
(format #t "~1Tbillboard: #<tr-stat @ #x~X>~%" (-> this billboard))
|
||||
(format #t "~1Ttfrag-trans: #<tr-stat @ #x~X>~%" (-> this tfrag-trans))
|
||||
(format #t "~1Ttfrag-scissor-trans: #<tr-stat @ #x~X>~%" (-> this tfrag-scissor-trans))
|
||||
(format #t "~1Ttfrag-water: #<tr-stat @ #x~X>~%" (-> this tfrag-water))
|
||||
(format #t "~1Ttfrag-scissor-water: #<tr-stat @ #x~X>~%" (-> this tfrag-scissor-water))
|
||||
(format #t "~1Ttrans-pris: #<tr-stat @ #x~X>~%" (-> this trans-pris))
|
||||
(format #t "~1Ttrans-shrub: #<tr-stat @ #x~X>~%" (-> this trans-shrub))
|
||||
(format #t "~1Tocean-mid: #<tr-stat @ #x~X>~%" (-> this ocean-mid))
|
||||
(format #t "~1Tocean-near: #<tr-stat @ #x~X>~%" (-> this ocean-near))
|
||||
(format #t "~1Tshadow: #<tr-stat @ #x~X>~%" (-> this shadow))
|
||||
(format #t "~1Thfrag: #<tr-stat @ #x~X>~%" (-> this hfrag))
|
||||
(format #t "~1Ttotal: #<tr-stat @ #x~X>~%" (-> this total))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type background-area
|
||||
(deftype background-area (structure)
|
||||
"Scratchpad memory layout for most background rendering
|
||||
This uses the full scratchpad so it should only be used when the stack isn't on the scratchpad (rendering code).
|
||||
Interestingly, dma-area went from a union of all the -dma types to a plain array of bytes in jak 3."
|
||||
((dma-area uint8 14336)
|
||||
(vis-list uint8 2048)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type background-area
|
||||
(defmethod inspect ((this background-area))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'background-area)
|
||||
(format #t "~1Tdma-area[14336] @ #x~X~%" (-> this dma-area))
|
||||
(format #t "~1Tvis-list[2048] @ #x~X~%" (-> this vis-list))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type foreground-area
|
||||
(deftype foreground-area (structure)
|
||||
"Scratchpad memory layout for most foreground rendering."
|
||||
((generic-work generic-work :inline :offset 0)
|
||||
(foreground-work foreground-work :inline :offset 0)
|
||||
(joint-work joint-work :inline :offset 0)
|
||||
(bone-mem bone-memory :inline :offset 0)
|
||||
(shadow-work shadow-work :inline :offset 0)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type foreground-area
|
||||
(defmethod inspect ((this foreground-area))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'foreground-area)
|
||||
(format #t "~1Tgeneric-work: #<generic-work @ #x~X>~%" (-> this generic-work))
|
||||
(format #t "~1Tforeground-work: #<foreground-work @ #x~X>~%" (-> this generic-work))
|
||||
(format #t "~1Tjoint-work: #<joint-work @ #x~X>~%" (-> this generic-work))
|
||||
(format #t "~1Tbone-mem: #<bone-memory @ #x~X>~%" (-> this generic-work))
|
||||
(format #t "~1Tshadow-work: #<shadow-work @ #x~X>~%" (-> this generic-work))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type region-prim-area
|
||||
(deftype region-prim-area (structure)
|
||||
"Scratchpad memory layout for regions."
|
||||
((region-prim-list region-prim-list :inline)
|
||||
(pos vector :inline)
|
||||
(ray vector :inline :offset 1328)
|
||||
(region-enter-count int32 :offset 1360)
|
||||
(region-enter-list region 320)
|
||||
(region-enter-prim-list drawable-region-sphere 320)
|
||||
(region-exit-count int32)
|
||||
(region-exit-list region 320)
|
||||
(region-exit-prim-list drawable-region-sphere 320)
|
||||
(region-inside-count int32)
|
||||
(region-inside-list region 320)
|
||||
(region-inside-prim-list drawable-region-sphere 320)
|
||||
(region-start-count int32)
|
||||
(region-start-list region 320)
|
||||
(region-start-prim-list drawable-region-sphere 320)
|
||||
)
|
||||
(:methods
|
||||
(region-prim-area-method-9 () none)
|
||||
(region-prim-area-method-10 () none)
|
||||
(region-prim-area-method-11 () none)
|
||||
(region-prim-area-method-12 () none)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type region-prim-area
|
||||
(defmethod inspect ((this region-prim-area))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'region-prim-area)
|
||||
(format #t "~1Tregion-prim-list: #<region-prim-list @ #x~X>~%" (-> this region-prim-list))
|
||||
(format #t "~1Tpos: ~`vector`P~%" (-> this pos))
|
||||
(format #t "~1Tray: ~`vector`P~%" (-> this ray))
|
||||
(format #t "~1Tregion-enter-count: ~D~%" (-> this region-enter-count))
|
||||
(format #t "~1Tregion-enter-list[320] @ #x~X~%" (-> this region-enter-list))
|
||||
(format #t "~1Tregion-enter-prim-list[320] @ #x~X~%" (-> this region-enter-prim-list))
|
||||
(format #t "~1Tregion-exit-count: ~D~%" (-> this region-exit-count))
|
||||
(format #t "~1Tregion-exit-list[320] @ #x~X~%" (-> this region-exit-list))
|
||||
(format #t "~1Tregion-exit-prim-list[320] @ #x~X~%" (-> this region-exit-prim-list))
|
||||
(format #t "~1Tregion-inside-count: ~D~%" (-> this region-inside-count))
|
||||
(format #t "~1Tregion-inside-list[320] @ #x~X~%" (-> this region-inside-list))
|
||||
(format #t "~1Tregion-inside-prim-list[320] @ #x~X~%" (-> this region-inside-prim-list))
|
||||
(format #t "~1Tregion-start-count: ~D~%" (-> this region-start-count))
|
||||
(format #t "~1Tregion-start-list[320] @ #x~X~%" (-> this region-start-list))
|
||||
(format #t "~1Tregion-start-prim-list[320] @ #x~X~%" (-> this region-start-prim-list))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type sprite-area
|
||||
(deftype sprite-area (structure)
|
||||
"Scratchpad memory layout for sprites."
|
||||
((clock-data vector 22 :inline)
|
||||
(buffer uint8 :dynamic)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type sprite-area
|
||||
(defmethod inspect ((this sprite-area))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'sprite-area)
|
||||
(format #t "~1Tclock-data[22] @ #x~X~%" (-> this clock-data))
|
||||
(format #t "~1Tbuffer[0] @ #x~X~%" (-> this buffer))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type work-area
|
||||
(deftype work-area (structure)
|
||||
"All scratchpad memory layouts."
|
||||
((background background-area :inline :offset 0)
|
||||
(foreground foreground-area :inline :offset 0)
|
||||
(region-prim region-prim-area :inline :offset 0)
|
||||
(sprite sprite-area :inline :offset 0)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type work-area
|
||||
(defmethod inspect ((this work-area))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'work-area)
|
||||
(format #t "~1Tbackground: #<background-area @ #x~X>~%" (-> this background))
|
||||
(format #t "~1Tforeground: #<foreground-area @ #x~X>~%" (-> this background))
|
||||
(format #t "~1Tregion-prim: #<region-prim-area @ #x~X>~%" (-> this background))
|
||||
(format #t "~1Tsprite: #<sprite-area @ #x~X>~%" (-> this background))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type terrain-context
|
||||
(deftype terrain-context (structure)
|
||||
"Useless wrapper around work-area. (this added some stuff in jak 1)"
|
||||
((work work-area :inline)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type terrain-context
|
||||
(defmethod inspect ((this terrain-context))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'terrain-context)
|
||||
(format #t "~1Twork: #<work-area @ #x~X>~%" (-> this work))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition for symbol *terrain-stats*, type terrain-stats
|
||||
(define *terrain-stats* (new 'global 'terrain-stats))
|
||||
|
||||
;; definition for symbol *collide-stats*, type collide-stats
|
||||
(define *collide-stats* (new 'global 'collide-stats))
|
||||
|
||||
;; failed to figure out what this is:
|
||||
0
|
||||
|
||||
|
||||
|
||||
|
||||
+1071
File diff suppressed because it is too large
Load Diff
+482
@@ -0,0 +1,482 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; definition of type billboard
|
||||
(deftype billboard (drawable)
|
||||
"A billboard for shrubbery in the distance. This is simple a quad that faces the camera.
|
||||
The only data needed is the texture/mode. The location is determined by bsphere."
|
||||
((flat adgif-shader :inline)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type billboard
|
||||
(defmethod inspect ((this billboard))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this (-> this type))
|
||||
(format #t "~1Tid: ~D~%" (-> this id))
|
||||
(format #t "~1Tbsphere: ~`vector`P~%" (-> this bsphere))
|
||||
(format #t "~1Tflat: #<adgif-shader @ #x~X>~%" (-> this flat))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type shrub-view-data
|
||||
(deftype shrub-view-data (structure)
|
||||
"Camera and general settings for shrubbery VU1 program."
|
||||
((data uint128 3)
|
||||
(texture-giftag gs-gif-tag :inline :overlay-at (-> data 0))
|
||||
(consts vector :inline :overlay-at (-> data 1))
|
||||
(fog-clamp vector :inline :overlay-at (-> data 2))
|
||||
(tex-start-ptr int32 :overlay-at (-> data 1))
|
||||
(gifbufsum float :overlay-at (-> data 1))
|
||||
(mtx-buf-ptr int32 :overlay-at (-> consts y))
|
||||
(exp23 float :overlay-at mtx-buf-ptr)
|
||||
(fog-0 float :overlay-at (-> consts z))
|
||||
(fog-1 float :overlay-at (-> consts w))
|
||||
(fog-min float :overlay-at (-> data 2))
|
||||
(fog-max float :overlay-at (-> fog-clamp y))
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type shrub-view-data
|
||||
(defmethod inspect ((this shrub-view-data))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'shrub-view-data)
|
||||
(format #t "~1Tdata[3] @ #x~X~%" (-> this data))
|
||||
(format #t "~1Ttexture-giftag: #<qword @ #x~X>~%" (-> this data))
|
||||
(format #t "~1Tconsts: #<vector @ #x~X>~%" (-> this consts))
|
||||
(format #t "~1Tfog-clamp: #<vector @ #x~X>~%" (-> this fog-clamp))
|
||||
(format #t "~1Ttex-start-ptr: ~D~%" (-> this consts x))
|
||||
(format #t "~1Tgifbufsum: ~f~%" (-> this consts x))
|
||||
(format #t "~1Tmtx-buf-ptr: ~D~%" (-> this consts y))
|
||||
(format #t "~1Texp23: ~f~%" (-> this consts y))
|
||||
(format #t "~1Tfog-0: ~f~%" (-> this consts z))
|
||||
(format #t "~1Tfog-1: ~f~%" (-> this consts w))
|
||||
(format #t "~1Tfog-min: ~f~%" (-> this fog-clamp x))
|
||||
(format #t "~1Tfog-max: ~f~%" (-> this fog-clamp y))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type shrubbery
|
||||
(deftype shrubbery (drawable)
|
||||
"Prototype (mesh/geometry) for a shrub. not _really_ a drawable in any way, as it
|
||||
overwrites all the normal drawable fields."
|
||||
((textures (inline-array adgif-shader) :overlay-at id)
|
||||
(header qword :offset 8)
|
||||
(obj-qwc uint8 :offset 12)
|
||||
(vtx-qwc uint8 :offset 13)
|
||||
(col-qwc uint8 :offset 14)
|
||||
(stq-qwc uint8 :offset 15)
|
||||
(obj uint32 :overlay-at (-> bsphere data 0))
|
||||
(vtx uint32 :overlay-at (-> bsphere data 1))
|
||||
(col uint32 :overlay-at (-> bsphere data 2))
|
||||
(stq uint32 :overlay-at (-> bsphere data 3))
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type shrubbery
|
||||
(defmethod inspect ((this shrubbery))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this (-> this type))
|
||||
(format #t "~1Tid: ~D~%" (-> this id))
|
||||
(format #t "~1Tbsphere: ~`vector`P~%" (-> this bsphere))
|
||||
(format #t "~1Ttextures: #x~X~%" (-> this textures))
|
||||
(format #t "~1Theader: #<qword @ #x~X>~%" (-> this header))
|
||||
(format #t "~1Tobj-qwc: ~D~%" (-> this obj-qwc))
|
||||
(format #t "~1Tvtx-qwc: ~D~%" (-> this vtx-qwc))
|
||||
(format #t "~1Tcol-qwc: ~D~%" (-> this col-qwc))
|
||||
(format #t "~1Tstq-qwc: ~D~%" (-> this stq-qwc))
|
||||
(format #t "~1Tobj: #x~X~%" (-> this bsphere x))
|
||||
(format #t "~1Tvtx: #x~X~%" (-> this bsphere y))
|
||||
(format #t "~1Tcol: #x~X~%" (-> this bsphere z))
|
||||
(format #t "~1Tstq: #x~X~%" (-> this bsphere w))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type instance-shrubbery
|
||||
(deftype instance-shrubbery (instance)
|
||||
"Instance of a shrub."
|
||||
((flat-normal vector :inline)
|
||||
(flat-hwidth float :overlay-at (-> flat-normal data 3))
|
||||
(color uint32 :offset 8)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type instance-shrubbery
|
||||
(defmethod inspect ((this instance-shrubbery))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this (-> this type))
|
||||
(format #t "~1Tid: ~D~%" (-> this id))
|
||||
(format #t "~1Tbsphere: ~`vector`P~%" (-> this bsphere))
|
||||
(format #t "~1Tbucket-index: ~D~%" (-> this bucket-index))
|
||||
(format #t "~1Torigin: #<matrix4h @ #x~X>~%" (-> this origin))
|
||||
(format #t "~1Tflags: ~D~%" (-> this flags))
|
||||
(format #t "~1Twind-index: ~D~%" (-> this wind-index))
|
||||
(format #t "~1Tflat-normal: #<vector @ #x~X>~%" (-> this flat-normal))
|
||||
(format #t "~1Tflat-hwidth: ~f~%" (-> this flat-normal w))
|
||||
(format #t "~1Tcolor: ~D~%" (-> this color))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type drawable-inline-array-instance-shrub
|
||||
(deftype drawable-inline-array-instance-shrub (drawable-inline-array)
|
||||
"Array of shrub instances stored in the level data."
|
||||
((data instance-shrubbery 1 :inline)
|
||||
(pad uint32)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition of type drawable-tree-instance-shrub
|
||||
(deftype drawable-tree-instance-shrub (drawable-tree)
|
||||
"Drawable-tree for the shrubs."
|
||||
()
|
||||
)
|
||||
|
||||
;; definition of type generic-shrub-fragment
|
||||
(deftype generic-shrub-fragment (drawable)
|
||||
"Shrub data, converted into the format for generic.
|
||||
The shrub renderer doesn't support clipping, so it falls back to generic.
|
||||
This requires storing the data for all shrubs prototype twice!"
|
||||
((textures (inline-array adgif-shader) :overlay-at id)
|
||||
(vtx-cnt uint32 :offset 8)
|
||||
(cnt-qwc uint8 :offset 12)
|
||||
(vtx-qwc uint8 :offset 13)
|
||||
(col-qwc uint8 :offset 14)
|
||||
(stq-qwc uint8 :offset 15)
|
||||
(cnt uint32 :overlay-at (-> bsphere data 0))
|
||||
(vtx uint32 :overlay-at (-> bsphere data 1))
|
||||
(col uint32 :overlay-at (-> bsphere data 2))
|
||||
(stq uint32 :overlay-at (-> bsphere data 3))
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type generic-shrub-fragment
|
||||
(defmethod inspect ((this generic-shrub-fragment))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this (-> this type))
|
||||
(format #t "~1Tid: ~D~%" (-> this id))
|
||||
(format #t "~1Tbsphere: ~`vector`P~%" (-> this bsphere))
|
||||
(format #t "~1Ttextures: #x~X~%" (-> this textures))
|
||||
(format #t "~1Tvtx-cnt: ~D~%" (-> this vtx-cnt))
|
||||
(format #t "~1Tcnt-qwc: ~D~%" (-> this cnt-qwc))
|
||||
(format #t "~1Tvtx-qwc: ~D~%" (-> this vtx-qwc))
|
||||
(format #t "~1Tcol-qwc: ~D~%" (-> this col-qwc))
|
||||
(format #t "~1Tstq-qwc: ~D~%" (-> this stq-qwc))
|
||||
(format #t "~1Tcnt: #x~X~%" (-> this bsphere x))
|
||||
(format #t "~1Tvtx: #x~X~%" (-> this bsphere y))
|
||||
(format #t "~1Tcol: #x~X~%" (-> this bsphere z))
|
||||
(format #t "~1Tstq: #x~X~%" (-> this bsphere w))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type prototype-shrubbery
|
||||
(deftype prototype-shrubbery (drawable-inline-array)
|
||||
"Array of shrub prototypes."
|
||||
((data shrubbery 1 :inline)
|
||||
(pad uint32)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition of type prototype-trans-shrubbery
|
||||
(deftype prototype-trans-shrubbery (prototype-shrubbery)
|
||||
"Array of transparent shrub prototypes."
|
||||
()
|
||||
)
|
||||
|
||||
;; definition of type prototype-generic-shrub
|
||||
(deftype prototype-generic-shrub (drawable-group)
|
||||
()
|
||||
)
|
||||
|
||||
;; definition of type shrubbery-matrix
|
||||
(deftype shrubbery-matrix (structure)
|
||||
"Instance matrix for a shrub, contains interpolated color."
|
||||
((mat matrix :inline)
|
||||
(color qword :inline)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type shrubbery-matrix
|
||||
(defmethod inspect ((this shrubbery-matrix))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'shrubbery-matrix)
|
||||
(format #t "~1Tmat: #<matrix @ #x~X>~%" (-> this mat))
|
||||
(format #t "~1Tcolor: #<qword @ #x~X>~%" (-> this color))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition for function shrubbery-login-post-texture
|
||||
;; INFO: Used lq/sq
|
||||
;; WARN: Return type mismatch symbol vs none.
|
||||
(defun shrubbery-login-post-texture ((arg0 shrubbery))
|
||||
"Do some weird fix-up to the shrubbery textures. this is likely to present normal-looking adgifs to the texture system, but then we scramble them up for easier consumption by VU1."
|
||||
(let* ((v1-1 (-> arg0 header data 0))
|
||||
(a1-1 (the-as object (+ (the-as uint (-> arg0 header)) (* (+ (-> arg0 header data 1) 1) 16))))
|
||||
(a2-5 (the-as object (+ (the-as int a1-1) (* v1-1 64))))
|
||||
(a3-0 (the-as object (-> arg0 textures)))
|
||||
)
|
||||
(dotimes (a0-1 (the-as int v1-1))
|
||||
(set! (-> (the-as qword a2-5) quad) (-> (the-as qword a3-0) quad))
|
||||
(let ((a2-6 (the-as object (+ (the-as int a2-5) 16)))
|
||||
(a3-1 (the-as object (&+ (the-as pointer a3-0) 16)))
|
||||
)
|
||||
(set! (-> (the-as qword a1-1) vector4w x) (the-as int (-> (the-as qword a3-1) data 0)))
|
||||
(set! (-> (the-as qword a1-1) vector4w y) (the-as int (-> (the-as qword a3-1) data 1)))
|
||||
(set! (-> (the-as qword a1-1) vector4w z) (the-as int (-> (the-as qword a3-1) data 2)))
|
||||
(set! a1-1 (+ (the-as int a1-1) 16))
|
||||
(let ((a3-2 (the-as object (&+ (the-as pointer a3-1) 16))))
|
||||
(dotimes (t0-4 3)
|
||||
(set! (-> (the-as qword a1-1) quad) (-> (the-as qword a3-2) quad))
|
||||
(set! a1-1 (+ (the-as int a1-1) 16))
|
||||
(set! a3-2 (&+ (the-as pointer a3-2) 16))
|
||||
)
|
||||
(set! (-> (the-as qword a2-6) quad) (-> (the-as qword a3-2) quad))
|
||||
(set! a2-5 (+ (the-as int a2-6) 16))
|
||||
(set! a3-0 (&+ (the-as pointer a3-2) 80))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for symbol *shrub-state*, type int
|
||||
(define *shrub-state* 0)
|
||||
|
||||
;; definition of type shrub-near-packet
|
||||
(deftype shrub-near-packet (structure)
|
||||
"DMA templates for generic rendering of shrubs."
|
||||
((matrix-tmpl dma-packet :inline)
|
||||
(header-tmpl dma-packet :inline)
|
||||
(stq-tmpl dma-packet :inline)
|
||||
(color-tmpl dma-packet :inline)
|
||||
(vertex-tmpl dma-packet :inline)
|
||||
(mscal-tmpl dma-packet :inline)
|
||||
(init-tmpl dma-packet :inline)
|
||||
(init-data qword 8)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type shrub-near-packet
|
||||
(defmethod inspect ((this shrub-near-packet))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'shrub-near-packet)
|
||||
(format #t "~1Tmatrix-tmpl: #<dma-packet @ #x~X>~%" (-> this matrix-tmpl))
|
||||
(format #t "~1Theader-tmpl: #<dma-packet @ #x~X>~%" (-> this header-tmpl))
|
||||
(format #t "~1Tstq-tmpl: #<dma-packet @ #x~X>~%" (-> this stq-tmpl))
|
||||
(format #t "~1Tcolor-tmpl: #<dma-packet @ #x~X>~%" (-> this color-tmpl))
|
||||
(format #t "~1Tvertex-tmpl: #<dma-packet @ #x~X>~%" (-> this vertex-tmpl))
|
||||
(format #t "~1Tmscal-tmpl: #<dma-packet @ #x~X>~%" (-> this mscal-tmpl))
|
||||
(format #t "~1Tinit-tmpl: #<dma-packet @ #x~X>~%" (-> this init-tmpl))
|
||||
(format #t "~1Tinit-data[8] @ #x~X~%" (-> this init-data))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type instance-shrub-work
|
||||
(deftype instance-shrub-work (structure)
|
||||
"Scratchpad layout for generating shrub DMA."
|
||||
((dummy qword 3 :inline)
|
||||
(chaina qword 8 :inline)
|
||||
(chainb qword 8 :inline)
|
||||
(colors rgba 1024)
|
||||
(matrix-tmpl qword 20 :inline)
|
||||
(count-tmpl vector4w 20 :inline)
|
||||
(mscalf-tmpl dma-packet :inline)
|
||||
(mscalf-ret-tmpl dma-packet :inline)
|
||||
(adgif-tmpl dma-gif-packet :inline)
|
||||
(billboard-tmpl dma-gif-packet :inline)
|
||||
(billboard-const vector :inline)
|
||||
(shrub-near-packets shrub-near-packet 6 :inline)
|
||||
(dma-ref dma-packet :inline)
|
||||
(dma-end dma-packet :inline)
|
||||
(wind-const vector :inline)
|
||||
(constants vector :inline)
|
||||
(color-constant vector4w :inline)
|
||||
(hmge-d vector :inline)
|
||||
(hvdf-offset vector :inline)
|
||||
(wind-force vector :inline)
|
||||
(color vector :inline)
|
||||
(bb-color vector :inline)
|
||||
(min-dist vector :inline)
|
||||
(temp-vec vector :inline)
|
||||
(guard-plane plane 4 :inline)
|
||||
(plane plane 4 :inline)
|
||||
(last uint32 4)
|
||||
(next uint32 4)
|
||||
(count uint16 4)
|
||||
(mod-count uint16 4)
|
||||
(wind-vectors uint32)
|
||||
(instance-ptr uint32)
|
||||
(chain-ptr uint32)
|
||||
(chain-ptr-next uint32)
|
||||
(stack-ptr uint32)
|
||||
(bucket-ptr uint32)
|
||||
(src-ptr uint32)
|
||||
(to-spr uint32)
|
||||
(from-spr uint32)
|
||||
(shrub-count uint32)
|
||||
(stack-ptr2 uint32 :overlay-at stack-ptr)
|
||||
(node uint32 6 :offset 6428)
|
||||
(length uint32 6)
|
||||
(prototypes uint32)
|
||||
(bucket-ptr2 uint32 :overlay-at bucket-ptr)
|
||||
(start-bank uint8 20 :offset 6484)
|
||||
(buffer-index uint32)
|
||||
(current-spr uint32)
|
||||
(current-mem uint32)
|
||||
(current-shrub-near-packet uint32)
|
||||
(current-shrub-near-trans-packet uint32)
|
||||
(to-spr2 uint32 :overlay-at to-spr)
|
||||
(dma-buffer basic :offset 6528)
|
||||
(near-last uint32)
|
||||
(near-next uint32)
|
||||
(near-count uint32)
|
||||
(near-trans-last uint32)
|
||||
(near-trans-next uint32)
|
||||
(near-trans-count uint32)
|
||||
(last-shrubs uint32)
|
||||
(chains uint32)
|
||||
(flags uint32)
|
||||
(node-count uint32)
|
||||
(inst-count uint32)
|
||||
(wait-from-spr uint32)
|
||||
(wait-to-spr uint32)
|
||||
(texture-dists uint32)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type instance-shrub-work
|
||||
(defmethod inspect ((this instance-shrub-work))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'instance-shrub-work)
|
||||
(format #t "~1Tdummy[3] @ #x~X~%" (-> this dummy))
|
||||
(format #t "~1Tchaina[8] @ #x~X~%" (-> this chaina))
|
||||
(format #t "~1Tchainb[8] @ #x~X~%" (-> this chainb))
|
||||
(format #t "~1Tcolors[1024] @ #x~X~%" (-> this colors))
|
||||
(format #t "~1Tmatrix-tmpl[20] @ #x~X~%" (-> this matrix-tmpl))
|
||||
(format #t "~1Tcount-tmpl[20] @ #x~X~%" (-> this count-tmpl))
|
||||
(format #t "~1Tmscalf-tmpl: #<dma-packet @ #x~X>~%" (-> this mscalf-tmpl))
|
||||
(format #t "~1Tmscalf-ret-tmpl: #<dma-packet @ #x~X>~%" (-> this mscalf-ret-tmpl))
|
||||
(format #t "~1Tadgif-tmpl: #<dma-gif-packet @ #x~X>~%" (-> this adgif-tmpl))
|
||||
(format #t "~1Tbillboard-tmpl: #<dma-gif-packet @ #x~X>~%" (-> this billboard-tmpl))
|
||||
(format #t "~1Tbillboard-const: #<vector @ #x~X>~%" (-> this billboard-const))
|
||||
(format #t "~1Tshrub-near-packets[6] @ #x~X~%" (-> this shrub-near-packets))
|
||||
(format #t "~1Tdma-ref: #<dma-packet @ #x~X>~%" (-> this dma-ref))
|
||||
(format #t "~1Tdma-end: #<dma-packet @ #x~X>~%" (-> this dma-end))
|
||||
(format #t "~1Twind-const: #<vector @ #x~X>~%" (-> this wind-const))
|
||||
(format #t "~1Tconstants: #<vector @ #x~X>~%" (-> this constants))
|
||||
(format #t "~1Tcolor-constant: #<vector4w @ #x~X>~%" (-> this color-constant))
|
||||
(format #t "~1Thmge-d: #<vector @ #x~X>~%" (-> this hmge-d))
|
||||
(format #t "~1Thvdf-offset: #<vector @ #x~X>~%" (-> this hvdf-offset))
|
||||
(format #t "~1Twind-force: #<vector @ #x~X>~%" (-> this wind-force))
|
||||
(format #t "~1Tcolor: #<vector @ #x~X>~%" (-> this color))
|
||||
(format #t "~1Tbb-color: #<vector @ #x~X>~%" (-> this bb-color))
|
||||
(format #t "~1Tmin-dist: #<vector @ #x~X>~%" (-> this min-dist))
|
||||
(format #t "~1Ttemp-vec: #<vector @ #x~X>~%" (-> this temp-vec))
|
||||
(format #t "~1Tguard-plane[4] @ #x~X~%" (-> this guard-plane))
|
||||
(format #t "~1Tplane[4] @ #x~X~%" (-> this plane))
|
||||
(format #t "~1Tlast[4] @ #x~X~%" (-> this last))
|
||||
(format #t "~1Tnext[4] @ #x~X~%" (-> this next))
|
||||
(format #t "~1Tcount[4] @ #x~X~%" (-> this count))
|
||||
(format #t "~1Tmod-count[4] @ #x~X~%" (-> this mod-count))
|
||||
(format #t "~1Twind-vectors: #x~X~%" (-> this wind-vectors))
|
||||
(format #t "~1Tinstance-ptr: ~D~%" (-> this instance-ptr))
|
||||
(format #t "~1Tchain-ptr: ~D~%" (-> this chain-ptr))
|
||||
(format #t "~1Tchain-ptr-next: ~D~%" (-> this chain-ptr-next))
|
||||
(format #t "~1Tstack-ptr: ~D~%" (-> this stack-ptr))
|
||||
(format #t "~1Tbucket-ptr: ~D~%" (-> this bucket-ptr))
|
||||
(format #t "~1Tsrc-ptr: ~D~%" (-> this src-ptr))
|
||||
(format #t "~1Tto-spr: ~D~%" (-> this to-spr))
|
||||
(format #t "~1Tfrom-spr: ~D~%" (-> this from-spr))
|
||||
(format #t "~1Tshrub-count: ~D~%" (-> this shrub-count))
|
||||
(format #t "~1Tstack-ptr: ~D~%" (-> this stack-ptr))
|
||||
(format #t "~1Tnode[6] @ #x~X~%" (-> this node))
|
||||
(format #t "~1Tlength[6] @ #x~X~%" (-> this length))
|
||||
(format #t "~1Tprototypes: ~D~%" (-> this prototypes))
|
||||
(format #t "~1Tbucket-ptr: ~D~%" (-> this bucket-ptr))
|
||||
(format #t "~1Tstart-bank[20] @ #x~X~%" (-> this start-bank))
|
||||
(format #t "~1Tbuffer-index: ~D~%" (-> this buffer-index))
|
||||
(format #t "~1Tcurrent-spr: ~D~%" (-> this current-spr))
|
||||
(format #t "~1Tcurrent-mem: ~D~%" (-> this current-mem))
|
||||
(format #t "~1Tcurrent-shrub-near-packet: ~D~%" (-> this current-shrub-near-packet))
|
||||
(format #t "~1Tcurrent-shrub-near-trans-packet: ~D~%" (-> this current-shrub-near-trans-packet))
|
||||
(format #t "~1Tto-spr: ~D~%" (-> this to-spr))
|
||||
(format #t "~1Tdma-buffer: ~A~%" (-> this dma-buffer))
|
||||
(format #t "~1Tnear-last: ~D~%" (-> this near-last))
|
||||
(format #t "~1Tnear-next: ~D~%" (-> this near-next))
|
||||
(format #t "~1Tnear-count: ~D~%" (-> this near-count))
|
||||
(format #t "~1Tnear-trans-last: ~D~%" (-> this near-trans-last))
|
||||
(format #t "~1Tnear-trans-next: ~D~%" (-> this near-trans-next))
|
||||
(format #t "~1Tnear-trans-count: ~D~%" (-> this near-trans-count))
|
||||
(format #t "~1Tlast-shrubs: ~D~%" (-> this last-shrubs))
|
||||
(format #t "~1Tchains: ~D~%" (-> this chains))
|
||||
(format #t "~1Tflags: ~D~%" (-> this flags))
|
||||
(format #t "~1Tnode-count: ~D~%" (-> this node-count))
|
||||
(format #t "~1Tinst-count: ~D~%" (-> this inst-count))
|
||||
(format #t "~1Twait-from-spr: ~D~%" (-> this wait-from-spr))
|
||||
(format #t "~1Twait-to-spr: ~D~%" (-> this wait-to-spr))
|
||||
(format #t "~1Ttexture-dists: #x~X~%" (-> this texture-dists))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type instance-shrub-dma
|
||||
(deftype instance-shrub-dma (structure)
|
||||
((instancea uint128 325)
|
||||
(instanceb uint128 325)
|
||||
(outa uint128 128)
|
||||
(outb uint128 128)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type instance-shrub-dma
|
||||
(defmethod inspect ((this instance-shrub-dma))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'instance-shrub-dma)
|
||||
(format #t "~1Tinstancea[325] @ #x~X~%" (-> this instancea))
|
||||
(format #t "~1Tinstanceb[325] @ #x~X~%" (-> this instanceb))
|
||||
(format #t "~1Touta[128] @ #x~X~%" (-> this outa))
|
||||
(format #t "~1Toutb[128] @ #x~X~%" (-> this outb))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
0
|
||||
|
||||
|
||||
|
||||
|
||||
Generated
Vendored
+372
@@ -0,0 +1,372 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; definition of type sparticle-birthinfo
|
||||
(deftype sparticle-birthinfo (structure)
|
||||
"Used internally by the sparticle code."
|
||||
((sprite uint32)
|
||||
(anim int32)
|
||||
(anim-speed float)
|
||||
(birth-func basic)
|
||||
(joint-ppoint int32)
|
||||
(num-to-birth float)
|
||||
(sound basic)
|
||||
(dataf float 1 :overlay-at sprite)
|
||||
(data uint32 1 :overlay-at sprite)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type sparticle-birthinfo
|
||||
(defmethod inspect ((this sparticle-birthinfo))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'sparticle-birthinfo)
|
||||
(format #t "~1Tsprite: ~D~%" (-> this sprite))
|
||||
(format #t "~1Tanim: ~D~%" (-> this anim))
|
||||
(format #t "~1Tanim-speed: ~f~%" (-> this anim-speed))
|
||||
(format #t "~1Tbirth-func: ~A~%" (-> this birth-func))
|
||||
(format #t "~1Tjoint-ppoint: ~D~%" (-> this joint-ppoint))
|
||||
(format #t "~1Tnum-to-birth: ~f~%" (-> this num-to-birth))
|
||||
(format #t "~1Tsound: ~A~%" (-> this sound))
|
||||
(format #t "~1Tdataf[1] @ #x~X~%" (&-> this sprite))
|
||||
(format #t "~1Tdata[1] @ #x~X~%" (&-> this sprite))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type sp-field-init-spec
|
||||
(deftype sp-field-init-spec (structure)
|
||||
"Part of a particle definition - how to initialize a field of a particle."
|
||||
((field sp-field-id)
|
||||
(flags sp-flag)
|
||||
(initial-valuef float)
|
||||
(random-rangef float)
|
||||
(random-multf float)
|
||||
(initial-value int32 :overlay-at initial-valuef)
|
||||
(random-range int32 :overlay-at random-rangef)
|
||||
(random-mult int32 :overlay-at random-multf)
|
||||
(func symbol :overlay-at initial-valuef)
|
||||
(tex texture-id :overlay-at initial-valuef)
|
||||
(pntr pointer :overlay-at initial-valuef)
|
||||
(object basic :overlay-at initial-valuef)
|
||||
(sym symbol :overlay-at initial-valuef)
|
||||
(sound sound-spec :overlay-at initial-valuef)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type sp-field-init-spec
|
||||
(defmethod inspect ((this sp-field-init-spec))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'sp-field-init-spec)
|
||||
(format #t "~1Tfield: ~D~%" (-> this field))
|
||||
(format #t "~1Tflags: ~D~%" (-> this flags))
|
||||
(format #t "~1Tinitial-valuef: ~f~%" (-> this initial-valuef))
|
||||
(format #t "~1Trandom-rangef: ~f~%" (-> this random-rangef))
|
||||
(format #t "~1Trandom-multf: ~f~%" (-> this random-multf))
|
||||
(format #t "~1Tinitial-value: ~D~%" (-> this initial-valuef))
|
||||
(format #t "~1Trandom-range: ~D~%" (-> this random-rangef))
|
||||
(format #t "~1Trandom-mult: ~D~%" (-> this random-multf))
|
||||
(format #t "~1Tfunc: ~A~%" (-> this initial-valuef))
|
||||
(format #t "~1Ttex: ~D~%" (-> this initial-valuef))
|
||||
(format #t "~1Tpntr: #x~X~%" (-> this initial-valuef))
|
||||
(format #t "~1Tobject: ~A~%" (-> this initial-valuef))
|
||||
(format #t "~1Tsym: ~A~%" (-> this initial-valuef))
|
||||
(format #t "~1Tsound: ~A~%" (-> this initial-valuef))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type sparticle-launcher
|
||||
(deftype sparticle-launcher (basic)
|
||||
"A definition of a single particle, as a list of init specs."
|
||||
((birthaccum float)
|
||||
(soundaccum float)
|
||||
(init-specs (inline-array sp-field-init-spec))
|
||||
)
|
||||
(:methods
|
||||
(get-field-spec-by-id (_type_ sp-field-id) sp-field-init-spec)
|
||||
(setup-special-textures (_type_ string) none)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type sparticle-launcher
|
||||
(defmethod inspect ((this sparticle-launcher))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this (-> this type))
|
||||
(format #t "~1Tbirthaccum: ~f~%" (-> this birthaccum))
|
||||
(format #t "~1Tsoundaccum: ~f~%" (-> this soundaccum))
|
||||
(format #t "~1Tinit-specs: #x~X~%" (-> this init-specs))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type sparticle-group-item
|
||||
(deftype sparticle-group-item (structure)
|
||||
"A reference to a single sparticle-launcher (by ID) and some parameters for using it."
|
||||
((launcher uint32)
|
||||
(fade-after meters)
|
||||
(falloff-to meters)
|
||||
(flags sp-group-item-flag)
|
||||
(period uint16)
|
||||
(length uint16)
|
||||
(offset int16)
|
||||
(hour-mask uint32)
|
||||
(binding uint32)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type sparticle-group-item
|
||||
(defmethod inspect ((this sparticle-group-item))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'sparticle-group-item)
|
||||
(format #t "~1Tlauncher: ~D~%" (-> this launcher))
|
||||
(format #t "~1Tfade-after: (meters ~m)~%" (-> this fade-after))
|
||||
(format #t "~1Tfalloff-to: (meters ~m)~%" (-> this falloff-to))
|
||||
(format #t "~1Tflags: ~D~%" (-> this flags))
|
||||
(format #t "~1Tperiod: ~D~%" (-> this period))
|
||||
(format #t "~1Tlength: ~D~%" (-> this length))
|
||||
(format #t "~1Toffset: ~D~%" (-> this offset))
|
||||
(format #t "~1Thour-mask: ~D~%" (-> this hour-mask))
|
||||
(format #t "~1Tbinding: ~D~%" (-> this binding))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type sparticle-launch-state
|
||||
(deftype sparticle-launch-state (structure)
|
||||
"The state associated with a launcher of a given sparticle."
|
||||
((group-item sparticle-group-item)
|
||||
(flags sp-launch-state-flags)
|
||||
(randomize uint16)
|
||||
(center vector)
|
||||
(sprite3d sprite-vec-data-3d)
|
||||
(sprite sparticle-cpuinfo)
|
||||
(offset uint32)
|
||||
(accum float)
|
||||
(spawn-time uint32)
|
||||
(control sparticle-launch-control)
|
||||
(swarm basic :overlay-at offset)
|
||||
(seed uint32 :overlay-at accum)
|
||||
(time uint32 :overlay-at spawn-time)
|
||||
(spec basic :overlay-at sprite)
|
||||
(id uint32 :overlay-at sprite3d)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type sparticle-launch-state
|
||||
(defmethod inspect ((this sparticle-launch-state))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'sparticle-launch-state)
|
||||
(format #t "~1Tgroup-item: #<sparticle-group-item @ #x~X>~%" (-> this group-item))
|
||||
(format #t "~1Tflags: ~D~%" (-> this flags))
|
||||
(format #t "~1Trandomize: ~D~%" (-> this randomize))
|
||||
(format #t "~1Tcenter: #<vector @ #x~X>~%" (-> this center))
|
||||
(format #t "~1Tsprite3d: #<sprite-vec-data-3d @ #x~X>~%" (-> this sprite3d))
|
||||
(format #t "~1Tsprite: ~A~%" (-> this sprite))
|
||||
(format #t "~1Toffset: ~D~%" (-> this offset))
|
||||
(format #t "~1Taccum: ~f~%" (-> this accum))
|
||||
(format #t "~1Tspawn-time: ~D~%" (-> this spawn-time))
|
||||
(format #t "~1Tcontrol: ~A~%" (-> this control))
|
||||
(format #t "~1Tswarm: ~A~%" (-> this offset))
|
||||
(format #t "~1Tseed: ~D~%" (-> this accum))
|
||||
(format #t "~1Ttime: ~D~%" (-> this spawn-time))
|
||||
(format #t "~1Tspec: ~A~%" (-> this sprite))
|
||||
(format #t "~1Tid: ~D~%" (-> this sprite3d))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type sparticle-launch-group
|
||||
(deftype sparticle-launch-group (basic)
|
||||
"Definition of multiple a particle-group, which is a collection of particle effects."
|
||||
((length int16)
|
||||
(duration uint16)
|
||||
(linger-duration uint16)
|
||||
(flags sp-group-flag)
|
||||
(name string)
|
||||
(launcher (inline-array sparticle-group-item))
|
||||
(rotate-x degrees)
|
||||
(rotate-y degrees)
|
||||
(rotate-z degrees)
|
||||
(scale-x float)
|
||||
(scale-y float)
|
||||
(scale-z float)
|
||||
(bounds sphere :inline)
|
||||
)
|
||||
(:methods
|
||||
(create-launch-control (_type_ process) sparticle-launch-control)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type sparticle-launch-group
|
||||
(defmethod inspect ((this sparticle-launch-group))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this (-> this type))
|
||||
(format #t "~1Tlength: ~D~%" (-> this length))
|
||||
(format #t "~1Tduration: ~D~%" (-> this duration))
|
||||
(format #t "~1Tlinger-duration: ~D~%" (-> this linger-duration))
|
||||
(format #t "~1Tflags: ~D~%" (-> this flags))
|
||||
(format #t "~1Tname: ~A~%" (-> this name))
|
||||
(format #t "~1Tlauncher: #x~X~%" (-> this launcher))
|
||||
(format #t "~1Trotate-x: (deg ~r)~%" (-> this rotate-x))
|
||||
(format #t "~1Trotate-y: (deg ~r)~%" (-> this rotate-y))
|
||||
(format #t "~1Trotate-z: (deg ~r)~%" (-> this rotate-z))
|
||||
(format #t "~1Tscale-x: ~f~%" (-> this scale-x))
|
||||
(format #t "~1Tscale-y: ~f~%" (-> this scale-y))
|
||||
(format #t "~1Tscale-z: ~f~%" (-> this scale-z))
|
||||
(format #t "~1Tbounds: #<sphere @ #x~X>~%" (-> this bounds))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition for symbol *launch-matrix*, type matrix
|
||||
(define *launch-matrix* (matrix-identity! (new 'global 'matrix)))
|
||||
|
||||
;; definition of type sparticle-launch-control
|
||||
(deftype sparticle-launch-control (inline-array-class)
|
||||
"Top-level type containing all the state needed to launch a particle group.
|
||||
These are typically owned by a process, and allocated on the process heap.
|
||||
These refer to static particle definitions, and then spawn particles that are tracked by the
|
||||
particle system itself. This type just holds the launching-related state."
|
||||
((group sparticle-launch-group)
|
||||
(proc process-drawable)
|
||||
(local-clock int32)
|
||||
(fade float)
|
||||
(matrix int8)
|
||||
(state-mode uint8 3)
|
||||
(state-counter uint32)
|
||||
(local-space-binding particle-local-space-info :overlay-at fade)
|
||||
(last-spawn-frame int32)
|
||||
(last-spawn-time int32)
|
||||
(origin matrix :inline)
|
||||
(center vector :inline :overlay-at (-> origin data 12))
|
||||
(data sparticle-launch-state :inline :dynamic)
|
||||
)
|
||||
(:methods
|
||||
(sparticle-launch-control-method-14 () none)
|
||||
(sparticle-launch-control-method-15 () none)
|
||||
(sparticle-launch-control-method-16 () none)
|
||||
(sparticle-launch-control-method-17 () none)
|
||||
(sparticle-launch-control-method-18 () none)
|
||||
(sparticle-launch-control-method-19 () none)
|
||||
(sparticle-launch-control-method-20 () none)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type sparticle-launch-control
|
||||
(defmethod inspect ((this sparticle-launch-control))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this (-> this type))
|
||||
(format #t "~1Tlength: ~D~%" (-> this length))
|
||||
(format #t "~1Tallocated-length: ~D~%" (-> this allocated-length))
|
||||
(format #t "~1Tgroup: ~A~%" (-> this group))
|
||||
(format #t "~1Tproc: ~A~%" (-> this proc))
|
||||
(format #t "~1Tlocal-clock: ~D~%" (-> this local-clock))
|
||||
(format #t "~1Tfade: ~f~%" (-> this fade))
|
||||
(format #t "~1Tmatrix: ~D~%" (-> this matrix))
|
||||
(format #t "~1Tstate-mode[3] @ #x~X~%" (-> this state-mode))
|
||||
(format #t "~1Tstate-counter: ~D~%" (-> this state-counter))
|
||||
(format #t "~1Tlocal-space-binding: #<particle-local-space-info @ #x~X>~%" (-> this fade))
|
||||
(format #t "~1Tlast-spawn-frame: ~D~%" (-> this last-spawn-frame))
|
||||
(format #t "~1Tlast-spawn-time: ~D~%" (-> this last-spawn-time))
|
||||
(format #t "~1Torigin: #<matrix @ #x~X>~%" (-> this origin))
|
||||
(format #t "~1Tcenter: ~`vector`P~%" (-> this origin trans))
|
||||
(format #t "~1Tdata[0] @ #x~X~%" (-> this data))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(set! (-> sparticle-launch-control heap-base) (the-as uint 48))
|
||||
|
||||
;; definition of type sparticle-subsampler
|
||||
(deftype sparticle-subsampler (basic)
|
||||
((spt-num float)
|
||||
(sp-system sparticle-system)
|
||||
(sp-launcher sparticle-launcher)
|
||||
(spawn-mat matrix :inline)
|
||||
(inited? basic)
|
||||
)
|
||||
(:methods
|
||||
(new (symbol type sparticle-system sparticle-launcher float) _type_)
|
||||
(sparticle-subsampler-method-9 () none)
|
||||
(sparticle-subsampler-method-10 () none)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type sparticle-subsampler
|
||||
(defmethod inspect ((this sparticle-subsampler))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this (-> this type))
|
||||
(format #t "~1Tspt-num: ~f~%" (-> this spt-num))
|
||||
(format #t "~1Tsp-system: ~A~%" (-> this sp-system))
|
||||
(format #t "~1Tsp-launcher: ~A~%" (-> this sp-launcher))
|
||||
(format #t "~1Tspawn-mat: #<matrix @ #x~X>~%" (-> this spawn-mat))
|
||||
(format #t "~1Tinited?: ~A~%" (-> this inited?))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition for method 0 of type sparticle-subsampler
|
||||
(defmethod new sparticle-subsampler ((allocation symbol) (type-to-make type) (arg0 sparticle-system) (arg1 sparticle-launcher) (arg2 float))
|
||||
(let ((s3-0 (object-new allocation type-to-make (the-as int (-> type-to-make size)))))
|
||||
(if (zero? s3-0)
|
||||
(go process-drawable-art-error "sparticle-subsampler")
|
||||
)
|
||||
(set! (-> s3-0 sp-launcher) arg1)
|
||||
(set! (-> s3-0 inited?) #f)
|
||||
(set! (-> s3-0 sp-system) arg0)
|
||||
(set! (-> s3-0 spt-num) arg2)
|
||||
(matrix-identity! (-> s3-0 spawn-mat))
|
||||
s3-0
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for function compute-rot-in-screenspace
|
||||
(defun compute-rot-in-screenspace ((arg0 vector))
|
||||
"Unclear what this does, but I'm not actually sure it makes sense. Unused"
|
||||
0.0
|
||||
(let ((a0-1 (-> (math-camera-matrix) fvec)))
|
||||
0.0
|
||||
(let ((v1-0 (new 'stack-no-clear 'vector)))
|
||||
(let ((f0-3 (vector-dot a0-1 arg0)))
|
||||
(vector-float*! v1-0 a0-1 f0-3)
|
||||
)
|
||||
(vector-! arg0 arg0 v1-0)
|
||||
)
|
||||
)
|
||||
(let ((a2-1 (matrix-transpose! (new 'stack-no-clear 'matrix) (math-camera-matrix))))
|
||||
(vector-matrix*! arg0 arg0 a2-1)
|
||||
)
|
||||
(the float (sar (shl (the int (atan (-> arg0 y) (* -1.0 (-> arg0 x)))) 48) 48))
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
0
|
||||
|
||||
|
||||
|
||||
|
||||
+457
@@ -0,0 +1,457 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; definition of type tfragment-stats
|
||||
(deftype tfragment-stats (structure)
|
||||
"Triangle and vertex stats for a single tfragment."
|
||||
((num-tris uint16 4)
|
||||
(num-dverts uint16 4)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type tfragment-stats
|
||||
(defmethod inspect ((this tfragment-stats))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'tfragment-stats)
|
||||
(format #t "~1Tnum-tris[4] @ #x~X~%" (-> this num-tris))
|
||||
(format #t "~1Tnum-dverts[4] @ #x~X~%" (-> this num-dverts))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type tfragment-debug-data
|
||||
(deftype tfragment-debug-data (structure)
|
||||
"Optional debug information (stats, lines) for a tfragment."
|
||||
((stats tfragment-stats :inline)
|
||||
(debug-lines (array vector-array))
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type tfragment-debug-data
|
||||
(defmethod inspect ((this tfragment-debug-data))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'tfragment-debug-data)
|
||||
(format #t "~1Tstats: #<tfragment-stats @ #x~X>~%" (-> this stats))
|
||||
(format #t "~1Tdebug-lines: ~A~%" (-> this debug-lines))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type generic-tfragment
|
||||
(deftype generic-tfragment (structure)
|
||||
"Unused. Could have been a way to render tfrag's through generic."
|
||||
((dummy int32)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type generic-tfragment
|
||||
(defmethod inspect ((this generic-tfragment))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'generic-tfragment)
|
||||
(format #t "~1Tdummy: ~D~%" (-> this dummy))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type tfragment
|
||||
(deftype tfragment (drawable)
|
||||
"A tfrag mesh fragment. This is just references to DMA data, plus some metadata."
|
||||
((color-index uint16 :offset 6)
|
||||
(debug-data tfragment-debug-data :offset 8)
|
||||
(color-indices uint32 :offset 12)
|
||||
(colors uint32 :overlay-at color-indices)
|
||||
(dma-chain uint32 3 :offset 32)
|
||||
(dma-common uint32 :overlay-at (-> dma-chain 0))
|
||||
(dma-level-0 uint32 :overlay-at dma-common)
|
||||
(dma-base uint32 :overlay-at (-> dma-chain 1))
|
||||
(dma-level-1 uint32 :overlay-at (-> dma-chain 2))
|
||||
(dma-qwc uint8 4 :offset 44)
|
||||
(shader (inline-array adgif-shader) :offset 48)
|
||||
(num-shaders uint8 :offset 52)
|
||||
(num-base-colors uint8 :offset 53)
|
||||
(num-level0-colors uint8 :offset 54)
|
||||
(num-level1-colors uint8 :offset 55)
|
||||
(color-offset uint8 :offset 56)
|
||||
(color-count uint8 :offset 57)
|
||||
(texture-masks-index uint16 :offset 58)
|
||||
(generic generic-tfragment :offset 60)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type tfragment
|
||||
(defmethod inspect ((this tfragment))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this (-> this type))
|
||||
(format #t "~1Tid: ~D~%" (-> this id))
|
||||
(format #t "~1Tbsphere: ~`vector`P~%" (-> this bsphere))
|
||||
(format #t "~1Tcolor-index: ~D~%" (-> this color-index))
|
||||
(format #t "~1Tdebug-data: #<tfragment-debug-data @ #x~X>~%" (-> this debug-data))
|
||||
(format #t "~1Tcolor-indices: #x~X~%" (-> this color-indices))
|
||||
(format #t "~1Tcolors: #x~X~%" (-> this color-indices))
|
||||
(format #t "~1Tdma-chain[3] @ #x~X~%" (-> this dma-chain))
|
||||
(format #t "~1Tdma-common: #x~X~%" (-> this dma-common))
|
||||
(format #t "~1Tdma-level-0: #x~X~%" (-> this dma-common))
|
||||
(format #t "~1Tdma-base: #x~X~%" (-> this dma-base))
|
||||
(format #t "~1Tdma-level-1: #x~X~%" (-> this dma-level-1))
|
||||
(format #t "~1Tdma-qwc[4] @ #x~X~%" (-> this dma-qwc))
|
||||
(format #t "~1Tshader: #x~X~%" (-> this shader))
|
||||
(format #t "~1Tnum-shaders: ~D~%" (-> this num-shaders))
|
||||
(format #t "~1Tnum-base-colors: ~D~%" (-> this num-base-colors))
|
||||
(format #t "~1Tnum-level0-colors: ~D~%" (-> this num-level0-colors))
|
||||
(format #t "~1Tnum-level1-colors: ~D~%" (-> this num-level1-colors))
|
||||
(format #t "~1Tcolor-offset: ~D~%" (-> this color-offset))
|
||||
(format #t "~1Tcolor-count: ~D~%" (-> this color-count))
|
||||
(format #t "~1Ttexture-masks-index: ~D~%" (-> this texture-masks-index))
|
||||
(format #t "~1Tgeneric: #<generic-tfragment @ #x~X>~%" (-> this generic))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type drawable-inline-array-tfrag
|
||||
(deftype drawable-inline-array-tfrag (drawable-inline-array)
|
||||
"Array of tfragments"
|
||||
((data tfragment 1 :inline)
|
||||
(pad uint32)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition of type drawable-inline-array-tfrag-trans
|
||||
(deftype drawable-inline-array-tfrag-trans (drawable-inline-array-tfrag)
|
||||
((data2 tfragment 1 :inline)
|
||||
(pad2 uint32)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition of type drawable-inline-array-tfrag-water
|
||||
(deftype drawable-inline-array-tfrag-water (drawable-inline-array-tfrag)
|
||||
((data2 tfragment 1 :inline)
|
||||
(pad2 uint32)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition of type drawable-tree-tfrag
|
||||
(deftype drawable-tree-tfrag (drawable-tree)
|
||||
"top level tfrag tree."
|
||||
((time-of-day-pal time-of-day-palette :offset 12)
|
||||
(arrays drawable-inline-array :dynamic :offset 32)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition of type drawable-tree-tfrag-trans
|
||||
(deftype drawable-tree-tfrag-trans (drawable-tree-tfrag)
|
||||
()
|
||||
)
|
||||
|
||||
;; definition of type drawable-tree-tfrag-water
|
||||
(deftype drawable-tree-tfrag-water (drawable-tree-tfrag-trans)
|
||||
()
|
||||
)
|
||||
|
||||
;; definition of type tfrag-dists
|
||||
(deftype tfrag-dists (structure)
|
||||
"Distances for mesh level-of-detail blending for use on VU1."
|
||||
((data uint32 16)
|
||||
(vector vector 4 :overlay-at (-> data 0))
|
||||
(k0s vector 2 :overlay-at (-> data 0))
|
||||
(k1s vector 2 :overlay-at (-> data 8))
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type tfrag-dists
|
||||
(defmethod inspect ((this tfrag-dists))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'tfrag-dists)
|
||||
(format #t "~1Tdata[16] @ #x~X~%" (-> this data))
|
||||
(format #t "~1Tvector[4] @ #x~X~%" (-> this data))
|
||||
(format #t "~1Tk0s[2] @ #x~X~%" (-> this data))
|
||||
(format #t "~1Tk1s[2] @ #x~X~%" (-> this k1s))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type tfrag-data
|
||||
(deftype tfrag-data (structure)
|
||||
"Constants for VU1 data memory for tfrag rendering."
|
||||
((data uint32 56)
|
||||
(vector vector 14 :overlay-at (-> data 0))
|
||||
(fog vector :inline :overlay-at (-> data 0))
|
||||
(val vector :inline :overlay-at (-> data 4))
|
||||
(strgif gs-gif-tag :inline :overlay-at (-> data 8))
|
||||
(fangif gs-gif-tag :inline :overlay-at (-> data 12))
|
||||
(adgif gs-gif-tag :inline :overlay-at (-> data 16))
|
||||
(hvdf-offset vector :inline :overlay-at (-> data 20))
|
||||
(hmge-scale vector :inline :overlay-at (-> data 24))
|
||||
(invh-scale vector :inline :overlay-at (-> data 28))
|
||||
(ambient vector :inline :overlay-at (-> data 32))
|
||||
(guard vector :inline :overlay-at (-> data 36))
|
||||
(dists tfrag-dists :inline :overlay-at (-> data 40))
|
||||
(k0s uint128 2 :overlay-at (-> data 40))
|
||||
(k1s uint128 2 :overlay-at (-> data 48))
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type tfrag-data
|
||||
(defmethod inspect ((this tfrag-data))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'tfrag-data)
|
||||
(format #t "~1Tdata[56] @ #x~X~%" (-> this data))
|
||||
(format #t "~1Tvector[14] @ #x~X~%" (-> this data))
|
||||
(format #t "~1Tfog: #<vector @ #x~X>~%" (-> this data))
|
||||
(format #t "~1Tval: #<vector @ #x~X>~%" (-> this val))
|
||||
(format #t "~1Tstrgif: #<qword @ #x~X>~%" (-> this strgif))
|
||||
(format #t "~1Tfangif: #<qword @ #x~X>~%" (-> this fangif))
|
||||
(format #t "~1Tadgif: #<qword @ #x~X>~%" (-> this adgif))
|
||||
(format #t "~1Thvdf-offset: #<vector @ #x~X>~%" (-> this hvdf-offset))
|
||||
(format #t "~1Thmge-scale: #<vector @ #x~X>~%" (-> this hmge-scale))
|
||||
(format #t "~1Tinvh-scale: #<vector @ #x~X>~%" (-> this invh-scale))
|
||||
(format #t "~1Tambient: #<vector @ #x~X>~%" (-> this ambient))
|
||||
(format #t "~1Tguard: #<vector @ #x~X>~%" (-> this guard))
|
||||
(format #t "~1Tdists: #<tfrag-dists @ #x~X>~%" (-> this dists))
|
||||
(format #t "~1Tk0s[2] @ #x~X~%" (-> this dists))
|
||||
(format #t "~1Tk1s[2] @ #x~X~%" (-> this dists k1s))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type tfrag-control
|
||||
(deftype tfrag-control (structure)
|
||||
"VU1 'control' data containing address and counters."
|
||||
((num-base-points uint32)
|
||||
(num-shared-base-points uint32)
|
||||
(num-level0-points uint32)
|
||||
(num-shared-level0-points uint32)
|
||||
(num-level1-points uint32)
|
||||
(num-shared-level1-points uint32)
|
||||
(ptr-vtxdata uint32)
|
||||
(ptr-base-points uint32)
|
||||
(ptr-shared-base-points uint32)
|
||||
(ptr-level0-points uint32)
|
||||
(ptr-shared-level0-points uint32)
|
||||
(ptr-level1-points uint32)
|
||||
(ptr-shared-level1-points uint32)
|
||||
(ptr-draw-points uint32)
|
||||
(ptr-interpolated-0 uint32)
|
||||
(ptr-shared-interpolated-0 uint32)
|
||||
(ptr-interpolated1 uint32)
|
||||
(ptr-shared-interpolated1 uint32)
|
||||
(ptr-strip-data uint32)
|
||||
(ptr-texture-data uint32)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type tfrag-control
|
||||
(defmethod inspect ((this tfrag-control))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'tfrag-control)
|
||||
(format #t "~1Tnum-base-points: ~D~%" (-> this num-base-points))
|
||||
(format #t "~1Tnum-shared-base-points: ~D~%" (-> this num-shared-base-points))
|
||||
(format #t "~1Tnum-level0-points: ~D~%" (-> this num-level0-points))
|
||||
(format #t "~1Tnum-shared-level0-points: ~D~%" (-> this num-shared-level0-points))
|
||||
(format #t "~1Tnum-level1-points: ~D~%" (-> this num-level1-points))
|
||||
(format #t "~1Tnum-shared-level1-points: ~D~%" (-> this num-shared-level1-points))
|
||||
(format #t "~1Tptr-vtxdata: ~D~%" (-> this ptr-vtxdata))
|
||||
(format #t "~1Tptr-base-points: ~D~%" (-> this ptr-base-points))
|
||||
(format #t "~1Tptr-shared-base-points: ~D~%" (-> this ptr-shared-base-points))
|
||||
(format #t "~1Tptr-level0-points: ~D~%" (-> this ptr-level0-points))
|
||||
(format #t "~1Tptr-shared-level0-points: ~D~%" (-> this ptr-shared-level0-points))
|
||||
(format #t "~1Tptr-level1-points: ~D~%" (-> this ptr-level1-points))
|
||||
(format #t "~1Tptr-shared-level1-points: ~D~%" (-> this ptr-shared-level1-points))
|
||||
(format #t "~1Tptr-draw-points: ~D~%" (-> this ptr-draw-points))
|
||||
(format #t "~1Tptr-interpolated-0: ~D~%" (-> this ptr-interpolated-0))
|
||||
(format #t "~1Tptr-shared-interpolated-0: ~D~%" (-> this ptr-shared-interpolated-0))
|
||||
(format #t "~1Tptr-interpolated1: ~D~%" (-> this ptr-interpolated1))
|
||||
(format #t "~1Tptr-shared-interpolated1: ~D~%" (-> this ptr-shared-interpolated1))
|
||||
(format #t "~1Tptr-strip-data: ~D~%" (-> this ptr-strip-data))
|
||||
(format #t "~1Tptr-texture-data: ~D~%" (-> this ptr-texture-data))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type tfrag-stats
|
||||
(deftype tfrag-stats (structure)
|
||||
"TFRAG statistics computed on EE."
|
||||
((from int32)
|
||||
(to int32)
|
||||
(cnt int32)
|
||||
(tris int32)
|
||||
(tfaces int32)
|
||||
(tfrags int32)
|
||||
(dtris int32)
|
||||
(base-verts int32)
|
||||
(level0-verts int32)
|
||||
(level1-verts int32)
|
||||
(dma-cnt int32)
|
||||
(dma-dta int32)
|
||||
(dma-tex int32)
|
||||
(strips int32)
|
||||
(drawpoints int32)
|
||||
(vif int32)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type tfrag-stats
|
||||
(defmethod inspect ((this tfrag-stats))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'tfrag-stats)
|
||||
(format #t "~1Tfrom: ~D~%" (-> this from))
|
||||
(format #t "~1Tto: ~D~%" (-> this to))
|
||||
(format #t "~1Tcnt: ~D~%" (-> this cnt))
|
||||
(format #t "~1Ttris: ~D~%" (-> this tris))
|
||||
(format #t "~1Ttfaces: ~D~%" (-> this tfaces))
|
||||
(format #t "~1Ttfrags: ~D~%" (-> this tfrags))
|
||||
(format #t "~1Tdtris: ~D~%" (-> this dtris))
|
||||
(format #t "~1Tbase-verts: ~D~%" (-> this base-verts))
|
||||
(format #t "~1Tlevel0-verts: ~D~%" (-> this level0-verts))
|
||||
(format #t "~1Tlevel1-verts: ~D~%" (-> this level1-verts))
|
||||
(format #t "~1Tdma-cnt: ~D~%" (-> this dma-cnt))
|
||||
(format #t "~1Tdma-dta: ~D~%" (-> this dma-dta))
|
||||
(format #t "~1Tdma-tex: ~D~%" (-> this dma-tex))
|
||||
(format #t "~1Tstrips: ~D~%" (-> this strips))
|
||||
(format #t "~1Tdrawpoints: ~D~%" (-> this drawpoints))
|
||||
(format #t "~1Tvif: ~D~%" (-> this vif))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type tfrag-packet
|
||||
(deftype tfrag-packet (structure)
|
||||
((tag uint128 2)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type tfrag-packet
|
||||
(defmethod inspect ((this tfrag-packet))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'tfrag-packet)
|
||||
(format #t "~1Ttag[2] @ #x~X~%" (-> this tag))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type tfrag-work
|
||||
(deftype tfrag-work (structure)
|
||||
"Scratch space for generating TFRAG DMA."
|
||||
((base-tmpl dma-packet :inline)
|
||||
(level-0-tmpl dma-packet :inline)
|
||||
(common-tmpl dma-packet :inline)
|
||||
(level-1-tmpl dma-packet :inline)
|
||||
(color-tmpl dma-packet :inline)
|
||||
(frag-dists vector :inline)
|
||||
(min-dist vector :inline)
|
||||
(color-ptr vector4w :inline)
|
||||
(tr-stat-tfrag tr-stat)
|
||||
(tr-stat-tfrag-scissor tr-stat)
|
||||
(vu1-enable-tfrag int32)
|
||||
(vu1-enable-tfrag-scissor int32)
|
||||
(cur-vis-bits uint32)
|
||||
(end-vis-bits uint32)
|
||||
(src-ptr uint32)
|
||||
(last-call uint32)
|
||||
(dma-buffer basic)
|
||||
(test-id uint32)
|
||||
(wait-from-spr uint32)
|
||||
(wait-to-spr uint32)
|
||||
(near-wait-from-spr uint32)
|
||||
(near-wait-to-spr uint32)
|
||||
(max-fragment uint16)
|
||||
(min-fragment uint16)
|
||||
(texture-dists uint32)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type tfrag-work
|
||||
(defmethod inspect ((this tfrag-work))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'tfrag-work)
|
||||
(format #t "~1Tbase-tmpl: #<dma-packet @ #x~X>~%" (-> this base-tmpl))
|
||||
(format #t "~1Tlevel-0-tmpl: #<dma-packet @ #x~X>~%" (-> this level-0-tmpl))
|
||||
(format #t "~1Tcommon-tmpl: #<dma-packet @ #x~X>~%" (-> this common-tmpl))
|
||||
(format #t "~1Tlevel-1-tmpl: #<dma-packet @ #x~X>~%" (-> this level-1-tmpl))
|
||||
(format #t "~1Tcolor-tmpl: #<dma-packet @ #x~X>~%" (-> this color-tmpl))
|
||||
(format #t "~1Tfrag-dists: #<vector @ #x~X>~%" (-> this frag-dists))
|
||||
(format #t "~1Tmin-dist: #<vector @ #x~X>~%" (-> this min-dist))
|
||||
(format #t "~1Tcolor-ptr: #<vector4w @ #x~X>~%" (-> this color-ptr))
|
||||
(format #t "~1Ttr-stat-tfrag: #<tr-stat @ #x~X>~%" (-> this tr-stat-tfrag))
|
||||
(format #t "~1Ttr-stat-tfrag-scissor: #<tr-stat @ #x~X>~%" (-> this tr-stat-tfrag-scissor))
|
||||
(format #t "~1Tvu1-enable-tfrag: ~D~%" (-> this vu1-enable-tfrag))
|
||||
(format #t "~1Tvu1-enable-tfrag-scissor: ~D~%" (-> this vu1-enable-tfrag-scissor))
|
||||
(format #t "~1Tcur-vis-bits: ~D~%" (-> this cur-vis-bits))
|
||||
(format #t "~1Tend-vis-bits: ~D~%" (-> this end-vis-bits))
|
||||
(format #t "~1Tsrc-ptr: ~D~%" (-> this src-ptr))
|
||||
(format #t "~1Tlast-call: ~D~%" (-> this last-call))
|
||||
(format #t "~1Tdma-buffer: ~A~%" (-> this dma-buffer))
|
||||
(format #t "~1Ttest-id: ~D~%" (-> this test-id))
|
||||
(format #t "~1Twait-from-spr: ~D~%" (-> this wait-from-spr))
|
||||
(format #t "~1Twait-to-spr: ~D~%" (-> this wait-to-spr))
|
||||
(format #t "~1Tnear-wait-from-spr: ~D~%" (-> this near-wait-from-spr))
|
||||
(format #t "~1Tnear-wait-to-spr: ~D~%" (-> this near-wait-to-spr))
|
||||
(format #t "~1Tmax-fragment: ~D~%" (-> this max-fragment))
|
||||
(format #t "~1Tmin-fragment: ~D~%" (-> this min-fragment))
|
||||
(format #t "~1Ttexture-dists: #x~X~%" (-> this texture-dists))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type tfrag-dma
|
||||
(deftype tfrag-dma (structure)
|
||||
"Memory layout for to/from scratchpad for tfrag."
|
||||
((banka tfragment 16 :inline)
|
||||
(bankb tfragment 16 :inline)
|
||||
(outa uint128 128)
|
||||
(outb uint128 128)
|
||||
(colors rgba 2047)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type tfrag-dma
|
||||
(defmethod inspect ((this tfrag-dma))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'tfrag-dma)
|
||||
(format #t "~1Tbanka[16] @ #x~X~%" (-> this banka))
|
||||
(format #t "~1Tbankb[16] @ #x~X~%" (-> this bankb))
|
||||
(format #t "~1Touta[128] @ #x~X~%" (-> this outa))
|
||||
(format #t "~1Toutb[128] @ #x~X~%" (-> this outb))
|
||||
(format #t "~1Tcolors[2048] @ #x~X~%" (-> this colors))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
0
|
||||
|
||||
|
||||
|
||||
|
||||
+669
@@ -0,0 +1,669 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; definition of type tie-fragment-debug
|
||||
(deftype tie-fragment-debug (structure)
|
||||
"Optional debug information about a tie-fragment."
|
||||
((num-tris uint16)
|
||||
(num-dverts uint16)
|
||||
(debug-lines (array vector-array))
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type tie-fragment-debug
|
||||
(defmethod inspect ((this tie-fragment-debug))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'tie-fragment-debug)
|
||||
(format #t "~1Tnum-tris: ~D~%" (-> this num-tris))
|
||||
(format #t "~1Tnum-dverts: ~D~%" (-> this num-dverts))
|
||||
(format #t "~1Tdebug-lines: ~A~%" (-> this debug-lines))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type tie-fragment
|
||||
(deftype tie-fragment (drawable)
|
||||
"A mesh fragment of a TIE. This is a chunk of mesh that is rendered by VU1, stored as DMA chains."
|
||||
((gif-ref (inline-array adgif-shader) :overlay-at id)
|
||||
(point-ref uint32 :offset 8)
|
||||
(color-index uint16 :offset 12)
|
||||
(base-colors uint8 :offset 14)
|
||||
(tex-count uint16 :offset 32)
|
||||
(gif-count uint16 :offset 34)
|
||||
(vertex-count uint16 :offset 36)
|
||||
(color-count uint16)
|
||||
(dp-ref uint32)
|
||||
(dp-qwc uint32)
|
||||
(generic-ref uint32)
|
||||
(generic-count uint16)
|
||||
(normal-count uint16)
|
||||
(normal-ref uint32)
|
||||
(debug tie-fragment-debug)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type tie-fragment
|
||||
(defmethod inspect ((this tie-fragment))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this (-> this type))
|
||||
(format #t "~1Tid: ~D~%" (-> this id))
|
||||
(format #t "~1Tbsphere: ~`vector`P~%" (-> this bsphere))
|
||||
(format #t "~1Tgif-ref: #x~X~%" (-> this gif-ref))
|
||||
(format #t "~1Tpoint-ref: #x~X~%" (-> this point-ref))
|
||||
(format #t "~1Tcolor-index: ~D~%" (-> this color-index))
|
||||
(format #t "~1Tbase-colors: ~D~%" (-> this base-colors))
|
||||
(format #t "~1Ttex-count: ~D~%" (-> this tex-count))
|
||||
(format #t "~1Tgif-count: ~D~%" (-> this gif-count))
|
||||
(format #t "~1Tvertex-count: ~D~%" (-> this vertex-count))
|
||||
(format #t "~1Tcolor-count: ~D~%" (-> this color-count))
|
||||
(format #t "~1Tdp-ref: #x~X~%" (-> this dp-ref))
|
||||
(format #t "~1Tdp-qwc: ~D~%" (-> this dp-qwc))
|
||||
(format #t "~1Tgeneric-ref: #x~X~%" (-> this generic-ref))
|
||||
(format #t "~1Tgeneric-count: ~D~%" (-> this generic-count))
|
||||
(format #t "~1Tnormal-count: ~D~%" (-> this normal-count))
|
||||
(format #t "~1Tnormal-ref: #x~X~%" (-> this normal-ref))
|
||||
(format #t "~1Tdebug: #<tie-fragment-debug @ #x~X>~%" (-> this debug))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type instance-tie
|
||||
(deftype instance-tie (instance)
|
||||
"A TIE model instance."
|
||||
((color-indices uint32 :offset 8)
|
||||
(bucket-ptr prototype-bucket-tie :offset 12)
|
||||
(max-scale uint16 :overlay-at (-> origin data 3))
|
||||
(rmin-scale uint16 :overlay-at (-> origin data 11))
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type instance-tie
|
||||
(defmethod inspect ((this instance-tie))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this (-> this type))
|
||||
(format #t "~1Tid: ~D~%" (-> this id))
|
||||
(format #t "~1Tbsphere: ~`vector`P~%" (-> this bsphere))
|
||||
(format #t "~1Tbucket-index: ~D~%" (-> this bucket-index))
|
||||
(format #t "~1Torigin: #<matrix4h @ #x~X>~%" (-> this origin))
|
||||
(format #t "~1Tflags: ~D~%" (-> this flags))
|
||||
(format #t "~1Twind-index: ~D~%" (-> this wind-index))
|
||||
(format #t "~1Tcolor-indices: #x~X~%" (-> this color-indices))
|
||||
(format #t "~1Tbucket-ptr: ~A~%" (-> this bucket-ptr))
|
||||
(format #t "~1Tmax-scale: ~D~%" (-> this max-scale))
|
||||
(format #t "~1Trmin-scale: ~D~%" (-> this rmin-scale))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type drawable-inline-array-instance-tie
|
||||
(deftype drawable-inline-array-instance-tie (drawable-inline-array)
|
||||
"Array of tie instances stored in the level."
|
||||
((data instance-tie 1 :inline)
|
||||
(pad uint32)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition of type drawable-tree-instance-tie
|
||||
(deftype drawable-tree-instance-tie (drawable-tree)
|
||||
"Top-level drawable-tree for TIEs"
|
||||
((prototypes proxy-prototype-array-tie :offset 8)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type drawable-tree-instance-tie
|
||||
(defmethod inspect ((this drawable-tree-instance-tie))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-7)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this (-> this type))
|
||||
(format #t "~1Tid: ~D~%" (-> this id))
|
||||
(format #t "~1Tbsphere: ~`vector`P~%" (-> this bsphere))
|
||||
(format #t "~1Tlength: ~D~%" (-> this length))
|
||||
(format #t "~1Tdata[0] @ #x~X~%" (-> this data))
|
||||
(dotimes (s5-0 (-> this length))
|
||||
(format #t "~T [~D]~1Tdata: ~A~%" s5-0 (-> this data s5-0))
|
||||
)
|
||||
(format #t "~1Tprototypes: ~A~%" (-> this prototypes))
|
||||
(label cfg-7)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type prototype-tie
|
||||
(deftype prototype-tie (drawable-inline-array)
|
||||
"Prototype for a TIE: just an array of fragments."
|
||||
((data tie-fragment 1 :inline)
|
||||
(pad uint32)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition of type tie-matrix
|
||||
(deftype tie-matrix (structure)
|
||||
"Per-instance matrix for TIE VU1 rendering."
|
||||
((mat matrix :inline)
|
||||
(morph qword :inline)
|
||||
(fog qword :inline)
|
||||
(envmap-flag uint32 :overlay-at (-> fog data 0))
|
||||
(guard-flag uint32 :overlay-at (-> fog data 1))
|
||||
(vertex-alpha float :overlay-at (-> fog data 2))
|
||||
(fog-value float :overlay-at (-> fog data 3))
|
||||
(fixed-alpha float :overlay-at (-> morph data 1))
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type tie-matrix
|
||||
(defmethod inspect ((this tie-matrix))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'tie-matrix)
|
||||
(format #t "~1Tmat: #<matrix @ #x~X>~%" (-> this mat))
|
||||
(format #t "~1Tmorph: #<qword @ #x~X>~%" (-> this morph))
|
||||
(format #t "~1Tfog: #<qword @ #x~X>~%" (-> this fog))
|
||||
(format #t "~1Tenvmap-flag: ~D~%" (-> this envmap-flag))
|
||||
(format #t "~1Tguard-flag: ~D~%" (-> this guard-flag))
|
||||
(format #t "~1Tvertex-alpha: ~f~%" (-> this vertex-alpha))
|
||||
(format #t "~1Tfog-value: ~f~%" (-> this fog-value))
|
||||
(format #t "~1Tfixed-alpha: ~f~%" (-> this fixed-alpha))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type instance-tie-work
|
||||
(deftype instance-tie-work (structure)
|
||||
"workspace for TIE instance DMA generation"
|
||||
((wind-const vector :inline)
|
||||
(hmge-d vector :inline)
|
||||
(hvdf-offset vector :inline)
|
||||
(wind-force vector :inline)
|
||||
(constant vector :inline)
|
||||
(far-morph vector :inline)
|
||||
(dist-test vector :inline)
|
||||
(min-dist vector :inline)
|
||||
(guard-plane plane 4 :inline)
|
||||
(upload-color-0 dma-packet :inline)
|
||||
(upload-color-1 dma-packet :inline)
|
||||
(upload-color-2 dma-packet :inline)
|
||||
(upload-color-ret dma-packet :inline)
|
||||
(upload-color-temp dma-packet :inline)
|
||||
(generic-color-0 dma-packet :inline)
|
||||
(generic-color-1 dma-packet :inline)
|
||||
(generic-color-end dma-packet :inline)
|
||||
(envmap-color-0 dma-packet :inline)
|
||||
(envmap-color-1 dma-packet :inline)
|
||||
(tie-scissor-perspective-matrix matrix :inline)
|
||||
(tod-env-color vector :inline)
|
||||
(morph-temp vector :inline)
|
||||
(fog-temp vector :inline)
|
||||
(fade-temp float)
|
||||
(wind-vectors uint32)
|
||||
(test-id uint32)
|
||||
(test-id2 uint32)
|
||||
(dma-buffer basic)
|
||||
(to-spr uint32)
|
||||
(from-spr uint32)
|
||||
(wind-work uint32)
|
||||
(cur-vis-bits uint32)
|
||||
(end-vis-bits uint32)
|
||||
(refl-fade-fac float)
|
||||
(refl-fade-end float)
|
||||
(flags uint32)
|
||||
(vanish-flag uint32)
|
||||
(translucent-flag uint32)
|
||||
(wait-from-spr uint32)
|
||||
(wait-to-spr uint32)
|
||||
(use-etie symbol)
|
||||
(buffer-start uint32)
|
||||
(buffer-end uint32)
|
||||
(tfrag-dists uint32)
|
||||
(alpha-dists uint32)
|
||||
(water-dists uint32)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type instance-tie-work
|
||||
(defmethod inspect ((this instance-tie-work))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'instance-tie-work)
|
||||
(format #t "~1Twind-const: #<vector @ #x~X>~%" (-> this wind-const))
|
||||
(format #t "~1Thmge-d: #<vector @ #x~X>~%" (-> this hmge-d))
|
||||
(format #t "~1Thvdf-offset: #<vector @ #x~X>~%" (-> this hvdf-offset))
|
||||
(format #t "~1Twind-force: #<vector @ #x~X>~%" (-> this wind-force))
|
||||
(format #t "~1Tconstant: #<vector @ #x~X>~%" (-> this constant))
|
||||
(format #t "~1Tfar-morph: #<vector @ #x~X>~%" (-> this far-morph))
|
||||
(format #t "~1Tdist-test: #<vector @ #x~X>~%" (-> this dist-test))
|
||||
(format #t "~1Tmin-dist: #<vector @ #x~X>~%" (-> this min-dist))
|
||||
(format #t "~1Tguard-plane[4] @ #x~X~%" (-> this guard-plane))
|
||||
(format #t "~1Tupload-color-0: #<dma-packet @ #x~X>~%" (-> this upload-color-0))
|
||||
(format #t "~1Tupload-color-1: #<dma-packet @ #x~X>~%" (-> this upload-color-1))
|
||||
(format #t "~1Tupload-color-2: #<dma-packet @ #x~X>~%" (-> this upload-color-2))
|
||||
(format #t "~1Tupload-color-ret: #<dma-packet @ #x~X>~%" (-> this upload-color-ret))
|
||||
(format #t "~1Tupload-color-temp: #<dma-packet @ #x~X>~%" (-> this upload-color-temp))
|
||||
(format #t "~1Tgeneric-color-0: #<dma-packet @ #x~X>~%" (-> this generic-color-0))
|
||||
(format #t "~1Tgeneric-color-1: #<dma-packet @ #x~X>~%" (-> this generic-color-1))
|
||||
(format #t "~1Tgeneric-color-end: #<dma-packet @ #x~X>~%" (-> this generic-color-end))
|
||||
(format #t "~1Tenvmap-color-0: #<dma-packet @ #x~X>~%" (-> this envmap-color-0))
|
||||
(format #t "~1Tenvmap-color-1: #<dma-packet @ #x~X>~%" (-> this envmap-color-1))
|
||||
(format #t "~1Ttie-scissor-perspective-matrix: #<matrix @ #x~X>~%" (-> this tie-scissor-perspective-matrix))
|
||||
(format #t "~1Ttod-env-color: #<vector @ #x~X>~%" (-> this tod-env-color))
|
||||
(format #t "~1Tmorph-temp: #<vector @ #x~X>~%" (-> this morph-temp))
|
||||
(format #t "~1Tfog-temp: #<vector @ #x~X>~%" (-> this fog-temp))
|
||||
(format #t "~1Tfade-temp: ~f~%" (-> this fade-temp))
|
||||
(format #t "~1Twind-vectors: #x~X~%" (-> this wind-vectors))
|
||||
(format #t "~1Ttest-id: ~D~%" (-> this test-id))
|
||||
(format #t "~1Ttest-id2: ~D~%" (-> this test-id2))
|
||||
(format #t "~1Tdma-buffer: ~A~%" (-> this dma-buffer))
|
||||
(format #t "~1Tto-spr: ~D~%" (-> this to-spr))
|
||||
(format #t "~1Tfrom-spr: ~D~%" (-> this from-spr))
|
||||
(format #t "~1Twind-work: ~D~%" (-> this wind-work))
|
||||
(format #t "~1Tcur-vis-bits: ~D~%" (-> this cur-vis-bits))
|
||||
(format #t "~1Tend-vis-bits: ~D~%" (-> this end-vis-bits))
|
||||
(format #t "~1Trefl-fade-fac: ~f~%" (-> this refl-fade-fac))
|
||||
(format #t "~1Trefl-fade-end: ~f~%" (-> this refl-fade-end))
|
||||
(format #t "~1Tflags: ~D~%" (-> this flags))
|
||||
(format #t "~1Tvanish-flag: ~D~%" (-> this vanish-flag))
|
||||
(format #t "~1Ttranslucent-flag: ~D~%" (-> this translucent-flag))
|
||||
(format #t "~1Twait-from-spr: ~D~%" (-> this wait-from-spr))
|
||||
(format #t "~1Twait-to-spr: ~D~%" (-> this wait-to-spr))
|
||||
(format #t "~1Tuse-etie: ~A~%" (-> this use-etie))
|
||||
(format #t "~1Tbuffer-start: #x~X~%" (-> this buffer-start))
|
||||
(format #t "~1Tbuffer-end: #x~X~%" (-> this buffer-end))
|
||||
(format #t "~1Ttfrag-dists: #x~X~%" (-> this tfrag-dists))
|
||||
(format #t "~1Talpha-dists: #x~X~%" (-> this alpha-dists))
|
||||
(format #t "~1Twater-dists: #x~X~%" (-> this water-dists))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type instance-tie-dma
|
||||
(deftype instance-tie-dma (structure)
|
||||
"Scratchpad memory layout for TIE instance DMA generation."
|
||||
((banka instance-tie 32 :inline)
|
||||
(bankb instance-tie 32 :inline)
|
||||
(outa uint128 256)
|
||||
(outb uint128 256)
|
||||
(work instance-tie-work :dynamic)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type instance-tie-dma
|
||||
(defmethod inspect ((this instance-tie-dma))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'instance-tie-dma)
|
||||
(format #t "~1Tbanka[32] @ #x~X~%" (-> this banka))
|
||||
(format #t "~1Tbankb[32] @ #x~X~%" (-> this bankb))
|
||||
(format #t "~1Touta[256] @ #x~X~%" (-> this outa))
|
||||
(format #t "~1Toutb[256] @ #x~X~%" (-> this outb))
|
||||
(format #t "~1Twork: #<instance-tie-work @ #x~X>~%" (-> this work 0))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type prototype-tie-work
|
||||
(deftype prototype-tie-work (structure)
|
||||
"workspace for TIE protype DMA generation."
|
||||
((upload-flushe dma-packet :inline)
|
||||
(upload-palette dma-packet :inline)
|
||||
(upload-model-0 dma-packet :inline)
|
||||
(upload-model-1 dma-packet :inline)
|
||||
(upload-model-2 dma-packet :inline)
|
||||
(upload-model-3 dma-packet :inline)
|
||||
(upload-model-near-0 dma-packet :inline)
|
||||
(upload-model-near-1 dma-packet :inline)
|
||||
(upload-model-near-2 dma-packet :inline)
|
||||
(upload-model-near-3 dma-packet :inline)
|
||||
(upload-model-near-4 dma-packet :inline)
|
||||
(envmap-palette dma-packet :inline)
|
||||
(envmap-shader dma-packet :inline)
|
||||
(upload-envmap-0 dma-packet :inline)
|
||||
(upload-envmap-1 dma-packet :inline)
|
||||
(upload-envmap-2 dma-packet :inline)
|
||||
(upload-envmap-3 dma-packet :inline)
|
||||
(upload-envmap-4 dma-packet :inline)
|
||||
(upload-envmap-scissor-4 dma-packet :inline)
|
||||
(generic-palette dma-packet :inline)
|
||||
(generic-model-0 dma-packet :inline)
|
||||
(generic-model-1 dma-packet :inline)
|
||||
(generic-model-2 dma-packet :inline)
|
||||
(model-next dma-packet :inline)
|
||||
(clamp uint64)
|
||||
(prototype-array basic)
|
||||
(wait-from-spr uint32)
|
||||
(wait-to-spr uint32)
|
||||
(mood mood-context)
|
||||
(last uint32 16 :offset 416)
|
||||
(next uint32 16)
|
||||
(count uint16 16)
|
||||
(tie-last uint32 :overlay-at (-> last 0))
|
||||
(tie-next uint32 :overlay-at (-> next 0))
|
||||
(tie-count uint16 :overlay-at (-> count 0))
|
||||
(trans-last uint32 :overlay-at (-> last 1))
|
||||
(trans-next uint32 :overlay-at (-> next 1))
|
||||
(trans-count uint16 :overlay-at (-> count 1))
|
||||
(water-last uint32 :overlay-at (-> last 2))
|
||||
(water-next uint32 :overlay-at (-> next 2))
|
||||
(water-count uint16 :overlay-at (-> count 2))
|
||||
(scissor-last uint32 :overlay-at (-> last 3))
|
||||
(scissor-next uint32 :overlay-at (-> next 3))
|
||||
(scissor-count uint16 :overlay-at (-> count 3))
|
||||
(scissor-trans-last uint32 :overlay-at (-> last 4))
|
||||
(scissor-trans-next uint32 :overlay-at (-> next 4))
|
||||
(scissor-trans-count uint16 :overlay-at (-> count 4))
|
||||
(scissor-water-last uint32 :overlay-at (-> last 5))
|
||||
(scissor-water-next uint32 :overlay-at (-> next 5))
|
||||
(scissor-water-count uint16 :overlay-at (-> count 5))
|
||||
(envmap-last uint32 :overlay-at (-> last 6))
|
||||
(envmap-next uint32 :overlay-at (-> next 6))
|
||||
(envmap-count uint16 :overlay-at (-> count 6))
|
||||
(envmap-trans-last uint32 :overlay-at (-> last 7))
|
||||
(envmap-trans-next uint32 :overlay-at (-> next 7))
|
||||
(envmap-trans-count uint16 :overlay-at (-> count 7))
|
||||
(envmap-water-last uint32 :overlay-at (-> last 8))
|
||||
(envmap-water-next uint32 :overlay-at (-> next 8))
|
||||
(envmap-water-count uint16 :overlay-at (-> count 8))
|
||||
(envmap-scissor-last uint32 :overlay-at (-> last 9))
|
||||
(envmap-scissor-next uint32 :overlay-at (-> next 9))
|
||||
(envmap-scissor-count uint16 :overlay-at (-> count 9))
|
||||
(envmap-scissor-trans-last uint32 :overlay-at (-> last 10))
|
||||
(envmap-scissor-trans-next uint32 :overlay-at (-> next 10))
|
||||
(envmap-scissor-trans-count uint16 :overlay-at (-> count 10))
|
||||
(envmap-scissor-water-last uint32 :overlay-at (-> last 11))
|
||||
(envmap-scissor-water-next uint32 :overlay-at (-> next 11))
|
||||
(envmap-scissor-water-count uint16 :overlay-at (-> count 11))
|
||||
(generic-last uint32 :overlay-at (-> last 12))
|
||||
(generic-next uint32 :overlay-at (-> next 12))
|
||||
(generic-count uint16 :overlay-at (-> count 12))
|
||||
(generic-trans-last uint32 :overlay-at (-> last 13))
|
||||
(generic-trans-next uint32 :overlay-at (-> next 13))
|
||||
(generic-trans-count uint16 :overlay-at (-> count 13))
|
||||
(generic-water-last uint32 :overlay-at (-> last 14))
|
||||
(generic-water-next uint32 :overlay-at (-> next 14))
|
||||
(generic-water-count uint16 :overlay-at (-> count 14))
|
||||
(vanish-last uint32 :overlay-at (-> last 15))
|
||||
(vanish-next uint32 :overlay-at (-> next 15))
|
||||
(vanish-count uint16 :overlay-at (-> count 15))
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type prototype-tie-work
|
||||
(defmethod inspect ((this prototype-tie-work))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'prototype-tie-work)
|
||||
(format #t "~1Tupload-flushe: #<dma-packet @ #x~X>~%" (-> this upload-flushe))
|
||||
(format #t "~1Tupload-palette: #<dma-packet @ #x~X>~%" (-> this upload-palette))
|
||||
(format #t "~1Tupload-model-0: #<dma-packet @ #x~X>~%" (-> this upload-model-0))
|
||||
(format #t "~1Tupload-model-1: #<dma-packet @ #x~X>~%" (-> this upload-model-1))
|
||||
(format #t "~1Tupload-model-2: #<dma-packet @ #x~X>~%" (-> this upload-model-2))
|
||||
(format #t "~1Tupload-model-3: #<dma-packet @ #x~X>~%" (-> this upload-model-3))
|
||||
(format #t "~1Tupload-model-near-0: #<dma-packet @ #x~X>~%" (-> this upload-model-near-0))
|
||||
(format #t "~1Tupload-model-near-1: #<dma-packet @ #x~X>~%" (-> this upload-model-near-1))
|
||||
(format #t "~1Tupload-model-near-2: #<dma-packet @ #x~X>~%" (-> this upload-model-near-2))
|
||||
(format #t "~1Tupload-model-near-3: #<dma-packet @ #x~X>~%" (-> this upload-model-near-3))
|
||||
(format #t "~1Tupload-model-near-4: #<dma-packet @ #x~X>~%" (-> this upload-model-near-4))
|
||||
(format #t "~1Tenvmap-palette: #<dma-packet @ #x~X>~%" (-> this envmap-palette))
|
||||
(format #t "~1Tenvmap-shader: #<dma-packet @ #x~X>~%" (-> this envmap-shader))
|
||||
(format #t "~1Tupload-envmap-0: #<dma-packet @ #x~X>~%" (-> this upload-envmap-0))
|
||||
(format #t "~1Tupload-envmap-1: #<dma-packet @ #x~X>~%" (-> this upload-envmap-1))
|
||||
(format #t "~1Tupload-envmap-2: #<dma-packet @ #x~X>~%" (-> this upload-envmap-2))
|
||||
(format #t "~1Tupload-envmap-3: #<dma-packet @ #x~X>~%" (-> this upload-envmap-3))
|
||||
(format #t "~1Tupload-envmap-4: #<dma-packet @ #x~X>~%" (-> this upload-envmap-4))
|
||||
(format #t "~1Tupload-envmap-scissor-4: #<dma-packet @ #x~X>~%" (-> this upload-envmap-scissor-4))
|
||||
(format #t "~1Tgeneric-palette: #<dma-packet @ #x~X>~%" (-> this generic-palette))
|
||||
(format #t "~1Tgeneric-model-0: #<dma-packet @ #x~X>~%" (-> this generic-model-0))
|
||||
(format #t "~1Tgeneric-model-1: #<dma-packet @ #x~X>~%" (-> this generic-model-1))
|
||||
(format #t "~1Tgeneric-model-2: #<dma-packet @ #x~X>~%" (-> this generic-model-2))
|
||||
(format #t "~1Tmodel-next: #<dma-packet @ #x~X>~%" (-> this model-next))
|
||||
(format #t "~1Tclamp: ~D~%" (-> this clamp))
|
||||
(format #t "~1Tprototype-array: ~A~%" (-> this prototype-array))
|
||||
(format #t "~1Twait-from-spr: ~D~%" (-> this wait-from-spr))
|
||||
(format #t "~1Twait-to-spr: ~D~%" (-> this wait-to-spr))
|
||||
(format #t "~1Tmood: #<mood-context @ #x~X>~%" (-> this mood))
|
||||
(format #t "~1Tlast[16] @ #x~X~%" (-> this last))
|
||||
(format #t "~1Tnext[16] @ #x~X~%" (-> this next))
|
||||
(format #t "~1Tcount[16] @ #x~X~%" (-> this count))
|
||||
(format #t "~1Ttie-last: #x~X~%" (-> this tie-last))
|
||||
(format #t "~1Ttie-next: #x~X~%" (-> this tie-next))
|
||||
(format #t "~1Ttie-count: ~D~%" (-> this tie-count))
|
||||
(format #t "~1Ttrans-last: #x~X~%" (-> this trans-last))
|
||||
(format #t "~1Ttrans-next: #x~X~%" (-> this trans-next))
|
||||
(format #t "~1Ttrans-count: ~D~%" (-> this trans-count))
|
||||
(format #t "~1Twater-last: #x~X~%" (-> this water-last))
|
||||
(format #t "~1Twater-next: #x~X~%" (-> this water-next))
|
||||
(format #t "~1Twater-count: ~D~%" (-> this water-count))
|
||||
(format #t "~1Tscissor-last: #x~X~%" (-> this scissor-last))
|
||||
(format #t "~1Tscissor-next: #x~X~%" (-> this scissor-next))
|
||||
(format #t "~1Tscissor-count: ~D~%" (-> this scissor-count))
|
||||
(format #t "~1Tscissor-trans-last: #x~X~%" (-> this scissor-trans-last))
|
||||
(format #t "~1Tscissor-trans-next: #x~X~%" (-> this scissor-trans-next))
|
||||
(format #t "~1Tscissor-trans-count: ~D~%" (-> this scissor-trans-count))
|
||||
(format #t "~1Tscissor-water-last: #x~X~%" (-> this scissor-water-last))
|
||||
(format #t "~1Tscissor-water-next: #x~X~%" (-> this scissor-water-next))
|
||||
(format #t "~1Tscissor-water-count: ~D~%" (-> this scissor-water-count))
|
||||
(format #t "~1Tenvmap-last: #x~X~%" (-> this envmap-last))
|
||||
(format #t "~1Tenvmap-next: #x~X~%" (-> this envmap-next))
|
||||
(format #t "~1Tenvmap-count: ~D~%" (-> this envmap-count))
|
||||
(format #t "~1Tenvmap-trans-last: #x~X~%" (-> this envmap-trans-last))
|
||||
(format #t "~1Tenvmap-trans-next: #x~X~%" (-> this envmap-trans-next))
|
||||
(format #t "~1Tenvmap-trans-count: ~D~%" (-> this envmap-trans-count))
|
||||
(format #t "~1Tenvmap-water-last: #x~X~%" (-> this envmap-water-last))
|
||||
(format #t "~1Tenvmap-water-next: #x~X~%" (-> this envmap-water-next))
|
||||
(format #t "~1Tenvmap-water-count: ~D~%" (-> this envmap-water-count))
|
||||
(format #t "~1Tenvmap-scissor-last: #x~X~%" (-> this envmap-scissor-last))
|
||||
(format #t "~1Tenvmap-scissor-next: #x~X~%" (-> this envmap-scissor-next))
|
||||
(format #t "~1Tenvmap-scissor-count: ~D~%" (-> this envmap-scissor-count))
|
||||
(format #t "~1Tenvmap-scissor-trans-last: #x~X~%" (-> this envmap-scissor-trans-last))
|
||||
(format #t "~1Tenvmap-scissor-trans-next: #x~X~%" (-> this envmap-scissor-trans-next))
|
||||
(format #t "~1Tenvmap-scissor-trans-count: ~D~%" (-> this envmap-scissor-trans-count))
|
||||
(format #t "~1Tenvmap-scissor-water-last: #x~X~%" (-> this envmap-scissor-water-last))
|
||||
(format #t "~1Tenvmap-scissor-water-next: #x~X~%" (-> this envmap-scissor-water-next))
|
||||
(format #t "~1Tenvmap-scissor-water-count: ~D~%" (-> this envmap-scissor-water-count))
|
||||
(format #t "~1Tgeneric-last: #x~X~%" (-> this generic-last))
|
||||
(format #t "~1Tgeneric-next: #x~X~%" (-> this generic-next))
|
||||
(format #t "~1Tgeneric-count: ~D~%" (-> this generic-count))
|
||||
(format #t "~1Tgeneric-trans-last: #x~X~%" (-> this generic-trans-last))
|
||||
(format #t "~1Tgeneric-trans-next: #x~X~%" (-> this generic-trans-next))
|
||||
(format #t "~1Tgeneric-trans-count: ~D~%" (-> this generic-trans-count))
|
||||
(format #t "~1Tgeneric-water-last: #x~X~%" (-> this generic-water-last))
|
||||
(format #t "~1Tgeneric-water-next: #x~X~%" (-> this generic-water-next))
|
||||
(format #t "~1Tgeneric-water-count: ~D~%" (-> this generic-water-count))
|
||||
(format #t "~1Tvanish-last: #x~X~%" (-> this vanish-last))
|
||||
(format #t "~1Tvanish-next: #x~X~%" (-> this vanish-next))
|
||||
(format #t "~1Tvanish-count: ~D~%" (-> this vanish-count))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type prototype-tie-dma
|
||||
(deftype prototype-tie-dma (structure)
|
||||
((colora rgba 256)
|
||||
(colorb rgba 256)
|
||||
(outa uint128 256)
|
||||
(outb uint128 256)
|
||||
(geometry uint32 4)
|
||||
(next uint32 12)
|
||||
(count uint16 12)
|
||||
(counts uint32 4)
|
||||
(palette-ptr uint32 :overlay-at (-> counts 2))
|
||||
(model-ptr uint32 :overlay-at (-> counts 3))
|
||||
(ret-ptr uint32)
|
||||
(length uint32)
|
||||
(flags uint32)
|
||||
(dma-buffer basic)
|
||||
(this-frag-count uint32)
|
||||
(frag-count uint8 4)
|
||||
(from-spr uint32)
|
||||
(to-spr uint32)
|
||||
(spr-out uint32)
|
||||
(this-count uint32)
|
||||
(scissor-geometry uint32 :overlay-at (-> geometry 0))
|
||||
(near-geometry uint32 :overlay-at (-> geometry 1))
|
||||
(mid-geometry uint32 :overlay-at (-> geometry 2))
|
||||
(far-geometry uint32 :overlay-at (-> geometry 3))
|
||||
(scissor-frag-count uint8 :overlay-at (-> frag-count 0))
|
||||
(near-frag-count uint8 :overlay-at (-> frag-count 1))
|
||||
(mid-frag-count uint8 :overlay-at (-> frag-count 2))
|
||||
(far-frag-count uint8 :overlay-at (-> frag-count 3))
|
||||
(tie-scissor-next uint32 :overlay-at (-> next 0))
|
||||
(tie-near-next uint32 :overlay-at (-> next 1))
|
||||
(tie-mid-next uint32 :overlay-at (-> next 2))
|
||||
(tie-far-next uint32 :overlay-at (-> next 3))
|
||||
(trans-scissor-next uint32 4 :overlay-at (-> next 0))
|
||||
(trans-near-next uint32 :overlay-at (-> next 1))
|
||||
(trans-mid-next uint32 :overlay-at (-> next 2))
|
||||
(trans-far-next uint32 :overlay-at (-> next 3))
|
||||
(water-scissor-next uint32 4 :overlay-at (-> next 0))
|
||||
(water-near-next uint32 :overlay-at (-> next 1))
|
||||
(water-mid-next uint32 :overlay-at (-> next 2))
|
||||
(water-far-next uint32 :overlay-at (-> next 3))
|
||||
(envmap-scissor-next uint32 4 :overlay-at (-> next 4))
|
||||
(envmap-near-next uint32 :overlay-at (-> next 5))
|
||||
(envmap-mid-next uint32 :overlay-at (-> next 6))
|
||||
(envmap-far-next uint32 :overlay-at (-> next 7))
|
||||
(generic-near-next uint32 :overlay-at (-> next 8))
|
||||
(generic-mid-next uint32 :overlay-at (-> next 9))
|
||||
(generic-far-next uint32 :overlay-at (-> next 10))
|
||||
(vanish-next uint32 :overlay-at (-> next 11))
|
||||
(tie-count uint16 :overlay-at (-> count 0))
|
||||
(tie-scissor-count uint16 :overlay-at (-> count 0))
|
||||
(tie-near-count uint16 :overlay-at (-> count 1))
|
||||
(tie-mid-count uint16 :overlay-at (-> count 2))
|
||||
(tie-far-count uint16 :overlay-at (-> count 3))
|
||||
(trans-count uint16 :overlay-at (-> count 0))
|
||||
(trans-scissor-count uint16 :overlay-at (-> count 0))
|
||||
(trans-near-count uint16 :overlay-at (-> count 1))
|
||||
(trans-mid-count uint16 :overlay-at (-> count 2))
|
||||
(trans-far-count uint16 :overlay-at (-> count 3))
|
||||
(water-count uint16 :overlay-at (-> count 0))
|
||||
(water-scissor-count uint16 :overlay-at (-> count 0))
|
||||
(water-near-count uint16 :overlay-at (-> count 1))
|
||||
(water-mid-count uint16 :overlay-at (-> count 2))
|
||||
(water-far-count uint16 :overlay-at (-> count 3))
|
||||
(envmap-count uint16 :overlay-at (-> count 4))
|
||||
(envmap-scissor-count uint16 :overlay-at (-> count 4))
|
||||
(envmap-near-count uint16 :overlay-at (-> count 5))
|
||||
(envmap-mid-count uint16 :overlay-at (-> count 6))
|
||||
(envmap-far-count uint16 :overlay-at (-> count 7))
|
||||
(generic-count uint16 :overlay-at (-> count 8))
|
||||
(generic-near-count uint16 :overlay-at (-> count 8))
|
||||
(generic-mid-count uint16 :overlay-at (-> count 9))
|
||||
(generic-far-count uint16 :overlay-at (-> count 10))
|
||||
(vanish-count uint16 :overlay-at (-> count 11))
|
||||
(next-clear uint32 3 :overlay-at (-> next 0))
|
||||
(count-clear uint16 3 :overlay-at (-> count 0))
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type prototype-tie-dma
|
||||
(defmethod inspect ((this prototype-tie-dma))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'prototype-tie-dma)
|
||||
(format #t "~1Tcolora[256] @ #x~X~%" (-> this colora))
|
||||
(format #t "~1Tcolorb[256] @ #x~X~%" (-> this colorb))
|
||||
(format #t "~1Touta[256] @ #x~X~%" (-> this outa))
|
||||
(format #t "~1Toutb[256] @ #x~X~%" (-> this outb))
|
||||
(format #t "~1Tgeometry[4] @ #x~X~%" (-> this geometry))
|
||||
(format #t "~1Tnext[12] @ #x~X~%" (-> this next))
|
||||
(format #t "~1Tcount[12] @ #x~X~%" (-> this count))
|
||||
(format #t "~1Tcounts[4] @ #x~X~%" (-> this counts))
|
||||
(format #t "~1Tpalette-ptr: #x~X~%" (-> this palette-ptr))
|
||||
(format #t "~1Tmodel-ptr: #x~X~%" (-> this model-ptr))
|
||||
(format #t "~1Tret-ptr: #x~X~%" (-> this ret-ptr))
|
||||
(format #t "~1Tlength: ~D~%" (-> this length))
|
||||
(format #t "~1Tflags: ~D~%" (-> this flags))
|
||||
(format #t "~1Tdma-buffer: ~A~%" (-> this dma-buffer))
|
||||
(format #t "~1Tthis-frag-count: ~D~%" (-> this this-frag-count))
|
||||
(format #t "~1Tfrag-count[4] @ #x~X~%" (-> this frag-count))
|
||||
(format #t "~1Tfrom-spr: #x~X~%" (-> this from-spr))
|
||||
(format #t "~1Tto-spr: #x~X~%" (-> this to-spr))
|
||||
(format #t "~1Tspr-out: #x~X~%" (-> this spr-out))
|
||||
(format #t "~1Tthis-count: ~D~%" (-> this this-count))
|
||||
(format #t "~1Tscissor-geometry: #x~X~%" (-> this scissor-geometry))
|
||||
(format #t "~1Tnear-geometry: #x~X~%" (-> this near-geometry))
|
||||
(format #t "~1Tmid-geometry: #x~X~%" (-> this mid-geometry))
|
||||
(format #t "~1Tfar-geometry: #x~X~%" (-> this far-geometry))
|
||||
(format #t "~1Tscissor-frag-count: ~D~%" (-> this scissor-frag-count))
|
||||
(format #t "~1Tnear-frag-count: ~D~%" (-> this near-frag-count))
|
||||
(format #t "~1Tmid-frag-count: ~D~%" (-> this mid-frag-count))
|
||||
(format #t "~1Tfar-frag-count: ~D~%" (-> this far-frag-count))
|
||||
(format #t "~1Ttie-scissor-next: #x~X~%" (-> this tie-scissor-next))
|
||||
(format #t "~1Ttie-near-next: #x~X~%" (-> this tie-near-next))
|
||||
(format #t "~1Ttie-mid-next: #x~X~%" (-> this tie-mid-next))
|
||||
(format #t "~1Ttie-far-next: #x~X~%" (-> this tie-far-next))
|
||||
(format #t "~1Ttrans-scissor-next[4] @ #x~X~%" (-> this next))
|
||||
(format #t "~1Ttrans-near-next: #x~X~%" (-> this tie-near-next))
|
||||
(format #t "~1Ttrans-mid-next: #x~X~%" (-> this tie-mid-next))
|
||||
(format #t "~1Ttrans-far-next: #x~X~%" (-> this tie-far-next))
|
||||
(format #t "~1Twater-scissor-next[4] @ #x~X~%" (-> this next))
|
||||
(format #t "~1Twater-near-next: #x~X~%" (-> this tie-near-next))
|
||||
(format #t "~1Twater-mid-next: #x~X~%" (-> this tie-mid-next))
|
||||
(format #t "~1Twater-far-next: #x~X~%" (-> this tie-far-next))
|
||||
(format #t "~1Tenvmap-scissor-next[4] @ #x~X~%" (-> this envmap-scissor-next))
|
||||
(format #t "~1Tenvmap-near-next: #x~X~%" (-> this envmap-near-next))
|
||||
(format #t "~1Tenvmap-mid-next: #x~X~%" (-> this envmap-mid-next))
|
||||
(format #t "~1Tenvmap-far-next: #x~X~%" (-> this envmap-far-next))
|
||||
(format #t "~1Tgeneric-near-next: #x~X~%" (-> this generic-near-next))
|
||||
(format #t "~1Tgeneric-mid-next: #x~X~%" (-> this generic-mid-next))
|
||||
(format #t "~1Tgeneric-far-next: #x~X~%" (-> this generic-far-next))
|
||||
(format #t "~1Tvanish-next: #x~X~%" (-> this vanish-next))
|
||||
(format #t "~1Ttie-count: ~D~%" (-> this tie-count))
|
||||
(format #t "~1Ttie-scissor-count: ~D~%" (-> this tie-count))
|
||||
(format #t "~1Ttie-near-count: ~D~%" (-> this tie-near-count))
|
||||
(format #t "~1Ttie-mid-count: ~D~%" (-> this tie-mid-count))
|
||||
(format #t "~1Ttie-far-count: ~D~%" (-> this tie-far-count))
|
||||
(format #t "~1Ttrans-count: ~D~%" (-> this tie-count))
|
||||
(format #t "~1Ttrans-scissor-count: ~D~%" (-> this tie-count))
|
||||
(format #t "~1Ttrans-near-count: ~D~%" (-> this tie-near-count))
|
||||
(format #t "~1Ttrans-mid-count: ~D~%" (-> this tie-mid-count))
|
||||
(format #t "~1Ttrans-far-count: ~D~%" (-> this tie-far-count))
|
||||
(format #t "~1Twater-count: ~D~%" (-> this tie-count))
|
||||
(format #t "~1Twater-scissor-count: ~D~%" (-> this tie-count))
|
||||
(format #t "~1Twater-near-count: ~D~%" (-> this tie-near-count))
|
||||
(format #t "~1Twater-mid-count: ~D~%" (-> this tie-mid-count))
|
||||
(format #t "~1Twater-far-count: ~D~%" (-> this tie-far-count))
|
||||
(format #t "~1Tenvmap-count: ~D~%" (-> this envmap-count))
|
||||
(format #t "~1Tenvmap-scissor-count: ~D~%" (-> this envmap-count))
|
||||
(format #t "~1Tenvmap-near-count: ~D~%" (-> this envmap-near-count))
|
||||
(format #t "~1Tenvmap-mid-count: ~D~%" (-> this envmap-mid-count))
|
||||
(format #t "~1Tenvmap-far-count: ~D~%" (-> this envmap-far-count))
|
||||
(format #t "~1Tgeneric-count: ~D~%" (-> this generic-count))
|
||||
(format #t "~1Tgeneric-near-count: ~D~%" (-> this generic-count))
|
||||
(format #t "~1Tgeneric-mid-count: ~D~%" (-> this generic-mid-count))
|
||||
(format #t "~1Tgeneric-far-count: ~D~%" (-> this generic-far-count))
|
||||
(format #t "~1Tvanish-count: ~D~%" (-> this vanish-count))
|
||||
(format #t "~1Tnext-clear[3] @ #x~X~%" (-> this next))
|
||||
(format #t "~1Tcount-clear[3] @ #x~X~%" (-> this count))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition for symbol *instance-tie-work-copy*, type instance-tie-work
|
||||
(define *instance-tie-work-copy* (the-as instance-tie-work #f))
|
||||
|
||||
;; failed to figure out what this is:
|
||||
0
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
],
|
||||
|
||||
"skip_compile_files": [
|
||||
"types-h" // weird array of types.
|
||||
"types-h", // weird array of types.
|
||||
"hfrag-h" // weird duplicate type
|
||||
],
|
||||
|
||||
"skip_compile_functions": [
|
||||
@@ -58,7 +59,13 @@
|
||||
"(method 9 texture-page-dir)", "set-dirty-mask!",
|
||||
"(method 3 generic-tie-interp-point)",
|
||||
// cache stuff
|
||||
"invalidate-cache-line"
|
||||
"invalidate-cache-line",
|
||||
// multiple def
|
||||
"(method 3 hfrag-poly4)",
|
||||
"(method 3 hfrag-poly9)",
|
||||
"(method 3 hfrag-poly25)",
|
||||
"(method 3 hfrag-mip-packet)"
|
||||
|
||||
],
|
||||
|
||||
"skip_compile_states": {}
|
||||
|
||||
Reference in New Issue
Block a user