[decomp] Partial implementation of tie (#1916)

Some stuff isn't working fully yet:
- fog color
- time of day
- draw order for multiple passes (currently all draws in the default tie
bucket)
- possibly settings for transparent stuff (untested, but might work)
- the "vanish" effect (we might not want this anyway?)
- environment mapping/etie completely not implemented.


![image](https://user-images.githubusercontent.com/48171810/192154314-2cc8ac51-9dad-474f-a84b-3a1d98973215.png)

![image](https://user-images.githubusercontent.com/48171810/192154316-457a7ee0-b5a4-4a40-b48e-8863114da735.png)
This commit is contained in:
water111
2022-09-25 12:50:51 -04:00
committed by GitHub
parent a53c06fe2b
commit b5705bde96
26 changed files with 7998 additions and 397 deletions
+151 -142
View File
@@ -2725,75 +2725,75 @@
(tex-l0-tfrag 7) ;; level 0 tex
(tfrag-l0-tfrag 8) ;; tfrag
(bucket-9 9) ;; tie
(bucket-10 10) ;; tie
(tie-l0-tfrag 9) ;; tie
(etie-l0-tfrag 10) ;; tie
(tfrag-s-l0-tfrag 11) ;; tfrag
(bucket-12 12) ;; tie
(bucket-13 13) ;; tie
(tie-s-l0-tfrag 12) ;; tie
(etie-s-l0-tfrag 13) ;; tie
(merc-l0-tfrag 14) ;; merc
(emerc-l0-tfrag 15) ;; emerc
(bucket-16 16) ;; mercneric
(bucket-17 17) ;; tie
(tie-v-l0-tfrag 17) ;; tie
(tex-l1-tfrag 18) ;; tex
(tfrag-l1-tfrag 19) ;; tfrag
(bucket-20 20) ;; tie
(bucket-21 21) ;; tie
(tie-l1-tfrag 20) ;; tie
(etie-l1-tfrag 21) ;; tie
(tfrag-s-l1-tfrag 22) ;; tfrag
(bucket-23 23) ;; tie
(bucket-24 24) ;; tie
(tie-s-l1-tfrag 23) ;; tie
(etie-s-l1-tfrag 24) ;; tie
(merc-l1-tfrag 25) ;; merc
(emerc-l1-tfrag 26) ;; emerc
(bucket-27 27) ;; mercneric
(bucket-28 28) ;; tie
(tie-v-l1-tfrag 28) ;; tie
(tex-l2-tfrag 29) ;; tex
(tfrag-l2-tfrag 30) ;; tfrag
(bucket-31 31) ;; tie
(bucket-32 32) ;; tie
(tie-l2-tfrag 31) ;; tie
(etie-l2-tfrag 32) ;; tie
(tfrag-s-l2-tfrag 33) ;; tfrag
(bucket-34 34) ;; tie
(bucket-35 35) ;; tie
(tie-s-l2-tfrag 34) ;; tie
(etie-s-l2-tfrag 35) ;; tie
(merc-l2-tfrag 36) ;; merc
(emerc-l2-tfrag 37) ;; emerc
(bucket-38 38) ;; mercneric
(bucket-39 39) ;; tie
(tie-v-l2-tfrag 39) ;; tie
(tex-l3-tfrag 40) ;; tex
(tfrag-l3-tfrag 41) ;; tfrag
(bucket-42 42) ;; tie
(bucket-43 43) ;; tie
(tie-l3-tfrag 42) ;; tie
(etie-l3-tfrag 43) ;; tie
(tfrag-s-l3-tfrag 44) ;; tfrag
(bucket-45 45) ;; tie
(bucket-46 46) ;; tie
(tie-s-l3-tfrag 45) ;; tie
(etie-s-l3-tfrag 46) ;; tie
(merc-l3-tfrag 47) ;; merc
(emerc-l3-tfrag 48) ;; emerc
(bucket-49 49) ;; mercneric
(bucket-50 50) ;; tie
(tie-v-l3-tfrag 50) ;; tie
(tex-l4-tfrag 51) ;; tex
(tfrag-l4-tfrag 52) ;; tfrag
(bucket-53 53) ;; tie
(bucket-54 54) ;; tie
(tie-l4-tfrag 53) ;; tie
(etie-l4-tfrag 54) ;; tie
(tfrag-s-l4-tfrag 55) ;; tfrag
(bucket-56 56) ;; tie
(bucket-57 57) ;; tie
(tie-s-l4-tfrag 56) ;; tie
(etie-s-l4-tfrag 57) ;; tie
(merc-l4-tfrag 58) ;; merc
(emerc-l4-tfrag 59) ;; emerc
(bucket-60 60) ;; mercneric
(bucket-61 61) ;; tie
(tie-v-l4-tfrag 61) ;; tie
(tex-l5-tfrag 62) ;; tex
(tfrag-l5-tfrag 63) ;; tfrag
(bucket-64 64) ;; tie
(bucket-65 65) ;; tie
(tie-l5-tfrag 64) ;; tie
(etie-l5-tfrag 65) ;; tie
(tfrag-s-l5-tfrag 66) ;; tfrag
(bucket-67 67) ;; tie
(bucket-68 68) ;; tie
(tie-s-l5-tfrag 67) ;; tie
(etie-s-l5-tfrag 68) ;; tie
(merc-l5-tfrag 69) ;; merc
(emerc-l5-tfrag 70) ;; emerc
(bucket-71 71) ;; mercneric
(bucket-72 72) ;; tie
(tie-v-l5-tfrag 72) ;; tie
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; All levels with shrub tpage
@@ -2861,69 +2861,69 @@
(tex-l0-alpha 127) ;; tex
(tfrag-t-l0-alpha 128) ;; tfrag
(bucket-129 129) ;; tie
(bucket-130 130) ;; tie
(tie-t-l0-alpha 129) ;; tie
(etie-t-l0-alpha 130) ;; tie
(merc-l0-alpha 131) ;; merc
(emerc-l0-alpha 132) ;; emerc
(bucket-133 133) ;; mercneric
(tfrag-st-l0-alpha 134) ;; tfrag
(bucket-135 135) ;; tie
(bucket-136 136) ;; tie
(tie-st-l0-alpha 135) ;; tie
(etie-st-l0-alpha 136) ;; tie
(tex-l1-alpha 137) ;; tex
(tfrag-t-l1-alpha 138) ;; tfrag
(bucket-139 139) ;; tie
(bucket-140 140) ;; tie
(tie-t-l1-alpha 139) ;; tie
(etie-t-l1-alpha 140) ;; tie
(merc-l1-alpha 141) ;; merc
(emerc-l1-alpha 142) ;; emerc
(bucket-143 143) ;; mercneric
(tfrag-st-l1-alpha 144) ;; tfrag
(bucket-145 145) ;; tie
(bucket-146 146) ;; tie
(tie-st-l1-alpha 145) ;; tie
(etie-st-l1-alpha 146) ;; tie
(tex-l2-alpha 147) ;; tex
(tfrag-t-l2-alpha 148) ;; tfrag
(bucket-149 149) ;; tie
(bucket-150 150) ;; tie
(tie-t-l2-alpha 149) ;; tie
(etie-t-l2-alpha 150) ;; tie
(merc-l2-alpha 151) ;; merc
(emerc-l2-alpha 152) ;; emerc
(bucket-153 153) ;; mercneric
(tfrag-st-l2-alpha 154) ;; tfrag
(bucket-155 155) ;; tie
(bucket-156 156) ;; tie
(tie-st-l2-alpha 155) ;; tie
(etie-st-l2-alpha 156) ;; tie
(tex-l3-alpha 157) ;; tex
(tfrag-t-l3-alpha 158) ;; tfrag
(bucket-159 159) ;; tie
(bucket-160 160) ;; tie
(tie-t-l3-alpha 159) ;; tie
(etie-t-l3-alpha 160) ;; tie
(merc-l3-alpha 161) ;; merc
(emerc-l3-alpha 162) ;; emerc
(bucket-163 163) ;; mercneric
(tfrag-st-l3-alpha 164) ;; tfrag
(bucket-165 165) ;; tie
(bucket-166 166) ;; tie
(tie-st-l3-alpha 165) ;; tie
(etie-st-l3-alpha 166) ;; tie
(tex-l4-alpha 167) ;; tex
(tfrag-t-l4-alpha 168) ;; tfrag
(bucket-169 169) ;; tie
(bucket-170 170) ;; tie
(tie-t-l4-alpha 169) ;; tie
(etie-t-l4-alpha 170) ;; tie
(merc-l4-alpha 171) ;; merc
(emerc-l4-alpha 172) ;; emerc
(bucket-173 173) ;; mercneric
(tfrag-st-l4-alpha 174) ;; tfrag
(bucket-175 175) ;; tie
(bucket-176 176) ;; tie
(tie-st-l4-alpha 175) ;; tie
(etie-st-l4-alpha 176) ;; tie
(tex-l5-alpha 177) ;; tex
(tfrag-t-l5-alpha 178) ;; tfrag
(bucket-179 179) ;; tie
(bucket-180 180) ;; tie
(tie-t-l5-alpha 179) ;; tie
(etie-t-l5-alpha 180) ;; tie
(merc-l5-alpha 181) ;; merc
(emerc-l5-alpha 182) ;; emerc
(bucket-183 183) ;; mercneric
(tfrag-st-l5-alpha 184) ;; tfrag
(bucket-185 185) ;; tie
(bucket-186 186) ;; tie
(tie-st-l5-alpha 185) ;; tie
(etie-st-l5-alpha 186) ;; tie
(tex-lcom-tfrag 187) ;; tex
(merc-lcom-tfrag 188) ;; merc
@@ -3011,61 +3011,61 @@
(merc-l0-water 253) ;; merc
(bucket-254 254) ;; mercneric
(tfrag-w-l0-water 255) ;; tfrag
(bucket-256 256)
(bucket-257 257)
(bucket-258 258)
(tie-w-l0-water 256)
(etie-w-l0-water 257)
(tie-sw-l0-water 258)
(tfrag-ws-l0-water 259) ;; tfrag
(bucket-260 260)
(etie-sw-l0-water 260)
(tex-l1-water 261) ;; tex
(merc-l1-water 262) ;; merc
(bucket-263 263) ;; mercneric
(tfrag-w-l1-water 264) ;; tfrag
(bucket-265 265)
(bucket-266 266)
(bucket-267 267)
(tie-w-l1-water 265)
(etie-w-l1-water 266)
(tie-sw-l1-water 267)
(tfrag-ws-l1-water 268) ;; tfrag
(bucket-269 269)
(etie-sw-l1-water 269)
(tex-l2-water 270) ;; tex
(merc-l2-water 271) ;; merc
(bucket-272 272) ;; mercneric
(tfrag-w-l2-water 273) ;; tfrag
(bucket-274 274)
(bucket-275 275)
(bucket-276 276)
(tie-w-l2-water 274)
(etie-w-l2-water 275)
(tie-sw-l2-water 276)
(tfrag-ws-l2-water 277) ;; tfrag
(bucket-278 278)
(tie-esw-l2-water 278)
(tex-l3-water 279) ;; tex
(merc-l3-water 280) ;; merc
(bucket-281 281) ;; mercneric
(tfrag-w-l3-water 282) ;; tfrag
(bucket-283 283)
(bucket-284 284)
(bucket-285 285)
(tie-w-l3-water 283)
(etie-w-l3-water 284)
(tie-sw-l3-water 285)
(tfrag-ws-l3-water 286) ;; tfrag
(bucket-287 287)
(etie-sw-l3-water 287)
(tex-l4-water 288) ;; tex
(merc-l4-water 289) ;; merc
(bucket-290 290) ;; mercneric
(tfrag-w-l4-water 291) ;; tfrag
(bucket-292 292)
(bucket-293 293)
(bucket-294 294)
(tie-w-l4-water 292)
(etie-w-l4-water 293)
(tie-sw-l4-water 294)
(tfrag-ws-l4-water 295) ;; tfrag
(bucket-296 296)
(etie-sw-l4-water 296)
(tex-l5-water 297) ;; tex
(merc-l5-water 298) ;; merc
(bucket-299 299) ;; mercneric
(tfrag-w-l5-water 300) ;; tfrag
(bucket-301 301)
(bucket-302 302)
(bucket-303 303)
(tie-w-l5-water 301)
(etie-w-l5-water 302)
(tie-sw-l5-water 303)
(tfrag-ws-l5-water 304) ;; tfrag
(bucket-305 305)
(etie-sw-l5-water 305)
(tex-lcom-water 306) ;; tex
(merc-lcom-water 307) ;; merc
@@ -4032,7 +4032,7 @@
((word uint32 4 :offset-assert 0)
(quad uint128 :offset 0)
(data uint64 :offset 0)
(cmds uint64 :offset 8)
(cmds gs-reg64 :offset 8)
(cmd uint8 :offset 8)
(x uint32 :offset 0)
(y uint32 :offset 4)
@@ -7510,6 +7510,21 @@
(tfragment-color 6)
(tfragment-debug 7)
(tie-fragment 9)
(tie-gif 10)
(tie-points 11)
(tie-colors 12)
(tie-draw-points 13)
(tie-debug 14)
(tie-generic 17)
(instance-tie 18)
(instance-tie-colors0 19)
(instance-tie-colors1 20)
(instance-tie-colors2 21)
(instance-tie-colors3 22)
(inst-tie-colors* 23)
(entity 43)
(camera 44)
@@ -23202,37 +23217,35 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#|
(deftype tie-consts (structure)
((data uint32 40 :offset-assert 0) ;; guessed by decompiler
(vector vector 10 :offset-assert 0) ;; guessed by decompiler
(quads uint128 10 :offset-assert 0) ;; guessed by decompiler
(adgif qword :inline :offset-assert 0) ;; gs-gif-tag :inline
(strgif qword :inline :offset-assert 16) ;; gs-gif-tag :inline
(extra qword :inline :offset-assert 32) ;; vector :inline
(gifbufs qword :inline :offset-assert 48) ;; vector :inline
(clrbufs qword :inline :offset-assert 64)
(misc qword :inline :offset-assert 80)
(atestgif qword :inline :offset-assert 96) ;; gs-gif-tag :inline
(alpha qword :inline :offset-assert 112)
(atest ad-cmd 2 :offset-assert 128) ;; guessed by decompiler
(atest-tra gs-adcmd :inline :offset-assert 128) ;; ad-cmd :inline
(atest-def gs-adcmd :inline :offset-assert 144) ;; ad-cmd :inline
((data uint32 40 :offset 0 :score -2) ;; guessed by decompiler
(vector vector 10 :offset 0 :score -2) ;; guessed by decompiler
(quads uint128 10 :offset 0 :score -2) ;; guessed by decompiler
(adgif gs-gif-tag :inline :offset 0) ;; gs-gif-tag :inline
(strgif gs-gif-tag :inline :offset 16) ;; gs-gif-tag :inline
(extra vector :inline :offset 32) ;; vector :inline
(gifbufs vector :inline :offset 48) ;; vector :inline
(clrbufs qword :inline :offset 64)
(misc qword :inline :offset 80)
(atestgif gs-gif-tag :inline :offset 96) ;; gs-gif-tag :inline
(alpha gs-adcmd :inline :offset 112)
(atest gs-adcmd 2 :inline :offset 128 :score -1) ;; guessed by decompiler
(atest-tra gs-adcmd :inline :offset 128) ;; ad-cmd :inline
(atest-def gs-adcmd :inline :offset 144) ;; ad-cmd :inline
)
:method-count-assert 9
:size-assert #xa0
:flag-assert #x9000000a0
)
|#
;; (define-extern tie-vu1-block object) ;; vu-function
;; (define-extern tie-init-consts function) ;; (function tie-consts int none)
;; (define-extern tie-init-engine function) ;; (function dma-buffer gs-test int none)
;; (define-extern tie-end-buffer function) ;; (function dma-buffer none)
;; (define-extern tie-int-reg function) ;; (function int string)
;; (define-extern tie-float-reg function) ;; (function int string)
;; (define-extern tie-ints function) ;; (function none)
;; (define-extern tie-floats function) ;; (function none)
(define-extern tie-vu1-block vu-function)
(define-extern tie-init-consts (function tie-consts gs-alpha gs-test gs-test none))
(define-extern tie-init-engine (function dma-buffer gs-alpha gs-test gs-test none))
(define-extern tie-end-buffer (function dma-buffer none))
(define-extern tie-int-reg (function int string))
(define-extern tie-float-reg (function int string))
(define-extern tie-ints (function none))
(define-extern tie-floats (function none))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; etie-vu1 ;;
@@ -23273,8 +23286,8 @@
;; (define-extern etie-vu1-block object)
;; (define-extern etie-magic function)
;; (define-extern etie-init-consts function)
;; (define-extern etie-init-engine function)
;; (define-extern etie-end-buffer function)
(define-extern etie-init-engine (function dma-buffer none))
(define-extern etie-end-buffer (function dma-buffer none))
;; (define-extern etie-float-reg-bp function)
;; (define-extern etie-float-reg function)
;; (define-extern etie-floats function)
@@ -23351,8 +23364,8 @@
;; (define-extern etn-vu1-block object)
;; (define-extern etn-magic function)
;; (define-extern etn-init-consts function)
;; (define-extern etn-init-engine function)
;; (define-extern etn-end-buffer function)
(define-extern etn-init-engine (function dma-buffer none))
(define-extern etn-end-buffer (function dma-buffer none))
;; (define-extern etn-float-reg-calc function)
;; (define-extern etn-float-reg function)
;; (define-extern etn-floats function)
@@ -23387,9 +23400,9 @@
;; (define-extern tie-near-vu1-block object) ;; vu-function
;; (define-extern tie-near-init-consts function) ;; (function tie-near-consts int none)
;; (define-extern tie-near-init-engine function) ;; (function dma-buffer gs-test int none)
;; (define-extern tie-near-end-buffer function) ;; (function dma-buffer none)
(define-extern tie-scissor-make-perspective-matrix (function object object none))
(define-extern tie-near-init-engine (function dma-buffer gs-test int none))
(define-extern tie-near-end-buffer (function dma-buffer none))
(define-extern tie-scissor-make-perspective-matrix (function matrix matrix none))
;; (define-extern tie-near-int-reg function) ;; (function int string)
;; (define-extern tie-near-float-reg function) ;; (function int string)
@@ -23404,7 +23417,6 @@
;; tie-methods ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#|
(deftype tie-debug (structure)
((max-instance uint32 :offset-assert 0)
(min-instance uint32 :offset-assert 4)
@@ -23415,46 +23427,43 @@
:size-assert #x10
:flag-assert #x900000010
)
|#
#|
(deftype tie-init-data (structure)
((tie-bucket int32 :offset-assert 0)
(tie-scissor-bucket int32 :offset-assert 4)
(tie-envmap-bucket int32 :offset-assert 8)
(tie-envmap-scissor-bucket int32 :offset-assert 12)
(tie-vanish-bucket int32 :offset-assert 16)
(tie-trans-bucket int32 :offset-assert 20)
(tie-scissor-trans-bucket int32 :offset-assert 24)
(tie-envmap-trans-bucket int32 :offset-assert 28)
(tie-envmap-scissor-trans-bucket int32 :offset-assert 32)
(tie-water-bucket int32 :offset-assert 36)
(tie-scissor-water-bucket int32 :offset-assert 40)
(tie-envmap-water-bucket int32 :offset-assert 44)
(tie-envmap-scissor-water-bucket int32 :offset-assert 48)
((tie-bucket bucket-id :offset-assert 0)
(tie-scissor-bucket bucket-id :offset-assert 4)
(tie-envmap-bucket bucket-id :offset-assert 8)
(tie-envmap-scissor-bucket bucket-id :offset-assert 12)
(tie-vanish-bucket bucket-id :offset-assert 16)
(tie-trans-bucket bucket-id :offset-assert 20)
(tie-scissor-trans-bucket bucket-id :offset-assert 24)
(tie-envmap-trans-bucket bucket-id :offset-assert 28)
(tie-envmap-scissor-trans-bucket bucket-id :offset-assert 32)
(tie-water-bucket bucket-id :offset-assert 36)
(tie-scissor-water-bucket bucket-id :offset-assert 40)
(tie-envmap-water-bucket bucket-id :offset-assert 44)
(tie-envmap-scissor-water-bucket bucket-id :offset-assert 48)
)
:method-count-assert 9
:size-assert #x34
:flag-assert #x900000034
)
|#
;; (define-extern *tie* object) ;; tie-instance-debug
;; (define-extern tie-debug-between function) ;; (function uint uint uint)
;; (define-extern tie-debug-one function) ;; (function uint uint uint)
;; (define-extern tie-debug-frag-between function)
;; (define-extern tie-debug-frag-one function)
;; (define-extern walk-tie-generic-prototypes function) ;; (function none)
;; (define-extern *pke-hack* object) ;; vector
;; (define-extern draw-inline-array-instance-tie function) ;; (function pointer (inline-array instance-tie) int dma-buffer none)
;; (define-extern draw-inline-array-prototype-tie-asm function) ;; (function dma-buffer int prototype-array-tie none)
;; (define-extern instance-tie-patch-buckets function)
(define-extern *tie* tie-debug)
(define-extern tie-debug-between (function uint uint uint))
(define-extern tie-debug-one (function uint uint uint))
(define-extern tie-debug-frag-between (function uint uint uint))
(define-extern tie-debug-frag-one (function uint uint uint))
(define-extern walk-tie-generic-prototypes (function none))
(define-extern *pke-hack* vector)
(define-extern draw-inline-array-instance-tie (function pointer (inline-array instance-tie) int dma-buffer none))
(define-extern draw-inline-array-prototype-tie-asm (function dma-buffer int prototype-array-tie none))
(define-extern instance-tie-patch-buckets (function dma-buffer level object))
(define-extern draw-drawable-tree-instance-tie (function drawable-tree-instance-tie level none))
;; (define-extern tie-init-scissor-buf function)
;; (define-extern tie-init-buf function)
;; (define-extern tie-init-envmap-buf function)
;; (define-extern tie-init-envmap-scissor-buf function)
;; (define-extern *tie-init-table* object)
(define-extern tie-init-scissor-buf (function bucket-id gs-alpha gs-test gs-test none))
(define-extern tie-init-buf (function bucket-id gs-alpha gs-test gs-test none))
(define-extern tie-init-envmap-buf (function bucket-id gs-alpha int int none))
(define-extern tie-init-envmap-scissor-buf (function bucket-id gs-alpha int int none))
(define-extern *tie-init-table* (inline-array tie-init-data))
(define-extern tie-vu1-init-buffers (function none))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+2 -1
View File
@@ -290,7 +290,8 @@
"start-perf-stat-collection": [26],
"end-perf-stat-collection": [0],
"upload-vis-bits": [2, 6, 3, 0],
"set-background-regs!":[4, 3]
"set-background-regs!":[4, 3],
"draw-drawable-tree-instance-tie": [21, 23, 31, 33]
},
// Sometimes the game might use format strings that are fetched dynamically,
+4 -2
View File
@@ -189,8 +189,8 @@
["L896", "(pointer uint64)", 1],
["L897", "(pointer uint64)", 1]
],
"nav-mesh": [["L347", "(inline-array vector)", 2]],
"tfrag-methods": [["L119", "(inline-array tfrag-init-data)", 6]],
"nav-mesh": [["L347", "(inline-array vector)", 2]],
"progress": [
["L879", "uint64", true],
["L880", "uint64", true],
@@ -250,5 +250,7 @@
["L790", "uint64", true],
["L791", "uint64", true]
],
"target-gun": [["L595", "uint64", true]]
"target-gun": [["L595", "uint64", true]],
"tie-methods": [["L328", "(inline-array tie-init-data)", 6]],
"nav-mesh": [["L347", "(inline-array vector)", 2]]
}
+89
View File
@@ -2409,6 +2409,95 @@
[[128, 152], "a2", "dma-packet"],
[[157, 162], "a1", "dma-packet"]
],
"tfrag-scissor-vu1-init-buf": [
[[25, 34], "v1", "dma-packet"],
[[61, 66], "v1", "dma-packet"],
[69, "v1", "(pointer uint32)"]
],
"(method 9 tie-fragment)": [
[21, "a2", "(pointer int32)"],
[26, "a3", "(pointer int32)"],
[[1, 70], "s5", "adgif-shader"]
],
"tie-init-engine": [
[[11, 25], "a0", "dma-packet"],
[[37, 45], "a0", "dma-packet"],
[[47, 54], "a0", "dma-packet"],
[[57, 64], "v1", "vector"],
[[65,72], "v1", "(pointer vif-tag)"]
],
"tie-end-buffer": [
[[1, 8], "a1", "dma-packet"],
[[10, 17], "a1", "gs-gif-tag"],
[21, "a1", "(pointer gs-test)"],
[23, "a1", "(pointer gs-reg64)"],
[[27, 34], "a1", "dma-packet"],
[38, "a0", "(pointer vif-tag)"],
[40, "a0", "(pointer vif-tag)"],
[42, "a0", "(pointer vif-tag)"],
[44, "a0", "(pointer vif-tag)"],
[[45, 49], "a0", "(pointer int32)"]
],
"tie-ints": [
[17, "v1", "(pointer uint32)"],
[21, "v1", "(pointer uint32)"]
],
"(method 13 drawable-tree-instance-tie)": [
[[51, 70], "t1", "tie-fragment"],
[[102, 120], "a3", "tie-fragment"],
[[160, 178], "t1", "tie-fragment"],
[[211, 229], "a3", "tie-fragment"],
[[266, 286], "t1", "tie-fragment"],
[[320, 340], "a1", "tie-fragment"],
[[381, 400], "t1", "tie-fragment"],
[[432, 450], "a3", "tie-fragment"],
[[487, 507], "t1", "tie-fragment"],
[[541, 561], "a1", "tie-fragment"],
[[598, 616], "t1", "tie-fragment"],
[[649, 667], "a3", "tie-fragment"],
[[703, 723], "t1", "tie-fragment"],
[[756, 776], "a1", "tie-fragment"]
],
"draw-drawable-tree-instance-tie": [
[[23, 37], "v1", "drawable-inline-array-node"],
[25, "a0", "drawable-inline-array-node"],
[120, "s2", "drawable-inline-array-instance-tie"],
[132, "v1", "int"],
[132, "a0", "int"]
],
"instance-tie-patch-buckets": [
[39, "a0", "(pointer uint64)"],
[152, "a0", "(pointer uint64)"],
[265, "a0", "(pointer uint64)"],
[378, "a0", "(pointer uint64)"],
[491, "a0", "(pointer uint64)"],
[605, "a0", "(pointer uint64)"],
[719, "a0", "(pointer uint64)"],
[833, "a0", "(pointer uint64)"],
[947, "a0", "(pointer uint64)"],
[1061, "a0", "(pointer uint64)"],
[1175, "a0", "(pointer uint64)"],
[1289, "a0", "(pointer uint64)"],
[1403, "a0", "(pointer uint64)"],
[[51, 57], "a0", "dma-packet"],
[[164, 170], "a0", "dma-packet"]
],
"tie-floats": [[[3, 73], "gp", "(pointer uint32)"]],
"tie-init-buf": [
[[24, 31], "a0", "dma-packet"],
[[33, 40], "a0", "gs-gif-tag"],
[44, "a0", "(pointer gs-zbuf)"],
[46, "a0", "(pointer gs-reg64)"],
[[49, 59], "v1", "dma-packet"],
[[84, 90], "v1", "dma-packet"],
[92, "v1", "(pointer int32)"]
],
"tie-init-envmap-buf": [
[[23, 33], "v1", "dma-packet"],
[[58, 64], "v1", "dma-packet"],
[66, "v1", "(pointer int32)"]
],
"(enter othercam-running)": [[[50, 60], "gp", "process-drawable"]],
"(code othercam-running)": [[[2, 65], "s2", "process-drawable"]],
"(method 10 progress)": [[45, "t9", "(function progress none)"]],
@@ -40,13 +40,13 @@ struct SharedRenderState {
bool use_sky_cpu = true;
bool use_occlusion_culling = true;
bool enable_merc_xgkick = true;
math::Vector<u8, 4> fog_color;
math::Vector<u8, 4> fog_color = math::Vector<u8, 4>{0, 0, 0, 0};
float fog_intensity = 1.f;
bool no_multidraw = false;
void reset();
bool has_pc_data = false;
LevelVis occlusion_vis[2];
LevelVis occlusion_vis[6];
math::Vector4f camera_planes[4];
math::Vector4f camera_matrix[4];
@@ -90,8 +90,10 @@ void OpenGLRenderer::init_bucket_renderers_jak2() {
init_bucket_renderer<TFragment>("tfrag-l0-tfrag", BucketCategory::TFRAG, BucketId::TFRAG_L0_TFRAG,
std::vector{tfrag3::TFragmentTreeKind::NORMAL}, false, 0);
init_bucket_renderer<Tie3>("tie-l0-tfrag", BucketCategory::TIE, BucketId::TIE_L0_TFRAG, 0);
init_bucket_renderer<TFragment>("tfrag-l1-tfrag", BucketCategory::TFRAG, BucketId::TFRAG_L1_TFRAG,
std::vector{tfrag3::TFragmentTreeKind::NORMAL}, false, 0);
std::vector{tfrag3::TFragmentTreeKind::NORMAL}, false, 1);
init_bucket_renderer<Tie3>("tie-l1-tfrag", BucketCategory::TIE, BucketId::TIE_L1_TFRAG, 1);
init_bucket_renderer<Shrub>("shrub-l0-shrub", BucketCategory::SHRUB, BucketId::SHRUB_L0_SHRUB);
init_bucket_renderer<Shrub>("shrub-l1-shrub", BucketCategory::SHRUB, BucketId::SHRUB_L1_SHRUB);
init_bucket_renderer<TFragment>("tfrag-t-l0-alpha", BucketCategory::TFRAG,
@@ -773,7 +775,7 @@ void OpenGLRenderer::dispatch_buckets_jak2(DmaFollower dma,
// should have ended at the start of the next chain
ASSERT(dma.current_tag_offset() == m_render_state.next_bucket);
m_render_state.next_bucket += 16;
vif_interrupt_callback(bucket_id);
vif_interrupt_callback(bucket_id + 1);
m_category_times[(int)m_bucket_categories[bucket_id]] += bucket_prof.get_elapsed_time();
}
vif_interrupt_callback(m_bucket_renderers.size());
@@ -10,6 +10,17 @@ Tie3::Tie3(const std::string& name, int my_id, int level_id)
// we won't actually interp or upload to gpu the unused ones, but we need a fixed maximum so
// indexing works properly.
m_color_result.resize(TIME_OF_DAY_COLOR_COUNT);
m_wind_data.paused = 0;
math::Vector4f ones(1, 1, 1, 1);
m_wind_data.wind_normal = ones;
m_wind_data.wind_temp = ones;
for (auto& wv : m_wind_data.wind_array) {
wv = ones;
}
for (auto& wf : m_wind_data.wind_force) {
wf = 1.f;
}
}
Tie3::~Tie3() {
@@ -301,8 +312,9 @@ void Tie3::render(DmaFollower& dma, SharedRenderState* render_state, ScopedProfi
}
auto data0 = dma.read_and_advance();
ASSERT(data0.vif1() == 0);
ASSERT(data0.vif0() == 0);
ASSERT(data0.vif1() == 0 || data0.vifcode1().kind == VifCode::Kind::NOP);
ASSERT(data0.vif0() == 0 || data0.vifcode0().kind == VifCode::Kind::NOP ||
data0.vifcode0().kind == VifCode::Kind::MARK);
ASSERT(data0.size_bytes == 0);
if (dma.current_tag().kind == DmaTag::Kind::CALL) {
@@ -314,11 +326,18 @@ void Tie3::render(DmaFollower& dma, SharedRenderState* render_state, ScopedProfi
return;
}
auto gs_test = dma.read_and_advance();
ASSERT(gs_test.size_bytes == 32);
if (dma.current_tag_offset() == render_state->next_bucket) {
return;
}
auto tie_consts = dma.read_and_advance();
ASSERT(tie_consts.size_bytes == 9 * 16);
auto gs_test = dma.read_and_advance();
if (gs_test.size_bytes == 160) {
} else {
ASSERT(gs_test.size_bytes == 32);
auto tie_consts = dma.read_and_advance();
ASSERT(tie_consts.size_bytes == 9 * 16);
}
auto mscalf = dma.read_and_advance();
ASSERT(mscalf.size_bytes == 0);
@@ -327,6 +346,9 @@ void Tie3::render(DmaFollower& dma, SharedRenderState* render_state, ScopedProfi
ASSERT(row.size_bytes == 32);
auto next = dma.read_and_advance();
if (next.size_bytes == 32) {
next = dma.read_and_advance();
}
ASSERT(next.size_bytes == 0);
auto pc_port_data = dma.read_and_advance();
@@ -334,9 +356,12 @@ void Tie3::render(DmaFollower& dma, SharedRenderState* render_state, ScopedProfi
memcpy(&m_pc_port_data, pc_port_data.data, sizeof(TfragPcPortData));
m_pc_port_data.level_name[11] = '\0';
auto wind_data = dma.read_and_advance();
ASSERT(wind_data.size_bytes == sizeof(WindWork));
memcpy(&m_wind_data, wind_data.data, sizeof(WindWork));
if (render_state->version == GameVersion::Jak1) {
auto wind_data = dma.read_and_advance();
ASSERT(wind_data.size_bytes == sizeof(WindWork));
memcpy(&m_wind_data, wind_data.data, sizeof(WindWork));
} else {
}
while (dma.current_tag_offset() != render_state->next_bucket) {
dma.read_and_advance();
+2
View File
@@ -82,7 +82,9 @@ namespace jak2 {
enum class BucketId {
TFRAG_L0_TFRAG = 8,
TIE_L0_TFRAG = 9,
TFRAG_L1_TFRAG = 19,
TIE_L1_TFRAG = 20,
SHRUB_L0_SHRUB = 74,
SHRUB_L1_SHRUB = 83,
TFRAG_T_L0_ALPHA = 128,
@@ -16,6 +16,21 @@
(tfragment-color 6)
(tfragment-debug 7)
(tie-fragment 9)
(tie-gif 10)
(tie-points 11)
(tie-colors 12)
(tie-draw-points 13)
(tie-debug 14)
(tie-generic 17)
(instance-tie 18)
(instance-tie-colors0 19)
(instance-tie-colors1 20)
(instance-tie-colors2 21)
(instance-tie-colors3 22)
(inst-tie-colors* 23)
(entity 43)
(camera 44)
+1 -1
View File
@@ -934,7 +934,7 @@
;; post-draw buffer setup
(tfrag-vu1-init-buffers)
; (tie-vu1-init-buffers)
(tie-vu1-init-buffers)
; (merc-vu1-init-buffers)
; (emerc-vu1-init-buffers)
; (generic-vu1-init-buffers)
@@ -390,38 +390,38 @@
)
)
; (when (nonzero? (-> *background-work* tie-tree-count))
; (set! (-> *instance-tie-work* tod-env-color quad) (-> *time-of-day-context* current-env-color quad))
; (with-profiler 'instance-tie *profile-instance-tie-color*
; (dotimes (s5-10 (-> *background-work* tie-tree-count))
; (let ((s4-8 (-> *background-work* tie-levels s5-10)))
; (let ((a2-29 (-> s4-8 bsp)))
; (when (!= s4-8 gp-6)
; (set! (-> *instance-tie-work* min-dist x) 4095996000.0)
; (upload-vis-bits s4-8 gp-6 a2-29)
; (set! gp-6 s4-8)
; )
; )
; (set! *draw-index* (-> s4-8 draw-index))
; (set! (-> *prototype-tie-work* mood) (-> s4-8 mood-context))
; (set-background-regs! s4-8)
; (set-tie-quard-planes! s4-8)
; (tie-scissor-make-perspective-matrix
; (-> *instance-tie-work* tie-scissor-perspective-matrix)
; (if (-> s4-8 info use-camera-other)
; (-> *math-camera* camera-temp-other)
; (-> *math-camera* camera-temp)
; )
; )
; (draw-drawable-tree-instance-tie (-> *background-work* tie-trees s5-10) s4-8)
; )
; (set! (-> *background-work* tie-generic s5-10) (the-as basic (-> *prototype-tie-work* generic-next)))
; (set! (-> *background-work* tie-generic-trans s5-10)
; (the-as basic (-> *prototype-tie-work* generic-trans-next))
; )
; )
; )
; )
(when (nonzero? (-> *background-work* tie-tree-count))
(set! (-> *instance-tie-work* tod-env-color quad) (-> *time-of-day-context* current-env-color quad))
(with-profiler 'instance-tie *profile-instance-tie-color*
(dotimes (s5-10 (-> *background-work* tie-tree-count))
(let ((s4-8 (-> *background-work* tie-levels s5-10)))
(let ((a2-29 (-> s4-8 bsp)))
(when (!= s4-8 gp-6)
(set! (-> *instance-tie-work* min-dist x) 4095996000.0)
(upload-vis-bits s4-8 gp-6 a2-29)
(set! gp-6 s4-8)
)
)
(set! *draw-index* (-> s4-8 draw-index))
(set! (-> *prototype-tie-work* mood) (-> s4-8 mood-context))
(set-background-regs! s4-8)
(set-tie-quard-planes! s4-8)
(tie-scissor-make-perspective-matrix
(-> *instance-tie-work* tie-scissor-perspective-matrix)
(if (-> s4-8 info use-camera-other)
(-> *math-camera* camera-temp-other)
(-> *math-camera* camera-temp)
)
)
(draw-drawable-tree-instance-tie (-> *background-work* tie-trees s5-10) s4-8)
)
(set! (-> *background-work* tie-generic s5-10) (the-as basic (-> *prototype-tie-work* generic-next)))
(set! (-> *background-work* tie-generic-trans s5-10)
(the-as basic (-> *prototype-tie-work* generic-trans-next))
)
)
)
)
)
(dotimes (v1-282 (-> *level* length))
@@ -564,7 +564,17 @@
(set! (-> data-ptr 1) (-> *math-camera* plane 1 quad))
(set! (-> data-ptr 2) (-> *math-camera* plane 2 quad))
(set! (-> data-ptr 3) (-> *math-camera* plane 3 quad))
; (set! (-> data-ptr 4) (-> lev mood itimes 0 quad)) todo, time of dayl
;; hack to set time of day to something.
(let ((hack-itimes (new 'stack 'vector4w)))
(dotimes (i 4)
(set! (-> hack-itimes data i) #x60)
)
(dotimes (i 4)
(set! (-> data-ptr (+ 4 i)) (-> hack-itimes quad))
)
)
; (set! (-> data-ptr 4) (-> lev mood itimes 0 quad)) todo, time of day
; (set! (-> data-ptr 5) (-> lev mood itimes 1 quad))
; (set! (-> data-ptr 6) (-> lev mood itimes 2 quad))
; (set! (-> data-ptr 7) (-> lev mood itimes 3 quad))
+10 -9
View File
@@ -523,21 +523,22 @@
;; Adress + Data command
(deftype gs-adcmd (structure)
((word uint32 4 :offset-assert 0)
(quad uint128 :offset 0)
(data uint64 :offset 0)
(cmds uint64 :offset 8)
(cmd uint8 :offset 8)
(x uint32 :offset 0)
(y uint32 :offset 4)
(z uint32 :offset 8)
(w uint32 :offset 12)
((word uint32 4 :offset-assert 0)
(quad uint128 :offset 0)
(data uint64 :offset 0)
(cmds gs-reg64 :offset 8)
(cmd uint8 :offset 8)
(x uint32 :offset 0)
(y uint32 :offset 4)
(z uint32 :offset 8)
(w uint32 :offset 12)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; the GS's TRXPOS register specifies the position and scanning direction of the rectangular area
;; in each buffer where buffer transmission is performed.
(deftype gs-trxpos (uint64)
+2
View File
@@ -11,6 +11,7 @@
(define-extern *instance-tie-work* instance-tie-work)
(define-extern *prototype-tie-work* prototype-tie-work)
(define-extern tie-scissor-make-perspective-matrix (function matrix matrix none))
;; DECOMP BEGINS
@@ -335,3 +336,4 @@
(define *instance-tie-work-copy* (the-as instance-tie-work #f))
(define-extern draw-drawable-tree-instance-tie (function drawable-tree-instance-tie level none))
File diff suppressed because it is too large Load Diff
+4
View File
@@ -7,3 +7,7 @@
;; DECOMP BEGINS
(defun tie-scissor-make-perspective-matrix ((arg0 matrix) (arg1 matrix))
(column-scale-matrix! arg0 (-> *math-camera* hmge-scale) arg1)
(none)
)
+652
View File
@@ -7,3 +7,655 @@
;; DECOMP BEGINS
(defmethod login tie-fragment ((obj tie-fragment))
(let ((s5-0 (the-as adgif-shader (-> obj gif-ref)))
(s4-0 (/ (-> obj tex-count) (the-as uint 5)))
)
(dotimes (s3-0 (the-as int s4-0))
(let ((v1-1 (adgif-shader-login-no-remap s5-0)))
(when v1-1
(dotimes (a0-4 3)
(dotimes (a1-0 3)
(set! (-> (the-as (pointer int32) (+ (+ (* a0-4 16) (* a1-0 4)) (the-as int *texture-masks*))))
(logior (-> (the-as (pointer int32) (+ (* a1-0 4) (the-as int *texture-masks*) (* a0-4 16))) 0)
(-> (the-as (pointer int32) (+ (* a1-0 4) (the-as int v1-1) (* a0-4 16))) 15)
)
)
)
(set! (-> *texture-masks* data a0-4 dist)
(fmax (-> *texture-masks* data a0-4 dist) (-> v1-1 masks data a0-4 dist))
)
)
)
)
(when (= (-> s5-0 reg-4) 66)
(set! (-> s5-0 reg-4) (the-as uint 127))
(set! (-> s5-0 alpha) (new 'static 'gs-alpha))
0
)
(&+! s5-0 80)
)
)
obj
)
(defmethod inspect drawable-inline-array-instance-tie ((obj drawable-inline-array-instance-tie))
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~Tlength: ~D~%" (-> obj length))
(format #t "~Tdata[~D]: @ #x~X~%" (-> obj length) (-> obj data))
(dotimes (s5-0 (-> obj length))
(format #t "~T [~D] ~A~%" s5-0 (-> obj data s5-0))
)
obj
)
(defmethod asize-of drawable-inline-array-instance-tie ((obj drawable-inline-array-instance-tie))
(the-as int (+ (-> drawable-inline-array-instance-tie size) (* (+ (-> obj length) -1) 64)))
)
; (defmethod login drawable-tree-instance-tie ((obj drawable-tree-instance-tie))
; obj
; )
(defmethod login drawable-tree-instance-tie ((obj drawable-tree-instance-tie))
(dotimes (s5-0 (-> obj length))
(login (-> obj data s5-0))
)
obj
)
(defmethod inspect prototype-tie ((obj prototype-tie))
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~Tlength: ~D~%" (-> obj length))
(format #t "~Tdata[~D]: @ #x~X~%" (-> obj length) (-> obj data))
(dotimes (s5-0 (-> obj length))
(format #t "~T [~D] ~A~%" s5-0 (-> obj data s5-0))
)
obj
)
(defmethod login prototype-tie ((obj prototype-tie))
(dotimes (s5-0 (-> obj length))
(login (-> obj data s5-0))
)
obj
)
(defmethod mem-usage drawable-tree-instance-tie ((obj drawable-tree-instance-tie) (arg0 memory-usage-block) (arg1 int))
(set! (-> arg0 length) (max 1 (-> arg0 length)))
(set! (-> arg0 data 0 name) (symbol->string 'drawable-group))
(+! (-> arg0 data 0 count) 1)
(let ((v1-7 32))
(+! (-> arg0 data 0 used) v1-7)
(+! (-> arg0 data 0 total) (logand -16 (+ v1-7 15)))
)
(dotimes (s3-0 (-> obj length))
(mem-usage (-> obj data s3-0) arg0 arg1)
)
(mem-usage (-> obj prototypes prototype-array-tie) arg0 (logior arg1 1))
obj
)
(defmethod mem-usage tie-fragment ((obj tie-fragment) (arg0 memory-usage-block) (arg1 int))
(when (logtest? arg1 2)
(let ((v1-3 (* (-> obj color-count) 4))
(a0-2 (cond
((logtest? arg1 4)
20
)
((logtest? arg1 8)
21
)
(else
22
)
)
)
)
(+! (-> arg0 data a0-2 count) 1)
(+! (-> arg0 data a0-2 used) v1-3)
(+! (-> arg0 data a0-2 total) (logand -4 (+ v1-3 3)))
)
(set! (-> arg0 length) (max 23 (-> arg0 length)))
(set! obj obj)
(goto cfg-13)
)
(set! (-> arg0 length) (max 18 (-> arg0 length)))
(set! (-> arg0 data 9 name) "tie-fragment")
(set! (-> arg0 data 10 name) "tie-gif")
(set! (-> arg0 data 11 name) "tie-points")
(set! (-> arg0 data 12 name) "tie-colors")
(set! (-> arg0 data 14 name) "tie-debug")
(set! (-> arg0 data 13 name) "tie-draw-points")
(set! (-> arg0 data 17 name) "tie-generic")
(+! (-> arg0 data 9 count) 1)
(let ((v1-21 (asize-of obj)))
(+! (-> arg0 data 9 used) v1-21)
(+! (-> arg0 data 9 total) (logand -16 (+ v1-21 15)))
)
(let ((v1-26 (* (-> obj gif-count) 16)))
(+! (-> arg0 data 10 count) (-> obj tex-count))
(+! (-> arg0 data 10 used) v1-26)
(+! (-> arg0 data 10 total) (logand -16 (+ v1-26 15)))
)
(let ((v1-31 (* (-> obj vertex-count) 16)))
(+! (-> arg0 data 11 count) (-> obj vertex-count))
(+! (-> arg0 data 11 used) v1-31)
(+! (-> arg0 data 11 total) (logand -16 (+ v1-31 15)))
)
(let ((v1-36 (* (-> obj dp-qwc) 16)))
(+! (-> arg0 data 13 count) (* (-> obj dp-qwc) 16))
(+! (-> arg0 data 13 used) v1-36)
(+! (-> arg0 data 13 total) (logand -16 (+ v1-36 15)))
)
(let ((v1-41 (* (-> obj generic-count) 16)))
(+! (-> arg0 data 17 count) 1)
(+! (-> arg0 data 17 used) v1-41)
(+! (-> arg0 data 17 total) (logand -16 (+ v1-41 15)))
)
(let ((s4-0 (-> obj debug debug-lines)))
(when (nonzero? s4-0)
(dotimes (s3-0 (-> s4-0 length))
(+! (-> arg0 data 14 count) (-> s4-0 s3-0 length))
(let ((v1-52 (asize-of (-> s4-0 s3-0))))
(+! (-> arg0 data 12 used) v1-52)
(+! (-> arg0 data 12 total) (logand -16 (+ v1-52 15)))
)
)
)
)
(label cfg-13)
obj
)
(defmethod mem-usage instance-tie ((obj instance-tie) (arg0 memory-usage-block) (arg1 int))
(set! (-> arg0 length) (max 19 (-> arg0 length)))
(set! (-> arg0 data 18 name) "instance-tie")
(+! (-> arg0 data 18 count) 1)
(let ((v1-6 (asize-of obj)))
(+! (-> arg0 data 18 used) v1-6)
(+! (-> arg0 data 18 total) (logand -16 (+ v1-6 15)))
)
(when (nonzero? (-> obj color-indices))
(set! (-> arg0 length) (max 24 (-> arg0 length)))
(set! (-> arg0 data 23 name) "instance-tie-colors*")
(set! (-> arg0 data 19 name) "instance-tie-colors0")
(set! (-> arg0 data 20 name) "instance-tie-colors1")
(set! (-> arg0 data 21 name) "instance-tie-colors2")
(set! (-> arg0 data 22 name) "instance-tie-colors3")
(+! (-> arg0 data 23 count) 1)
(let ((s3-0 (-> obj bucket-ptr)))
(+ (-> arg0 data 19 used) (-> arg0 data 20 used) (-> arg0 data 21 used) (-> arg0 data 22 used))
(dotimes (s2-0 4)
(let ((a0-10 (-> s3-0 tie-geom s2-0)))
(when (nonzero? a0-10)
(let ((t9-1 (method-of-object a0-10 mem-usage))
(a1-2 arg0)
(v1-29 s2-0)
)
(t9-1 a0-10 a1-2 (logior (logior (cond
((= v1-29 1)
4
)
((= v1-29 2)
8
)
((= v1-29 3)
16
)
(else
0
)
)
2
)
arg1
)
)
)
)
)
)
)
)
obj
)
(defmethod mem-usage drawable-inline-array-instance-tie ((obj drawable-inline-array-instance-tie) (arg0 memory-usage-block) (arg1 int))
(set! (-> arg0 length) (max 1 (-> arg0 length)))
(set! (-> arg0 data 0 name) (symbol->string 'drawable-group))
(+! (-> arg0 data 0 count) 1)
(let ((v1-7 32))
(+! (-> arg0 data 0 used) v1-7)
(+! (-> arg0 data 0 total) (logand -16 (+ v1-7 15)))
)
(dotimes (s3-0 (-> obj length))
(mem-usage (-> obj data s3-0) arg0 arg1)
)
obj
)
(defmethod mem-usage prototype-tie ((obj prototype-tie) (arg0 memory-usage-block) (arg1 int))
(set! (-> arg0 length) (max 1 (-> arg0 length)))
(set! (-> arg0 data 0 name) (symbol->string 'drawable-group))
(+! (-> arg0 data 0 count) 1)
(let ((v1-7 32))
(+! (-> arg0 data 0 used) v1-7)
(+! (-> arg0 data 0 total) (logand -16 (+ v1-7 15)))
)
(dotimes (s3-0 (-> obj length))
(mem-usage (-> obj data s3-0) arg0 arg1)
)
obj
)
(defmethod asize-of prototype-tie ((obj prototype-tie))
(the-as int (+ (-> prototype-tie size) (* (+ (-> obj length) -1) 64)))
)
(deftype tie-consts (structure)
((data uint32 40 :offset 0)
(vector vector 10 :offset 0)
(quads uint128 10 :offset 0)
(adgif gs-gif-tag :inline :offset 0)
(strgif gs-gif-tag :inline :offset 16)
(extra vector :inline :offset 32)
(gifbufs vector :inline :offset 48)
(clrbufs qword :inline :offset 64)
(misc qword :inline :offset 80)
(atestgif gs-gif-tag :inline :offset 96)
(alpha gs-adcmd :inline :offset 112)
(atest gs-adcmd 2 :inline :offset 128)
(atest-tra gs-adcmd :inline :offset 128)
(atest-def gs-adcmd :inline :offset 144)
)
:method-count-assert 9
:size-assert #xa0
:flag-assert #x9000000a0
)
(define tie-vu1-block (new 'static 'vu-function :length 0 :qlength 0))
(defun tie-init-consts ((arg0 tie-consts) (arg1 gs-alpha) (arg2 gs-test) (arg3 gs-test))
(set! (-> arg0 adgif tag) (new 'static 'gif-tag64 :nloop #x5 :nreg #x1))
(set! (-> arg0 adgif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d)))
(case *subdivide-draw-mode*
(((subdivide-setting textured))
(set! (-> arg0 strgif tag)
(new 'static 'gif-tag64
:pre #x1
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :fge #x1 :abe #x1)
:nreg #x3
)
)
)
(((subdivide-setting outline))
(set! (-> arg0 strgif tag)
(new 'static 'gif-tag64
:pre #x1
:prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1 :abe #x1)
:nreg #x3
)
)
)
(((subdivide-setting gouraud))
(set! (-> arg0 strgif tag)
(new 'static 'gif-tag64
:pre #x1
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :fge #x1 :abe #x1)
:nreg #x3
)
)
)
(((subdivide-setting hack))
(set! (-> arg0 strgif tag)
(new 'static 'gif-tag64
:pre #x1
:prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1 :abe #x1)
:nreg #x3
)
)
)
)
(set! (-> arg0 strgif regs)
(new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2))
)
(let ((f0-0 8388894.0)
(f1-0 8389078.0)
(f2-0 8389262.0)
)
(set! (-> arg0 gifbufs x) f2-0)
(set! (-> arg0 gifbufs y) f1-0)
(set! (-> arg0 gifbufs z) f2-0)
(set! (-> arg0 gifbufs w) f1-0)
(set! (-> arg0 extra x) (+ f0-0 f1-0 f2-0))
(set! (-> arg0 extra y) 0.0)
(set! (-> arg0 extra z) (+ f0-0 f1-0 f2-0))
)
(set! (-> arg0 clrbufs vector4w x) 198)
(set! (-> arg0 clrbufs vector4w y) 242)
(set! (-> arg0 clrbufs vector4w z) 198)
(set! (-> arg0 clrbufs vector4w w) 242)
(set! (-> arg0 atestgif tag) (new 'static 'gif-tag64 :nloop #x2 :eop #x1 :nreg #x1))
(set! (-> arg0 atestgif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d)))
(set! (-> arg0 alpha data) (the-as uint arg1))
(set! (-> arg0 alpha cmds) (gs-reg64 alpha-1))
(set! (-> arg0 atest-tra cmds) (gs-reg64 test-1))
(set! (-> arg0 atest-tra data) (the-as uint arg2))
(set! (-> arg0 atest-def cmds) (gs-reg64 test-1))
(set! (-> arg0 atest-def data) (the-as uint arg3))
(set! (-> arg0 misc vector4w x) 0)
(set! (-> arg0 misc vector4w y) -1)
(none)
)
(defun tie-init-engine ((arg0 dma-buffer) (arg1 gs-alpha) (arg2 gs-test) (arg3 gs-test))
(dma-buffer-add-vu-function arg0 tie-vu1-block 1)
(let ((s5-0 10))
(let* ((v1-0 arg0)
(a0-2 (the-as dma-packet (-> v1-0 base)))
)
(set! (-> a0-2 dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc s5-0))
(set! (-> a0-2 vif0) (new 'static 'vif-tag :cmd (vif-cmd stmod)))
(set! (-> a0-2 vif1) (new 'static 'vif-tag :imm #x3c6 :cmd (vif-cmd unpack-v4-32) :num s5-0))
(set! (-> v1-0 base) (the-as pointer (&+ a0-2 16)))
)
(tie-init-consts (the-as tie-consts (-> arg0 base)) arg1 arg2 arg3)
(&+! (-> arg0 base) (* s5-0 16))
)
(let* ((v1-3 arg0)
(a0-6 (the-as dma-packet (-> v1-3 base)))
)
(set! (-> a0-6 dma) (new 'static 'dma-tag :id (dma-tag-id cnt)))
(set! (-> a0-6 vif0) (new 'static 'vif-tag :imm #x8 :cmd (vif-cmd mscalf) :msk #x1))
(set! (-> a0-6 vif1) (new 'static 'vif-tag :cmd (vif-cmd flusha) :msk #x1))
(set! (-> v1-3 base) (the-as pointer (&+ a0-6 16)))
)
(let* ((v1-4 arg0)
(a0-8 (the-as dma-packet (-> v1-4 base)))
)
(set! (-> a0-8 dma) (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt)))
(set! (-> a0-8 vif0) (new 'static 'vif-tag))
(set! (-> a0-8 vif1) (new 'static 'vif-tag :cmd (vif-cmd strow) :msk #x1))
(set! (-> v1-4 base) (the-as pointer (&+ a0-8 16)))
)
(let ((v1-5 (the-as object (-> arg0 base))))
(set! (-> (the-as vector v1-5) x) 8388608.0)
(set! (-> (the-as vector v1-5) y) 8388608.0)
(set! (-> (the-as vector v1-5) z) 8388608.0)
(set! (-> (the-as vector v1-5) w) 8388608.0)
(set! (-> (the-as (pointer vif-tag) v1-5) 4) (new 'static 'vif-tag :cmd (vif-cmd base)))
(set! (-> (the-as (pointer vif-tag) v1-5) 5) (new 'static 'vif-tag :imm #x2c :cmd (vif-cmd offset)))
(set! (-> (the-as (pointer vif-tag) v1-5) 6) (new 'static 'vif-tag :cmd (vif-cmd stmod)))
(set! (-> (the-as (pointer vif-tag) v1-5) 7) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)))
(set! (-> arg0 base) (&+ (the-as pointer v1-5) 32))
)
0
(none)
)
(defun tie-end-buffer ((arg0 dma-buffer))
(let* ((v1-0 arg0)
(a1-0 (the-as dma-packet (-> v1-0 base)))
)
(set! (-> a1-0 dma) (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt)))
(set! (-> a1-0 vif0) (new 'static 'vif-tag))
(set! (-> a1-0 vif1) (new 'static 'vif-tag :imm #x2 :cmd (vif-cmd direct) :msk #x1))
(set! (-> v1-0 base) (the-as pointer (&+ a1-0 16)))
)
(let* ((v1-1 arg0)
(a1-2 (the-as gs-gif-tag (-> v1-1 base)))
)
(set! (-> a1-2 tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1))
(set! (-> a1-2 regs) GIF_REGS_ALL_AD)
(set! (-> v1-1 base) (the-as pointer (&+ a1-2 16)))
)
(let* ((v1-2 arg0)
(a1-4 (-> v1-2 base))
)
(set! (-> (the-as (pointer gs-test) a1-4) 0) (new 'static 'gs-test :zte #x1 :ztst (gs-ztest greater-equal)))
(set! (-> (the-as (pointer gs-reg64) a1-4) 1) (gs-reg64 test-1))
(set! (-> v1-2 base) (&+ a1-4 16))
)
(let* ((v1-3 arg0)
(a1-6 (the-as dma-packet (-> v1-3 base)))
)
(set! (-> a1-6 dma) (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt)))
(set! (-> a1-6 vif0) (new 'static 'vif-tag :cmd (vif-cmd stmask)))
(set! (-> a1-6 vif1) (new 'static 'vif-tag))
(set! (-> v1-3 base) (the-as pointer (&+ a1-6 16)))
)
(let* ((v1-4 arg0)
(a0-1 (-> v1-4 base))
)
(set! (-> (the-as (pointer vif-tag) a0-1) 0) (new 'static 'vif-tag :imm #x4 :cmd (vif-cmd mscalf) :msk #x1))
(set! (-> (the-as (pointer vif-tag) a0-1) 1) (new 'static 'vif-tag :cmd (vif-cmd stmod)))
(set! (-> (the-as (pointer vif-tag) a0-1) 2) (new 'static 'vif-tag :cmd (vif-cmd flusha) :msk #x1))
(set! (-> (the-as (pointer vif-tag) a0-1) 3) (new 'static 'vif-tag :cmd (vif-cmd strow) :msk #x1))
(set! (-> (the-as (pointer int32) a0-1) 4) 0)
(set! (-> (the-as (pointer int32) a0-1) 5) 0)
(set! (-> (the-as (pointer int32) a0-1) 6) 0)
(set! (-> (the-as (pointer int32) a0-1) 7) 0)
(set! (-> v1-4 base) (&+ a0-1 32))
)
0
(none)
)
(defun-debug tie-int-reg ((arg0 int))
(let ((v1-0 arg0))
(cond
((zero? v1-0)
"zero"
)
((= v1-0 1)
"itemp"
)
((= v1-0 2)
"point-ptr"
)
((= v1-0 3)
"clr-ptr"
)
((= v1-0 4)
"target-bp1-ptr"
)
((= v1-0 5)
"skip-bp2"
)
((= v1-0 6)
"target-bp2-ptr"
)
((= v1-0 7)
"target-ip1-ptr"
)
((= v1-0 8)
"target-ip2-ptr"
)
((= v1-0 9)
"ind/ind0"
)
((= v1-0 10)
" ind1"
)
((= v1-0 11)
" ind2"
)
((= v1-0 12)
"dest-ptr"
)
((= v1-0 13)
"dest2-ptr"
)
((= v1-0 14)
"skip-ips"
)
((= v1-0 15)
"kick-addr"
)
)
)
)
(defun-debug tie-float-reg ((arg0 int))
(let ((v1-0 arg0))
(cond
((zero? v1-0)
"zero"
)
((= v1-0 1)
"t-mtx0"
)
((= v1-0 2)
"t-mtx1"
)
((= v1-0 3)
"t-mtx2"
)
((= v1-0 4)
"t-mtx3"
)
((= v1-0 5)
"vtx-0"
)
((= v1-0 6)
"vtx-1"
)
((= v1-0 7)
"vtx-2"
)
((= v1-0 8)
"vtx-3"
)
((= v1-0 9)
"pos-0/2"
)
((= v1-0 10)
"pos-1/3"
)
((= v1-0 11)
"clr-0"
)
((= v1-0 12)
"clr-1"
)
((= v1-0 13)
"clr-2"
)
((= v1-0 14)
"clr-3"
)
((= v1-0 15)
"tex-0"
)
((= v1-0 16)
"tex-1"
)
((= v1-0 17)
"tex-2"
)
((= v1-0 18)
"tex-3"
)
((= v1-0 19)
"res-0/2"
)
((= v1-0 20)
"res-1/3"
)
((= v1-0 21)
"gifbuf"
)
((= v1-0 22)
"clrbuf"
)
((= v1-0 23)
"extra"
)
((= v1-0 24)
"inds"
)
((= v1-0 25)
"--"
)
((= v1-0 26)
"--"
)
((= v1-0 27)
"morph"
)
((= v1-0 28)
"xyzofs"
)
((= v1-0 29)
"clr1"
)
((= v1-0 30)
"clr2"
)
((= v1-0 31)
"--"
)
)
)
)
(defun-debug tie-ints ()
(local-vars (sv-16 uint))
(let ((gp-0 (+ #x3da0 #x1100c000)))
(dotimes (s5-0 16)
(if (< s5-0 10)
(format 0 " ")
)
(let ((s4-0 format)
(s3-0 0)
(s2-0 "vi~d: ~6d #x~4,'0X ~s~%")
(s1-0 s5-0)
(s0-0 (-> (the-as (pointer uint32) (+ gp-0 (* (* s5-0 4) 4))) 0))
)
(set! sv-16 (-> (the-as (pointer uint32) (+ gp-0 (* (* s5-0 4) 4))) 0))
(let ((t1-0 (tie-int-reg s5-0)))
(s4-0 s3-0 s2-0 s1-0 s0-0 sv-16 t1-0)
)
)
)
)
(none)
)
(defun-debug tie-floats ()
(local-vars (sv-16 uint) (sv-32 uint))
(let ((gp-0 (the-as (pointer uint32) (+ #x3da0 #x1100c000))))
(dotimes (s5-0 32)
(if (< s5-0 10)
(format 0 " ")
)
(format
0
"vf~d: #x~8,'0X #x~8,'0X #x~8,'0X #x~8,'0X "
s5-0
(-> gp-0 (* s5-0 4))
(-> gp-0 (+ (* s5-0 4) 1))
(-> gp-0 (+ (* s5-0 4) 2))
(-> gp-0 (+ (* s5-0 4) 3))
)
(let ((s4-0 format)
(s3-0 0)
(s2-0 "~F ~F ~F ~F ~s~%")
(s1-0 (-> gp-0 (* s5-0 4)))
(s0-0 (-> gp-0 (+ (* s5-0 4) 1)))
)
(set! sv-16 (-> gp-0 (+ (* s5-0 4) 2)))
(set! sv-32 (-> gp-0 (+ (* s5-0 4) 3)))
(let ((t2-1 (tie-float-reg s5-0)))
(s4-0 s3-0 s2-0 s1-0 s0-0 sv-16 sv-32 t2-1)
)
)
)
)
(none)
)
+79 -78
View File
@@ -28,75 +28,75 @@
(tex-l0-tfrag 7) ;; level 0 tex
(tfrag-l0-tfrag 8) ;; tfrag
(bucket-9 9) ;; tie
(bucket-10 10) ;; tie
(tie-l0-tfrag 9) ;; tie
(etie-l0-tfrag 10) ;; tie
(tfrag-s-l0-tfrag 11) ;; tfrag
(bucket-12 12) ;; tie
(bucket-13 13) ;; tie
(tie-s-l0-tfrag 12) ;; tie
(etie-s-l0-tfrag 13) ;; tie
(merc-l0-tfrag 14) ;; merc
(emerc-l0-tfrag 15) ;; emerc
(bucket-16 16) ;; mercneric
(bucket-17 17) ;; tie
(tie-v-l0-tfrag 17) ;; tie
(tex-l1-tfrag 18) ;; tex
(tfrag-l1-tfrag 19) ;; tfrag
(bucket-20 20) ;; tie
(bucket-21 21) ;; tie
(tie-l1-tfrag 20) ;; tie
(etie-l1-tfrag 21) ;; tie
(tfrag-s-l1-tfrag 22) ;; tfrag
(bucket-23 23) ;; tie
(bucket-24 24) ;; tie
(tie-s-l1-tfrag 23) ;; tie
(etie-s-l1-tfrag 24) ;; tie
(merc-l1-tfrag 25) ;; merc
(emerc-l1-tfrag 26) ;; emerc
(bucket-27 27) ;; mercneric
(bucket-28 28) ;; tie
(tie-v-l1-tfrag 28) ;; tie
(tex-l2-tfrag 29) ;; tex
(tfrag-l2-tfrag 30) ;; tfrag
(bucket-31 31) ;; tie
(bucket-32 32) ;; tie
(tie-l2-tfrag 31) ;; tie
(etie-l2-tfrag 32) ;; tie
(tfrag-s-l2-tfrag 33) ;; tfrag
(bucket-34 34) ;; tie
(bucket-35 35) ;; tie
(tie-s-l2-tfrag 34) ;; tie
(etie-s-l2-tfrag 35) ;; tie
(merc-l2-tfrag 36) ;; merc
(emerc-l2-tfrag 37) ;; emerc
(bucket-38 38) ;; mercneric
(bucket-39 39) ;; tie
(tie-v-l2-tfrag 39) ;; tie
(tex-l3-tfrag 40) ;; tex
(tfrag-l3-tfrag 41) ;; tfrag
(bucket-42 42) ;; tie
(bucket-43 43) ;; tie
(tie-l3-tfrag 42) ;; tie
(etie-l3-tfrag 43) ;; tie
(tfrag-s-l3-tfrag 44) ;; tfrag
(bucket-45 45) ;; tie
(bucket-46 46) ;; tie
(tie-s-l3-tfrag 45) ;; tie
(etie-s-l3-tfrag 46) ;; tie
(merc-l3-tfrag 47) ;; merc
(emerc-l3-tfrag 48) ;; emerc
(bucket-49 49) ;; mercneric
(bucket-50 50) ;; tie
(tie-v-l3-tfrag 50) ;; tie
(tex-l4-tfrag 51) ;; tex
(tfrag-l4-tfrag 52) ;; tfrag
(bucket-53 53) ;; tie
(bucket-54 54) ;; tie
(tie-l4-tfrag 53) ;; tie
(etie-l4-tfrag 54) ;; tie
(tfrag-s-l4-tfrag 55) ;; tfrag
(bucket-56 56) ;; tie
(bucket-57 57) ;; tie
(tie-s-l4-tfrag 56) ;; tie
(etie-s-l4-tfrag 57) ;; tie
(merc-l4-tfrag 58) ;; merc
(emerc-l4-tfrag 59) ;; emerc
(bucket-60 60) ;; mercneric
(bucket-61 61) ;; tie
(tie-v-l4-tfrag 61) ;; tie
(tex-l5-tfrag 62) ;; tex
(tfrag-l5-tfrag 63) ;; tfrag
(bucket-64 64) ;; tie
(bucket-65 65) ;; tie
(tie-l5-tfrag 64) ;; tie
(etie-l5-tfrag 65) ;; tie
(tfrag-s-l5-tfrag 66) ;; tfrag
(bucket-67 67) ;; tie
(bucket-68 68) ;; tie
(tie-s-l5-tfrag 67) ;; tie
(etie-s-l5-tfrag 68) ;; tie
(merc-l5-tfrag 69) ;; merc
(emerc-l5-tfrag 70) ;; emerc
(bucket-71 71) ;; mercneric
(bucket-72 72) ;; tie
(tie-v-l5-tfrag 72) ;; tie
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; All levels with shrub tpage
@@ -164,69 +164,69 @@
(tex-l0-alpha 127) ;; tex
(tfrag-t-l0-alpha 128) ;; tfrag
(bucket-129 129) ;; tie
(bucket-130 130) ;; tie
(tie-t-l0-alpha 129) ;; tie
(etie-t-l0-alpha 130) ;; tie
(merc-l0-alpha 131) ;; merc
(emerc-l0-alpha 132) ;; emerc
(bucket-133 133) ;; mercneric
(tfrag-st-l0-alpha 134) ;; tfrag
(bucket-135 135) ;; tie
(bucket-136 136) ;; tie
(tie-st-l0-alpha 135) ;; tie
(etie-st-l0-alpha 136) ;; tie
(tex-l1-alpha 137) ;; tex
(tfrag-t-l1-alpha 138) ;; tfrag
(bucket-139 139) ;; tie
(bucket-140 140) ;; tie
(tie-t-l1-alpha 139) ;; tie
(etie-t-l1-alpha 140) ;; tie
(merc-l1-alpha 141) ;; merc
(emerc-l1-alpha 142) ;; emerc
(bucket-143 143) ;; mercneric
(tfrag-st-l1-alpha 144) ;; tfrag
(bucket-145 145) ;; tie
(bucket-146 146) ;; tie
(tie-st-l1-alpha 145) ;; tie
(etie-st-l1-alpha 146) ;; tie
(tex-l2-alpha 147) ;; tex
(tfrag-t-l2-alpha 148) ;; tfrag
(bucket-149 149) ;; tie
(bucket-150 150) ;; tie
(tie-t-l2-alpha 149) ;; tie
(etie-t-l2-alpha 150) ;; tie
(merc-l2-alpha 151) ;; merc
(emerc-l2-alpha 152) ;; emerc
(bucket-153 153) ;; mercneric
(tfrag-st-l2-alpha 154) ;; tfrag
(bucket-155 155) ;; tie
(bucket-156 156) ;; tie
(tie-st-l2-alpha 155) ;; tie
(etie-st-l2-alpha 156) ;; tie
(tex-l3-alpha 157) ;; tex
(tfrag-t-l3-alpha 158) ;; tfrag
(bucket-159 159) ;; tie
(bucket-160 160) ;; tie
(tie-t-l3-alpha 159) ;; tie
(etie-t-l3-alpha 160) ;; tie
(merc-l3-alpha 161) ;; merc
(emerc-l3-alpha 162) ;; emerc
(bucket-163 163) ;; mercneric
(tfrag-st-l3-alpha 164) ;; tfrag
(bucket-165 165) ;; tie
(bucket-166 166) ;; tie
(tie-st-l3-alpha 165) ;; tie
(etie-st-l3-alpha 166) ;; tie
(tex-l4-alpha 167) ;; tex
(tfrag-t-l4-alpha 168) ;; tfrag
(bucket-169 169) ;; tie
(bucket-170 170) ;; tie
(tie-t-l4-alpha 169) ;; tie
(etie-t-l4-alpha 170) ;; tie
(merc-l4-alpha 171) ;; merc
(emerc-l4-alpha 172) ;; emerc
(bucket-173 173) ;; mercneric
(tfrag-st-l4-alpha 174) ;; tfrag
(bucket-175 175) ;; tie
(bucket-176 176) ;; tie
(tie-st-l4-alpha 175) ;; tie
(etie-st-l4-alpha 176) ;; tie
(tex-l5-alpha 177) ;; tex
(tfrag-t-l5-alpha 178) ;; tfrag
(bucket-179 179) ;; tie
(bucket-180 180) ;; tie
(tie-t-l5-alpha 179) ;; tie
(etie-t-l5-alpha 180) ;; tie
(merc-l5-alpha 181) ;; merc
(emerc-l5-alpha 182) ;; emerc
(bucket-183 183) ;; mercneric
(tfrag-st-l5-alpha 184) ;; tfrag
(bucket-185 185) ;; tie
(bucket-186 186) ;; tie
(tie-st-l5-alpha 185) ;; tie
(etie-st-l5-alpha 186) ;; tie
(tex-lcom-tfrag 187) ;; tex
(merc-lcom-tfrag 188) ;; merc
@@ -314,61 +314,61 @@
(merc-l0-water 253) ;; merc
(bucket-254 254) ;; mercneric
(tfrag-w-l0-water 255) ;; tfrag
(bucket-256 256)
(bucket-257 257)
(bucket-258 258)
(tie-w-l0-water 256)
(etie-w-l0-water 257)
(tie-sw-l0-water 258)
(tfrag-ws-l0-water 259) ;; tfrag
(bucket-260 260)
(etie-sw-l0-water 260)
(tex-l1-water 261) ;; tex
(merc-l1-water 262) ;; merc
(bucket-263 263) ;; mercneric
(tfrag-w-l1-water 264) ;; tfrag
(bucket-265 265)
(bucket-266 266)
(bucket-267 267)
(tie-w-l1-water 265)
(etie-w-l1-water 266)
(tie-sw-l1-water 267)
(tfrag-ws-l1-water 268) ;; tfrag
(bucket-269 269)
(etie-sw-l1-water 269)
(tex-l2-water 270) ;; tex
(merc-l2-water 271) ;; merc
(bucket-272 272) ;; mercneric
(tfrag-w-l2-water 273) ;; tfrag
(bucket-274 274)
(bucket-275 275)
(bucket-276 276)
(tie-w-l2-water 274)
(etie-w-l2-water 275)
(tie-sw-l2-water 276)
(tfrag-ws-l2-water 277) ;; tfrag
(bucket-278 278)
(tie-esw-l2-water 278)
(tex-l3-water 279) ;; tex
(merc-l3-water 280) ;; merc
(bucket-281 281) ;; mercneric
(tfrag-w-l3-water 282) ;; tfrag
(bucket-283 283)
(bucket-284 284)
(bucket-285 285)
(tie-w-l3-water 283)
(etie-w-l3-water 284)
(tie-sw-l3-water 285)
(tfrag-ws-l3-water 286) ;; tfrag
(bucket-287 287)
(etie-sw-l3-water 287)
(tex-l4-water 288) ;; tex
(merc-l4-water 289) ;; merc
(bucket-290 290) ;; mercneric
(tfrag-w-l4-water 291) ;; tfrag
(bucket-292 292)
(bucket-293 293)
(bucket-294 294)
(tie-w-l4-water 292)
(etie-w-l4-water 293)
(tie-sw-l4-water 294)
(tfrag-ws-l4-water 295) ;; tfrag
(bucket-296 296)
(etie-sw-l4-water 296)
(tex-l5-water 297) ;; tex
(merc-l5-water 298) ;; merc
(bucket-299 299) ;; mercneric
(tfrag-w-l5-water 300) ;; tfrag
(bucket-301 301)
(bucket-302 302)
(bucket-303 303)
(tie-w-l5-water 301)
(etie-w-l5-water 302)
(tie-sw-l5-water 303)
(tfrag-ws-l5-water 304) ;; tfrag
(bucket-305 305)
(etie-sw-l5-water 305)
(tex-lcom-water 306) ;; tex
(merc-lcom-water 307) ;; merc
@@ -397,6 +397,7 @@
(debug3 326)
)
(defenum vu1-renderer-mask
:type uint64
:bitfield #t
+54 -55
View File
@@ -192,61 +192,60 @@
)
(defun profile-tie-test ((arg0 bucket-id))
"Is this a tie bucket?"
(or (= arg0 (bucket-id bucket-9))
(= arg0 (bucket-id bucket-20))
(= arg0 (bucket-id bucket-31))
(= arg0 (bucket-id bucket-42))
(= arg0 (bucket-id bucket-53))
(= arg0 (bucket-id bucket-64))
(= arg0 (bucket-id bucket-10))
(= arg0 (bucket-id bucket-21))
(= arg0 (bucket-id bucket-32))
(= arg0 (bucket-id bucket-43))
(= arg0 (bucket-id bucket-54))
(= arg0 (bucket-id bucket-65))
(= arg0 (bucket-id bucket-12))
(= arg0 (bucket-id bucket-23))
(= arg0 (bucket-id bucket-34))
(= arg0 (bucket-id bucket-45))
(= arg0 (bucket-id bucket-56))
(= arg0 (bucket-id bucket-67))
(= arg0 (bucket-id bucket-13))
(= arg0 (bucket-id bucket-24))
(= arg0 (bucket-id bucket-35))
(= arg0 (bucket-id bucket-46))
(= arg0 (bucket-id bucket-57))
(= arg0 (bucket-id bucket-68))
(= arg0 (bucket-id bucket-17))
(= arg0 (bucket-id bucket-28))
(= arg0 (bucket-id bucket-39))
(= arg0 (bucket-id bucket-50))
(= arg0 (bucket-id bucket-61))
(= arg0 (bucket-id bucket-72))
(= arg0 (bucket-id bucket-129))
(= arg0 (bucket-id bucket-139))
(= arg0 (bucket-id bucket-149))
(= arg0 (bucket-id bucket-159))
(= arg0 (bucket-id bucket-169))
(= arg0 (bucket-id bucket-179))
(= arg0 (bucket-id bucket-130))
(= arg0 (bucket-id bucket-140))
(= arg0 (bucket-id bucket-150))
(= arg0 (bucket-id bucket-160))
(= arg0 (bucket-id bucket-170))
(= arg0 (bucket-id bucket-180))
(= arg0 (bucket-id bucket-135))
(= arg0 (bucket-id bucket-145))
(= arg0 (bucket-id bucket-155))
(= arg0 (bucket-id bucket-165))
(= arg0 (bucket-id bucket-175))
(= arg0 (bucket-id bucket-185))
(= arg0 (bucket-id bucket-136))
(= arg0 (bucket-id bucket-146))
(= arg0 (bucket-id bucket-156))
(= arg0 (bucket-id bucket-166))
(= arg0 (bucket-id bucket-176))
(= arg0 (bucket-id bucket-186))
(or (= arg0 (bucket-id tie-l0-tfrag))
(= arg0 (bucket-id tie-l1-tfrag))
(= arg0 (bucket-id tie-l2-tfrag))
(= arg0 (bucket-id tie-l3-tfrag))
(= arg0 (bucket-id tie-l4-tfrag))
(= arg0 (bucket-id tie-l5-tfrag))
(= arg0 (bucket-id etie-l0-tfrag))
(= arg0 (bucket-id etie-l1-tfrag))
(= arg0 (bucket-id etie-l2-tfrag))
(= arg0 (bucket-id etie-l3-tfrag))
(= arg0 (bucket-id etie-l4-tfrag))
(= arg0 (bucket-id etie-l5-tfrag))
(= arg0 (bucket-id tie-s-l0-tfrag))
(= arg0 (bucket-id tie-s-l1-tfrag))
(= arg0 (bucket-id tie-s-l2-tfrag))
(= arg0 (bucket-id tie-s-l3-tfrag))
(= arg0 (bucket-id tie-s-l4-tfrag))
(= arg0 (bucket-id tie-s-l5-tfrag))
(= arg0 (bucket-id etie-s-l0-tfrag))
(= arg0 (bucket-id etie-s-l1-tfrag))
(= arg0 (bucket-id etie-s-l2-tfrag))
(= arg0 (bucket-id etie-s-l3-tfrag))
(= arg0 (bucket-id etie-s-l4-tfrag))
(= arg0 (bucket-id etie-s-l5-tfrag))
(= arg0 (bucket-id tie-v-l0-tfrag))
(= arg0 (bucket-id tie-v-l1-tfrag))
(= arg0 (bucket-id tie-v-l2-tfrag))
(= arg0 (bucket-id tie-v-l3-tfrag))
(= arg0 (bucket-id tie-v-l4-tfrag))
(= arg0 (bucket-id tie-v-l5-tfrag))
(= arg0 (bucket-id tie-t-l0-alpha))
(= arg0 (bucket-id tie-t-l1-alpha))
(= arg0 (bucket-id tie-t-l2-alpha))
(= arg0 (bucket-id tie-t-l3-alpha))
(= arg0 (bucket-id tie-t-l4-alpha))
(= arg0 (bucket-id tie-t-l5-alpha))
(= arg0 (bucket-id etie-t-l0-alpha))
(= arg0 (bucket-id etie-t-l1-alpha))
(= arg0 (bucket-id etie-t-l2-alpha))
(= arg0 (bucket-id etie-t-l3-alpha))
(= arg0 (bucket-id etie-t-l4-alpha))
(= arg0 (bucket-id etie-t-l5-alpha))
(= arg0 (bucket-id tie-st-l0-alpha))
(= arg0 (bucket-id tie-st-l1-alpha))
(= arg0 (bucket-id tie-st-l2-alpha))
(= arg0 (bucket-id tie-st-l3-alpha))
(= arg0 (bucket-id tie-st-l4-alpha))
(= arg0 (bucket-id tie-st-l5-alpha))
(= arg0 (bucket-id etie-st-l0-alpha))
(= arg0 (bucket-id etie-st-l1-alpha))
(= arg0 (bucket-id etie-st-l2-alpha))
(= arg0 (bucket-id etie-st-l3-alpha))
(= arg0 (bucket-id etie-st-l4-alpha))
(= arg0 (bucket-id etie-st-l5-alpha))
)
)
+9 -9
View File
@@ -387,15 +387,15 @@
;; definition of type gs-adcmd
(deftype gs-adcmd (structure)
((word uint32 4 :offset-assert 0)
(quad uint128 :offset 0)
(data uint64 :offset 0)
(cmds uint64 :offset 8)
(cmd uint8 :offset 8)
(x uint32 :offset 0)
(y uint32 :offset 4)
(z uint32 :offset 8)
(w uint32 :offset 12)
((word uint32 4 :offset-assert 0)
(quad uint128 :offset 0)
(data uint64 :offset 0)
(cmds gs-reg64 :offset 8)
(cmd uint8 :offset 8)
(x uint32 :offset 0)
(y uint32 :offset 4)
(z uint32 :offset 8)
(w uint32 :offset 12)
)
:method-count-assert 9
:size-assert #x10
+943
View File
@@ -0,0 +1,943 @@
;;-*-Lisp-*-
(in-package goal)
;; definition for function edge-debug-lines
;; WARN: Return type mismatch symbol vs none.
(defun edge-debug-lines ((arg0 (array vector-array)))
(when (nonzero? arg0)
(dotimes (s5-0 (-> arg0 length))
(when (logtest? *display-strip-lines* (ash 1 s5-0))
(let ((s4-0 (-> arg0 s5-0)))
(dotimes (s3-0 (/ (-> s4-0 length) 2))
(add-debug-line
#t
(bucket-id debug-no-zbuf1)
(-> s4-0 data (* s3-0 2))
(-> s4-0 data (+ (* s3-0 2) 1))
(new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)
#f
(the-as rgba -1)
)
)
)
)
)
)
(none)
)
;; definition for function draw-drawable-tree-tfrag
;; WARN: Return type mismatch drawable-tree-tfrag vs none.
(defun draw-drawable-tree-tfrag ((arg0 drawable-tree-tfrag))
(local-vars (sv-16 int))
(when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask tfrag))
(let ((s5-0 (+ (-> arg0 length) -1)))
(when (nonzero? s5-0)
(dotimes (s4-0 s5-0)
(let* ((v1-8 (-> arg0 arrays s4-0))
(a0-4 (-> arg0 arrays (+ s4-0 1)))
(a1-1 (/ (-> (the-as drawable-inline-array-node v1-8) data 0 id) 8))
(a0-6 (/ (-> (the-as drawable-inline-array-node a0-4) data 0 id) 8))
(a1-3 (+ a1-1 #x38a0 #x70000000))
(a0-8 (+ a0-6 #x38a0 #x70000000))
)
(draw-node-cull
(the-as pointer a0-8)
(the-as pointer a1-3)
(the-as (inline-array draw-node) (&+ v1-8 32))
(-> v1-8 length)
)
)
)
)
(let* ((v1-14 (-> arg0 arrays s5-0))
(s4-1 (&+ v1-14 32))
(s3-0 (-> v1-14 length))
)
(set! sv-16 (+ (/ (-> s4-1 id) 8) #x38a0 #x70000000))
(let ((s5-1 (-> *display* frames (-> *display* on-screen) global-buf base)))
(let* ((s1-0 (-> *display* frames (-> *display* on-screen) global-buf))
(s2-0 (-> s1-0 base))
)
(set! (-> *tfrag-work* wait-to-spr) (the-as uint 0))
(set! (-> *tfrag-work* wait-from-spr) (the-as uint 0))
(set! (-> *tfrag-work* texture-dists) (the-as uint (-> *level* draw-level *draw-index* bsp tfrag-closest)))
(set! (-> *tfrag-work* last-call) (the-as uint 0))
(draw-inline-array-tfrag (the-as pointer sv-16) s4-1 s3-0 s1-0)
(set! (-> *level* draw-level *draw-index* tfrag-last-calls 0) (the-as int (-> *tfrag-work* last-call)))
(update-wait-stats
(-> *perf-stats* data 42)
(the-as uint 0)
(-> *tfrag-work* wait-to-spr)
(-> *tfrag-work* wait-from-spr)
)
(let ((a3-3 (-> s1-0 base)))
(let ((v1-46 (the-as dma-packet (-> s1-0 base))))
(set! (-> v1-46 dma) (new 'static 'dma-tag :id (dma-tag-id next)))
(set! (-> v1-46 vif0) (new 'static 'vif-tag))
(set! (-> v1-46 vif1) (new 'static 'vif-tag))
(set! (-> s1-0 base) (the-as pointer (&+ v1-46 16)))
)
(let ((t9-3 dma-bucket-insert-tag)
(a0-22 (-> *display* frames (-> *display* on-screen) bucket-group))
(v1-53 *draw-index*)
)
(t9-3
a0-22
(cond
((zero? v1-53)
(bucket-id tfrag-l0-tfrag)
)
((= v1-53 1)
(bucket-id tfrag-l1-tfrag)
)
((= v1-53 2)
(bucket-id tfrag-l2-tfrag)
)
((= v1-53 3)
(bucket-id tfrag-l3-tfrag)
)
((= v1-53 4)
(bucket-id tfrag-l4-tfrag)
)
(else
(bucket-id tfrag-l5-tfrag)
)
)
s2-0
(the-as (pointer dma-tag) a3-3)
)
)
)
)
(let* ((s1-1 (-> *display* frames (-> *display* on-screen) global-buf))
(s2-1 (-> s1-1 base))
)
(set! (-> *tfrag-work* near-wait-to-spr) (the-as uint 0))
(set! (-> *tfrag-work* near-wait-from-spr) (the-as uint 0))
(set! (-> *tfrag-work* last-call) (the-as uint 0))
(draw-inline-array-tfrag-scissor (the-as pointer sv-16) s4-1 s3-0 s1-1)
(set! (-> *level* draw-level *draw-index* tfrag-last-calls 1) (the-as int (-> *tfrag-work* last-call)))
(update-wait-stats
(-> *perf-stats* data 43)
(the-as uint 0)
(-> *tfrag-work* near-wait-to-spr)
(-> *tfrag-work* near-wait-from-spr)
)
(let ((a3-6 (-> s1-1 base)))
(let ((v1-70 (the-as dma-packet (-> s1-1 base))))
(set! (-> v1-70 dma) (new 'static 'dma-tag :id (dma-tag-id next)))
(set! (-> v1-70 vif0) (new 'static 'vif-tag))
(set! (-> v1-70 vif1) (new 'static 'vif-tag))
(set! (-> s1-1 base) (the-as pointer (&+ v1-70 16)))
)
(let ((t9-6 dma-bucket-insert-tag)
(a0-32 (-> *display* frames (-> *display* on-screen) bucket-group))
(v1-77 *draw-index*)
)
(t9-6
a0-32
(cond
((zero? v1-77)
(bucket-id tfrag-s-l0-tfrag)
)
((= v1-77 1)
(bucket-id tfrag-s-l1-tfrag)
)
((= v1-77 2)
(bucket-id tfrag-s-l2-tfrag)
)
((= v1-77 3)
(bucket-id tfrag-s-l3-tfrag)
)
((= v1-77 4)
(bucket-id tfrag-s-l4-tfrag)
)
(else
(bucket-id tfrag-s-l5-tfrag)
)
)
s2-1
(the-as (pointer dma-tag) a3-6)
)
)
)
)
(let ((v1-78 *dma-mem-usage*))
(when (nonzero? v1-78)
(set! (-> v1-78 length) (max 2 (-> v1-78 length)))
(set! (-> v1-78 data 1 name) "tfragment")
(+! (-> v1-78 data 1 count) 1)
(+! (-> v1-78 data 1 used)
(&- (-> *display* frames (-> *display* on-screen) global-buf base) (the-as uint s5-1))
)
(set! (-> v1-78 data 1 total) (-> v1-78 data 1 used))
)
)
)
)
)
)
(none)
)
;; definition for function draw-drawable-tree-tfrag-trans
;; WARN: Return type mismatch drawable-tree-tfrag vs none.
(defun draw-drawable-tree-tfrag-trans ((arg0 drawable-tree-tfrag))
(local-vars (sv-16 int))
(when (logtest? (vu1-renderer-mask tfrag-trans) (-> *display* vu1-enable-user))
(let ((s5-0 (+ (-> arg0 length) -1)))
(when (nonzero? s5-0)
(dotimes (s4-0 s5-0)
(let* ((v1-7 (-> arg0 arrays s4-0))
(a0-6 (-> arg0 arrays (+ s4-0 1)))
(a1-1 (/ (-> (the-as drawable-inline-array-node v1-7) data 0 id) 8))
(a0-8 (/ (-> (the-as drawable-inline-array-node a0-6) data 0 id) 8))
(a1-3 (+ a1-1 #x38a0 #x70000000))
(a0-10 (+ a0-8 #x38a0 #x70000000))
)
(draw-node-cull
(the-as pointer a0-10)
(the-as pointer a1-3)
(the-as (inline-array draw-node) (&+ v1-7 32))
(-> v1-7 length)
)
)
)
)
(let* ((v1-13 (-> arg0 arrays s5-0))
(s5-1 (&+ v1-13 32))
(s4-1 (-> v1-13 length))
)
(set! sv-16 (+ (/ (-> s5-1 id) 8) #x38a0 #x70000000))
(let* ((s2-0 (-> *display* frames (-> *display* on-screen) global-buf))
(s3-0 (-> s2-0 base))
)
(set! (-> *tfrag-work* wait-to-spr) (the-as uint 0))
(set! (-> *tfrag-work* wait-from-spr) (the-as uint 0))
(set! (-> *tfrag-work* texture-dists) (the-as uint (-> *level* draw-level *draw-index* bsp alpha-closest)))
(set! (-> *tfrag-work* last-call) (the-as uint 0))
(draw-inline-array-tfrag (the-as pointer sv-16) s5-1 s4-1 s2-0)
(set! (-> *level* draw-level *draw-index* tfrag-last-calls 2) (the-as int (-> *tfrag-work* last-call)))
(update-wait-stats
(-> *perf-stats* data 42)
(the-as uint 0)
(-> *tfrag-work* wait-to-spr)
(-> *tfrag-work* wait-from-spr)
)
(let ((a3-3 (-> s2-0 base)))
(let ((v1-39 (the-as dma-packet (-> s2-0 base))))
(set! (-> v1-39 dma) (new 'static 'dma-tag :id (dma-tag-id next)))
(set! (-> v1-39 vif0) (new 'static 'vif-tag))
(set! (-> v1-39 vif1) (new 'static 'vif-tag))
(set! (-> s2-0 base) (the-as pointer (&+ v1-39 16)))
)
(let ((t9-3 dma-bucket-insert-tag)
(a0-23 (-> *display* frames (-> *display* on-screen) bucket-group))
(v1-46 *draw-index*)
)
(t9-3
a0-23
(cond
((zero? v1-46)
(bucket-id tfrag-t-l0-alpha)
)
((= v1-46 1)
(bucket-id tfrag-t-l1-alpha)
)
((= v1-46 2)
(bucket-id tfrag-t-l2-alpha)
)
((= v1-46 3)
(bucket-id tfrag-t-l3-alpha)
)
((= v1-46 4)
(bucket-id tfrag-t-l4-alpha)
)
(else
(bucket-id tfrag-t-l5-alpha)
)
)
s3-0
(the-as (pointer dma-tag) a3-3)
)
)
)
)
(let* ((s2-1 (-> *display* frames (-> *display* on-screen) global-buf))
(s3-1 (-> s2-1 base))
)
(set! (-> *tfrag-work* near-wait-to-spr) (the-as uint 0))
(set! (-> *tfrag-work* near-wait-from-spr) (the-as uint 0))
(set! (-> *tfrag-work* last-call) (the-as uint 0))
(draw-inline-array-tfrag-scissor (the-as pointer sv-16) s5-1 s4-1 s2-1)
(set! (-> *level* draw-level *draw-index* tfrag-last-calls 3) (the-as int (-> *tfrag-work* last-call)))
(update-wait-stats
(-> *perf-stats* data 43)
(the-as uint 0)
(-> *tfrag-work* near-wait-to-spr)
(-> *tfrag-work* near-wait-from-spr)
)
(let ((a3-6 (-> s2-1 base)))
(let ((v1-63 (the-as dma-packet (-> s2-1 base))))
(set! (-> v1-63 dma) (new 'static 'dma-tag :id (dma-tag-id next)))
(set! (-> v1-63 vif0) (new 'static 'vif-tag))
(set! (-> v1-63 vif1) (new 'static 'vif-tag))
(set! (-> s2-1 base) (the-as pointer (&+ v1-63 16)))
)
(let ((t9-6 dma-bucket-insert-tag)
(a0-33 (-> *display* frames (-> *display* on-screen) bucket-group))
(v1-70 *draw-index*)
)
(t9-6
a0-33
(cond
((zero? v1-70)
(bucket-id tfrag-st-l0-alpha)
)
((= v1-70 1)
(bucket-id tfrag-st-l1-alpha)
)
((= v1-70 2)
(bucket-id tfrag-st-l2-alpha)
)
((= v1-70 3)
(bucket-id tfrag-st-l3-alpha)
)
((= v1-70 4)
(bucket-id tfrag-st-l4-alpha)
)
(else
(bucket-id tfrag-st-l5-alpha)
)
)
s3-1
(the-as (pointer dma-tag) a3-6)
)
)
)
)
)
)
)
(none)
)
;; definition for function draw-drawable-tree-tfrag-water
;; WARN: Return type mismatch drawable-tree-tfrag vs none.
(defun draw-drawable-tree-tfrag-water ((arg0 drawable-tree-tfrag))
(local-vars (sv-16 int))
(when (logtest? (vu1-renderer-mask tfrag-water) (-> *display* vu1-enable-user))
(let ((s5-0 (+ (-> arg0 length) -1)))
(when (nonzero? s5-0)
(dotimes (s4-0 s5-0)
(let* ((v1-7 (-> arg0 arrays s4-0))
(a0-6 (-> arg0 arrays (+ s4-0 1)))
(a1-1 (/ (-> (the-as drawable-inline-array-node v1-7) data 0 id) 8))
(a0-8 (/ (-> (the-as drawable-inline-array-node a0-6) data 0 id) 8))
(a1-3 (+ a1-1 #x38a0 #x70000000))
(a0-10 (+ a0-8 #x38a0 #x70000000))
)
(draw-node-cull
(the-as pointer a0-10)
(the-as pointer a1-3)
(the-as (inline-array draw-node) (&+ v1-7 32))
(-> v1-7 length)
)
)
)
)
(let* ((v1-13 (-> arg0 arrays s5-0))
(s5-1 (&+ v1-13 32))
(s4-1 (-> v1-13 length))
)
(set! sv-16 (+ (/ (-> s5-1 id) 8) #x38a0 #x70000000))
(let* ((s2-0 (-> *display* frames (-> *display* on-screen) global-buf))
(s3-0 (-> s2-0 base))
)
(set! (-> *tfrag-work* wait-to-spr) (the-as uint 0))
(set! (-> *tfrag-work* wait-from-spr) (the-as uint 0))
(set! (-> *tfrag-work* texture-dists) (the-as uint (-> *level* draw-level *draw-index* bsp water-closest)))
(set! (-> *tfrag-work* last-call) (the-as uint 0))
(draw-inline-array-tfrag (the-as pointer sv-16) s5-1 s4-1 s2-0)
(set! (-> *level* draw-level *draw-index* tfrag-last-calls 4) (the-as int (-> *tfrag-work* last-call)))
(update-wait-stats
(-> *perf-stats* data 42)
(the-as uint 0)
(-> *tfrag-work* wait-to-spr)
(-> *tfrag-work* wait-from-spr)
)
(let ((a3-3 (-> s2-0 base)))
(let ((v1-39 (the-as dma-packet (-> s2-0 base))))
(set! (-> v1-39 dma) (new 'static 'dma-tag :id (dma-tag-id next)))
(set! (-> v1-39 vif0) (new 'static 'vif-tag))
(set! (-> v1-39 vif1) (new 'static 'vif-tag))
(set! (-> s2-0 base) (the-as pointer (&+ v1-39 16)))
)
(let ((t9-3 dma-bucket-insert-tag)
(a0-23 (-> *display* frames (-> *display* on-screen) bucket-group))
(v1-46 *draw-index*)
)
(t9-3
a0-23
(cond
((zero? v1-46)
(bucket-id tfrag-w-l0-water)
)
((= v1-46 1)
(bucket-id tfrag-w-l1-water)
)
((= v1-46 2)
(bucket-id tfrag-w-l2-water)
)
((= v1-46 3)
(bucket-id tfrag-w-l3-water)
)
((= v1-46 4)
(bucket-id tfrag-w-l4-water)
)
(else
(bucket-id tfrag-w-l5-water)
)
)
s3-0
(the-as (pointer dma-tag) a3-3)
)
)
)
)
(let* ((s2-1 (-> *display* frames (-> *display* on-screen) global-buf))
(s3-1 (-> s2-1 base))
)
(set! (-> *tfrag-work* near-wait-to-spr) (the-as uint 0))
(set! (-> *tfrag-work* near-wait-from-spr) (the-as uint 0))
(set! (-> *tfrag-work* last-call) (the-as uint 0))
(draw-inline-array-tfrag-scissor (the-as pointer sv-16) s5-1 s4-1 s2-1)
(set! (-> *level* draw-level *draw-index* tfrag-last-calls 5) (the-as int (-> *tfrag-work* last-call)))
(update-wait-stats
(-> *perf-stats* data 43)
(the-as uint 0)
(-> *tfrag-work* near-wait-to-spr)
(-> *tfrag-work* near-wait-from-spr)
)
(let ((a3-6 (-> s2-1 base)))
(let ((v1-63 (the-as dma-packet (-> s2-1 base))))
(set! (-> v1-63 dma) (new 'static 'dma-tag :id (dma-tag-id next)))
(set! (-> v1-63 vif0) (new 'static 'vif-tag))
(set! (-> v1-63 vif1) (new 'static 'vif-tag))
(set! (-> s2-1 base) (the-as pointer (&+ v1-63 16)))
)
(let ((t9-6 dma-bucket-insert-tag)
(a0-33 (-> *display* frames (-> *display* on-screen) bucket-group))
(v1-70 *draw-index*)
)
(t9-6
a0-33
(cond
((zero? v1-70)
(bucket-id tfrag-ws-l0-water)
)
((= v1-70 1)
(bucket-id tfrag-ws-l1-water)
)
((= v1-70 2)
(bucket-id tfrag-ws-l2-water)
)
((= v1-70 3)
(bucket-id tfrag-ws-l3-water)
)
((= v1-70 4)
(bucket-id tfrag-ws-l4-water)
)
(else
(bucket-id tfrag-ws-l5-water)
)
)
s3-1
(the-as (pointer dma-tag) a3-6)
)
)
)
)
)
)
)
(none)
)
;; definition for function tfrag-vu1-init-buf
;; WARN: Return type mismatch pointer vs none.
(defun tfrag-vu1-init-buf ((arg0 bucket-id) (arg1 gs-test) (arg2 int) (arg3 uint) (arg4 symbol))
(let ((s4-0 (-> *display* frames (-> *display* on-screen) bucket-group arg0)))
(when (!= s4-0 (-> s4-0 last))
(let* ((s3-0 (-> *display* frames (-> *display* on-screen) global-buf))
(s2-1 (-> s3-0 base))
)
(tfrag-init-buffer s3-0 arg1 arg2 arg4)
(let ((v1-12 (the-as object (-> s3-0 base))))
(set! (-> (the-as dma-packet v1-12) dma) (new 'static 'dma-tag :id (dma-tag-id next) :addr (-> s4-0 next)))
(set! (-> (the-as dma-packet v1-12) vif0) (new 'static 'vif-tag))
(set! (-> (the-as dma-packet v1-12) vif1) (new 'static 'vif-tag))
(set! (-> s3-0 base) (the-as pointer (&+ (the-as dma-packet v1-12) 16)))
)
(set! (-> s4-0 next) (the-as uint s2-1))
)
)
)
(let ((s5-1 (-> *display* frames (-> *display* on-screen) bucket-group arg0)))
(when (!= s5-1 (-> s5-1 last))
(let* ((s3-1 (-> *display* frames (-> *display* on-screen) global-buf))
(s4-1 (-> s3-1 base))
)
(tfrag-end-buffer s3-1 (the-as int arg3))
(let ((v0-3 (-> s3-1 base)))
(let ((v1-26 (the-as object (-> s3-1 base))))
(set! (-> (the-as dma-packet v1-26) dma) (new 'static 'dma-tag :id (dma-tag-id next)))
(set! (-> (the-as dma-packet v1-26) vif0) (new 'static 'vif-tag))
(set! (-> (the-as dma-packet v1-26) vif1) (new 'static 'vif-tag))
(set! (-> s3-1 base) (&+ (the-as pointer v1-26) 16))
)
(set! (-> (the-as (pointer int32) (-> s5-1 last)) 1) (the-as int s4-1))
(set! (-> s5-1 last) (the-as (pointer dma-tag) v0-3))
)
)
)
)
(none)
)
;; definition for function tfrag-scissor-vu1-init-buf
;; WARN: Return type mismatch pointer vs none.
(defun tfrag-scissor-vu1-init-buf ((arg0 bucket-id) (arg1 gs-test) (arg2 int) (arg3 uint) (arg4 symbol))
(let ((s4-0 (-> *display* frames (-> *display* on-screen) bucket-group arg0)))
(when (!= s4-0 (-> s4-0 last))
(let* ((s3-0 (-> *display* frames (-> *display* on-screen) global-buf))
(s2-1 (-> s3-0 base))
)
(tfrag-scissor-init-buffer s3-0 arg1 arg2 arg4)
(let ((v1-12 (the-as object (-> s3-0 base))))
(set! (-> (the-as dma-packet v1-12) dma) (new 'static 'dma-tag :id (dma-tag-id next) :addr (-> s4-0 next)))
(set! (-> (the-as dma-packet v1-12) vif0) (new 'static 'vif-tag))
(set! (-> (the-as dma-packet v1-12) vif1) (new 'static 'vif-tag))
(set! (-> s3-0 base) (&+ (the-as pointer v1-12) 16))
)
(set! (-> s4-0 next) (the-as uint s2-1))
)
)
)
(let ((s5-1 (-> *display* frames (-> *display* on-screen) bucket-group arg0)))
(when (!= s5-1 (-> s5-1 last))
(let* ((s3-1 (-> *display* frames (-> *display* on-screen) global-buf))
(s4-1 (-> s3-1 base))
)
(tfrag-scissor-end-buffer s3-1 arg3)
(let ((v0-3 (-> s3-1 base)))
(let ((v1-26 (the-as object (-> s3-1 base))))
(set! (-> (the-as dma-packet v1-26) dma) (new 'static 'dma-tag :id (dma-tag-id next)))
(set! (-> (the-as dma-packet v1-26) vif0) (new 'static 'vif-tag))
(set! (-> (the-as dma-packet v1-26) vif1) (new 'static 'vif-tag))
(set! (-> s3-1 base) (&+ (the-as pointer v1-26) 16))
)
(set! (-> (the-as (pointer uint32) (-> s5-1 last)) 1) (the-as uint s4-1))
(set! (-> s5-1 last) (the-as (pointer dma-tag) v0-3))
)
)
)
)
(none)
)
;; definition of type tfrag-init-data
(deftype tfrag-init-data (structure)
((tfrag-bucket bucket-id :offset-assert 0)
(tfrag-scissor-bucket bucket-id :offset-assert 4)
(tfrag-trans-bucket bucket-id :offset-assert 8)
(tfrag-scissor-trans-bucket bucket-id :offset-assert 12)
(tfrag-water-bucket bucket-id :offset-assert 16)
(tfrag-water-scissor-bucket bucket-id :offset-assert 20)
)
:method-count-assert 9
:size-assert #x18
:flag-assert #x900000018
)
;; definition for method 3 of type tfrag-init-data
(defmethod inspect tfrag-init-data ((obj tfrag-init-data))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj 'tfrag-init-data)
(format #t "~1Ttfrag-bucket: ~D~%" (-> obj tfrag-bucket))
(format #t "~1Ttfrag-scissor-bucket: ~D~%" (-> obj tfrag-scissor-bucket))
(format #t "~1Ttfrag-trans-bucket: ~D~%" (-> obj tfrag-trans-bucket))
(format #t "~1Ttfrag-scissor-trans-bucket: ~D~%" (-> obj tfrag-scissor-trans-bucket))
(format #t "~1Ttfrag-water-bucket: ~D~%" (-> obj tfrag-water-bucket))
(format #t "~1Ttfrag-water-scissor-bucket: ~D~%" (-> obj tfrag-water-scissor-bucket))
(label cfg-4)
obj
)
;; definition for symbol *tfrag-init-table*, type (inline-array tfrag-init-data)
(define *tfrag-init-table* (new 'static 'inline-array tfrag-init-data 6
(new 'static 'tfrag-init-data
:tfrag-bucket (bucket-id tfrag-l0-tfrag)
:tfrag-scissor-bucket (bucket-id tfrag-s-l0-tfrag)
:tfrag-trans-bucket (bucket-id tfrag-t-l0-alpha)
:tfrag-scissor-trans-bucket (bucket-id tfrag-st-l0-alpha)
:tfrag-water-bucket (bucket-id tfrag-w-l0-water)
:tfrag-water-scissor-bucket (bucket-id tfrag-ws-l0-water)
)
(new 'static 'tfrag-init-data
:tfrag-bucket (bucket-id tfrag-l1-tfrag)
:tfrag-scissor-bucket (bucket-id tfrag-s-l1-tfrag)
:tfrag-trans-bucket (bucket-id tfrag-t-l1-alpha)
:tfrag-scissor-trans-bucket (bucket-id tfrag-st-l1-alpha)
:tfrag-water-bucket (bucket-id tfrag-w-l1-water)
:tfrag-water-scissor-bucket (bucket-id tfrag-ws-l1-water)
)
(new 'static 'tfrag-init-data
:tfrag-bucket (bucket-id tfrag-l2-tfrag)
:tfrag-scissor-bucket (bucket-id tfrag-s-l2-tfrag)
:tfrag-trans-bucket (bucket-id tfrag-t-l2-alpha)
:tfrag-scissor-trans-bucket (bucket-id tfrag-st-l2-alpha)
:tfrag-water-bucket (bucket-id tfrag-w-l2-water)
:tfrag-water-scissor-bucket (bucket-id tfrag-ws-l2-water)
)
(new 'static 'tfrag-init-data
:tfrag-bucket (bucket-id tfrag-l3-tfrag)
:tfrag-scissor-bucket (bucket-id tfrag-s-l3-tfrag)
:tfrag-trans-bucket (bucket-id tfrag-t-l3-alpha)
:tfrag-scissor-trans-bucket (bucket-id tfrag-st-l3-alpha)
:tfrag-water-bucket (bucket-id tfrag-w-l3-water)
:tfrag-water-scissor-bucket (bucket-id tfrag-ws-l3-water)
)
(new 'static 'tfrag-init-data
:tfrag-bucket (bucket-id tfrag-l4-tfrag)
:tfrag-scissor-bucket (bucket-id tfrag-s-l4-tfrag)
:tfrag-trans-bucket (bucket-id tfrag-t-l4-alpha)
:tfrag-scissor-trans-bucket (bucket-id tfrag-st-l4-alpha)
:tfrag-water-bucket (bucket-id tfrag-w-l4-water)
:tfrag-water-scissor-bucket (bucket-id tfrag-ws-l4-water)
)
(new 'static 'tfrag-init-data
:tfrag-bucket (bucket-id tfrag-l5-tfrag)
:tfrag-scissor-bucket (bucket-id tfrag-s-l5-tfrag)
:tfrag-trans-bucket (bucket-id tfrag-t-l5-alpha)
:tfrag-scissor-trans-bucket (bucket-id tfrag-st-l5-alpha)
:tfrag-water-bucket (bucket-id tfrag-w-l5-water)
:tfrag-water-scissor-bucket (bucket-id tfrag-ws-l5-water)
)
)
)
;; definition for function tfrag-vu1-init-buffers
;; WARN: Return type mismatch symbol vs none.
(defun tfrag-vu1-init-buffers ()
(dotimes (gp-0 6)
(let ((s5-0 (-> *level* draw-level gp-0))
(s4-0 (-> *tfrag-init-table* gp-0))
)
(when s5-0
(let ((s3-0 (-> s5-0 tfrag-gs-test)))
(tfrag-vu1-init-buf
(-> s4-0 tfrag-bucket)
s3-0
0
(-> s5-0 tfrag-last-calls-u32 0)
(-> s5-0 info use-camera-other)
)
(tfrag-scissor-vu1-init-buf
(-> s4-0 tfrag-scissor-bucket)
s3-0
0
(-> s5-0 tfrag-last-calls-u32 1)
(-> s5-0 info use-camera-other)
)
)
(tfrag-vu1-init-buf
(-> s4-0 tfrag-trans-bucket)
(new 'static 'gs-test
:ate #x1
:atst (gs-atest greater-equal)
:aref #x26
:afail #x1
:zte #x1
:ztst (gs-ztest greater-equal)
)
1
(-> s5-0 tfrag-last-calls-u32 2)
(-> s5-0 info use-camera-other)
)
(tfrag-scissor-vu1-init-buf
(-> s4-0 tfrag-scissor-trans-bucket)
(new 'static 'gs-test
:ate #x1
:atst (gs-atest greater-equal)
:aref #x26
:afail #x1
:zte #x1
:ztst (gs-ztest greater-equal)
)
1
(-> s5-0 tfrag-last-calls-u32 3)
(-> s5-0 info use-camera-other)
)
(tfrag-vu1-init-buf
(-> s4-0 tfrag-water-bucket)
(new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest greater-equal))
1
(-> s5-0 tfrag-last-calls-u32 4)
(-> s5-0 info use-camera-other)
)
(tfrag-scissor-vu1-init-buf
(-> s4-0 tfrag-water-scissor-bucket)
(new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest greater-equal))
1
(-> s5-0 tfrag-last-calls-u32 5)
(-> s5-0 info use-camera-other)
)
)
)
)
(none)
)
;; definition for method 10 of type drawable-tree-tfrag
;; WARN: Return type mismatch int vs none.
(defmethod draw drawable-tree-tfrag ((obj drawable-tree-tfrag) (arg0 drawable-tree-tfrag) (arg1 display-frame))
(let ((v1-1 (-> *background-work* tfrag-tree-count))
(a1-4 (-> *level* draw-level *draw-index*))
)
(set! (-> *background-work* tfrag-trees v1-1) obj)
(set! (-> *background-work* tfrag-levels v1-1) a1-4)
)
(+! (-> *background-work* tfrag-tree-count) 1)
0
(none)
)
;; definition for method 10 of type drawable-tree-tfrag-trans
;; WARN: Return type mismatch int vs none.
(defmethod draw drawable-tree-tfrag-trans ((obj drawable-tree-tfrag-trans) (arg0 drawable-tree-tfrag-trans) (arg1 display-frame))
(let ((v1-1 (-> *background-work* tfrag-trans-tree-count))
(a1-4 (-> *level* draw-level *draw-index*))
)
(set! (-> *background-work* tfrag-trans-trees v1-1) obj)
(set! (-> *background-work* tfrag-trans-levels v1-1) a1-4)
)
(+! (-> *background-work* tfrag-trans-tree-count) 1)
0
(none)
)
;; definition for method 10 of type drawable-tree-tfrag-water
;; WARN: Return type mismatch int vs none.
(defmethod draw drawable-tree-tfrag-water ((obj drawable-tree-tfrag-water) (arg0 drawable-tree-tfrag-water) (arg1 display-frame))
(let ((v1-1 (-> *background-work* tfrag-water-tree-count))
(a1-4 (-> *level* draw-level *draw-index*))
)
(set! (-> *background-work* tfrag-water-trees v1-1) obj)
(set! (-> *background-work* tfrag-water-levels v1-1) a1-4)
)
(+! (-> *background-work* tfrag-water-tree-count) 1)
0
(none)
)
;; definition for method 13 of type tfragment
;; WARN: Return type mismatch int vs none.
(defmethod collect-stats tfragment ((obj tfragment))
(stats-tfrag-asm obj)
0
(none)
)
;; definition for method 13 of type drawable-tree-tfrag
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod collect-stats drawable-tree-tfrag ((obj drawable-tree-tfrag))
(when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask tfrag))
(set! (-> *tfrag-work* vu1-enable-tfrag)
(the-as int (logand (-> *display* vu1-enable-user) (vu1-renderer-mask tfrag)))
)
(set! (-> *tfrag-work* vu1-enable-tfrag-scissor)
(the-as int (logand (-> *display* vu1-enable-user) (vu1-renderer-mask tfrag)))
)
(set! (-> *tfrag-work* tr-stat-tfrag) (-> *terrain-stats* tfrag))
(set! (-> *tfrag-work* tr-stat-tfrag-scissor) (-> *terrain-stats* tfrag-scissor))
(let ((v1-15 (-> *tfrag-work* frag-dists quad)))
(set! (-> *tfrag-work* frag-dists quad) v1-15)
)
(dotimes (s5-0 (-> obj length))
(collect-stats (-> obj arrays s5-0))
)
)
0
(none)
)
;; definition for method 13 of type drawable-tree-tfrag-trans
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod collect-stats drawable-tree-tfrag-trans ((obj drawable-tree-tfrag-trans))
(when (logtest? (vu1-renderer-mask tfrag-trans) (-> *display* vu1-enable-user))
(set! (-> *tfrag-work* vu1-enable-tfrag)
(the-as int (logand (vu1-renderer-mask tfrag-trans) (-> *display* vu1-enable-user)))
)
(set! (-> *tfrag-work* vu1-enable-tfrag-scissor)
(the-as int (logand (vu1-renderer-mask tfrag-trans) (-> *display* vu1-enable-user)))
)
(set! (-> *tfrag-work* tr-stat-tfrag) (-> *terrain-stats* tfrag-trans))
(set! (-> *tfrag-work* tr-stat-tfrag-scissor) (-> *terrain-stats* tfrag-scissor-trans))
(let ((v1-12 (-> *tfrag-work* frag-dists quad)))
(set! (-> *tfrag-work* frag-dists quad) v1-12)
)
(dotimes (s5-0 (-> obj length))
(collect-stats (-> obj arrays s5-0))
)
)
0
(none)
)
;; definition for method 13 of type drawable-tree-tfrag-water
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod collect-stats drawable-tree-tfrag-water ((obj drawable-tree-tfrag-water))
(when (logtest? (vu1-renderer-mask tfrag-water) (-> *display* vu1-enable-user))
(set! (-> *tfrag-work* vu1-enable-tfrag)
(the-as int (logand (vu1-renderer-mask tfrag-water) (-> *display* vu1-enable-user)))
)
(set! (-> *tfrag-work* vu1-enable-tfrag-scissor)
(the-as int (logand (vu1-renderer-mask tfrag-water) (-> *display* vu1-enable-user)))
)
(set! (-> *tfrag-work* tr-stat-tfrag) (-> *terrain-stats* tfrag-water))
(set! (-> *tfrag-work* tr-stat-tfrag-scissor) (-> *terrain-stats* tfrag-scissor-water))
(let ((v1-12 (-> *tfrag-work* frag-dists quad)))
(set! (-> *tfrag-work* frag-dists quad) v1-12)
)
(dotimes (s5-0 (-> obj length))
(collect-stats (-> obj arrays s5-0))
)
)
0
(none)
)
;; definition for method 13 of type drawable-inline-array-tfrag
;; WARN: Return type mismatch int vs none.
(defmethod collect-stats drawable-inline-array-tfrag ((obj drawable-inline-array-tfrag))
(when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask tfrag))
(dotimes (s5-0 (-> obj length))
(let ((s4-0 (-> obj data s5-0)))
(if (vis-cull (-> s4-0 id))
(collect-stats s4-0)
)
)
)
)
0
(none)
)
;; definition for method 13 of type drawable-inline-array-tfrag-trans
;; WARN: Return type mismatch int vs none.
(defmethod collect-stats drawable-inline-array-tfrag-trans ((obj drawable-inline-array-tfrag-trans))
(when (logtest? (vu1-renderer-mask tfrag-trans) (-> *display* vu1-enable-user))
(dotimes (s5-0 (-> obj length))
(let ((s4-0 (-> obj data s5-0)))
(if (vis-cull (-> s4-0 id))
(collect-stats s4-0)
)
)
)
)
0
(none)
)
;; definition for method 13 of type drawable-inline-array-tfrag-water
;; WARN: Return type mismatch int vs none.
(defmethod collect-stats drawable-inline-array-tfrag-water ((obj drawable-inline-array-tfrag-water))
(when (logtest? (vu1-renderer-mask tfrag-water) (-> *display* vu1-enable-user))
(dotimes (s5-0 (-> obj length))
(let ((s4-0 (-> obj data s5-0)))
(if (vis-cull (-> s4-0 id))
(collect-stats s4-0)
)
)
)
)
0
(none)
)
;; definition for method 14 of type drawable-tree-tfrag
;; WARN: Return type mismatch int vs none.
(defmethod debug-draw drawable-tree-tfrag ((obj drawable-tree-tfrag) (arg0 drawable) (arg1 display-frame))
(when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask tfrag))
(dotimes (s4-0 (-> obj length))
(let ((a1-1 (-> obj arrays s4-0)))
(debug-draw a1-1 a1-1 arg1)
)
)
)
0
(none)
)
;; definition for method 14 of type drawable-tree-tfrag-trans
;; WARN: Return type mismatch int vs none.
(defmethod debug-draw drawable-tree-tfrag-trans ((obj drawable-tree-tfrag-trans) (arg0 drawable) (arg1 display-frame))
(when (logtest? (vu1-renderer-mask tfrag-trans) (-> *display* vu1-enable-user))
(dotimes (s4-0 (-> obj length))
(let ((a1-1 (-> obj arrays s4-0)))
(debug-draw a1-1 a1-1 arg1)
)
)
)
0
(none)
)
;; definition for method 14 of type drawable-tree-tfrag-water
;; WARN: Return type mismatch int vs none.
(defmethod debug-draw drawable-tree-tfrag-water ((obj drawable-tree-tfrag-water) (arg0 drawable) (arg1 display-frame))
(when (logtest? (vu1-renderer-mask tfrag-water) (-> *display* vu1-enable-user))
(dotimes (s4-0 (-> obj length))
(let ((a1-1 (-> obj arrays s4-0)))
(debug-draw a1-1 a1-1 arg1)
)
)
)
0
(none)
)
;; definition for method 14 of type drawable-inline-array-tfrag
;; WARN: Return type mismatch int vs none.
(defmethod debug-draw drawable-inline-array-tfrag ((obj drawable-inline-array-tfrag) (arg0 drawable) (arg1 display-frame))
(dotimes (s4-0 (-> obj length))
(let ((s3-0 (-> obj data s4-0)))
(if (vis-cull (-> s3-0 id))
(debug-draw s3-0 s3-0 arg1)
)
)
)
0
(none)
)
;; definition for method 14 of type tfragment
;; WARN: Return type mismatch int vs none.
(defmethod debug-draw tfragment ((obj tfragment) (arg0 drawable) (arg1 display-frame))
(-> arg1 global-buf)
(edge-debug-lines (-> obj debug-data debug-lines))
0
(none)
)
+709
View File
@@ -0,0 +1,709 @@
;;-*-Lisp-*-
(in-package goal)
;; definition for method 9 of type tie-fragment
(defmethod login tie-fragment ((obj tie-fragment))
(let ((s5-0 (the-as adgif-shader (-> obj gif-ref)))
(s4-0 (/ (-> obj tex-count) (the-as uint 5)))
)
(dotimes (s3-0 (the-as int s4-0))
(let ((v1-1 (adgif-shader-login-no-remap s5-0)))
(when v1-1
(dotimes (a0-4 3)
(dotimes (a1-0 3)
(set! (-> (the-as (pointer int32) (+ (+ (* a0-4 16) (* a1-0 4)) (the-as int *texture-masks*))))
(logior (-> (the-as (pointer int32) (+ (* a1-0 4) (the-as int *texture-masks*) (* a0-4 16))) 0)
(-> (the-as (pointer int32) (+ (* a1-0 4) (the-as int v1-1) (* a0-4 16))) 15)
)
)
)
(set! (-> *texture-masks* data a0-4 dist)
(fmax (-> *texture-masks* data a0-4 dist) (-> v1-1 masks data a0-4 dist))
)
)
)
)
(when (= (-> s5-0 reg-4) 66)
(set! (-> s5-0 reg-4) (the-as uint 127))
(set! (-> s5-0 alpha) (new 'static 'gs-alpha))
0
)
(&+! s5-0 80)
)
)
obj
)
;; definition for method 3 of type drawable-inline-array-instance-tie
(defmethod inspect drawable-inline-array-instance-tie ((obj drawable-inline-array-instance-tie))
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~Tlength: ~D~%" (-> obj length))
(format #t "~Tdata[~D]: @ #x~X~%" (-> obj length) (-> obj data))
(dotimes (s5-0 (-> obj length))
(format #t "~T [~D] ~A~%" s5-0 (-> obj data s5-0))
)
obj
)
;; definition for method 5 of type drawable-inline-array-instance-tie
;; WARN: Return type mismatch uint vs int.
(defmethod asize-of drawable-inline-array-instance-tie ((obj drawable-inline-array-instance-tie))
(the-as int (+ (-> drawable-inline-array-instance-tie size) (* (+ (-> obj length) -1) 64)))
)
;; definition for method 9 of type drawable-tree-instance-tie
;; INFO: this function exists in multiple non-identical object files
(defmethod login drawable-tree-instance-tie ((obj drawable-tree-instance-tie))
obj
)
;; definition for method 9 of type drawable-tree-instance-tie
;; INFO: this function exists in multiple non-identical object files
(defmethod login drawable-tree-instance-tie ((obj drawable-tree-instance-tie))
(dotimes (s5-0 (-> obj length))
(login (-> obj data s5-0))
)
obj
)
;; definition for method 3 of type prototype-tie
(defmethod inspect prototype-tie ((obj prototype-tie))
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~Tlength: ~D~%" (-> obj length))
(format #t "~Tdata[~D]: @ #x~X~%" (-> obj length) (-> obj data))
(dotimes (s5-0 (-> obj length))
(format #t "~T [~D] ~A~%" s5-0 (-> obj data s5-0))
)
obj
)
;; definition for method 9 of type prototype-tie
(defmethod login prototype-tie ((obj prototype-tie))
(dotimes (s5-0 (-> obj length))
(login (-> obj data s5-0))
)
obj
)
;; definition for method 8 of type drawable-tree-instance-tie
(defmethod mem-usage drawable-tree-instance-tie ((obj drawable-tree-instance-tie) (arg0 memory-usage-block) (arg1 int))
(set! (-> arg0 length) (max 1 (-> arg0 length)))
(set! (-> arg0 data 0 name) (symbol->string 'drawable-group))
(+! (-> arg0 data 0 count) 1)
(let ((v1-7 32))
(+! (-> arg0 data 0 used) v1-7)
(+! (-> arg0 data 0 total) (logand -16 (+ v1-7 15)))
)
(dotimes (s3-0 (-> obj length))
(mem-usage (-> obj data s3-0) arg0 arg1)
)
(mem-usage (-> obj prototypes prototype-array-tie) arg0 (logior arg1 1))
obj
)
;; definition for method 8 of type tie-fragment
(defmethod mem-usage tie-fragment ((obj tie-fragment) (arg0 memory-usage-block) (arg1 int))
(when (logtest? arg1 2)
(let ((v1-3 (* (-> obj color-count) 4))
(a0-2 (cond
((logtest? arg1 4)
20
)
((logtest? arg1 8)
21
)
(else
22
)
)
)
)
(+! (-> arg0 data a0-2 count) 1)
(+! (-> arg0 data a0-2 used) v1-3)
(+! (-> arg0 data a0-2 total) (logand -4 (+ v1-3 3)))
)
(set! (-> arg0 length) (max 23 (-> arg0 length)))
(set! obj obj)
(goto cfg-13)
)
(set! (-> arg0 length) (max 18 (-> arg0 length)))
(set! (-> arg0 data 9 name) "tie-fragment")
(set! (-> arg0 data 10 name) "tie-gif")
(set! (-> arg0 data 11 name) "tie-points")
(set! (-> arg0 data 12 name) "tie-colors")
(set! (-> arg0 data 14 name) "tie-debug")
(set! (-> arg0 data 13 name) "tie-draw-points")
(set! (-> arg0 data 17 name) "tie-generic")
(+! (-> arg0 data 9 count) 1)
(let ((v1-21 (asize-of obj)))
(+! (-> arg0 data 9 used) v1-21)
(+! (-> arg0 data 9 total) (logand -16 (+ v1-21 15)))
)
(let ((v1-26 (* (-> obj gif-count) 16)))
(+! (-> arg0 data 10 count) (-> obj tex-count))
(+! (-> arg0 data 10 used) v1-26)
(+! (-> arg0 data 10 total) (logand -16 (+ v1-26 15)))
)
(let ((v1-31 (* (-> obj vertex-count) 16)))
(+! (-> arg0 data 11 count) (-> obj vertex-count))
(+! (-> arg0 data 11 used) v1-31)
(+! (-> arg0 data 11 total) (logand -16 (+ v1-31 15)))
)
(let ((v1-36 (* (-> obj dp-qwc) 16)))
(+! (-> arg0 data 13 count) (* (-> obj dp-qwc) 16))
(+! (-> arg0 data 13 used) v1-36)
(+! (-> arg0 data 13 total) (logand -16 (+ v1-36 15)))
)
(let ((v1-41 (* (-> obj generic-count) 16)))
(+! (-> arg0 data 17 count) 1)
(+! (-> arg0 data 17 used) v1-41)
(+! (-> arg0 data 17 total) (logand -16 (+ v1-41 15)))
)
(let ((s4-0 (-> obj debug debug-lines)))
(when (nonzero? s4-0)
(dotimes (s3-0 (-> s4-0 length))
(+! (-> arg0 data 14 count) (-> s4-0 s3-0 length))
(let ((v1-52 (asize-of (-> s4-0 s3-0))))
(+! (-> arg0 data 12 used) v1-52)
(+! (-> arg0 data 12 total) (logand -16 (+ v1-52 15)))
)
)
)
)
(label cfg-13)
obj
)
;; definition for method 8 of type instance-tie
(defmethod mem-usage instance-tie ((obj instance-tie) (arg0 memory-usage-block) (arg1 int))
(set! (-> arg0 length) (max 19 (-> arg0 length)))
(set! (-> arg0 data 18 name) "instance-tie")
(+! (-> arg0 data 18 count) 1)
(let ((v1-6 (asize-of obj)))
(+! (-> arg0 data 18 used) v1-6)
(+! (-> arg0 data 18 total) (logand -16 (+ v1-6 15)))
)
(when (nonzero? (-> obj color-indices))
(set! (-> arg0 length) (max 24 (-> arg0 length)))
(set! (-> arg0 data 23 name) "instance-tie-colors*")
(set! (-> arg0 data 19 name) "instance-tie-colors0")
(set! (-> arg0 data 20 name) "instance-tie-colors1")
(set! (-> arg0 data 21 name) "instance-tie-colors2")
(set! (-> arg0 data 22 name) "instance-tie-colors3")
(+! (-> arg0 data 23 count) 1)
(let ((s3-0 (-> obj bucket-ptr)))
(+ (-> arg0 data 19 used) (-> arg0 data 20 used) (-> arg0 data 21 used) (-> arg0 data 22 used))
(dotimes (s2-0 4)
(let ((a0-10 (-> s3-0 tie-geom s2-0)))
(when (nonzero? a0-10)
(let ((t9-1 (method-of-object a0-10 mem-usage))
(a1-2 arg0)
(v1-29 s2-0)
)
(t9-1 a0-10 a1-2 (logior (logior (cond
((= v1-29 1)
4
)
((= v1-29 2)
8
)
((= v1-29 3)
16
)
(else
0
)
)
2
)
arg1
)
)
)
)
)
)
)
)
obj
)
;; definition for method 8 of type drawable-inline-array-instance-tie
(defmethod mem-usage drawable-inline-array-instance-tie ((obj drawable-inline-array-instance-tie) (arg0 memory-usage-block) (arg1 int))
(set! (-> arg0 length) (max 1 (-> arg0 length)))
(set! (-> arg0 data 0 name) (symbol->string 'drawable-group))
(+! (-> arg0 data 0 count) 1)
(let ((v1-7 32))
(+! (-> arg0 data 0 used) v1-7)
(+! (-> arg0 data 0 total) (logand -16 (+ v1-7 15)))
)
(dotimes (s3-0 (-> obj length))
(mem-usage (-> obj data s3-0) arg0 arg1)
)
obj
)
;; definition for method 8 of type prototype-tie
(defmethod mem-usage prototype-tie ((obj prototype-tie) (arg0 memory-usage-block) (arg1 int))
(set! (-> arg0 length) (max 1 (-> arg0 length)))
(set! (-> arg0 data 0 name) (symbol->string 'drawable-group))
(+! (-> arg0 data 0 count) 1)
(let ((v1-7 32))
(+! (-> arg0 data 0 used) v1-7)
(+! (-> arg0 data 0 total) (logand -16 (+ v1-7 15)))
)
(dotimes (s3-0 (-> obj length))
(mem-usage (-> obj data s3-0) arg0 arg1)
)
obj
)
;; definition for method 5 of type prototype-tie
;; WARN: Return type mismatch uint vs int.
(defmethod asize-of prototype-tie ((obj prototype-tie))
(the-as int (+ (-> prototype-tie size) (* (+ (-> obj length) -1) 64)))
)
;; definition of type tie-consts
(deftype tie-consts (structure)
((data uint32 40 :offset 0)
(vector vector 10 :offset 0)
(quads uint128 10 :offset 0)
(adgif gs-gif-tag :inline :offset 0)
(strgif gs-gif-tag :inline :offset 16)
(extra vector :inline :offset 32)
(gifbufs vector :inline :offset 48)
(clrbufs qword :inline :offset 64)
(misc qword :inline :offset 80)
(atestgif gs-gif-tag :inline :offset 96)
(alpha gs-adcmd :inline :offset 112)
(atest gs-adcmd 2 :inline :offset 128)
(atest-tra gs-adcmd :inline :offset 128)
(atest-def gs-adcmd :inline :offset 144)
)
:method-count-assert 9
:size-assert #xa0
:flag-assert #x9000000a0
)
;; definition for method 3 of type tie-consts
(defmethod inspect tie-consts ((obj tie-consts))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj 'tie-consts)
(format #t "~1Tdata[40] @ #x~X~%" (-> obj adgif))
(format #t "~1Tvector[10] @ #x~X~%" (-> obj adgif))
(format #t "~1Tquads[10] @ #x~X~%" (-> obj adgif))
(format #t "~1Tadgif: #<qword @ #x~X>~%" (-> obj adgif))
(format #t "~1Tstrgif: #<qword @ #x~X>~%" (-> obj strgif))
(format #t "~1Textra: #<qword @ #x~X>~%" (-> obj extra))
(format #t "~1Tgifbufs: #<qword @ #x~X>~%" (-> obj gifbufs))
(format #t "~1Tclrbufs: #<qword @ #x~X>~%" (-> obj clrbufs))
(format #t "~1Tmisc: #<qword @ #x~X>~%" (-> obj misc))
(format #t "~1Tatestgif: #<qword @ #x~X>~%" (-> obj atestgif))
(format #t "~1Talpha: #<qword @ #x~X>~%" (-> obj alpha))
(format #t "~1Tatest[2] @ #x~X~%" (-> obj atest-tra))
(format #t "~1Tatest-tra: #<gs-adcmd @ #x~X>~%" (-> obj atest-tra))
(format #t "~1Tatest-def: #<gs-adcmd @ #x~X>~%" (-> obj atest-def))
(label cfg-4)
obj
)
;; definition for symbol tie-vu1-block, type vu-function
(define tie-vu1-block (new 'static 'vu-function :length #x3e7 :qlength #x1f4))
;; definition for function tie-init-consts
;; WARN: Return type mismatch int vs none.
(defun tie-init-consts ((arg0 tie-consts) (arg1 gs-alpha) (arg2 gs-test) (arg3 gs-test))
(set! (-> arg0 adgif tag) (new 'static 'gif-tag64 :nloop #x5 :nreg #x1))
(set! (-> arg0 adgif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d)))
(case *subdivide-draw-mode*
(((subdivide-setting textured))
(set! (-> arg0 strgif tag)
(new 'static 'gif-tag64
:pre #x1
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :fge #x1 :abe #x1)
:nreg #x3
)
)
)
(((subdivide-setting outline))
(set! (-> arg0 strgif tag)
(new 'static 'gif-tag64
:pre #x1
:prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1 :abe #x1)
:nreg #x3
)
)
)
(((subdivide-setting gouraud))
(set! (-> arg0 strgif tag)
(new 'static 'gif-tag64
:pre #x1
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :fge #x1 :abe #x1)
:nreg #x3
)
)
)
(((subdivide-setting hack))
(set! (-> arg0 strgif tag)
(new 'static 'gif-tag64
:pre #x1
:prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1 :abe #x1)
:nreg #x3
)
)
)
)
(set! (-> arg0 strgif regs)
(new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2))
)
(let ((f0-0 8388894.0)
(f1-0 8389078.0)
(f2-0 8389262.0)
)
(set! (-> arg0 gifbufs x) f2-0)
(set! (-> arg0 gifbufs y) f1-0)
(set! (-> arg0 gifbufs z) f2-0)
(set! (-> arg0 gifbufs w) f1-0)
(set! (-> arg0 extra x) (+ f0-0 f1-0 f2-0))
(set! (-> arg0 extra y) 0.0)
(set! (-> arg0 extra z) (+ f0-0 f1-0 f2-0))
)
(set! (-> arg0 clrbufs vector4w x) 198)
(set! (-> arg0 clrbufs vector4w y) 242)
(set! (-> arg0 clrbufs vector4w z) 198)
(set! (-> arg0 clrbufs vector4w w) 242)
(set! (-> arg0 atestgif tag) (new 'static 'gif-tag64 :nloop #x2 :eop #x1 :nreg #x1))
(set! (-> arg0 atestgif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d)))
(set! (-> arg0 alpha data) (the-as uint arg1))
(set! (-> arg0 alpha cmds) (gs-reg64 alpha-1))
(set! (-> arg0 atest-tra cmds) (gs-reg64 test-1))
(set! (-> arg0 atest-tra data) (the-as uint arg2))
(set! (-> arg0 atest-def cmds) (gs-reg64 test-1))
(set! (-> arg0 atest-def data) (the-as uint arg3))
(set! (-> arg0 misc vector4w x) 0)
(set! (-> arg0 misc vector4w y) -1)
(none)
)
;; definition for function tie-init-engine
;; WARN: Return type mismatch int vs none.
(defun tie-init-engine ((arg0 dma-buffer) (arg1 gs-alpha) (arg2 gs-test) (arg3 gs-test))
(dma-buffer-add-vu-function arg0 tie-vu1-block 1)
(let ((s5-0 10))
(let* ((v1-0 arg0)
(a0-2 (the-as dma-packet (-> v1-0 base)))
)
(set! (-> a0-2 dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc s5-0))
(set! (-> a0-2 vif0) (new 'static 'vif-tag :cmd (vif-cmd stmod)))
(set! (-> a0-2 vif1) (new 'static 'vif-tag :imm #x3c6 :cmd (vif-cmd unpack-v4-32) :num s5-0))
(set! (-> v1-0 base) (the-as pointer (&+ a0-2 16)))
)
(tie-init-consts (the-as tie-consts (-> arg0 base)) arg1 arg2 arg3)
(&+! (-> arg0 base) (* s5-0 16))
)
(let* ((v1-3 arg0)
(a0-6 (the-as dma-packet (-> v1-3 base)))
)
(set! (-> a0-6 dma) (new 'static 'dma-tag :id (dma-tag-id cnt)))
(set! (-> a0-6 vif0) (new 'static 'vif-tag :imm #x8 :cmd (vif-cmd mscalf) :msk #x1))
(set! (-> a0-6 vif1) (new 'static 'vif-tag :cmd (vif-cmd flusha) :msk #x1))
(set! (-> v1-3 base) (the-as pointer (&+ a0-6 16)))
)
(let* ((v1-4 arg0)
(a0-8 (the-as dma-packet (-> v1-4 base)))
)
(set! (-> a0-8 dma) (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt)))
(set! (-> a0-8 vif0) (new 'static 'vif-tag))
(set! (-> a0-8 vif1) (new 'static 'vif-tag :cmd (vif-cmd strow) :msk #x1))
(set! (-> v1-4 base) (the-as pointer (&+ a0-8 16)))
)
(let ((v1-5 (the-as object (-> arg0 base))))
(set! (-> (the-as vector v1-5) x) 8388608.0)
(set! (-> (the-as vector v1-5) y) 8388608.0)
(set! (-> (the-as vector v1-5) z) 8388608.0)
(set! (-> (the-as vector v1-5) w) 8388608.0)
(set! (-> (the-as (pointer vif-tag) v1-5) 4) (new 'static 'vif-tag :cmd (vif-cmd base)))
(set! (-> (the-as (pointer vif-tag) v1-5) 5) (new 'static 'vif-tag :imm #x2c :cmd (vif-cmd offset)))
(set! (-> (the-as (pointer vif-tag) v1-5) 6) (new 'static 'vif-tag :cmd (vif-cmd stmod)))
(set! (-> (the-as (pointer vif-tag) v1-5) 7) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)))
(set! (-> arg0 base) (&+ (the-as pointer v1-5) 32))
)
0
(none)
)
;; definition for function tie-end-buffer
;; WARN: Return type mismatch int vs none.
(defun tie-end-buffer ((arg0 dma-buffer))
(let* ((v1-0 arg0)
(a1-0 (the-as dma-packet (-> v1-0 base)))
)
(set! (-> a1-0 dma) (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt)))
(set! (-> a1-0 vif0) (new 'static 'vif-tag))
(set! (-> a1-0 vif1) (new 'static 'vif-tag :imm #x2 :cmd (vif-cmd direct) :msk #x1))
(set! (-> v1-0 base) (the-as pointer (&+ a1-0 16)))
)
(let* ((v1-1 arg0)
(a1-2 (the-as gs-gif-tag (-> v1-1 base)))
)
(set! (-> a1-2 tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1))
(set! (-> a1-2 regs) GIF_REGS_ALL_AD)
(set! (-> v1-1 base) (the-as pointer (&+ a1-2 16)))
)
(let* ((v1-2 arg0)
(a1-4 (-> v1-2 base))
)
(set! (-> (the-as (pointer gs-test) a1-4) 0) (new 'static 'gs-test :zte #x1 :ztst (gs-ztest greater-equal)))
(set! (-> (the-as (pointer gs-reg64) a1-4) 1) (gs-reg64 test-1))
(set! (-> v1-2 base) (&+ a1-4 16))
)
(let* ((v1-3 arg0)
(a1-6 (the-as dma-packet (-> v1-3 base)))
)
(set! (-> a1-6 dma) (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt)))
(set! (-> a1-6 vif0) (new 'static 'vif-tag :cmd (vif-cmd stmask)))
(set! (-> a1-6 vif1) (new 'static 'vif-tag))
(set! (-> v1-3 base) (the-as pointer (&+ a1-6 16)))
)
(let* ((v1-4 arg0)
(a0-1 (-> v1-4 base))
)
(set! (-> (the-as (pointer vif-tag) a0-1) 0) (new 'static 'vif-tag :imm #x4 :cmd (vif-cmd mscalf) :msk #x1))
(set! (-> (the-as (pointer vif-tag) a0-1) 1) (new 'static 'vif-tag :cmd (vif-cmd stmod)))
(set! (-> (the-as (pointer vif-tag) a0-1) 2) (new 'static 'vif-tag :cmd (vif-cmd flusha) :msk #x1))
(set! (-> (the-as (pointer vif-tag) a0-1) 3) (new 'static 'vif-tag :cmd (vif-cmd strow) :msk #x1))
(set! (-> (the-as (pointer int32) a0-1) 4) 0)
(set! (-> (the-as (pointer int32) a0-1) 5) 0)
(set! (-> (the-as (pointer int32) a0-1) 6) 0)
(set! (-> (the-as (pointer int32) a0-1) 7) 0)
(set! (-> v1-4 base) (&+ a0-1 32))
)
0
(none)
)
;; definition (debug) for function tie-int-reg
(defun-debug tie-int-reg ((arg0 int))
(let ((v1-0 arg0))
(cond
((zero? v1-0)
"zero"
)
((= v1-0 1)
"itemp"
)
((= v1-0 2)
"point-ptr"
)
((= v1-0 3)
"clr-ptr"
)
((= v1-0 4)
"target-bp1-ptr"
)
((= v1-0 5)
"skip-bp2"
)
((= v1-0 6)
"target-bp2-ptr"
)
((= v1-0 7)
"target-ip1-ptr"
)
((= v1-0 8)
"target-ip2-ptr"
)
((= v1-0 9)
"ind/ind0"
)
((= v1-0 10)
" ind1"
)
((= v1-0 11)
" ind2"
)
((= v1-0 12)
"dest-ptr"
)
((= v1-0 13)
"dest2-ptr"
)
((= v1-0 14)
"skip-ips"
)
((= v1-0 15)
"kick-addr"
)
)
)
)
;; definition (debug) for function tie-float-reg
(defun-debug tie-float-reg ((arg0 int))
(let ((v1-0 arg0))
(cond
((zero? v1-0)
"zero"
)
((= v1-0 1)
"t-mtx0"
)
((= v1-0 2)
"t-mtx1"
)
((= v1-0 3)
"t-mtx2"
)
((= v1-0 4)
"t-mtx3"
)
((= v1-0 5)
"vtx-0"
)
((= v1-0 6)
"vtx-1"
)
((= v1-0 7)
"vtx-2"
)
((= v1-0 8)
"vtx-3"
)
((= v1-0 9)
"pos-0/2"
)
((= v1-0 10)
"pos-1/3"
)
((= v1-0 11)
"clr-0"
)
((= v1-0 12)
"clr-1"
)
((= v1-0 13)
"clr-2"
)
((= v1-0 14)
"clr-3"
)
((= v1-0 15)
"tex-0"
)
((= v1-0 16)
"tex-1"
)
((= v1-0 17)
"tex-2"
)
((= v1-0 18)
"tex-3"
)
((= v1-0 19)
"res-0/2"
)
((= v1-0 20)
"res-1/3"
)
((= v1-0 21)
"gifbuf"
)
((= v1-0 22)
"clrbuf"
)
((= v1-0 23)
"extra"
)
((= v1-0 24)
"inds"
)
((= v1-0 25)
"--"
)
((= v1-0 26)
"--"
)
((= v1-0 27)
"morph"
)
((= v1-0 28)
"xyzofs"
)
((= v1-0 29)
"clr1"
)
((= v1-0 30)
"clr2"
)
((= v1-0 31)
"--"
)
)
)
)
;; definition (debug) for function tie-ints
;; INFO: Used lq/sq
;; WARN: Return type mismatch symbol vs none.
(defun-debug tie-ints ()
(local-vars (sv-16 uint))
(let ((gp-0 (+ #x3da0 #x1100c000)))
(dotimes (s5-0 16)
(if (< s5-0 10)
(format 0 " ")
)
(let ((s4-0 format)
(s3-0 0)
(s2-0 "vi~d: ~6d #x~4,'0X ~s~%")
(s1-0 s5-0)
(s0-0 (-> (the-as (pointer uint32) (+ gp-0 (* (* s5-0 4) 4))) 0))
)
(set! sv-16 (-> (the-as (pointer uint32) (+ gp-0 (* (* s5-0 4) 4))) 0))
(let ((t1-0 (tie-int-reg s5-0)))
(s4-0 s3-0 s2-0 s1-0 s0-0 sv-16 t1-0)
)
)
)
)
(none)
)
;; definition (debug) for function tie-floats
;; INFO: Used lq/sq
;; WARN: Return type mismatch symbol vs none.
(defun-debug tie-floats ()
(local-vars (sv-16 uint) (sv-32 uint))
(let ((gp-0 (the-as (pointer uint32) (+ #x3da0 #x1100c000))))
(dotimes (s5-0 32)
(if (< s5-0 10)
(format 0 " ")
)
(format
0
"vf~d: #x~8,'0X #x~8,'0X #x~8,'0X #x~8,'0X "
s5-0
(-> gp-0 (* s5-0 4))
(-> gp-0 (+ (* s5-0 4) 1))
(-> gp-0 (+ (* s5-0 4) 2))
(-> gp-0 (+ (* s5-0 4) 3))
)
(let ((s4-0 format)
(s3-0 0)
(s2-0 "~F ~F ~F ~F ~s~%")
(s1-0 (-> gp-0 (* s5-0 4)))
(s0-0 (-> gp-0 (+ (* s5-0 4) 1)))
)
(set! sv-16 (-> gp-0 (+ (* s5-0 4) 2)))
(set! sv-32 (-> gp-0 (+ (* s5-0 4) 3)))
(let ((t2-1 (tie-float-reg s5-0)))
(s4-0 s3-0 s2-0 s1-0 s0-0 sv-16 sv-32 t2-1)
)
)
)
)
(none)
)
+54 -54
View File
@@ -196,60 +196,60 @@
;; definition for function profile-tie-test
(defun profile-tie-test ((arg0 bucket-id))
(or (= arg0 (bucket-id bucket-9))
(= arg0 (bucket-id bucket-20))
(= arg0 (bucket-id bucket-31))
(= arg0 (bucket-id bucket-42))
(= arg0 (bucket-id bucket-53))
(= arg0 (bucket-id bucket-64))
(= arg0 (bucket-id bucket-10))
(= arg0 (bucket-id bucket-21))
(= arg0 (bucket-id bucket-32))
(= arg0 (bucket-id bucket-43))
(= arg0 (bucket-id bucket-54))
(= arg0 (bucket-id bucket-65))
(= arg0 (bucket-id bucket-12))
(= arg0 (bucket-id bucket-23))
(= arg0 (bucket-id bucket-34))
(= arg0 (bucket-id bucket-45))
(= arg0 (bucket-id bucket-56))
(= arg0 (bucket-id bucket-67))
(= arg0 (bucket-id bucket-13))
(= arg0 (bucket-id bucket-24))
(= arg0 (bucket-id bucket-35))
(= arg0 (bucket-id bucket-46))
(= arg0 (bucket-id bucket-57))
(= arg0 (bucket-id bucket-68))
(= arg0 (bucket-id bucket-17))
(= arg0 (bucket-id bucket-28))
(= arg0 (bucket-id bucket-39))
(= arg0 (bucket-id bucket-50))
(= arg0 (bucket-id bucket-61))
(= arg0 (bucket-id bucket-72))
(= arg0 (bucket-id bucket-129))
(= arg0 (bucket-id bucket-139))
(= arg0 (bucket-id bucket-149))
(= arg0 (bucket-id bucket-159))
(= arg0 (bucket-id bucket-169))
(= arg0 (bucket-id bucket-179))
(= arg0 (bucket-id bucket-130))
(= arg0 (bucket-id bucket-140))
(= arg0 (bucket-id bucket-150))
(= arg0 (bucket-id bucket-160))
(= arg0 (bucket-id bucket-170))
(= arg0 (bucket-id bucket-180))
(= arg0 (bucket-id bucket-135))
(= arg0 (bucket-id bucket-145))
(= arg0 (bucket-id bucket-155))
(= arg0 (bucket-id bucket-165))
(= arg0 (bucket-id bucket-175))
(= arg0 (bucket-id bucket-185))
(= arg0 (bucket-id bucket-136))
(= arg0 (bucket-id bucket-146))
(= arg0 (bucket-id bucket-156))
(= arg0 (bucket-id bucket-166))
(= arg0 (bucket-id bucket-176))
(= arg0 (bucket-id bucket-186))
(or (= arg0 (bucket-id tie-l0-tfrag))
(= arg0 (bucket-id tie-l1-tfrag))
(= arg0 (bucket-id tie-l2-tfrag))
(= arg0 (bucket-id tie-l3-tfrag))
(= arg0 (bucket-id tie-l4-tfrag))
(= arg0 (bucket-id tie-l5-tfrag))
(= arg0 (bucket-id etie-l0-tfrag))
(= arg0 (bucket-id etie-l1-tfrag))
(= arg0 (bucket-id etie-l2-tfrag))
(= arg0 (bucket-id etie-l3-tfrag))
(= arg0 (bucket-id etie-l4-tfrag))
(= arg0 (bucket-id etie-l5-tfrag))
(= arg0 (bucket-id tie-s-l0-tfrag))
(= arg0 (bucket-id tie-s-l1-tfrag))
(= arg0 (bucket-id tie-s-l2-tfrag))
(= arg0 (bucket-id tie-s-l3-tfrag))
(= arg0 (bucket-id tie-s-l4-tfrag))
(= arg0 (bucket-id tie-s-l5-tfrag))
(= arg0 (bucket-id etie-s-l0-tfrag))
(= arg0 (bucket-id etie-s-l1-tfrag))
(= arg0 (bucket-id etie-s-l2-tfrag))
(= arg0 (bucket-id etie-s-l3-tfrag))
(= arg0 (bucket-id etie-s-l4-tfrag))
(= arg0 (bucket-id etie-s-l5-tfrag))
(= arg0 (bucket-id tie-v-l0-tfrag))
(= arg0 (bucket-id tie-v-l1-tfrag))
(= arg0 (bucket-id tie-v-l2-tfrag))
(= arg0 (bucket-id tie-v-l3-tfrag))
(= arg0 (bucket-id tie-v-l4-tfrag))
(= arg0 (bucket-id tie-v-l5-tfrag))
(= arg0 (bucket-id tie-t-l0-alpha))
(= arg0 (bucket-id tie-t-l1-alpha))
(= arg0 (bucket-id tie-t-l2-alpha))
(= arg0 (bucket-id tie-t-l3-alpha))
(= arg0 (bucket-id tie-t-l4-alpha))
(= arg0 (bucket-id tie-t-l5-alpha))
(= arg0 (bucket-id etie-t-l0-alpha))
(= arg0 (bucket-id etie-t-l1-alpha))
(= arg0 (bucket-id etie-t-l2-alpha))
(= arg0 (bucket-id etie-t-l3-alpha))
(= arg0 (bucket-id etie-t-l4-alpha))
(= arg0 (bucket-id etie-t-l5-alpha))
(= arg0 (bucket-id tie-st-l0-alpha))
(= arg0 (bucket-id tie-st-l1-alpha))
(= arg0 (bucket-id tie-st-l2-alpha))
(= arg0 (bucket-id tie-st-l3-alpha))
(= arg0 (bucket-id tie-st-l4-alpha))
(= arg0 (bucket-id tie-st-l5-alpha))
(= arg0 (bucket-id etie-st-l0-alpha))
(= arg0 (bucket-id etie-st-l1-alpha))
(= arg0 (bucket-id etie-st-l2-alpha))
(= arg0 (bucket-id etie-st-l3-alpha))
(= arg0 (bucket-id etie-st-l4-alpha))
(= arg0 (bucket-id etie-st-l5-alpha))
)
)
+7
View File
@@ -72,6 +72,13 @@ TEST(VuDisasm, SpriteGlow_Jak2) {
EXPECT_EQ(disasm.to_string(prog), get_expected("jak2/sprite-glow"));
}
TEST(VuDisasm, Tie_Jak2) {
auto data = get_test_data("jak2/tie");
VuDisassembler disasm(VuDisassembler::VuKind::VU1);
auto prog = disasm.disassemble(data.data(), data.size() * 4, false);
EXPECT_EQ(disasm.to_string(prog), get_expected("jak2/tie"));
}
TEST(VuDisasm, SpriteDistort) {
auto data = get_test_data("sprite-distort");
VuDisassembler disasm(VuDisassembler::VuKind::VU1);
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+2
View File
@@ -155,6 +155,8 @@
"draw-prototype-inline-array-shrub",
"(method 9 drawable-tree-instance-tie)", // duplicate
"i-hopefully-will-never-exist-dont-add-anything-after-me-please"
],