mirror of
https://github.com/open-goal/jak-project
synced 2026-07-09 06:53:45 -04:00
[decomp] headers for generic, mercneric, tieneric, merc, cpu shadow renderers, art, joint and bone (#424)
* decomp a bunch of renderer files * fixes
This commit is contained in:
+579
-579
File diff suppressed because it is too large
Load Diff
@@ -388,5 +388,10 @@
|
||||
],
|
||||
"(method 14 res-lump)": [
|
||||
[2, "a0", "res-tag"]
|
||||
],
|
||||
|
||||
// SHADOW-CPU-H
|
||||
"(method 10 shadow-control)": [
|
||||
[1, "v1", "int"]
|
||||
]
|
||||
}
|
||||
|
||||
@@ -849,6 +849,10 @@
|
||||
"args": ["allocation", "type-to-make", "psm", "w", "h", "ztest", "zpsm"],
|
||||
"vars": { "gp-0": "obj" }
|
||||
},
|
||||
|
||||
"(method 0 ripple-control)": {
|
||||
"vars": { "v0-0": "obj" }
|
||||
},
|
||||
|
||||
"vector-seek-2d-xz-smooth!": {
|
||||
"args": ["vec", "target", "max-step", "alpha"],
|
||||
@@ -1551,5 +1555,11 @@
|
||||
"(method 21 level-group)": {
|
||||
"args": ["obj", "name", "cmd-idx"],
|
||||
"vars": { "v1-1": "cmd-lst" }
|
||||
},
|
||||
|
||||
// SHADOW-CPU-H
|
||||
"(method 0 shadow-control)": {
|
||||
"args": ["allocation", "type-to-make", "bottom-offset", "top-offset", "dir", "center", "fade"],
|
||||
"vars": { "v0-0": "obj" }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,3 +5,122 @@
|
||||
;; name in dgo: bones-h
|
||||
;; dgos: GAME, ENGINE
|
||||
|
||||
(deftype bone-buffer (structure)
|
||||
((joint joint-anim-compressed-hdr 16 :inline :offset-assert 0)
|
||||
(bone bone 16 :inline :offset-assert 1024)
|
||||
(_pad uint8 2048 :offset-assert 2560)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x1200
|
||||
:flag-assert #x900001200
|
||||
)
|
||||
|
||||
(deftype bone-layout (structure)
|
||||
((joint joint 2 :offset-assert 0)
|
||||
(bone bone 2 :offset-assert 8)
|
||||
(data uint16 8 :offset 0)
|
||||
(output uint32 2 :offset-assert 16)
|
||||
(cache uint32 2 :offset-assert 24)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x20
|
||||
:flag-assert #x900000020
|
||||
)
|
||||
|
||||
(deftype bone-regs (structure)
|
||||
((joint-ptr (pointer joint) :offset-assert 0)
|
||||
(bone-ptr (pointer bone) :offset-assert 4)
|
||||
(num-bones uint32 :offset-assert 8)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #xc
|
||||
:flag-assert #x90000000c
|
||||
)
|
||||
|
||||
(deftype bone-work (structure)
|
||||
((layout bone-layout :inline :offset-assert 0)
|
||||
(bounds sphere :inline :offset-assert 32)
|
||||
(lights vu-lights :inline :offset-assert 48)
|
||||
(distance vector :inline :offset-assert 160)
|
||||
(next-tag dma-packet :inline :offset-assert 176)
|
||||
(dma-buf dma-buffer :offset-assert 192)
|
||||
(sink-group basic :offset-assert 196)
|
||||
(next-pris dma-packet :offset-assert 200)
|
||||
(next-merc dma-packet :offset-assert 204)
|
||||
(wait-count uint32 :offset-assert 208)
|
||||
(in-count uint32 :offset-assert 212)
|
||||
(sp-size uint32 :offset-assert 216)
|
||||
(sp-bufnum uint32 :offset-assert 220)
|
||||
(regs bone-regs :inline :offset-assert 224)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #xec
|
||||
:flag-assert #x9000000ec
|
||||
)
|
||||
|
||||
(deftype bone-debug (structure)
|
||||
((time-ctr uint32 :offset-assert 0)
|
||||
(timing uint32 360 :offset-assert 4)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x5a4
|
||||
:flag-assert #x9000005a4
|
||||
)
|
||||
|
||||
(deftype bone-memory (structure)
|
||||
((work bone-work :inline :offset-assert 0)
|
||||
(buffer bone-buffer 2 :inline :offset-assert 240)
|
||||
(dma-list dma-packet :inline :offset 240)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x24f0
|
||||
:flag-assert #x9000024f0
|
||||
)
|
||||
|
||||
(defun invalidate-cache-line ((arg0 pointer))
|
||||
"Invalidate a single cache line. Won't be used in PC"
|
||||
|
||||
(#unless PC_PORT
|
||||
(.sync.l)
|
||||
(.cache dxwbin arg0 0)
|
||||
(.sync.l)
|
||||
(.cache dxwbin arg0 1)
|
||||
(.sync.l)
|
||||
)
|
||||
0
|
||||
)
|
||||
|
||||
(deftype merc-globals (structure)
|
||||
((first uint32 :offset-assert 0)
|
||||
(next uint32 :offset-assert 4)
|
||||
(sink basic :offset-assert 8)
|
||||
)
|
||||
:allow-misaligned
|
||||
:method-count-assert 9
|
||||
:size-assert #xc
|
||||
:flag-assert #x90000000c
|
||||
)
|
||||
|
||||
(deftype merc-global-array (structure)
|
||||
((count uint32 :offset-assert 0)
|
||||
(globals merc-globals 8 :inline :offset-assert 4)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x84
|
||||
:flag-assert #x900000084
|
||||
)
|
||||
|
||||
(define *merc-globals* #f)
|
||||
|
||||
(deftype shadow-dma-packet (structure)
|
||||
((tag generic-merc-tag :inline :offset-assert 0)
|
||||
(settings shadow-settings :inline :offset-assert 16)
|
||||
(geo-ref dma-packet :inline :offset-assert 96)
|
||||
(mtx-ref dma-packet :inline :offset-assert 112)
|
||||
(end-tag dma-packet :inline :offset-assert 128)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x90
|
||||
:flag-assert #x900000090
|
||||
)
|
||||
|
||||
|
||||
@@ -5,3 +5,96 @@
|
||||
;; name in dgo: joint-h
|
||||
;; dgos: GAME, ENGINE
|
||||
|
||||
(deftype joint-control-channel (structure)
|
||||
((parent basic :offset-assert 0)
|
||||
(command basic :offset-assert 4)
|
||||
(frame-interp float :offset-assert 8)
|
||||
(frame-group basic :offset-assert 12)
|
||||
(frame-num float :offset-assert 16)
|
||||
(num-func basic :offset-assert 20)
|
||||
(param uint32 2 :offset-assert 24)
|
||||
(group-sub-index int16 :offset-assert 32)
|
||||
(group-size int16 :offset-assert 34)
|
||||
(dist float :offset-assert 36)
|
||||
(eval-time uint32 :offset-assert 40)
|
||||
(inspector-amount float :offset-assert 44)
|
||||
)
|
||||
:method-count-assert 10
|
||||
:size-assert #x30
|
||||
:flag-assert #xa00000030
|
||||
(:methods
|
||||
(dummy-9 () none 9)
|
||||
)
|
||||
)
|
||||
|
||||
(deftype joint-control (basic)
|
||||
((status uint16 :offset-assert 4)
|
||||
(allocated-length int16 :offset-assert 6)
|
||||
(root-channel uint32 :offset 16)
|
||||
(blend-index int32 :offset-assert 20)
|
||||
(active-channels int32 :offset-assert 24)
|
||||
(generate-frame-function basic :offset-assert 28)
|
||||
(prebind-function basic :offset-assert 32)
|
||||
(postbind-function basic :offset-assert 36)
|
||||
(effect basic :offset-assert 40)
|
||||
(channel joint-control-channel 3 :inline :offset-assert 48)
|
||||
(frame-group0 basic :offset 60)
|
||||
(frame-num0 float :offset 64)
|
||||
(frame-interp0 float :offset 56)
|
||||
(frame-group1 basic :offset 108)
|
||||
(frame-num1 float :offset 112)
|
||||
(frame-interp1 float :offset 104)
|
||||
(frame-group2 basic :offset 156)
|
||||
(frame-num2 float :offset 160)
|
||||
(frame-interp2 float :offset 152)
|
||||
)
|
||||
:method-count-assert 11
|
||||
:size-assert #xc0
|
||||
:flag-assert #xb000000c0
|
||||
(:methods
|
||||
(dummy-9 () none 9)
|
||||
(dummy-10 () none 10)
|
||||
)
|
||||
)
|
||||
|
||||
(deftype matrix-stack (structure)
|
||||
((top matrix :offset-assert 0)
|
||||
(data matrix 24 :inline :offset-assert 16)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x610
|
||||
:flag-assert #x900000610
|
||||
)
|
||||
|
||||
(deftype channel-upload-info (structure)
|
||||
((fixed joint-anim-compressed-fixed :offset-assert 0)
|
||||
(fixed-qwc int32 :offset-assert 4)
|
||||
(frame joint-anim-compressed-frame :offset-assert 8)
|
||||
(frame-qwc int32 :offset-assert 12)
|
||||
(amount float :offset-assert 16)
|
||||
(interp float :offset-assert 20)
|
||||
)
|
||||
:pack-me
|
||||
:method-count-assert 9
|
||||
:size-assert #x18
|
||||
:flag-assert #x900000018
|
||||
)
|
||||
|
||||
(deftype joint-work (structure)
|
||||
((temp-mtx matrix :inline :offset-assert 0)
|
||||
(joint-stack matrix-stack :inline :offset-assert 64)
|
||||
(fix-jmp-table uint32 16 :offset-assert 1616)
|
||||
(frm-jmp-table uint32 16 :offset-assert 1680)
|
||||
(pair-jmp-table uint32 16 :offset-assert 1744)
|
||||
(uploads channel-upload-info 24 :inline :offset-assert 1808)
|
||||
(num-uploads int32 :offset-assert 2384)
|
||||
(mtx-acc matrix 2 :inline :offset-assert 2400)
|
||||
(tq-acc transformq 100 :inline :offset-assert 2528)
|
||||
(jacp-hdr joint-anim-compressed-hdr :inline :offset-assert 7328)
|
||||
(fixed-data joint-anim-compressed-fixed :inline :offset-assert 7392)
|
||||
(frame-data joint-anim-compressed-frame 2 :inline :offset-assert 9600)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x3640
|
||||
:flag-assert #x900003640
|
||||
)
|
||||
|
||||
@@ -5,7 +5,123 @@
|
||||
;; name in dgo: art-h
|
||||
;; dgos: GAME, ENGINE
|
||||
|
||||
;; TODO more
|
||||
(deftype joint-anim (basic)
|
||||
((name basic :offset-assert 4)
|
||||
(number int16 :offset-assert 8)
|
||||
(length int16 :offset-assert 10)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #xc
|
||||
:flag-assert #x90000000c
|
||||
)
|
||||
|
||||
(deftype joint-anim-matrix (joint-anim)
|
||||
((matrix matrix :offset-assert 12)) ;; guess
|
||||
;; inspect in joint
|
||||
:method-count-assert 9
|
||||
:size-assert #x10
|
||||
:flag-assert #x900000010
|
||||
)
|
||||
|
||||
(deftype joint-anim-transformq (joint-anim)
|
||||
((transformq transformq :offset-assert 12)) ;; guess
|
||||
;; inspect in joint
|
||||
:method-count-assert 9
|
||||
:size-assert #x10
|
||||
:flag-assert #x900000010
|
||||
;; too many basic blocks
|
||||
)
|
||||
|
||||
(deftype joint-anim-drawable (joint-anim)
|
||||
((data uint32 :inline :dynamic :offset-assert 12) ;; guess
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #xc
|
||||
:flag-assert #x90000000c
|
||||
)
|
||||
|
||||
(deftype joint-anim-compressed (joint-anim)
|
||||
()
|
||||
:method-count-assert 9
|
||||
:size-assert #xc
|
||||
:flag-assert #x90000000c
|
||||
)
|
||||
|
||||
(deftype joint-anim-frame (structure)
|
||||
((matrices matrix 2 :inline :offset-assert 0)
|
||||
(data uint32 :dynamic :offset-assert 128) ;; guess
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x80
|
||||
:flag-assert #x900000080
|
||||
(:methods
|
||||
(new (symbol type int) _type_ 0)
|
||||
)
|
||||
)
|
||||
|
||||
(defmethod
|
||||
new
|
||||
joint-anim-frame
|
||||
((allocation symbol) (type-to-make type) (arg0 int))
|
||||
(let ((v1-1 (max 0 (+ arg0 -2))))
|
||||
(the-as
|
||||
joint-anim-frame
|
||||
(new-dynamic-structure
|
||||
(the-as kheap allocation)
|
||||
type-to-make
|
||||
(the-as int (+ (-> type-to-make size) (the-as uint (* 48 v1-1))))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(deftype joint-anim-compressed-hdr (structure)
|
||||
((control-bits uint32 14 :offset-assert 0)
|
||||
(num-joints uint32 :offset-assert 56)
|
||||
(matrix-bits uint32 :offset-assert 60)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x40
|
||||
:flag-assert #x900000040
|
||||
)
|
||||
|
||||
(deftype joint-anim-compressed-fixed (structure)
|
||||
((hdr joint-anim-compressed-hdr :inline :offset-assert 0)
|
||||
(offset-64 uint32 :offset-assert 64)
|
||||
(offset-32 uint32 :offset-assert 68)
|
||||
(offset-16 uint32 :offset-assert 72)
|
||||
(reserved uint32 :offset-assert 76)
|
||||
(data vector 133 :inline :offset-assert 80) ;; guess
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x8a0
|
||||
:flag-assert #x9000008a0
|
||||
)
|
||||
|
||||
(deftype joint-anim-compressed-frame (structure)
|
||||
((offset-64 uint32 :offset-assert 0)
|
||||
(offset-32 uint32 :offset-assert 4)
|
||||
(offset-16 uint32 :offset-assert 8)
|
||||
(reserved uint32 :offset-assert 12)
|
||||
(data vector 133 :inline :offset-assert 16) ;; guess
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x860
|
||||
:flag-assert #x900000860
|
||||
)
|
||||
|
||||
(deftype joint-anim-compressed-control (structure)
|
||||
((num-frames uint32 :offset-assert 0)
|
||||
(fixed-qwc uint32 :offset-assert 4)
|
||||
(frame-qwc uint32 :offset-assert 8)
|
||||
(fixed joint-anim-compressed-fixed :offset-assert 12)
|
||||
(data uint32 1 :offset-assert 16) ;; guess
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x14
|
||||
:flag-assert #x900000014
|
||||
)
|
||||
|
||||
(deftype art (basic)
|
||||
((name basic :offset 8)
|
||||
(length int32 :offset-assert 12)
|
||||
@@ -22,7 +138,6 @@
|
||||
)
|
||||
)
|
||||
|
||||
;; art-h
|
||||
(deftype art-element (art)
|
||||
((pad uint8 12))
|
||||
:method-count-assert 13
|
||||
@@ -35,3 +150,144 @@
|
||||
(dummy-12 () none 12)
|
||||
)
|
||||
)
|
||||
|
||||
(deftype art-mesh-anim (art-element)
|
||||
()
|
||||
:method-count-assert 13
|
||||
:size-assert #x20
|
||||
:flag-assert #xd00000020
|
||||
)
|
||||
|
||||
(deftype art-joint-anim (art-element)
|
||||
((pad2 uint8 16 :offset-assert 32)
|
||||
)
|
||||
:method-count-assert 13
|
||||
:size-assert #x30
|
||||
:flag-assert #xd00000030
|
||||
)
|
||||
|
||||
(deftype art-group (art)
|
||||
((pad2 uint8 12 :offset-assert 20)
|
||||
)
|
||||
:method-count-assert 15
|
||||
:size-assert #x20
|
||||
:flag-assert #xf00000020
|
||||
(:methods
|
||||
(dummy-13 () none 13)
|
||||
(dummy-14 () none 14)
|
||||
)
|
||||
)
|
||||
|
||||
(deftype art-mesh-geo (art-element)
|
||||
()
|
||||
:method-count-assert 13
|
||||
:size-assert #x20
|
||||
:flag-assert #xd00000020
|
||||
)
|
||||
|
||||
(deftype art-joint-geo (art-element)
|
||||
()
|
||||
:method-count-assert 13
|
||||
:size-assert #x20
|
||||
:flag-assert #xd00000020
|
||||
)
|
||||
|
||||
(deftype skeleton-group (basic)
|
||||
((art-group-name basic :offset-assert 4)
|
||||
(jgeo int32 :offset-assert 8)
|
||||
(janim int32 :offset-assert 12)
|
||||
(bounds vector :inline :offset-assert 16)
|
||||
(radius float :offset 28)
|
||||
(mgeo uint16 4 :offset-assert 32)
|
||||
(max-lod int32 :offset-assert 40)
|
||||
(lod-dist float 4 :offset-assert 44)
|
||||
(longest-edge float :offset-assert 60)
|
||||
(texture-level int8 :offset-assert 64)
|
||||
(version int8 :offset-assert 65)
|
||||
(shadow int8 :offset-assert 66)
|
||||
(sort int8 :offset-assert 67)
|
||||
(_pad uint8 4 :offset-assert 68)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x48
|
||||
:flag-assert #x900000048
|
||||
)
|
||||
|
||||
(deftype lod-group (structure)
|
||||
((geo basic :offset-assert 0)
|
||||
(dist float :offset-assert 4)
|
||||
)
|
||||
:pack-me
|
||||
:method-count-assert 9
|
||||
:size-assert #x8
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
|
||||
(deftype lod-set (structure)
|
||||
((lod lod-group 4 :inline :offset-assert 0)
|
||||
(max-lod int8 :offset-assert 32)
|
||||
)
|
||||
:pack-me
|
||||
:method-count-assert 10
|
||||
:size-assert #x21
|
||||
:flag-assert #xa00000021
|
||||
(:methods
|
||||
(dummy-9 () none 9)
|
||||
)
|
||||
)
|
||||
|
||||
(deftype draw-control (basic)
|
||||
((status uint8 :offset-assert 4)
|
||||
(matrix-type uint8 :offset-assert 5)
|
||||
(data-format uint8 :offset-assert 6)
|
||||
(global-effect uint8 :offset-assert 7)
|
||||
(art-group art-group :offset-assert 8)
|
||||
(jgeo art-joint-geo :offset-assert 12)
|
||||
(mgeo art-mesh-geo :offset-assert 16)
|
||||
(dma-add-func function :offset-assert 20)
|
||||
(skeleton skeleton-group :offset-assert 24)
|
||||
(lod-set lod-set :inline :offset-assert 28)
|
||||
(lod lod-group 4 :inline :offset 28)
|
||||
(max-lod int8 :offset 60)
|
||||
(force-lod int8 :offset-assert 61)
|
||||
(cur-lod int8 :offset-assert 62)
|
||||
(desired-lod int8 :offset-assert 63)
|
||||
(ripple basic :offset-assert 64)
|
||||
(longest-edge float :offset-assert 68) ;; meters
|
||||
(longest-edge? uint32 :offset 68)
|
||||
(light-index uint8 :offset-assert 72)
|
||||
(dummy uint8 2 :offset-assert 73)
|
||||
(death-draw-overlap uint8 :offset-assert 75)
|
||||
(death-timer uint8 :offset-assert 76)
|
||||
(death-timer-org uint8 :offset-assert 77)
|
||||
(death-vertex-skip uint16 :offset-assert 78)
|
||||
(death-effect uint32 :offset-assert 80)
|
||||
(sink-group basic :offset-assert 84) ;; dma-foreground-sink-group?
|
||||
(process process :offset-assert 88)
|
||||
(shadow basic :offset-assert 92)
|
||||
(shadow-ctrl basic :offset-assert 96)
|
||||
(origin vector :inline :offset-assert 112)
|
||||
(bounds vector :inline :offset-assert 128)
|
||||
(radius float :offset 140) ;; meters
|
||||
(color-mult rgbaf :inline :offset-assert 144)
|
||||
(color-emissive rgbaf :inline :offset-assert 160)
|
||||
(secondary-interp float :offset-assert 176)
|
||||
(current-secondary-interp float :offset-assert 180)
|
||||
(shadow-mask uint8 :offset-assert 184)
|
||||
(level-index uint8 :offset-assert 185)
|
||||
(origin-joint-index uint8 :offset-assert 186)
|
||||
(shadow-joint-index uint8 :offset-assert 187)
|
||||
)
|
||||
:method-count-assert 12
|
||||
:size-assert #xbc
|
||||
:flag-assert #xc000000bc
|
||||
(:methods
|
||||
(dummy-9 (_type_) (pointer int8) 9)
|
||||
(dummy-10 () none 10)
|
||||
(dummy-11 () none 11)
|
||||
)
|
||||
)
|
||||
|
||||
(defmethod dummy-9 draw-control ((obj draw-control))
|
||||
(&-> (-> obj skeleton) texture-level)
|
||||
)
|
||||
|
||||
@@ -139,6 +139,7 @@
|
||||
(morph-z uint16 :offset-assert 12)
|
||||
(morph-w uint16 :offset-assert 14)
|
||||
)
|
||||
:pack-me
|
||||
:method-count-assert 9
|
||||
:size-assert #x10
|
||||
:flag-assert #x900000010
|
||||
|
||||
@@ -5,3 +5,94 @@
|
||||
;; name in dgo: generic-work-h
|
||||
;; dgos: GAME, ENGINE
|
||||
|
||||
(deftype generic-input-buffer (structure)
|
||||
((merc generic-merc-work :inline :offset 0)
|
||||
(tie generic-tie-work :inline :offset 0)
|
||||
(data uint128 472 :offset 0)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x1d80
|
||||
:flag-assert #x900001d80
|
||||
)
|
||||
|
||||
(deftype generic-debug (structure)
|
||||
((locks uint32 4 :offset-assert 0)
|
||||
(timer uint32 32 :offset-assert 16)
|
||||
(count uint32 32 :offset-assert 144)
|
||||
(vps uint32 32 :offset-assert 272)
|
||||
(buffer int32 :offset-assert 400)
|
||||
(start-addr int32 :offset-assert 404)
|
||||
(lock int32 :offset-assert 408)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x19c
|
||||
:flag-assert #x90000019c
|
||||
)
|
||||
|
||||
(deftype generic-vu1-header (structure)
|
||||
((matrix matrix :inline :offset-assert 0)
|
||||
(strgif generic-gif-tag :inline :offset-assert 64)
|
||||
(adnop1 ad-cmd :inline :offset-assert 80)
|
||||
(adnop2 ad-cmd :inline :offset-assert 96)
|
||||
(adcmds ad-cmd 2 :inline :offset 80)
|
||||
(dps uint16 :offset 92)
|
||||
(kickoff uint16 :offset 108)
|
||||
(strips uint16 :offset 76)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x70
|
||||
:flag-assert #x900000070
|
||||
)
|
||||
|
||||
(deftype generic-vu1-texbuf (structure)
|
||||
((header generic-vu1-header :inline :offset-assert 0)
|
||||
(shader uint32 :dynamic :offset-assert 112)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x70
|
||||
:flag-assert #x900000070
|
||||
)
|
||||
|
||||
(deftype generic-texbuf (structure)
|
||||
((tag dma-packet :inline :offset-assert 0)
|
||||
(header generic-vu1-header :inline :offset-assert 16)
|
||||
(shader uint32 :dynamic :offset-assert 128)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x80
|
||||
:flag-assert #x900000080
|
||||
)
|
||||
|
||||
(deftype generic-effect-work (structure)
|
||||
((consts generic-consts :inline :offset-assert 0)
|
||||
(storage generic-storage :inline :offset-assert 432)
|
||||
(storage2 generic-storage :inline :offset-assert 688)
|
||||
(lights vu-lights :inline :offset-assert 944)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x420
|
||||
:flag-assert #x900000420
|
||||
)
|
||||
|
||||
(deftype generic-effect-buffer (structure)
|
||||
((outbuf-0 uint8 3552 :offset-assert 0)
|
||||
(work generic-effect-work :inline :offset-assert 3552)
|
||||
(outbuf-1 uint8 3552 :offset-assert 4608)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x1fe0
|
||||
:flag-assert #x900001fe0
|
||||
)
|
||||
|
||||
(deftype generic-work (structure)
|
||||
((saves generic-saves :inline :offset-assert 0)
|
||||
(storage generic-storage :inline :offset-assert 368)
|
||||
(in-buf generic-input-buffer :inline :offset-assert 624)
|
||||
(fx-buf generic-effect-buffer :inline :offset-assert 8176)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x3fd0
|
||||
:flag-assert #x900003fd0
|
||||
)
|
||||
|
||||
(define *generic-debug* (new 'global 'generic-debug))
|
||||
@@ -5,3 +5,123 @@
|
||||
;; name in dgo: generic-merc-h
|
||||
;; dgos: GAME, ENGINE
|
||||
|
||||
(deftype merc-matrix (structure)
|
||||
((quad uint128 8 :offset-assert 0)
|
||||
(vector vector 8 :inline :offset 0)
|
||||
(tag uint64 :offset 0)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x80
|
||||
:flag-assert #x900000080
|
||||
)
|
||||
|
||||
(deftype generic-merc-tag (dma-packet)
|
||||
((next-ptr uint32 :offset 12)
|
||||
(size uint32 :offset 8)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x10
|
||||
:flag-assert #x900000010
|
||||
)
|
||||
|
||||
(deftype generic-merc-ctrl (structure)
|
||||
((tag generic-merc-tag :inline :offset-assert 0)
|
||||
(lights vu-lights :inline :offset-assert 16)
|
||||
(header merc-ctrl-header :inline :offset-assert 128)
|
||||
(effect merc-effect :inline :offset-assert 208)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #xf0
|
||||
:flag-assert #x9000000f0
|
||||
)
|
||||
|
||||
(deftype generic-merc-ctrl-with-sfx (generic-merc-ctrl)
|
||||
((sfx-data uint128 11 :offset-assert 240)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x1a0
|
||||
:flag-assert #x9000001a0
|
||||
)
|
||||
|
||||
(deftype generic-merc-input (structure)
|
||||
((geo-tag generic-merc-tag :inline :offset-assert 0)
|
||||
(geo-block uint8 1296 :offset-assert 16)
|
||||
(byte-header merc-byte-header :inline :offset 16)
|
||||
(matrix merc-matrix 9 :inline :offset-assert 1312)
|
||||
(control generic-merc-ctrl-with-sfx :inline :offset-assert 2464)
|
||||
(end-tag generic-merc-tag :inline :offset-assert 2880)
|
||||
(shader adgif-shader :inline :offset-assert 2896)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #xba0
|
||||
:flag-assert #x900000ba0
|
||||
)
|
||||
|
||||
(deftype generic-merc-output (structure)
|
||||
((info gsf-info :inline :offset-assert 0)
|
||||
(header gsf-header :inline :offset-assert 16)
|
||||
(index-kick-table uint16 80 :offset-assert 32)
|
||||
(index-table uint8 160 :offset 32)
|
||||
(inverse-table uint8 256 :offset-assert 192)
|
||||
(vertex-table gsf-vertex 72 :inline :offset-assert 448)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #xac0
|
||||
:flag-assert #x900000ac0
|
||||
)
|
||||
|
||||
(deftype generic-merc-dcache (structure)
|
||||
((output-a generic-merc-output :inline :offset-assert 0)
|
||||
(output-b generic-merc-output :inline :offset-assert 2752)
|
||||
(inv-table-1 uint8 544 :offset-assert 5504)
|
||||
(inv-table-7 uint8 544 :offset-assert 6048)
|
||||
(inv-safety uint8 16 :offset-assert 6592)
|
||||
(effect-data uint8 1584 :offset-assert 6608)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x2000
|
||||
:flag-assert #x900002000
|
||||
)
|
||||
|
||||
(deftype gm-shadow (structure)
|
||||
((perspective matrix :inline :offset-assert 0)
|
||||
(isometric matrix :inline :offset-assert 64)
|
||||
(inv-camera-rot matrix :inline :offset-assert 128)
|
||||
(envmap-shader adgif-shader :inline :offset-assert 192)
|
||||
(current-chain uint32 :offset-assert 272)
|
||||
(next-chain uint32 :offset-assert 276)
|
||||
(buf-index uint32 :offset-assert 280)
|
||||
(fragment-count uint32 :offset-assert 284)
|
||||
(write-limit int32 :offset-assert 288)
|
||||
(indexed-input-base generic-merc-input :offset-assert 292)
|
||||
(other-input-base generic-merc-input :offset-assert 296)
|
||||
(indexed-output-base generic-merc-output :offset-assert 300)
|
||||
(other-output-base generic-merc-output :offset-assert 304)
|
||||
(p-input uint32 :offset-assert 308)
|
||||
(gsf-buf generic-merc-dcache :offset-assert 312)
|
||||
(p-fheader merc-fp-header :offset-assert 316)
|
||||
(mercneric-convert basic :offset-assert 320)
|
||||
(generic-prepare-dma-single basic :offset-assert 324)
|
||||
(generic-prepare-dma-double basic :offset-assert 328)
|
||||
(generic-light-proc basic :offset-assert 332)
|
||||
(generic-envmap-proc basic :offset-assert 336)
|
||||
(high-speed-reject basic :offset-assert 340)
|
||||
(hsr-xmult vector :inline :offset-assert 352)
|
||||
(hsr-ymult vector :inline :offset-assert 368)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x180
|
||||
:flag-assert #x900000180
|
||||
)
|
||||
|
||||
(deftype generic-merc-work (structure)
|
||||
((input-a generic-merc-input :inline :offset-assert 0)
|
||||
(input-b generic-merc-input :inline :offset-assert 2976)
|
||||
(ctrl generic-merc-ctrl-with-sfx :inline :offset-assert 5952)
|
||||
(shadow gm-shadow :inline :offset-assert 6368)
|
||||
(stack uint128 16 :offset-assert 6752)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x1b60
|
||||
:flag-assert #x900001b60
|
||||
)
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
;; dgos: GAME, ENGINE
|
||||
|
||||
(deftype ripple-merc-query (inline-array-class)
|
||||
((start-vertex int32 :offset-assert 16)
|
||||
(vertex-skip int32 :offset-assert 20)
|
||||
(vertex-count int32 :offset-assert 24)
|
||||
(current-loc int32 :offset-assert 28)
|
||||
(data2 uint8 :dynamic :offset-assert 32) ;; renamed from data. suspect inline-array has some magic.
|
||||
((start-vertex int32 :offset-assert 16)
|
||||
(vertex-skip int32 :offset-assert 20)
|
||||
(vertex-count int32 :offset-assert 24)
|
||||
(current-loc int32 :offset-assert 28)
|
||||
(data2 uint8 :dynamic :offset-assert 32) ;; renamed from data. suspect inline-array has some magic.
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x20
|
||||
@@ -20,19 +20,19 @@
|
||||
(set! (-> ripple-merc-query heap-base) 16)
|
||||
|
||||
(deftype merc-byte-header (structure)
|
||||
((srcdest-off uint8 :offset-assert 0)
|
||||
(rgba-off uint8 :offset-assert 1)
|
||||
(lump-off uint8 :offset-assert 2)
|
||||
(fp-off uint8 :offset-assert 3)
|
||||
(mat1-cnt uint8 :offset-assert 4)
|
||||
(mat2-cnt uint8 :offset-assert 5)
|
||||
(mat3-cnt uint8 :offset-assert 6)
|
||||
(samecopy-cnt uint8 :offset-assert 7)
|
||||
(crosscopy-cnt uint8 :offset-assert 8)
|
||||
(strip-len uint8 :offset-assert 9)
|
||||
(mm-quadword-fp-off uint8 :offset-assert 10)
|
||||
(mm-quadword-size uint8 :offset-assert 11)
|
||||
(perc-off uint8 :offset-assert 12)
|
||||
((srcdest-off uint8 :offset-assert 0)
|
||||
(rgba-off uint8 :offset-assert 1)
|
||||
(lump-off uint8 :offset-assert 2)
|
||||
(fp-off uint8 :offset-assert 3)
|
||||
(mat1-cnt uint8 :offset-assert 4)
|
||||
(mat2-cnt uint8 :offset-assert 5)
|
||||
(mat3-cnt uint8 :offset-assert 6)
|
||||
(samecopy-cnt uint8 :offset-assert 7)
|
||||
(crosscopy-cnt uint8 :offset-assert 8)
|
||||
(strip-len uint8 :offset-assert 9)
|
||||
(mm-quadword-fp-off uint8 :offset-assert 10)
|
||||
(mm-quadword-size uint8 :offset-assert 11)
|
||||
(perc-off uint8 :offset-assert 12)
|
||||
(mat-slot uint8 10 :offset-assert 13)
|
||||
)
|
||||
:method-count-assert 9
|
||||
@@ -40,10 +40,9 @@
|
||||
:flag-assert #x900000017
|
||||
)
|
||||
|
||||
;; merc-h
|
||||
(deftype merc-fragment (structure)
|
||||
((header merc-byte-header :inline :offset-assert 0)
|
||||
(rest uint8 1 :offset-assert 23)
|
||||
(rest uint8 1 :offset-assert 23)
|
||||
)
|
||||
:method-count-assert 10
|
||||
:size-assert #x18
|
||||
@@ -53,7 +52,6 @@
|
||||
)
|
||||
)
|
||||
|
||||
;; merc-h
|
||||
(deftype merc-vtx (structure)
|
||||
((mat-0 uint8 :offset-assert 0)
|
||||
(mat-1 uint8 :offset-assert 1)
|
||||
@@ -73,7 +71,6 @@
|
||||
:flag-assert #x90000000c
|
||||
)
|
||||
|
||||
;; merc-h
|
||||
(deftype merc-fp-header (structure)
|
||||
((x-add float :offset-assert 0)
|
||||
(y-add float :offset-assert 4)
|
||||
@@ -93,7 +90,6 @@
|
||||
(the pointer (&+ arg0 (the-as uint (shl (-> arg0 header mm-quadword-fp-off) 4))))
|
||||
)
|
||||
|
||||
;; merc-h
|
||||
(deftype merc-mat-dest (structure)
|
||||
((matrix-number uint8 :offset-assert 0)
|
||||
(matrix-dest uint8 :offset-assert 1)
|
||||
@@ -103,12 +99,11 @@
|
||||
:flag-assert #x900000002
|
||||
)
|
||||
|
||||
;; merc-h
|
||||
(deftype merc-fragment-control (structure)
|
||||
((unsigned-four-count uint8 :offset-assert 0)
|
||||
(lump-four-count uint8 :offset-assert 1)
|
||||
(fp-qwc uint8 :offset-assert 2)
|
||||
(mat-xfer-count uint8 :offset-assert 3)
|
||||
((unsigned-four-count uint8 :offset-assert 0)
|
||||
(lump-four-count uint8 :offset-assert 1)
|
||||
(fp-qwc uint8 :offset-assert 2)
|
||||
(mat-xfer-count uint8 :offset-assert 3)
|
||||
(mat-dest-data uint8 :dynamic :offset-assert 4)
|
||||
)
|
||||
:method-count-assert 9
|
||||
@@ -116,16 +111,14 @@
|
||||
:flag-assert #x900000004
|
||||
)
|
||||
|
||||
;; merc-h
|
||||
(deftype merc-blend-data (structure) ;; was unknown!
|
||||
((int8-data int8 :dynamic :offset-assert 0)
|
||||
)
|
||||
)
|
||||
|
||||
;; merc-h
|
||||
(deftype merc-blend-ctrl (structure)
|
||||
((blend-vtx-count uint8 :offset-assert 0)
|
||||
(nonzero-index-count uint8 :offset-assert 1)
|
||||
((blend-vtx-count uint8 :offset-assert 0)
|
||||
(nonzero-index-count uint8 :offset-assert 1)
|
||||
(bt-index uint8 :dynamic :offset-assert 2)
|
||||
)
|
||||
:method-count-assert 9
|
||||
@@ -133,7 +126,6 @@
|
||||
:flag-assert #x900000002
|
||||
)
|
||||
|
||||
;; merc-h
|
||||
(deftype mei-envmap-tint (structure)
|
||||
((fade0 float :offset-assert 0)
|
||||
(fade1 float :offset-assert 4)
|
||||
@@ -145,14 +137,13 @@
|
||||
:flag-assert #x900000010
|
||||
)
|
||||
|
||||
;; merc-h
|
||||
(deftype mei-texture-scroll (structure)
|
||||
((max-dist float :offset-assert 0)
|
||||
(st-int-scale uint8 :offset-assert 4)
|
||||
(time-factor uint8 :offset-assert 5)
|
||||
(scroll-dir uint8 :offset-assert 6)
|
||||
(cached-time uint8 :offset-assert 7)
|
||||
(time-delta uint8 :offset-assert 8)
|
||||
((max-dist float :offset-assert 0)
|
||||
(st-int-scale uint8 :offset-assert 4)
|
||||
(time-factor uint8 :offset-assert 5)
|
||||
(scroll-dir uint8 :offset-assert 6)
|
||||
(cached-time uint8 :offset-assert 7)
|
||||
(time-delta uint8 :offset-assert 8)
|
||||
(dummy uint8 7 :offset-assert 9)
|
||||
)
|
||||
:method-count-assert 9
|
||||
@@ -160,7 +151,6 @@
|
||||
:flag-assert #x900000010
|
||||
)
|
||||
|
||||
;; merc-h
|
||||
(deftype mei-ripple (structure)
|
||||
((x-base float :offset-assert 0)
|
||||
(z-base float :offset-assert 4)
|
||||
@@ -172,12 +162,11 @@
|
||||
:flag-assert #x900000010
|
||||
)
|
||||
|
||||
;; merc-h
|
||||
(deftype merc-extra-info (structure)
|
||||
((envmap-tint-offset uint8 :offset-assert 0)
|
||||
(shader-offset uint8 :offset-assert 1)
|
||||
(texture-scroll-offset uint8 :offset-assert 2)
|
||||
(ripple-offset uint8 :offset-assert 3)
|
||||
((envmap-tint-offset uint8 :offset-assert 0)
|
||||
(shader-offset uint8 :offset-assert 1)
|
||||
(texture-scroll-offset uint8 :offset-assert 2)
|
||||
(ripple-offset uint8 :offset-assert 3)
|
||||
(dummy uint8 12 :offset-assert 4)
|
||||
)
|
||||
:method-count-assert 9
|
||||
@@ -185,7 +174,6 @@
|
||||
:flag-assert #x900000010
|
||||
)
|
||||
|
||||
; ;; merc-h
|
||||
(deftype merc-effect (structure)
|
||||
((frag-geo merc-fragment :offset-assert 0)
|
||||
(frag-ctrl merc-fragment-control :offset-assert 4)
|
||||
@@ -209,39 +197,36 @@
|
||||
)
|
||||
)
|
||||
|
||||
;; merc-h
|
||||
(deftype merc-eye-ctrl (structure)
|
||||
((eye-slot int8 :offset-assert 0)
|
||||
(shader-offset int8 :offset-assert 1)
|
||||
(shader-count int8 :offset-assert 2)
|
||||
;(shader UNKNOWN 3 :offset-assert 16)
|
||||
(iris-shader adgif-shader :inline :offset-assert 16)
|
||||
(pupil-shader adgif-shader :inline :offset-assert 96)
|
||||
(lid-shader adgif-shader :inline :offset-assert 176)
|
||||
(shader adgif-shader 3 :inline :offset 16) ;; moved
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x100
|
||||
:flag-assert #x900000100
|
||||
)
|
||||
|
||||
;; merc-h
|
||||
(deftype merc-eye-anim-frame (structure)
|
||||
((pupil-trans-x int8 :offset-assert 0)
|
||||
(pupil-trans-y int8 :offset-assert 1)
|
||||
(blink int8 :offset-assert 2)
|
||||
(iris-scale int8 :offset 4)
|
||||
(pupil-scale int8 :offset-assert 5)
|
||||
(lid-scale int8 :offset-assert 6)
|
||||
(dword uint64 :offset 0)
|
||||
((pupil-trans-x int8 :offset-assert 0)
|
||||
(pupil-trans-y int8 :offset-assert 1)
|
||||
(blink int8 :offset-assert 2)
|
||||
(iris-scale int8 :offset 4)
|
||||
(pupil-scale int8 :offset-assert 5)
|
||||
(lid-scale int8 :offset-assert 6)
|
||||
(dword uint64 :offset 0)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x8
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
|
||||
;; merc-h
|
||||
(deftype merc-eye-anim-block (structure)
|
||||
((max-frame int16 :offset-assert 0)
|
||||
((max-frame int16 :offset-assert 0)
|
||||
(data uint8 :dynamic :offset 8)
|
||||
)
|
||||
:method-count-assert 9
|
||||
@@ -249,7 +234,6 @@
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
|
||||
;; merc-h
|
||||
(deftype merc-ctrl-header (structure)
|
||||
((xyz-scale float :offset-assert 0)
|
||||
(st-magic uint32 :offset-assert 4)
|
||||
@@ -278,8 +262,8 @@
|
||||
(num-verts uint16 :offset-assert 58)
|
||||
(longest-edge float :offset-assert 60)
|
||||
(eye-ctrl merc-eye-ctrl :offset-assert 64)
|
||||
(masks uint32 3 :offset-assert 68)
|
||||
(dummy-bytes uint8 48 :offset 32)
|
||||
(masks uint32 3 :offset-assert 68)
|
||||
(dummy-bytes uint8 48 :offset 32)
|
||||
(envmap-tint uint32 :offset 32)
|
||||
(query basic :offset 36)
|
||||
(needs-clip uint8 :offset 40)
|
||||
@@ -298,7 +282,6 @@
|
||||
;; field xyz-scale is a float printed as hex?
|
||||
)
|
||||
|
||||
;; merc-h
|
||||
(deftype merc-ctrl (art-element)
|
||||
((num-joints int32 :offset 20)
|
||||
(header merc-ctrl-header :inline :offset-assert 32)
|
||||
@@ -315,7 +298,6 @@
|
||||
)
|
||||
)
|
||||
|
||||
;; merc-h
|
||||
(deftype merc-vu1-low-mem (structure)
|
||||
((tri-strip-gif qword :inline :offset-assert 0)
|
||||
(ad-gif qword :inline :offset-assert 16)
|
||||
@@ -328,7 +310,6 @@
|
||||
:flag-assert #x900000080
|
||||
)
|
||||
|
||||
;; merc-h
|
||||
(deftype ripple-wave (structure)
|
||||
((scale float :offset-assert 0)
|
||||
(offs float :offset-assert 4)
|
||||
@@ -345,7 +326,6 @@
|
||||
:flag-assert #x90000001c
|
||||
)
|
||||
|
||||
;; merc-h
|
||||
(deftype ripple-wave-set (basic)
|
||||
((count int32 :offset-assert 4)
|
||||
(converted basic :offset-assert 8)
|
||||
@@ -358,7 +338,6 @@
|
||||
:flag-assert #x900000084
|
||||
)
|
||||
|
||||
;; merc-h
|
||||
(deftype ripple-control (basic)
|
||||
((global-scale float :offset-assert 4)
|
||||
(last-frame-scale float :offset-assert 8)
|
||||
@@ -379,18 +358,16 @@
|
||||
)
|
||||
|
||||
(defmethod new ripple-control ((allocation symbol) (type-to-make type))
|
||||
(local-vars (v0-0 ripple-control))
|
||||
(set! v0-0
|
||||
(object-new allocation type-to-make (the-as int (-> type-to-make size)))
|
||||
)
|
||||
(set! (-> v0-0 global-scale) 0.000000)
|
||||
(set! (-> v0-0 last-frame-scale) (the-as float #xba83126f))
|
||||
(set! (-> v0-0 close-fade-dist) (the-as float #x4f742400))
|
||||
(set! (-> v0-0 far-fade-dist) (the-as float #x4ff42400))
|
||||
(set! (-> v0-0 faded-scale) (the-as float #xba83126f))
|
||||
(set! (-> v0-0 waveform) #f)
|
||||
(set! (-> v0-0 individual-normal-scale) 1.000000)
|
||||
(set! (-> v0-0 send-query) #f)
|
||||
(set! (-> v0-0 query) #f)
|
||||
v0-0
|
||||
(let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size)))))
|
||||
(set! (-> obj global-scale) 0.0)
|
||||
(set! (-> obj last-frame-scale) -0.001)
|
||||
(set! (-> obj close-fade-dist) (meters 1000000))
|
||||
(set! (-> obj far-fade-dist) (meters 2000000))
|
||||
(set! (-> obj faded-scale) -0.001)
|
||||
(set! (-> obj waveform) #f)
|
||||
(set! (-> obj individual-normal-scale) 1.0)
|
||||
(set! (-> obj send-query) #f)
|
||||
(set! (-> obj query) #f)
|
||||
obj
|
||||
)
|
||||
)
|
||||
|
||||
@@ -30,10 +30,10 @@
|
||||
:flag-assert #x1000000060
|
||||
(:methods
|
||||
(new (symbol type float float float float float) _type_ 0)
|
||||
(clear-offset-bit (shadow-control) none 9)
|
||||
(set-offset-bit (shadow-control) none 10)
|
||||
(set-top-plane-offset (shadow-control float) none 11)
|
||||
(set-bottom-plane-offset (shadow-control float) none 12)
|
||||
(clear-offset-bit (shadow-control) int 9)
|
||||
(set-offset-bit (shadow-control) int 10)
|
||||
(set-top-plane-offset (shadow-control float) int 11)
|
||||
(set-bottom-plane-offset (shadow-control float) int 12)
|
||||
(dummy-13 () none 13)
|
||||
(dummy-14 () none 14)
|
||||
(dummy-15 () none 15)
|
||||
@@ -43,30 +43,30 @@
|
||||
(defmethod clear-offset-bit shadow-control ((obj shadow-control))
|
||||
"Clear a bit in w for the center of the shadow."
|
||||
(set! (-> obj settings center w)
|
||||
(the-as float (logand -33 (the-as int (-> obj settings center w))))
|
||||
(the-as float (logand (lognot #x20)
|
||||
(the-as int (-> obj settings center w))))
|
||||
)
|
||||
(none)
|
||||
0
|
||||
)
|
||||
|
||||
(defmethod set-offset-bit shadow-control ((obj shadow-control))
|
||||
"Set a bit in w for the center position of the shadow"
|
||||
(set! (-> obj settings center w)
|
||||
(the-as float (logior (the-as int (-> obj settings center w))
|
||||
32)
|
||||
)
|
||||
#x20))
|
||||
)
|
||||
(none)
|
||||
0
|
||||
)
|
||||
|
||||
|
||||
(defmethod set-bottom-plane-offset shadow-control ((obj shadow-control) (arg0 float))
|
||||
(set! (-> obj settings bot-plane d) (- arg0))
|
||||
(none)
|
||||
0
|
||||
)
|
||||
|
||||
(defmethod set-top-plane-offset shadow-control ((obj shadow-control) (arg0 float))
|
||||
(set! (-> obj settings top-plane d) (- arg0))
|
||||
(none)
|
||||
0
|
||||
)
|
||||
|
||||
(deftype shadow-data (structure)
|
||||
@@ -118,16 +118,12 @@
|
||||
|
||||
(defun shadow-queue-append ((arg0 shadow-queue))
|
||||
"Increment the run counter"
|
||||
(local-vars (v0-0 uint))
|
||||
(set! v0-0 (+ (-> arg0 cur-run) 1))
|
||||
(set! (-> arg0 cur-run) v0-0)
|
||||
v0-0
|
||||
(set! (-> arg0 cur-run) (+ (-> arg0 cur-run) 1))
|
||||
)
|
||||
|
||||
(defun shadow-queue-reset ((arg0 shadow-queue))
|
||||
"Reset the run counter"
|
||||
(set! (-> arg0 cur-run) 0)
|
||||
0
|
||||
)
|
||||
|
||||
(define *shadow-queue* (new 'global 'shadow-queue))
|
||||
@@ -221,43 +217,17 @@
|
||||
:method-count-assert 13
|
||||
:size-assert #x50
|
||||
:flag-assert #xd00000050
|
||||
(:methods
|
||||
(dummy-9 () none 9)
|
||||
(dummy-10 () none 10)
|
||||
(dummy-11 () none 11)
|
||||
(dummy-12 () none 12)
|
||||
)
|
||||
)
|
||||
|
||||
(defmethod new shadow-control ((allocation symbol) (type-to-make type)
|
||||
(bottom-offset float)
|
||||
(top-offset float)
|
||||
(dir float)
|
||||
(center float)
|
||||
(fade float)
|
||||
)
|
||||
(local-vars (v0-0 shadow-control) (v1-2 vector) (v1-3 plane) (v1-4 plane))
|
||||
(set! v0-0
|
||||
(object-new allocation type-to-make (the-as int (-> type-to-make size)))
|
||||
)
|
||||
(set! (-> v0-0 settings center data 3) center)
|
||||
(set! v1-2 (-> v0-0 settings shadow-dir))
|
||||
(set! (-> v1-2 x) 0.000000)
|
||||
(set! (-> v1-2 y) -1.000000)
|
||||
(set! (-> v1-2 z) 0.000000)
|
||||
(set! (-> v1-2 w) dir)
|
||||
(set! v1-3 (-> v0-0 settings bot-plane))
|
||||
(set! (-> v1-3 a) 0.000000)
|
||||
(set! (-> v1-3 b) 1.000000)
|
||||
(set! (-> v1-3 c) 0.000000)
|
||||
(set! (-> v1-3 d) (- bottom-offset))
|
||||
(set! v1-4 (-> v0-0 settings top-plane))
|
||||
(set! (-> v1-4 a) 0.000000)
|
||||
(set! (-> v1-4 b) 1.000000)
|
||||
(set! (-> v1-4 c) 0.000000)
|
||||
(set! (-> v1-4 d) (- top-offset))
|
||||
(set! (-> v0-0 settings fade-dist) fade)
|
||||
v0-0
|
||||
(defmethod new shadow-control ((allocation symbol) (type-to-make type) (bottom-offset float) (top-offset float) (dir float) (center float) (fade float))
|
||||
(let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size)))))
|
||||
(set! (-> obj settings center w) center)
|
||||
(set-vector! (-> obj settings shadow-dir) 0.0 -1.0 0.0 dir)
|
||||
(set-vector! (-> obj settings bot-plane) 0.0 1.0 0.0 (- bottom-offset))
|
||||
(set-vector! (-> obj settings top-plane) 0.0 1.0 0.0 (- top-offset))
|
||||
(set! (-> obj settings fade-dist) fade)
|
||||
obj
|
||||
)
|
||||
)
|
||||
|
||||
(define *shadow* #f)
|
||||
|
||||
@@ -5,3 +5,228 @@
|
||||
;; name in dgo: generic-tie-h
|
||||
;; dgos: GAME, ENGINE
|
||||
|
||||
(deftype generic-tie-instance (structure)
|
||||
((matrix-tag dma-packet :inline :offset-assert 0)
|
||||
(matrix-data vector 6 :inline :offset-assert 16)
|
||||
(index-tag dma-packet :inline :offset-assert 112)
|
||||
(indices uint8 224 :offset-assert 128)
|
||||
(end-tag dma-packet :inline :offset-assert 352)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x170
|
||||
:flag-assert #x900000170
|
||||
)
|
||||
|
||||
(deftype generic-tie-input (structure)
|
||||
((palette-tag dma-packet :inline :offset-assert 0)
|
||||
(palette rgba 128 :offset-assert 16)
|
||||
(model-tag dma-packet :inline :offset-assert 528)
|
||||
(model vector 146 :inline :offset-assert 544)
|
||||
(matrix-tag dma-packet :inline :offset-assert 2880)
|
||||
(matrix-data vector 6 :inline :offset-assert 2896)
|
||||
(index-tag dma-packet :inline :offset-assert 2992)
|
||||
(indices uint8 224 :offset-assert 3008)
|
||||
(end-tag dma-packet :inline :offset-assert 3232)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #xcb0
|
||||
:flag-assert #x900000cb0
|
||||
)
|
||||
|
||||
(deftype generic-tie-run-control (structure)
|
||||
((skip-bp2 uint8 :offset-assert 0)
|
||||
(skip-ips uint8 :offset-assert 1)
|
||||
(gifbuf-skip uint8 :offset-assert 2)
|
||||
(strips uint8 :offset-assert 3)
|
||||
(target-bp1 uint8 :offset-assert 4)
|
||||
(target-bp2 uint8 :offset-assert 5)
|
||||
(target-ip1 uint8 :offset-assert 6)
|
||||
(target-ip2 uint8 :offset-assert 7)
|
||||
(target-bps uint8 :offset-assert 8)
|
||||
(target-ips uint8 :offset-assert 9)
|
||||
(is-generic uint8 :offset-assert 10)
|
||||
(reserved uint8 :offset-assert 11)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #xc
|
||||
:flag-assert #x90000000c
|
||||
)
|
||||
|
||||
(deftype generic-tie-base-point (structure)
|
||||
((x int16 :offset-assert 0)
|
||||
(y int16 :offset-assert 2)
|
||||
(z int16 :offset-assert 4)
|
||||
(d0 int16 :offset-assert 6)
|
||||
(vtx uint64 :offset 0)
|
||||
(u int16 :offset-assert 8)
|
||||
(v int16 :offset-assert 10)
|
||||
(tex uint32 :offset 8)
|
||||
(w int16 :offset-assert 12)
|
||||
(d1 int16 :offset-assert 14)
|
||||
(data uint16 8 :offset 0) ;; moved
|
||||
(quad uint128 :offset 0) ;; moved
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x10
|
||||
:flag-assert #x900000010
|
||||
)
|
||||
|
||||
(deftype generic-tie-bps (structure)
|
||||
((bp generic-tie-base-point 4 :inline :offset-assert 0)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x40
|
||||
:flag-assert #x900000040
|
||||
)
|
||||
|
||||
(deftype generic-tie-interp-point (structure)
|
||||
((x int16 :offset-assert 0)
|
||||
(y int16 :offset-assert 2)
|
||||
(z int16 :offset-assert 4)
|
||||
(d0 int16 :offset-assert 6)
|
||||
(vtx0 uint64 :offset 0)
|
||||
(dx int16 :offset-assert 8)
|
||||
(dy int16 :offset-assert 10)
|
||||
(dz int16 :offset-assert 12)
|
||||
(unused int16 :offset-assert 14)
|
||||
(vtx1 uint64 :offset 8)
|
||||
(u int16 :offset-assert 16)
|
||||
(v int16 :offset-assert 18)
|
||||
(tex uint32 :offset 16)
|
||||
(w int16 :offset-assert 20)
|
||||
(d1 int16 :offset-assert 22)
|
||||
(data uint16 12 :offset 0)
|
||||
;(quad uint128 :offset 0)
|
||||
)
|
||||
:pack-me
|
||||
:method-count-assert 9
|
||||
:size-assert #x18
|
||||
:flag-assert #x900000018
|
||||
)
|
||||
|
||||
(deftype generic-tie-ips (structure)
|
||||
((ip generic-tie-interp-point 2 :inline :offset-assert 0)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x30
|
||||
:flag-assert #x900000030
|
||||
)
|
||||
|
||||
(deftype generic-tie-header (structure)
|
||||
((effect uint8 :offset-assert 0)
|
||||
(interp-table-size uint8 :offset-assert 1)
|
||||
(num-bps uint8 :offset-assert 2)
|
||||
(num-ips uint8 :offset-assert 3)
|
||||
(tint-color uint32 :offset-assert 4)
|
||||
(index-table-offset uint16 :offset-assert 8)
|
||||
(kick-table-offset uint16 :offset-assert 10)
|
||||
(normal-table-offset uint16 :offset-assert 12)
|
||||
(interp-table-offset uint16 :offset-assert 14)
|
||||
(gsf-header gsf-header :inline :offset-assert 16)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x20
|
||||
:flag-assert #x900000020
|
||||
)
|
||||
|
||||
(deftype generic-tie-matrix (structure)
|
||||
((matrix matrix :inline :offset-assert 0)
|
||||
(morph vector :inline :offset-assert 64)
|
||||
(fog qword :inline :offset-assert 80)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x60
|
||||
:flag-assert #x900000060
|
||||
)
|
||||
|
||||
(deftype generic-tie-normal (structure)
|
||||
((x int8 :offset-assert 0)
|
||||
(y int8 :offset-assert 1)
|
||||
(z int8 :offset-assert 2)
|
||||
(dummy int8 :offset-assert 3)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x4
|
||||
:flag-assert #x900000004
|
||||
)
|
||||
|
||||
(deftype generic-tie-control (structure)
|
||||
((ptr-palette uint32 :offset-assert 0)
|
||||
(ptr-shaders uint32 :offset-assert 4)
|
||||
(ptr-runctrl generic-tie-run-control :offset-assert 8)
|
||||
(ptr-verts uint32 :offset-assert 12)
|
||||
(ptr-generic generic-tie-header :offset-assert 16)
|
||||
(ptr-dps uint32 :offset-assert 20)
|
||||
(ptr-kicks uint32 :offset-assert 24)
|
||||
(ptr-normals uint32 :offset-assert 28)
|
||||
(ptr-interp uint32 :offset-assert 32)
|
||||
(ptr-mtxs generic-tie-matrix :offset-assert 36)
|
||||
(ptr-cinds uint32 :offset-assert 40)
|
||||
(next-instance uint32 :offset-assert 44)
|
||||
(next-model uint32 :offset-assert 48)
|
||||
(next-is-model uint32 :offset-assert 52)
|
||||
(tie-type uint32 :offset-assert 56)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x3c
|
||||
:flag-assert #x90000003c
|
||||
)
|
||||
|
||||
(deftype generic-tie-stats (structure)
|
||||
((num-bps uint32 :offset-assert 0)
|
||||
(num-ips uint32 :offset-assert 4)
|
||||
(num-dps uint32 :offset-assert 8)
|
||||
(num-shaders uint32 :offset-assert 12)
|
||||
(num-models uint32 :offset-assert 16)
|
||||
(num-instances uint32 :offset-assert 20)
|
||||
(num-waits uint32 :offset-assert 24)
|
||||
(num-qwc uint32 :offset-assert 28)
|
||||
(max-qwc uint32 :offset-assert 32)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x24
|
||||
:flag-assert #x900000024
|
||||
)
|
||||
|
||||
(deftype generic-tie-calls (structure)
|
||||
((generic-prepare-dma-double basic :offset-assert 0)
|
||||
(generic-envmap-dproc basic :offset-assert 4)
|
||||
(generic-interp-dproc basic :offset-assert 8)
|
||||
(generic-no-light-dproc basic :offset-assert 12)
|
||||
)
|
||||
:pack-me
|
||||
:method-count-assert 9
|
||||
:size-assert #x10
|
||||
:flag-assert #x900000010
|
||||
)
|
||||
|
||||
(deftype generic-tie-shadow (structure)
|
||||
((out-buf gsf-buffer :offset-assert 0)
|
||||
(cur-buf uint32 :offset-assert 4)
|
||||
(tie-type int32 :offset-assert 8)
|
||||
(ptr-inst uint32 :offset-assert 12)
|
||||
(ptr-buf uint32 :offset-assert 16)
|
||||
(inst-xor int32 :offset-assert 20)
|
||||
(end-of-chain uint32 :offset-assert 24)
|
||||
(write-limit uint32 :offset-assert 28)
|
||||
(calls generic-tie-calls :inline :offset-assert 32)
|
||||
)
|
||||
:pack-me
|
||||
:method-count-assert 9
|
||||
:size-assert #x30
|
||||
:flag-assert #x900000030
|
||||
)
|
||||
|
||||
(deftype generic-tie-work (structure)
|
||||
((control generic-tie-control :inline :offset-assert 0)
|
||||
(interp-job generic-interp-job :inline :offset-assert 60)
|
||||
(shadow generic-tie-shadow :inline :offset-assert 76)
|
||||
(input-a generic-tie-input :inline :offset-assert 128)
|
||||
(input-b generic-tie-input :inline :offset-assert 3376)
|
||||
(inst-buf generic-tie-instance :inline :offset-assert 6624)
|
||||
(palette-buf rgba 128 :offset-assert 6992)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x1d50
|
||||
:flag-assert #x900001d50
|
||||
)
|
||||
|
||||
@@ -488,11 +488,13 @@
|
||||
)
|
||||
|
||||
(defmacro set-vector! (v xv yv zv wv)
|
||||
`(begin
|
||||
(set! (-> ,v x) ,xv)
|
||||
(set! (-> ,v y) ,yv)
|
||||
(set! (-> ,v z) ,zv)
|
||||
(set! (-> ,v w) ,wv)))
|
||||
(with-gensyms (vec)
|
||||
`(let ((vec ,v))
|
||||
(set! (-> vec x) ,xv)
|
||||
(set! (-> vec y) ,yv)
|
||||
(set! (-> vec z) ,zv)
|
||||
(set! (-> vec w) ,wv)))
|
||||
)
|
||||
|
||||
(defun vector-dot ((a vector) (b vector))
|
||||
"Take the dot product of two vectors.
|
||||
|
||||
@@ -367,16 +367,6 @@
|
||||
)
|
||||
)
|
||||
|
||||
(defmacro case-no-let (switch &rest cases)
|
||||
"Same as case, but switch is replaced inline in the conditions instead of being saved to a separate variable.
|
||||
Only use this if you know what you're doing!"
|
||||
|
||||
`(cond ,@(apply
|
||||
(lambda (x) `(,@(if (eq? (first x) 'else) `(else ,@(rest x)) `((= ,switch ,(first x)) ,@(rest x)))))
|
||||
cases)
|
||||
)
|
||||
)
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;
|
||||
;; Math Macros
|
||||
;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
@@ -240,6 +240,7 @@
|
||||
(morph-z uint16 :offset-assert 12)
|
||||
(morph-w uint16 :offset-assert 14)
|
||||
)
|
||||
:pack-me
|
||||
:method-count-assert 9
|
||||
:size-assert #x10
|
||||
:flag-assert #x900000010
|
||||
@@ -495,3 +496,6 @@
|
||||
(the-as gsf-buffer (kmalloc global 9216 (kmalloc-flags align-64) "malloc"))
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user