[decomp] background and tfrag (#1909)

This commit is contained in:
water111
2022-09-24 14:30:44 -04:00
committed by GitHub
parent d00ebe5397
commit 80cefb9575
55 changed files with 3346 additions and 786 deletions
+338 -321
View File
@@ -2719,10 +2719,10 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(tex-l0-tfrag 7) ;; level 0 tex
(bucket-8 8) ;; tfrag
(tfrag-l0-tfrag 8) ;; tfrag
(bucket-9 9) ;; tie
(bucket-10 10) ;; tie
(bucket-11 11) ;; tfrag
(tfrag-s-l0-tfrag 11) ;; tfrag
(bucket-12 12) ;; tie
(bucket-13 13) ;; tie
(merc-l0-tfrag 14) ;; merc
@@ -2731,10 +2731,10 @@
(bucket-17 17) ;; tie
(tex-l1-tfrag 18) ;; tex
(bucket-19 19) ;; tfrag
(tfrag-l1-tfrag 19) ;; tfrag
(bucket-20 20) ;; tie
(bucket-21 21) ;; tie
(bucket-22 22) ;; tfrag
(tfrag-s-l1-tfrag 22) ;; tfrag
(bucket-23 23) ;; tie
(bucket-24 24) ;; tie
(merc-l1-tfrag 25) ;; merc
@@ -2743,10 +2743,10 @@
(bucket-28 28) ;; tie
(tex-l2-tfrag 29) ;; tex
(bucket-30 30) ;; tfrag
(tfrag-l2-tfrag 30) ;; tfrag
(bucket-31 31) ;; tie
(bucket-32 32) ;; tie
(bucket-33 33) ;; tfrag
(tfrag-s-l2-tfrag 33) ;; tfrag
(bucket-34 34) ;; tie
(bucket-35 35) ;; tie
(merc-l2-tfrag 36) ;; merc
@@ -2755,10 +2755,10 @@
(bucket-39 39) ;; tie
(tex-l3-tfrag 40) ;; tex
(bucket-41 41) ;; tfrag
(tfrag-l3-tfrag 41) ;; tfrag
(bucket-42 42) ;; tie
(bucket-43 43) ;; tie
(bucket-44 44) ;; tfrag
(tfrag-s-l3-tfrag 44) ;; tfrag
(bucket-45 45) ;; tie
(bucket-46 46) ;; tie
(merc-l3-tfrag 47) ;; merc
@@ -2767,10 +2767,10 @@
(bucket-50 50) ;; tie
(tex-l4-tfrag 51) ;; tex
(bucket-52 52) ;; tfrag
(tfrag-l4-tfrag 52) ;; tfrag
(bucket-53 53) ;; tie
(bucket-54 54) ;; tie
(bucket-55 55) ;; tfrag
(tfrag-s-l4-tfrag 55) ;; tfrag
(bucket-56 56) ;; tie
(bucket-57 57) ;; tie
(merc-l4-tfrag 58) ;; merc
@@ -2779,10 +2779,10 @@
(bucket-61 61) ;; tie
(tex-l5-tfrag 62) ;; tex
(bucket-63 63) ;; tfrag
(tfrag-l5-tfrag 63) ;; tfrag
(bucket-64 64) ;; tie
(bucket-65 65) ;; tie
(bucket-66 66) ;; tfrag
(tfrag-s-l5-tfrag 66) ;; tfrag
(bucket-67 67) ;; tie
(bucket-68 68) ;; tie
(merc-l5-tfrag 69) ;; merc
@@ -2794,299 +2794,299 @@
;; All levels with shrub tpage
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(tex-l0-shrub 73) ;; tex
(bucket-74 74) ;; shrub
(bucket-75 75) ;; shrub
(bucket-76 76) ;; shrub
(bucket-77 77) ;; shrub
(bucket-78 78) ;; shrub
(merc-l0-shrub 79) ;; merc
(emerc-l0-shrub 80) ;; emerc
(bucket-81 81) ;; mercneric
(tex-l0-shrub 73) ;; tex
(bucket-74 74) ;; shrub
(bucket-75 75) ;; shrub
(bucket-76 76) ;; shrub
(bucket-77 77) ;; shrub
(bucket-78 78) ;; shrub
(merc-l0-shrub 79) ;; merc
(emerc-l0-shrub 80) ;; emerc
(bucket-81 81) ;; mercneric
(tex-l1-shrub 82) ;; tex
(bucket-83 83) ;; shrub
(bucket-84 84) ;; shrub
(bucket-85 85) ;; shrub
(bucket-86 86) ;; shrub
(bucket-87 87) ;; shrub
(merc-l1-shrub 88) ;; merc
(emerc-l1-shrub 89) ;; emerc
(bucket-90 90) ;; mercneric
(tex-l1-shrub 82) ;; tex
(bucket-83 83) ;; shrub
(bucket-84 84) ;; shrub
(bucket-85 85) ;; shrub
(bucket-86 86) ;; shrub
(bucket-87 87) ;; shrub
(merc-l1-shrub 88) ;; merc
(emerc-l1-shrub 89) ;; emerc
(bucket-90 90) ;; mercneric
(tex-l2-shrub 91) ;; tex
(bucket-92 92) ;; shrub
(bucket-93 93) ;; shrub
(bucket-94 94) ;; shrub
(bucket-95 95) ;; shrub
(bucket-96 96) ;; shrub
(merc-l2-shrub 97) ;; merc
(emerc-l2-shrub 98) ;; emerc
(bucket-99 99) ;; mercneric
(tex-l2-shrub 91) ;; tex
(bucket-92 92) ;; shrub
(bucket-93 93) ;; shrub
(bucket-94 94) ;; shrub
(bucket-95 95) ;; shrub
(bucket-96 96) ;; shrub
(merc-l2-shrub 97) ;; merc
(emerc-l2-shrub 98) ;; emerc
(bucket-99 99) ;; mercneric
(tex-l3-shrub 100) ;; tex
(bucket-101 101) ;; shrub
(bucket-102 102) ;; shrub
(bucket-103 103) ;; shrub
(bucket-104 104) ;; shrub
(bucket-105 105) ;; shrub
(merc-l3-shrub 106) ;; merc
(emerc-l3-shrub 107) ;; emerc
(bucket-108 108) ;; mercneric
(tex-l3-shrub 100) ;; tex
(bucket-101 101) ;; shrub
(bucket-102 102) ;; shrub
(bucket-103 103) ;; shrub
(bucket-104 104) ;; shrub
(bucket-105 105) ;; shrub
(merc-l3-shrub 106) ;; merc
(emerc-l3-shrub 107) ;; emerc
(bucket-108 108) ;; mercneric
(tex-l4-shrub 109) ;; tex
(bucket-110 110) ;; shrub
(bucket-111 111) ;; shrub
(bucket-112 112) ;; shrub
(bucket-113 113) ;; shrub
(bucket-114 114) ;; shrub
(merc-l4-shrub 115) ;; merc
(emerc-l4-shrub 116) ;; emerc
(bucket-117 117) ;; mercneric
(tex-l4-shrub 109) ;; tex
(bucket-110 110) ;; shrub
(bucket-111 111) ;; shrub
(bucket-112 112) ;; shrub
(bucket-113 113) ;; shrub
(bucket-114 114) ;; shrub
(merc-l4-shrub 115) ;; merc
(emerc-l4-shrub 116) ;; emerc
(bucket-117 117) ;; mercneric
(tex-l5-shrub 118) ;; tex
(bucket-119 119) ;; shrub
(bucket-120 120) ;; shrub
(bucket-121 121) ;; shrub
(bucket-122 122) ;; shrub
(bucket-123 123) ;; shrub
(merc-l5-shrub 124) ;; merc
(emerc-l5-shrub 125) ;; emerc
(bucket-126 126) ;; mercneric
(tex-l5-shrub 118) ;; tex
(bucket-119 119) ;; shrub
(bucket-120 120) ;; shrub
(bucket-121 121) ;; shrub
(bucket-122 122) ;; shrub
(bucket-123 123) ;; shrub
(merc-l5-shrub 124) ;; merc
(emerc-l5-shrub 125) ;; emerc
(bucket-126 126) ;; mercneric
(tex-l0-alpha 127) ;; tex
(bucket-128 128) ;; tfrag
(bucket-129 129) ;; tie
(bucket-130 130) ;; tie
(merc-l0-alpha 131) ;; merc
(emerc-l0-alpha 132) ;; emerc
(bucket-133 133) ;; mercneric
(bucket-134 134) ;; tfrag
(bucket-135 135) ;; tie
(bucket-136 136) ;; tie
(tex-l0-alpha 127) ;; tex
(tfrag-t-l0-alpha 128) ;; tfrag
(bucket-129 129) ;; tie
(bucket-130 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
(tex-l1-alpha 137) ;; tex
(bucket-138 138) ;; tfrag
(bucket-139 139) ;; tie
(bucket-140 140) ;; tie
(merc-l1-alpha 141) ;; merc
(emerc-l1-alpha 142) ;; emerc
(bucket-143 143) ;; mercneric
(bucket-144 144) ;; tfrag
(bucket-145 145) ;; tie
(bucket-146 146) ;; tie
(tex-l1-alpha 137) ;; tex
(tfrag-t-l1-alpha 138) ;; tfrag
(bucket-139 139) ;; tie
(bucket-140 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
(tex-l2-alpha 147) ;; tex
(bucket-148 148) ;; tfrag
(bucket-149 149) ;; tie
(bucket-150 150) ;; tie
(merc-l2-alpha 151) ;; merc
(emerc-l2-alpha 152) ;; emerc
(bucket-153 153) ;; mercneric
(bucket-154 154) ;; tfrag
(bucket-155 155) ;; tie
(bucket-156 156) ;; tie
(tex-l2-alpha 147) ;; tex
(tfrag-t-l2-alpha 148) ;; tfrag
(bucket-149 149) ;; tie
(bucket-150 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
(tex-l3-alpha 157) ;; tex
(bucket-158 158) ;; tfrag
(bucket-159 159) ;; tie
(bucket-160 160) ;; tie
(merc-l3-alpha 161) ;; merc
(emerc-l3-alpha 162) ;; emerc
(bucket-163 163) ;; mercneric
(bucket-164 164) ;; tfrag
(bucket-165 165) ;; tie
(bucket-166 166) ;; tie
(tex-l3-alpha 157) ;; tex
(tfrag-t-l3-alpha 158) ;; tfrag
(bucket-159 159) ;; tie
(bucket-160 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
(tex-l4-alpha 167) ;; tex
(bucket-168 168) ;; tfrag
(bucket-169 169) ;; tie
(bucket-170 170) ;; tie
(merc-l4-alpha 171) ;; merc
(emerc-l4-alpha 172) ;; emerc
(bucket-173 173) ;; mercneric
(bucket-174 174) ;; tfrag
(bucket-175 175) ;; tie
(bucket-176 176) ;; tie
(tex-l4-alpha 167) ;; tex
(tfrag-t-l4-alpha 168) ;; tfrag
(bucket-169 169) ;; tie
(bucket-170 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
(tex-l5-alpha 177) ;; tex
(bucket-178 178) ;; tfrag
(bucket-179 179) ;; tie
(bucket-180 180) ;; tie
(merc-l5-alpha 181) ;; merc
(emerc-l5-alpha 182) ;; emerc
(bucket-183 183) ;; mercneric
(bucket-184 184) ;; tfrag
(bucket-185 185) ;; tie
(bucket-186 186) ;; tie
(tex-l5-alpha 177) ;; tex
(tfrag-t-l5-alpha 178) ;; tfrag
(bucket-179 179) ;; tie
(bucket-180 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
(tex-lcom-tfrag 187) ;; tex
(merc-lcom-tfrag 188) ;; merc
(emerc-lcom-tfrag 189) ;; emerc
(bucket-190 190) ;; mercneric
(tex-lcom-tfrag 187) ;; tex
(merc-lcom-tfrag 188) ;; merc
(emerc-lcom-tfrag 189) ;; emerc
(bucket-190 190) ;; mercneric
(tex-lcom-shrub 191) ;; tex
(merc-lcom-shrub 192) ;; merc
(emerc-lcom-shrub 193) ;; emerc
(bucket-194 194) ;; mercneric
(tex-lcom-shrub 191) ;; tex
(merc-lcom-shrub 192) ;; merc
(emerc-lcom-shrub 193) ;; emerc
(bucket-194 194) ;; mercneric
(bucket-195 195) ;; shadow
(bucket-195 195) ;; shadow
(tex-l0-pris 196) ;; tex
(merc-l0-pris 197) ;; merc
(emerc-l0-pris 198) ;; emerc
(bucket-199 199) ;; mercneric
(tex-l0-pris 196) ;; tex
(merc-l0-pris 197) ;; merc
(emerc-l0-pris 198) ;; emerc
(bucket-199 199) ;; mercneric
(tex-l1-pris 200) ;; tex
(merc-l1-pris 201) ;; merc
(emerc-l1-pris 202) ;; emerc
(bucket-203 203) ;; mercneric
(tex-l1-pris 200) ;; tex
(merc-l1-pris 201) ;; merc
(emerc-l1-pris 202) ;; emerc
(bucket-203 203) ;; mercneric
(tex-l2-pris 204) ;; tex
(merc-l2-pris 205) ;; merc
(emerc-l2-pris 206) ;; emerc
(bucket-207 207) ;; mercneric
(tex-l2-pris 204) ;; tex
(merc-l2-pris 205) ;; merc
(emerc-l2-pris 206) ;; emerc
(bucket-207 207) ;; mercneric
(tex-l3-pris 208) ;; tex
(merc-l3-pris 209) ;; merc
(emerc-l3-pris 210) ;; emerc
(bucket-211 211) ;; mercneric
(tex-l3-pris 208) ;; tex
(merc-l3-pris 209) ;; merc
(emerc-l3-pris 210) ;; emerc
(bucket-211 211) ;; mercneric
(tex-l4-pris 212) ;; tex
(merc-l4-pris 213) ;; merc
(emerc-l4-pris 214) ;; emerc
(bucket-215 215) ;; mercneric
(tex-l4-pris 212) ;; tex
(merc-l4-pris 213) ;; merc
(emerc-l4-pris 214) ;; emerc
(bucket-215 215) ;; mercneric
(tex-l5-pris 216) ;; tex
(merc-l5-pris 217) ;; merc
(emerc-l5-pris 218) ;; emerc
(bucket-219 219) ;; mercneric
(tex-l5-pris 216) ;; tex
(merc-l5-pris 217) ;; merc
(emerc-l5-pris 218) ;; emerc
(bucket-219 219) ;; mercneric
(tex-lcom-pris 220) ;; tex
(merc-lcom-pris 221) ;; merc
(emerc-lcom-pris 222) ;; emerc
(bucket-223 223) ;; mercneric
(tex-lcom-pris 220) ;; tex
(merc-lcom-pris 221) ;; merc
(emerc-lcom-pris 222) ;; emerc
(bucket-223 223) ;; mercneric
(tex-l0-pris2 224) ;; tex
(merc-l0-pris2 225) ;; merc
(emerc-l0-pris2 226) ;; emerc
(bucket-227 227) ;; mercneric
(tex-l0-pris2 224) ;; tex
(merc-l0-pris2 225) ;; merc
(emerc-l0-pris2 226) ;; emerc
(bucket-227 227) ;; mercneric
(tex-l1-pris2 228) ;; tex
(merc-l1-pris2 229) ;; merc
(emerc-l1-pris2 230) ;; emerc
(bucket-231 231) ;; mercneric
(tex-l1-pris2 228) ;; tex
(merc-l1-pris2 229) ;; merc
(emerc-l1-pris2 230) ;; emerc
(bucket-231 231) ;; mercneric
(tex-l2-pris2 232) ;; tex
(merc-l2-pris2 233) ;; merc
(emerc-l2-pris2 234) ;; emerc
(bucket-235 235) ;; mercneric
(tex-l2-pris2 232) ;; tex
(merc-l2-pris2 233) ;; merc
(emerc-l2-pris2 234) ;; emerc
(bucket-235 235) ;; mercneric
(tex-l3-pris2 236) ;; tex
(merc-l3-pris2 237) ;; merc
(emerc-l3-pris2 238) ;; emerc
(bucket-239 239) ;; mercneric
(tex-l3-pris2 236) ;; tex
(merc-l3-pris2 237) ;; merc
(emerc-l3-pris2 238) ;; emerc
(bucket-239 239) ;; mercneric
(tex-l4-pris2 240) ;; tex
(merc-l4-pris2 241) ;; merc
(emerc-l4-pris2 242) ;; emerc
(bucket-243 243) ;; mercneric
(tex-l4-pris2 240) ;; tex
(merc-l4-pris2 241) ;; merc
(emerc-l4-pris2 242) ;; emerc
(bucket-243 243) ;; mercneric
(tex-l5-pris2 244) ;; tex
(merc-l5-pris2 245) ;; merc
(emerc-l5-pris2 246) ;; emerc
(bucket-247 247) ;; mercneric
(tex-l5-pris2 244) ;; tex
(merc-l5-pris2 245) ;; merc
(emerc-l5-pris2 246) ;; emerc
(bucket-247 247) ;; mercneric
(tex-lcom-pris2 248) ;; tex
(merc-lcom-pris2 249) ;; merc
(emerc-lcom-pris2 250) ;; emerc
(bucket-251 251) ;; mercneric
(tex-lcom-pris2 248) ;; tex
(merc-lcom-pris2 249) ;; merc
(emerc-lcom-pris2 250) ;; emerc
(bucket-251 251) ;; mercneric
(tex-l0-water 252) ;; tex
(merc-l0-water 253) ;; merc
(bucket-254 254) ;; mercneric
(bucket-255 255) ;; tfrag
(bucket-256 256)
(bucket-257 257)
(bucket-258 258)
(bucket-259 259) ;; tfrag
(bucket-260 260)
(tex-l0-water 252) ;; tex
(merc-l0-water 253) ;; merc
(bucket-254 254) ;; mercneric
(tfrag-w-l0-water 255) ;; tfrag
(bucket-256 256)
(bucket-257 257)
(bucket-258 258)
(tfrag-ws-l0-water 259) ;; tfrag
(bucket-260 260)
(tex-l1-water 261) ;; tex
(merc-l1-water 262) ;; merc
(bucket-263 263) ;; mercneric
(bucket-264 264) ;; tfrag
(bucket-265 265)
(bucket-266 266)
(bucket-267 267)
(bucket-268 268) ;; tfrag
(bucket-269 269)
(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)
(tfrag-ws-l1-water 268) ;; tfrag
(bucket-269 269)
(tex-l2-water 270) ;; tex
(merc-l2-water 271) ;; merc
(bucket-272 272) ;; mercneric
(bucket-273 273) ;; tfrag
(bucket-274 274)
(bucket-275 275)
(bucket-276 276)
(bucket-277 277) ;; tfrag
(bucket-278 278)
(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)
(tfrag-ws-l2-water 277) ;; tfrag
(bucket-278 278)
(tex-l3-water 279) ;; tex
(merc-l3-water 280) ;; merc
(bucket-281 281) ;; mercneric
(bucket-282 282) ;; tfrag
(bucket-283 283)
(bucket-284 284)
(bucket-285 285)
(bucket-286 286) ;; tfrag
(bucket-287 287)
(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)
(tfrag-ws-l3-water 286) ;; tfrag
(bucket-287 287)
(tex-l4-water 288) ;; tex
(merc-l4-water 289) ;; merc
(bucket-290 290) ;; mercneric
(bucket-291 291) ;; tfrag
(bucket-292 292)
(bucket-293 293)
(bucket-294 294)
(bucket-295 295) ;; tfrag
(bucket-296 296)
(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)
(tfrag-ws-l4-water 295) ;; tfrag
(bucket-296 296)
(tex-l5-water 297) ;; tex
(merc-l5-water 298) ;; merc
(bucket-299 299) ;; mercneric
(bucket-300 300) ;; tfrag
(bucket-301 301)
(bucket-302 302)
(bucket-303 303)
(bucket-304 304) ;; tfrag
(bucket-305 305)
(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)
(tfrag-ws-l5-water 304) ;; tfrag
(bucket-305 305)
(tex-lcom-water 306) ;; tex
(merc-lcom-water 307) ;; merc
(bucket-308 308) ;; mercneric
(tex-lcom-water 306) ;; tex
(merc-lcom-water 307) ;; merc
(bucket-308 308) ;; mercneric
(tex-lcom-sky-post 309)
(tex-lcom-sky-post 309)
(bucket-310 310) ;; ocean
(bucket-311 311) ;; depth-cue
(bucket-310 310) ;; ocean
(bucket-311 311) ;; depth-cue
(tex-all-sprite 312)
(bucket-313 313) ;; particles
(bucket-314 314) ;; shadow
(bucket-315 315) ;; effects
(tex-all-warp 316) ;; tex
(bucket-317 317) ;; mercneric
(tex-all-sprite 312)
(bucket-313 313) ;; particles
(bucket-314 314) ;; shadow
(bucket-315 315) ;; effects
(tex-all-warp 316) ;; tex
(bucket-317 317) ;; mercneric
(debug-no-zbuf1 318) ;; debug, no zbuf
(tex-all-map 319) ;; tex
(bucket-320 320) ;; hud
(screen-filter 321) ;; hud letterbox, no zbuf
(bucket-322 322) ;; hud
(bucket-323 323) ;; hud
(debug2 324) ;; debug
(debug-no-zbuf2 325) ;; debug
(debug3 326)
(debug-no-zbuf1 318) ;; debug, no zbuf
(tex-all-map 319) ;; tex
(bucket-320 320) ;; hud
(screen-filter 321) ;; hud letterbox, no zbuf
(bucket-322 322) ;; hud
(bucket-323 323) ;; hud
(debug2 324) ;; debug
(debug-no-zbuf2 325) ;; debug
(debug3 326)
)
;; TODO - names in `render` menu
@@ -3099,7 +3099,7 @@
(rn3)
(rn4)
(rn5)
(rn6)
(tfrag)
(rn7)
(rn8)
(rn9)
@@ -3112,12 +3112,12 @@
(rn16)
(rn17)
(rn18)
(rn19)
(tfrag-trans)
(rn20)
(rn21)
(rn22)
(rn23)
(rn24)
(tfrag-water)
(rn25)
(rn26)
(rn27)
@@ -4855,7 +4855,7 @@
(deftype texture-mask (structure)
((mask vector4w :inline :offset-assert 0)
(dist float :offset 12)
(dist float :offset 12 :score 1)
(long uint64 2 :offset 0)
(quad uint128 :offset 0)
)
@@ -5899,6 +5899,7 @@
(water-masks texture-masks-array :offset-assert 5064)
(water-dists pointer :offset-assert 5068)
(tfrag-last-calls int32 6 :offset-assert 5072)
(tfrag-last-calls-u32 uint32 6 :offset 5072) ;; added
(texture-anim-array texture-anim-array 10 :offset-assert 5096)
(light-hash light-hash :offset-assert 5136)
(draw-priority float :offset-assert 5140)
@@ -7479,6 +7480,14 @@
(defenum mem-usage-id
:bitfield #f
:type uint32
(tfragment 1)
(tfragment-base 2)
(tfragment-common 3)
(tfragment-level0 4)
(tfragment-level1 5)
(tfragment-color 6)
(tfragment-debug 7)
(entity 43)
(camera 44)
@@ -8022,7 +8031,7 @@
(draw (_type_ _type_ display-frame) none 10)
(drawable-method-11 () none 11) ;; (collide-with-box (_type_ int collide-list) none 11)
(drawable-method-12 () none 12) ;; (collide-y-probe (_type_ int collide-list) none 12)
(collect-stats (_type_) none 13)
(collect-stats (_type_) none 13) ;; (collide-ray (_type_ int collide-list) none 13)
(debug-draw (_type_ drawable display-frame) none 14)
(unpack-vis (_type_ (pointer int8) (pointer int8)) (pointer int8) 15) ;;
(collect-regions (_type_ sphere int region-prim-list) none 16)
@@ -17000,17 +17009,26 @@
(collide-hash collide-hash :offset-assert 196)
;; 200 is some array
;; 204 is maybe that array's length
(wind-array-length int32 :offset 204)
;; 216 is a vector array
;; (vec-array (pointer vector) :offset 216) ; TODO see - `update-visible` hits assertion
(region-tree drawable-tree-region-prim :offset 252)
(tfrag-masks texture-masks-array :offset-assert 256)
(tfrag-mask-count uint32 :offset-assert 260)
(tfrag-closest (pointer float) :offset-assert 260)
(tfrag-mask-count uint32 :offset 260)
(shrub-masks texture-masks-array :offset-assert 264)
(shrub-mask-count uint32 :offset-assert 268)
(shrub-closest (pointer float) :offset-assert 268)
(shrub-mask-count uint32 :offset 268)
(alpha-masks texture-masks-array :offset-assert 272)
(alpha-mask-count uint32 :offset-assert 276)
(alpha-closest (pointer float) :offset-assert 276)
(alpha-mask-count uint32 :offset 276)
(water-masks texture-masks-array :offset-assert 280)
(water-mask-count uint32 :offset-assert 284)
(water-closest (pointer float) :offset-assert 284)
(water-mask-count uint32 :offset 284)
(bsp-scale vector :inline :offset-assert 288)
(bsp-offset vector :inline :offset-assert 304)
@@ -17852,6 +17870,7 @@
(dma-base uint32 :offset 36)
(dma-level-1 uint32 :offset 40)
(dma-qwc uint8 4 :offset 44) ;; guessed by decompiler
(dma-u32 uint32 :offset 44) ;; added
(shader (inline-array adgif-shader) :offset 48) ;; guessed by decompiler
(num-shaders uint8 :offset 52)
(num-base-colors uint8 :offset 53)
@@ -21785,7 +21804,7 @@
(define-extern update-wind (function wind-work (array uint8) none))
;; (define-extern wind-get-hashed-index function) ;; (function vector int)
;; (define-extern level-update-wind function)
(define-extern level-update-wind (function wind-work none))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; bsp ;;
@@ -22615,7 +22634,7 @@
(define-extern *generic-consts* generic-consts)
;; (define-extern generic-work-init function) ;; (function generic-dma-foreground-sink none)
;; (define-extern generic-upload-vu0 function) ;; (function none)
;; (define-extern upload-vu0-program function) ;; (function vu-function pointer none)
(define-extern upload-vu0-program (function vu-function pointer none))
;; (define-extern generic-initialize-without-sync function)
;; (define-extern generic-initialize function) ;; (function generic-dma-foreground-sink matrix vu-lights none)
;; (define-extern generic-wrapup function) ;; (function generic-dma-foreground-sink none)
@@ -22960,20 +22979,20 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define-extern *background-work* background-work)
;; (define-extern background-vu0-block object) ;; vu-function
;; (define-extern background-upload-vu0 function) ;; (function none)
(define-extern background-vu0-block vu-function)
(define-extern background-upload-vu0 (function none))
(define-extern init-background (function none))
;; (define-extern upload-vis-bits function) ;; (function level level bsp-header none)
;; (define-extern set-background-regs! function)
;; (define-extern set-tie-quard-planes! function)
;; (define-extern set-shrub-quard-planes! function)
(define-extern upload-vis-bits (function level level bsp-header none))
(define-extern set-background-regs! (function level none))
(define-extern set-tie-quard-planes! (function level none))
(define-extern set-shrub-quard-planes! (function level none))
(define-extern finish-background (function none))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; draw-node ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; (define-extern draw-node-cull function) ;; (function pointer pointer (inline-array draw-node) int none)
(define-extern draw-node-cull (function pointer pointer (inline-array draw-node) int none))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; shrubbery ;;
@@ -23026,56 +23045,54 @@
;; tfrag-near ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; (define-extern tnear-vu1-block object) ;; vu-function
;; (define-extern tfrag-details function) ;; (function tfragment none)
;; (define-extern clip-restore function) ;; (function none)
(define-extern tnear-vu1-block vu-function)
(define-extern tfrag-details (function tfragment none))
(define-extern clip-restore (function none))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; tfrag ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; (define-extern *tfrag-display-stats* object) ;; symbol
;; (define-extern tfrag-vu1-block object) ;; vu-function
;; (define-extern tfrag-data-setup function) ;; (function tfrag-data int none)
;; (define-extern add-tfrag-mtx-0 function) ;; (function dma-buffer none)
;; (define-extern add-tfrag-mtx-1 function) ;; (function dma-buffer none)
;; (define-extern add-tfrag-data function) ;; (function dma-buffer int none)
;; (define-extern t-stat object) ;; tfrag-stats
;; (define-extern tfrag-print-stats function) ;; (function symbol none)
;; (define-extern tfrag-init-buffer function) ;; (function dma-buffer gs-test int none)
;; (define-extern tfrag-end-buffer function) ;; (function dma-buffer none)
;; (define-extern draw-inline-array-tfrag function) ;; (function pointer drawable-inline-array int dma-buffer none)
;; (define-extern tfrag-scissor-init-buffer function)
;; (define-extern tfrag-scissor-end-buffer function)
;; (define-extern draw-inline-array-tfrag-scissor function)
;; (define-extern stats-tfrag-asm function) ;; (function tfragment none)
(define-extern *tfrag-display-stats* symbol)
(define-extern tfrag-vu1-block vu-function)
(define-extern tfrag-data-setup (function tfrag-data int int none))
(define-extern add-tfrag-mtx-0 (function dma-buffer symbol none))
(define-extern add-tfrag-mtx-1 (function dma-buffer symbol none))
(define-extern add-tfrag-data (function dma-buffer int int none))
(define-extern t-stat tfrag-stats)
(define-extern tfrag-print-stats (function symbol none))
(define-extern tfrag-init-buffer (function dma-buffer gs-test int symbol none))
(define-extern tfrag-end-buffer (function dma-buffer int none))
(define-extern draw-inline-array-tfrag (function pointer drawable-inline-array int dma-buffer none))
(define-extern tfrag-scissor-init-buffer (function dma-buffer gs-test int symbol none))
(define-extern tfrag-scissor-end-buffer (function dma-buffer uint none))
(define-extern draw-inline-array-tfrag-scissor (function pointer drawable-inline-array int dma-buffer none))
(define-extern stats-tfrag-asm (function tfragment none))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; tfrag-methods ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#|
(deftype tfrag-init-data (structure)
((tfrag-bucket int32 :offset-assert 0)
(tfrag-scissor-bucket int32 :offset-assert 4)
(tfrag-trans-bucket int32 :offset-assert 8)
(tfrag-scissor-trans-bucket int32 :offset-assert 12)
(tfrag-water-bucket int32 :offset-assert 16)
(tfrag-water-scissor-bucket int32 :offset-assert 20)
((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
)
|#
;; (define-extern edge-debug-lines function) ;; (function (array vector-array) none)
;; (define-extern draw-drawable-tree-tfrag function) ;; (function drawable-tree-tfrag none)
;; (define-extern draw-drawable-tree-tfrag-trans function)
;; (define-extern draw-drawable-tree-tfrag-water function)
;; (define-extern tfrag-vu1-init-buf function)
;; (define-extern tfrag-scissor-vu1-init-buf function)
;; (define-extern *tfrag-init-table* object)
(define-extern edge-debug-lines (function (array vector-array) none))
(define-extern draw-drawable-tree-tfrag (function drawable-tree-tfrag none))
(define-extern draw-drawable-tree-tfrag-trans (function drawable-tree-tfrag none))
(define-extern draw-drawable-tree-tfrag-water (function drawable-tree-tfrag none))
(define-extern tfrag-vu1-init-buf (function bucket-id gs-test int uint symbol none))
(define-extern tfrag-scissor-vu1-init-buf (function bucket-id gs-test int uint symbol none))
(define-extern *tfrag-init-table* (inline-array tfrag-init-data))
(define-extern tfrag-vu1-init-buffers (function none))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -23276,7 +23293,7 @@
;; (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)
(define-extern tie-scissor-make-perspective-matrix (function object object none))
;; (define-extern tie-near-int-reg function) ;; (function int string)
;; (define-extern tie-near-float-reg function) ;; (function int string)
@@ -23336,7 +23353,7 @@
;; (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 draw-drawable-tree-instance-tie function) ;; (function drawable-tree-instance-tie level none)
(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)
@@ -24736,8 +24753,8 @@
(define-extern init-time-of-day (function object :behavior time-of-day-proc)) ;;
(define-extern start-time-of-day (function (pointer process)))
(define-extern time-of-day-setup (function symbol symbol))
;; (define-extern time-of-day-interp-colors function) ;; (function (pointer rgba) uint mood-context none)
;; (define-extern time-of-day-interp-colors-scratch function) ;; (function (pointer rgba) time-of-day-palette mood-context none)
(define-extern time-of-day-interp-colors (function (pointer rgba) uint mood-context none))
(define-extern time-of-day-interp-colors-scratch (function (pointer rgba) time-of-day-palette mood-context none))
(define-extern init-time-of-day-context (function time-of-day-context symbol))
(define-extern set-filter-color! (function float float float none))
(define-extern tod-madd! (function vector vector vector float))
+3 -1
View File
@@ -278,7 +278,9 @@
"draw-actor-marks": [8],
"find-nearest-entity": [7, 9, 10, 11, 12, 13, 14],
"start-perf-stat-collection": [26],
"end-perf-stat-collection": [0]
"end-perf-stat-collection": [0],
"upload-vis-bits": [2, 6, 3, 0],
"set-background-regs!":[4, 3]
},
// Sometimes the game might use format strings that are fetched dynamically,
+9 -5
View File
@@ -12,10 +12,10 @@
"CGO/KERNEL.CGO",
"CGO/ENGINE.CGO",
"CGO/GAME.CGO",
"CGO/COMMON.CGO" // ,
"CGO/COMMON.CGO",
// "DGO/LWIDEB.DGO",
// "DGO/LMEETBRT.DGO",
// "DGO/CTA.DGO",
"DGO/CTA.DGO",
// "DGO/PALOUT.DGO",
// "DGO/STD.DGO",
// "DGO/FOR.DGO",
@@ -63,7 +63,7 @@
// "DGO/LTRNTESS.DGO",
// "DGO/TBO.DGO",
// "DGO/THR.DGO",
// "DGO/PRI.DGO",
"DGO/PRI.DGO",
// "DGO/LKIDDOGE.DGO",
// "DGO/NESTT.DGO",
// "DGO/LWIDEC.DGO",
@@ -148,7 +148,7 @@
// "DGO/UNB.DGO",
// "DGO/CPO.DGO",
// "DGO/CAP.DGO",
// "DGO/CWI.DGO",
"DGO/CWI.DGO"
// "DGO/CTYKORA.DGO",
// "DGO/RUI.DGO",
// "DGO/LSACK.DGO",
@@ -184,5 +184,9 @@
"streamed_audio_file_names": [],
"levels_to_extract": []
"levels_to_extract": [
"PRI.DGO",
"CTA.DGO",
"CWI.DGO"
]
}
+1
View File
@@ -189,5 +189,6 @@
["L896", "(pointer uint64)", 1],
["L897", "(pointer uint64)", 1]
],
"tfrag-methods": [["L119", "(inline-array tfrag-init-data)", 6]],
"nav-mesh": [["L347", "(inline-array vector)", 2]]
}
+78 -1
View File
@@ -1563,7 +1563,7 @@
],
"(method 9 shrubbery)": [
[23, "a2", "(pointer int32)"],
[28, "a3", "(inline-array texture-masks)"]
[28, "a3", "(pointer int32)"]
],
"init-dma-test": [[29, "v1", "(inline-array qword)"]],
"drawable-load": [[[25, 28], "s5", "drawable"]],
@@ -2309,6 +2309,12 @@
[123, "a1", "drawable-tree-instance-shrub"],
[[129, 133], "a2", "(inline-array prototype-bucket-shrub)"]
],
"(method 10 bsp-header)": [
[43, "a1", "terrain-context"],
[31, "a0", "terrain-context"]
],
"history-draw": [
[151, "a0", "uint"],
["_stack_", 24, "pat-surface"]
@@ -2321,6 +2327,77 @@
[[42, 46], "t2", "(pointer int8)"]
],
"(method 14 drawable-tree-array)": [[11, "s5", "drawable-tree-array"]],
"upload-vis-bits": [
[14, "a1", "(pointer uint128)"]
],
"set-background-regs!": [
[42, "v1", "(pointer int32)"],
[47, "v1", "(pointer int32)"],
[45, "a0", "(pointer int32)"]
],
"finish-background": [
[752, "t0", "(pointer float)"],
[785, "t4", "(pointer int32)"],
[815, "t0", "(pointer float)"],
[848, "t4", "(pointer int32)"],
[878, "t0", "(pointer float)"],
[911, "t4", "(pointer int32)"],
[941, "a3", "(pointer float)"],
[974, "t3", "(pointer int32)"]
],
"(method 16 drawable-inline-array-node)": [
[[1,7], "v1", "draw-node"]
],
"(method 9 tfragment)": [
[27, "a3", "(pointer int32)"],
[32, "t0", "texture"]
],
"add-tfrag-mtx-0": [
[[3, 17], "a0", "dma-packet"]
],
"add-tfrag-mtx-1": [
[[3, 17], "a0", "dma-packet"]
],
"add-tfrag-data": [
[[3, 17], "a0", "dma-packet"],
[[24, 31], "v1", "dma-packet"]
],
"tfrag-init-buffer": [
[[10, 17], "a0", "dma-packet"],
[[19, 26], "a0", "gs-gif-tag"],
[31, "a0", "(pointer gs-reg64)"],
[[47, 55], "v1", "dma-packet"]
],
"tfrag-end-buffer": [
[[1, 8], "a2", "dma-packet"],
[[11, 18], "a0", "(pointer vif-tag)"],
[[18, 22], "a0", "(pointer int32)"],
[[23, 29], "a0", "(pointer vif-tag)"]
],
"draw-drawable-tree-tfrag": [
[17, "v1", "drawable-inline-array-node"],
[19, "a0", "drawable-inline-array-node"],
[[104, 110], "v1", "dma-packet"],
[[183, 189], "v1", "dma-packet"]
],
"draw-drawable-tree-tfrag-trans": [
[18, "v1", "drawable-inline-array-node"],
[20, "a0", "drawable-inline-array-node"],
[[176, 182], "v1", "dma-packet"],
[[97, 103], "v1", "dma-packet"]
],
"draw-drawable-tree-tfrag-water": [
[18, "v1", "drawable-inline-array-node"],
[20, "a0", "drawable-inline-array-node"],
[[176, 182], "v1", "dma-packet"],
[[97, 103], "v1", "dma-packet"]
],
"tfrag-vu1-init-buf": [
[[27, 35], "v1", "dma-packet"],
[[61, 66], "v1", "dma-packet"],
[69, "v1", "(pointer int32)"]
],
// placeholder
"placeholder-do-not-add-below": []
}
+1 -1
View File
@@ -99,7 +99,7 @@
////////////////////////////
// turn this on to extract level background graphics data
"levels_extract": false,
"levels_extract": true,
// turn this on if you want extracted levels to be saved out as .obj files
"rip_levels": false,
// should we extract collision meshes?
+8 -5
View File
@@ -1355,7 +1355,6 @@ void DrawableTreeInstanceShrub::read_from_file(TypedRef ref,
word.symbol_name() == "collide-hash-fragment") {
done = true;
} else {
fmt::print("unknown next thing: {}\n", word.symbol_name());
ASSERT(word.symbol_name() == "draw-node" || word.symbol_name() == "instance-shrubbery");
}
}
@@ -1779,10 +1778,14 @@ std::unique_ptr<DrawableTree> make_drawable_tree(TypedRef ref,
return tree;
}
if (ref.type->get_name() == "drawable-tree-instance-shrub") {
auto tree = std::make_unique<shrub_types::DrawableTreeInstanceShrub>();
tree->read_from_file(ref, dts, stats, version);
return tree;
if (version == GameVersion::Jak2) {
lg::warn("skipping drawable-tree-instance-shrub reading for jak 2");
} else {
if (ref.type->get_name() == "drawable-tree-instance-shrub") {
auto tree = std::make_unique<shrub_types::DrawableTreeInstanceShrub>();
tree->read_from_file(ref, dts, stats, version);
return tree;
}
}
if (ref.type->get_name() == "drawable-tree-collide-fragment") {
+13 -5
View File
@@ -100,6 +100,10 @@ void extract_art_groups_from_level(const ObjectFileDB& db,
const std::vector<level_tools::TextureRemap>& tex_remap,
const std::string& dgo_name,
tfrag3::Level& level_data) {
if (db.version() == GameVersion::Jak2) {
lg::warn("skipping art group extraction for jak 2");
return;
}
const auto& files = db.obj_files_by_dgo.at(dgo_name);
for (const auto& file : files) {
if (file.name.length() > 3 && !file.name.compare(file.name.length() - 3, 3, "-ag")) {
@@ -171,11 +175,15 @@ std::vector<level_tools::TextureRemap> extract_bsp_from_level(const ObjectFileDB
extract_tie(as_tie_tree, fmt::format("{}-{}-tie", dgo_name, i++),
bsp_header.texture_remap_table, tex_db, level_data, false);
} else if (draw_tree->my_type() == "drawable-tree-instance-shrub") {
auto as_shrub_tree =
dynamic_cast<level_tools::shrub_types::DrawableTreeInstanceShrub*>(draw_tree.get());
ASSERT(as_shrub_tree);
extract_shrub(as_shrub_tree, fmt::format("{}-{}-shrub", dgo_name, i++),
bsp_header.texture_remap_table, tex_db, {}, level_data, false);
if (db.version() == GameVersion::Jak2) {
lg::warn("skipping drawable-tree-instance-shrub extraction for jak 2");
} else {
auto as_shrub_tree =
dynamic_cast<level_tools::shrub_types::DrawableTreeInstanceShrub*>(draw_tree.get());
ASSERT(as_shrub_tree);
extract_shrub(as_shrub_tree, fmt::format("{}-{}-shrub", dgo_name, i++),
bsp_header.texture_remap_table, tex_db, {}, level_data, false);
}
} else if (draw_tree->my_type() == "drawable-tree-collide-fragment" && extract_collision) {
auto as_collide_frags =
dynamic_cast<level_tools::DrawableTreeCollideFragment*>(draw_tree.get());
+6 -3
View File
@@ -6,6 +6,9 @@
#include "decompiler/ObjectFile/LinkedObjectFile.h"
// Jak 2 notes:
// - proto flags are currently ignored, but stored.
namespace decompiler {
/// <summary>
@@ -339,6 +342,7 @@ struct TieProtoInfo {
std::string name;
std::vector<TieInstanceInfo> instances;
bool uses_generic = false;
u32 proto_flag;
float stiffness = 0; // wind
u32 generic_flag;
std::vector<tfrag3::TimeOfDayColor> time_of_day_colors; // c++ type for time of day data
@@ -483,11 +487,10 @@ void update_proto_info(std::vector<TieProtoInfo>* out,
for (size_t i = 0; i < protos.size(); i++) {
const auto& proto = protos[i];
auto& info = out->at(i);
// the flags can either be 0 or 2.
ASSERT(proto.flags == 0 || proto.flags == 2);
info.proto_flag = proto.flags;
// flag of 2 means it should use the generic renderer (determined from EE asm)
// for now, we ignore this and use TIE on everything.
info.uses_generic = (proto.flags == 2);
info.uses_generic = (proto.flags == 2); // possibly different in jak 2
// for debug, remember the name
info.name = proto.name;
// wind "stiffness" nonzero value means it has the wind effect
+9 -3
View File
@@ -261,10 +261,16 @@ bool backprop_tagged_type(const TP_Type& expected_type,
case types2::Tag::BLOCK_ENTRY:
// don't update if we're updating to exactly the same thing.
if (actual_type.tag.block_entry->selected_type &&
actual_type.tag.block_entry->selected_type == expected_type) {
return false;
if (actual_type.tag.block_entry->selected_type) {
if (actual_type.tag.block_entry->selected_type == expected_type) {
return false;
}
if (actual_type.tag.block_entry->selected_type->typespec().base_type() == "vector" &&
expected_type.typespec().base_type() == "vector4") {
return false;
}
}
{
actual_type.tag.block_entry->updated = true;
actual_type.tag.block_entry->selected_type = expected_type;
@@ -88,6 +88,13 @@ void OpenGLRenderer::init_bucket_renderers_jak2() {
m_bucket_renderers.resize((int)BucketId::MAX_BUCKETS);
m_bucket_categories.resize((int)BucketId::MAX_BUCKETS, BucketCategory::OTHER);
init_bucket_renderer<TFragment>("tfrag-l0-tfrag", BucketCategory::TFRAG, BucketId::TFRAG_L0_TFRAG,
std::vector{tfrag3::TFragmentTreeKind::NORMAL}, false, 0);
init_bucket_renderer<TFragment>("tfrag-l1-tfrag", BucketCategory::TFRAG, BucketId::TFRAG_L1_TFRAG,
std::vector{tfrag3::TFragmentTreeKind::NORMAL}, false, 0);
init_bucket_renderer<TFragment>("tfrag-t-l0-alpha", BucketCategory::TFRAG,
BucketId::TFRAG_T_L0_ALPHA,
std::vector{tfrag3::TFragmentTreeKind::TRANS}, false, 0);
init_bucket_renderer<DirectRenderer>("debug-no-zbuf1", BucketCategory::OTHER,
BucketId::DEBUG_NO_ZBUF1, 0x8000);
init_bucket_renderer<DirectRenderer>("debug-no-zbuf2", BucketCategory::OTHER,
@@ -46,8 +46,8 @@ void TFragment::render(DmaFollower& dma,
// unless we are a child, in which case our parent took this already.
if (!m_child_mode) {
auto data0 = dma.read_and_advance();
ASSERT(data0.vif1() == 0);
ASSERT(data0.vif0() == 0);
ASSERT(data0.vifcode1().kind == VifCode::Kind::NOP);
ASSERT(data0.vif0() == 0 || data0.vifcode0().kind == VifCode::Kind::MARK);
ASSERT(data0.size_bytes == 0);
}
@@ -109,7 +109,9 @@ void TFragment::render(DmaFollower& dma,
dma.read_and_advance();
}
ASSERT(!level_name.empty());
if (level_name.empty()) {
return;
}
{
m_tfrag3.setup_for_level(m_tree_kinds, level_name, render_state);
TfragRenderSettings settings;
+9 -1
View File
@@ -80,7 +80,15 @@ enum class BucketId {
namespace jak2 {
enum class BucketId { DEBUG_NO_ZBUF1 = 318, DEBUG_NO_ZBUF2 = 325, DEBUG3 = 326, MAX_BUCKETS = 327 };
enum class BucketId {
TFRAG_L0_TFRAG = 8,
TFRAG_L1_TFRAG = 19,
TFRAG_T_L0_ALPHA = 128,
DEBUG_NO_ZBUF1 = 318,
DEBUG_NO_ZBUF2 = 325,
DEBUG3 = 326,
MAX_BUCKETS = 327
};
}
enum class BucketCategory {
@@ -61,7 +61,7 @@ void main() {
// hack
transformed.xyz *= transformed.w;
// scissoring area adjust
transformed.y *= SCISSOR_ADJUST;
transformed.y *= SCISSOR_ADJUST * HEIGHT_SCALE;
gl_Position = transformed;
// time of day lookup
@@ -36,7 +36,7 @@ void main() {
// hack
transformed.xyz *= transformed.w;
// scissoring area adjust
transformed.y *= SCISSOR_ADJUST;
transformed.y *= SCISSOR_ADJUST * HEIGHT_SCALE;
gl_Position = transformed;
// time of day lookup
+14 -1
View File
@@ -473,6 +473,19 @@ u64 kopen(u64 fs, u64 name, u64 mode) {
return fs;
}
void pc_set_levels(u32 lev_list) {
std::vector<std::string> levels;
for (int i = 0; i < 6; i++) {
u32 lev = *Ptr<u32>(lev_list + i * 4);
std::string ls = Ptr<String>(lev).c()->data();
if (ls != "none" && ls != "#f" && ls != "") {
levels.push_back(ls);
}
}
Gfx::set_levels(levels);
}
void InitMachine_PCPort() {
// PC Port added functions
@@ -482,7 +495,7 @@ void InitMachine_PCPort() {
make_function_symbol_from_c("__pc-texture-upload-now", (void*)pc_texture_upload_now);
make_function_symbol_from_c("__pc-texture-relocate", (void*)pc_texture_relocate);
make_function_symbol_from_c("__pc-get-mips2c", (void*)pc_get_mips2c);
// make_function_symbol_from_c("__pc-set-levels", (void*)pc_set_levels);
make_function_symbol_from_c("__pc-set-levels", (void*)pc_set_levels);
// pad stuff
make_function_symbol_from_c("pc-pad-get-mapped-button", (void*)Gfx::get_mapped_button);
+13
View File
@@ -0,0 +1,13 @@
("CTA.DGO"
("ctysluma-part.o" "ctysluma-part")
("neon-baron-part.o" "neon-baron-part")
("tpage-974.go" "tpage-974")
("tpage-973.go" "tpage-973")
("tpage-1680.go" "tpage-1680")
("tpage-1021.go" "tpage-1021")
("tpage-1646.go" "tpage-1646")
("fort-entry-gate-ag.go" "fort-entry-gate")
("cty-fruit-stand-ag.go" "cty-fruit-stand")
("hide-door-a-ag.go" "hide-door-a")
("ctysluma-vis.go" "ctysluma-vis")
)
+68
View File
@@ -0,0 +1,68 @@
("CWI.DGO"
("nav-graph-h.o" "nav-graph-h")
("traffic-engine-h.o" "traffic-engine-h")
("vehicle-h.o" "vehicle-h")
("citizen-h.o" "citizen-h")
("height-map-h.o" "height-map-h")
("ctywide-obs-h.o" "ctywide-obs-h")
("height-map.o" "height-map")
("traffic-height-map.o" "traffic-height-map")
("nav-graph.o" "nav-graph")
("vehicle-rider.o" "vehicle-rider")
("vehicle-control.o" "vehicle-control")
("vehicle-part.o" "vehicle-part")
("vehicle-effects.o" "vehicle-effects")
("vehicle.o" "vehicle")
("vehicle-util.o" "vehicle-util")
("vehicle-physics.o" "vehicle-physics")
("vehicle-states.o" "vehicle-states")
("vehicle-guard.o" "vehicle-guard")
("transport.o" "transport")
("bike.o" "bike")
("car.o" "car")
("test-bike.o" "test-bike")
("test-car.o" "test-car")
("citizen.o" "citizen")
("civilian.o" "civilian")
("guard.o" "guard")
("citizen-norm.o" "citizen-norm")
("citizen-fat.o" "citizen-fat")
("citizen-chick.o" "citizen-chick")
("citizen-enemy.o" "citizen-enemy")
("metalhead-predator.o" "metalhead-predator")
("metalhead-grunt.o" "metalhead-grunt")
("metalhead-flitter.o" "metalhead-flitter")
("traffic-engine.o" "traffic-engine")
("trail-graph.o" "trail-graph")
("trail.o" "trail")
("traffic-manager.o" "traffic-manager")
("ctywide-texture.o" "ctywide-texture")
("ctywide-part.o" "ctywide-part")
("ctywide-obs.o" "ctywide-obs")
("ctywide-tasks.o" "ctywide-tasks")
("ctywide-scenes.o" "ctywide-scenes")
("ctywide-speech.o" "ctywide-speech")
("ctyport-obs.o" "ctyport-obs")
("target-pilot.o" "target-pilot")
("pilot-states.o" "pilot-states")
("jak-pilot+0-ag.go" "jak-pilot+0")
("searchlight.o" "searchlight")
("tpage-1264.go" "tpage-1264")
("tpage-1266.go" "tpage-1266")
("tpage-1265.go" "tpage-1265")
("tpage-1674.go" "tpage-1674")
("tpage-1118.go" "tpage-1118")
("tpage-1657.go" "tpage-1657")
("baron-statue-ag.go" "baron-statue")
("cty-guard-turret-ag.go" "cty-guard-turret")
("vehicle-explosion-ag.go" "vehicle-explosion")
("barons-ship-lores-ag.go" "barons-ship-lores")
("propa-ag.go" "propa")
("vehicle-turret-ag.go" "vehicle-turret")
("lurker-pipe-lid-ag.go" "lurker-pipe-lid")
("searchlight-ag.go" "searchlight")
("burning-bush-ag.go" "burning-bush")
("stadium-barrier-ag.go" "stadium-barrier")
("security-wall-ag.go" "security-wall")
("ctywide-vis.go" "ctywide-vis")
)
@@ -8,6 +8,14 @@
(defenum mem-usage-id
:bitfield #f
:type uint32
(tfragment 1)
(tfragment-base 2)
(tfragment-common 3)
(tfragment-level0 4)
(tfragment-level1 5)
(tfragment-color 6)
(tfragment-debug 7)
(entity 43)
(camera 44)
+43
View File
@@ -5,5 +5,48 @@
;; name in dgo: draw-node
;; dgos: ENGINE, GAME
;; todo: draw-node-cull
;; DECOMP BEGINS
(defmethod collect-regions draw-node ((obj draw-node) (arg0 sphere) (arg1 int) (arg2 region-prim-list))
(dotimes (s2-0 arg1)
(if (spheres-overlap? arg0 (the-as sphere (-> obj bsphere)))
(collect-regions (-> obj child) arg0 (the-as int (-> obj child-count)) arg2)
)
(&+! obj 32)
)
0
(none)
)
(defmethod inspect drawable-inline-array-node ((obj drawable-inline-array-node))
(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 mem-usage drawable-inline-array-node ((obj drawable-inline-array-node) (arg0 memory-usage-block) (arg1 int))
(set! (-> arg0 length) (max 64 (-> arg0 length)))
(set! (-> arg0 data 63 name) "draw-node")
(+! (-> arg0 data 63 count) (-> obj length))
(let ((v1-6 (asize-of obj)))
(+! (-> arg0 data 63 used) v1-6)
(+! (-> arg0 data 63 total) (logand -16 (+ v1-6 15)))
)
obj
)
(defmethod asize-of drawable-inline-array-node ((obj drawable-inline-array-node))
(the-as int (+ (-> drawable-inline-array-node size) (* (+ (-> obj length) -1) 32)))
)
(defmethod collect-regions drawable-inline-array-node ((obj drawable-inline-array-node) (arg0 sphere) (arg1 int) (arg2 region-prim-list))
(collect-regions (the-as draw-node (-> obj data)) arg0 (-> obj length) arg2)
0
(none)
)
+1 -1
View File
@@ -17,7 +17,7 @@
(define-extern print-prototype-list (function none))
(define-extern prototype-bucket-recalc-fields (function prototype-bucket prototype-bucket))
(define-extern determine-pause-mode (function int))
(define-extern vis-cull (function int symbol))
;; DECOMP BEGINS
+20 -9
View File
@@ -407,16 +407,27 @@
(with-profiler 'background *profile-background-color*
;; (init-background)
;; (execute-connections *background-draw-engine* (-> *display* frames (-> *display* on-screen)))
;; Run the background renderers!
;; first, reset the background-work
(init-background)
;; next, collect all levels that are registered with the engine
;; this will call the drawable system's draw method on the levels which adds all
;; trees known to the background system to *background-work*.
(execute-connections *background-draw-engine* (-> *display* frames (-> *display* on-screen)))
;; execute all background drawing
(reset! (-> *perf-stats* data (perf-stat-bucket background)))
;; (finish-background)
(finish-background)
(read! (-> *perf-stats* data (perf-stat-bucket background)))
; (update-wait-stats (-> *perf-stats* data (perf-stat-bucket background))
; (-> *background-work* wait-to-vu0)
; (the-as uint 0)
; (the-as uint 0)
; )
;; update VU stats for background draw.
(update-wait-stats (-> *perf-stats* data (perf-stat-bucket background))
(-> *background-work* wait-to-vu0)
(the-as uint 0)
(the-as uint 0)
)
)
(end-perf-stat-collection)
@@ -922,7 +933,7 @@
;(-> s4-0 global-buf)
;; post-draw buffer setup
; (tfrag-vu1-init-buffers)
(tfrag-vu1-init-buffers)
; (tie-vu1-init-buffers)
; (merc-vu1-init-buffers)
; (emerc-vu1-init-buffers)
@@ -7,3 +7,547 @@
;; DECOMP BEGINS
(define *background-work* (new 'global 'background-work))
;; identical to Jak 1's VU0 program here.
(define background-vu0-block (new 'static 'vu-function :length 59 :qlength 30))
(defun background-upload-vu0 ()
;; (upload-vu0-program background-vu0-block (&-> *background-work* wait-to-vu0))
0
(none)
)
(defun init-background ()
"Clear the tree list in background-work."
(dotimes (v1-0 8)
(set! (-> *background-work* tfrag-trees v1-0) #f)
(set! (-> *background-work* tfrag-trans-trees v1-0) #f)
(set! (-> *background-work* tfrag-water-trees v1-0) #f)
)
(set! (-> *background-work* tfrag-tree-count) 0)
(set! (-> *background-work* tfrag-trans-tree-count) 0)
(set! (-> *background-work* tfrag-water-tree-count) 0)
(set! (-> *background-work* shrub-tree-count) 0)
(set! (-> *background-work* tie-tree-count) 0)
(set! (-> *background-work* wait-to-vu0) (the-as uint 0))
0
(none)
)
(defconstant VISIBLE_LIST_SCRATCHPAD #x38a0)
(defun upload-vis-bits ((arg0 level) (arg1 level) (arg2 bsp-header))
"Upload visibility data to the scratchpad."
(let ((qwc (/ (+ (-> arg2 visible-list-length) 15) 16)))
(let ((lev-vis-bits (the-as (pointer uint128) (-> arg0 vis-bits)))
(all-vis (the-as (pointer uint128) (-> arg2 all-visible-list)))
;;(spad-vis (the-as (pointer uint128) (+ #x38a0 #x70000000)))
(spad-vis (scratchpad-ptr uint128 :offset VISIBLE_LIST_SCRATCHPAD))
)
(b! (not *artist-flip-visible*) cfg-5 :delay (nop!))
(nop!)
(nop!)
(label cfg-2)
;; flip visible is selected. unfortunately this code is wrong and uses a 64-bit xor.
(let ((a3-2 (-> lev-vis-bits 0)))
(set! lev-vis-bits (&-> lev-vis-bits 1))
(let ((t0-0 (-> all-vis 0)))
(set! all-vis (&-> all-vis 1))
(nop!)
(nop!)
;; xor with all visible to flip the bits of the things that exist.
(let ((a3-3 (logxor a3-2 (the-as uint t0-0))))
(+! qwc -1)
(set! (-> spad-vis 0) a3-3)
)
)
)
(set! spad-vis (&-> spad-vis 1))
(b! (> qwc 0) cfg-2 :delay (nop!))
0
(b! #t cfg-8 :delay (nop!))
;; flip visible isn't selected, just copy to scratchpad.
(nop!)
(label cfg-5)
(nop!)
(nop!)
(label cfg-6)
(let ((a1-2 (-> lev-vis-bits 0)))
(set! lev-vis-bits (&-> lev-vis-bits 1))
(nop!)
(+! qwc -1)
(set! (-> spad-vis 0) a1-2)
)
(set! spad-vis (&-> spad-vis 1))
)
(b! (> qwc 0) cfg-6 :delay (nop!))
)
0
(label cfg-8)
(none)
)
(defun set-background-regs! ((arg0 level))
"Set up registers for background drawing.
These are the ones actually used by the background renderers."
(local-vars (v1-1 float) (v1-2 float))
;; set up background regs. These are the same ones used in bsp, but different from "transform" regs.
;; the "transform" have stuff like hmge/hvdf required to do screen space stuff. This is just geometry.
(let ((v1-0 *math-camera*))
(with-vf (vf16 vf17 vf18 vf19 vf20 vf21 vf22 vf23 vf24 vf25 vf26 vf27 vf28 vf29 vf30 vf31)
:rw 'write
(cond
((-> arg0 info use-camera-other)
(.lvf vf16 (&-> v1-0 plane-other 0 quad))
(.lvf vf17 (&-> v1-0 plane-other 1 quad))
(.lvf vf18 (&-> v1-0 plane-other 2 quad))
(.lvf vf19 (&-> v1-0 plane-other 3 quad))
(.lvf vf20 (&-> v1-0 shrub-mat-other vector 0 quad))
(.lvf vf21 (&-> v1-0 shrub-mat-other vector 1 quad))
(.lvf vf22 (&-> v1-0 shrub-mat-other vector 2 quad))
(.lvf vf23 (&-> v1-0 shrub-mat-other trans quad))
(.lvf vf24 (&-> v1-0 camera-rot-other vector 0 quad))
(.lvf vf25 (&-> v1-0 camera-rot-other vector 1 quad))
(.lvf vf26 (&-> v1-0 camera-rot-other vector 2 quad))
(.lvf vf27 (&-> v1-0 camera-rot-other trans quad))
(.lvf vf28 (&-> v1-0 camera-temp-other vector 0 quad))
(.lvf vf29 (&-> v1-0 camera-temp-other vector 1 quad))
(.lvf vf30 (&-> v1-0 camera-temp-other vector 2 quad))
(.lvf vf31 (&-> v1-0 camera-temp-other trans quad))
(.mov v1-1 vf31)
)
(else
(.lvf vf16 (&-> v1-0 plane 0 quad))
(.lvf vf17 (&-> v1-0 plane 1 quad))
(.lvf vf18 (&-> v1-0 plane 2 quad))
(.lvf vf19 (&-> v1-0 plane 3 quad))
(.lvf vf20 (&-> v1-0 shrub-mat vector 0 quad))
(.lvf vf21 (&-> v1-0 shrub-mat vector 1 quad))
(.lvf vf22 (&-> v1-0 shrub-mat vector 2 quad))
(.lvf vf23 (&-> v1-0 shrub-mat trans quad))
(.lvf vf24 (&-> v1-0 camera-rot vector 0 quad))
(.lvf vf25 (&-> v1-0 camera-rot vector 1 quad))
(.lvf vf26 (&-> v1-0 camera-rot vector 2 quad))
(.lvf vf27 (&-> v1-0 camera-rot trans quad))
(.lvf vf28 (&-> v1-0 camera-temp vector 0 quad))
(.lvf vf29 (&-> v1-0 camera-temp vector 1 quad))
(.lvf vf30 (&-> v1-0 camera-temp vector 2 quad))
(.lvf vf31 (&-> v1-0 camera-temp trans quad))
(.mov v1-2 vf31)
)
)
)
)
;; this code would wait for VU0 program upload, then do a vcallms 0 which sets up additional registers,
;; and stashes stuff in vu0 data memory.
;; note: vf24-vf27 get messed with here, but after they are stashed in VU0 memory.
; sq.xyzw vf24, 4(vi00) | maxw.xyzw vf01, vf00, vf00
; sq.xyzw vf25, 5(vi00) | nop
; sq.xyzw vf26, 6(vi00) | nop
; sq.xyzw vf27, 7(vi00) | nop
; sq.xyzw vf16, 0(vi00) | mulz.xyzw vf24, vf01, vf24
; sq.xyzw vf17, 1(vi00) | mulz.xyzw vf25, vf01, vf25
; sq.xyzw vf18, 2(vi00) | mulz.xyzw vf26, vf01, vf26
; sq.xyzw vf19, 3(vi00) | mulz.xyzw vf27, vf01, vf27
; sq.xyzw vf24, 12(vi00) | nop
; sq.xyzw vf25, 13(vi00) | nop
; sq.xyzw vf26, 14(vi00) | nop
; sq.xyzw vf27, 15(vi00) | nop
; sq.xyzw vf28, 8(vi00) | nop
; sq.xyzw vf29, 9(vi00) | nop
; sq.xyzw vf30, 10(vi00) | nop
; sq.xyzw vf31, 11(vi00) | nop :e
; iaddiu vi02, vi00, 0xf0 | nop
#|
(let ((v1-3 (the-as object #x10008000))
(a0-4 (the-as (pointer integer) (&-> *background-work* wait-to-vu0)))
)
(b! (zero? (logand (-> (the-as (pointer int32) v1-3) 0) 256)) cfg-5 :delay (nop!))
(let ((a1-2 (-> (the-as (pointer int32) a0-4) 0)))
(nop!)
(let ((a2-0 (-> (the-as (pointer int32) v1-3) 0)))
(nop!)
(let ((a2-1 (logand a2-0 256))
(a1-3 (+ a1-2 1))
)
(b! (nonzero? a2-1) cfg-4 :delay (set! (-> (the-as (pointer uint32) a0-4) 0) (the-as uint a1-3)))
)
)
)
)
(label cfg-5)
0
(.vcallms 0)
|#
0
(none)
)
(defun set-tie-quard-planes! ((arg0 level))
"Update guard planes for tie. The use-camera-other stuff can be used to effectively 'move' a level,
so the camera guard planes need to be set accordingly."
(cond
((-> arg0 info use-camera-other)
(set! (-> *instance-tie-work* guard-plane 0 quad) (-> *math-camera* guard-plane-other 0 quad))
(set! (-> *instance-tie-work* guard-plane 1 quad) (-> *math-camera* guard-plane-other 1 quad))
(set! (-> *instance-tie-work* guard-plane 2 quad) (-> *math-camera* guard-plane-other 2 quad))
(set! (-> *instance-tie-work* guard-plane 3 quad) (-> *math-camera* guard-plane-other 3 quad))
)
(else
(set! (-> *instance-tie-work* guard-plane 0 quad) (-> *math-camera* guard-plane 0 quad))
(set! (-> *instance-tie-work* guard-plane 1 quad) (-> *math-camera* guard-plane 1 quad))
(set! (-> *instance-tie-work* guard-plane 2 quad) (-> *math-camera* guard-plane 2 quad))
(set! (-> *instance-tie-work* guard-plane 3 quad) (-> *math-camera* guard-plane 3 quad))
)
)
(none)
)
(defun set-shrub-quard-planes! ((arg0 level))
"Update guard planes for shrub. The use-camera-other stuff can be used to effectively 'move' a level,
so the camera guard planes need to be set accordingly."
(cond
((-> arg0 info use-camera-other)
(set! (-> *instance-shrub-work* guard-plane 0 quad) (-> *math-camera* guard-plane-other 0 quad))
(set! (-> *instance-shrub-work* guard-plane 1 quad) (-> *math-camera* guard-plane-other 1 quad))
(set! (-> *instance-shrub-work* guard-plane 2 quad) (-> *math-camera* guard-plane-other 2 quad))
(set! (-> *instance-shrub-work* guard-plane 3 quad) (-> *math-camera* guard-plane-other 3 quad))
)
(else
(set! (-> *instance-shrub-work* guard-plane 0 quad) (-> *math-camera* guard-plane 0 quad))
(set! (-> *instance-shrub-work* guard-plane 1 quad) (-> *math-camera* guard-plane 1 quad))
(set! (-> *instance-shrub-work* guard-plane 2 quad) (-> *math-camera* guard-plane 2 quad))
(set! (-> *instance-shrub-work* guard-plane 3 quad) (-> *math-camera* guard-plane 3 quad))
)
)
(none)
)
(defun finish-background ()
"Main function for drawing the background (wind, shrub, tie, tfrag)"
(if (-> *blit-displays-work* menu-mode)
(return #f)
)
;; update wind!
(when (not (paused?))
(flush-cache 0)
(with-profiler 'wind *profile-particles-color*
(dotimes (gp-1 (-> *level* length))
(let ((v1-28 (-> *level* level gp-1)))
(when (= (-> v1-28 status) 'active)
(-> v1-28 bsp unk-data 5)
(if (nonzero? (-> v1-28 bsp wind-array-length))
(when (nonzero? level-update-wind) (level-update-wind *wind-work*)) ;; added nonzero check
)
)
)
)
)
)
;; start VU0 upload for background.
(background-upload-vu0)
(dotimes (v1-51 (-> *level* length))
(let ((a0-23 (-> *level* level v1-51)))
(when (= (-> a0-23 status) 'active)
(let ((a0-24 (-> a0-23 bsp)))
(when (nonzero? (-> a0-24 tfrag-masks))
(dotimes (a1-9 (-> a0-24 tfrag-masks length))
(set! (-> a0-24 tfrag-closest a1-9) 4095996000.0)
)
)
(when (nonzero? (-> a0-24 shrub-masks))
(dotimes (a1-14 (-> a0-24 shrub-masks length))
(set! (-> a0-24 shrub-closest a1-14) 4095996000.0)
)
)
(when (nonzero? (-> a0-24 alpha-masks))
(dotimes (a1-19 (-> a0-24 alpha-masks length))
(set! (-> a0-24 alpha-closest a1-19) 4095996000.0)
)
)
(when (nonzero? (-> a0-24 water-masks))
(dotimes (a1-24 (-> a0-24 water-masks length))
(set! (-> a0-24 water-closest a1-24) 4095996000.0)
)
)
)
)
)
)
; (when (nonzero? (-> *background-work* shrub-tree-count))
; (with-profiler 'instance-shrubbery *profile-instance-shrubbery-color*
; (dotimes (gp-4 (-> *background-work* shrub-tree-count))
; (set! *draw-index* (-> *background-work* shrub-levels gp-4 draw-index))
; (flush-cache 0)
; (let ((s5-3 (-> *background-work* shrub-trees gp-4))
; (s4-3 (-> *background-work* shrub-levels gp-4))
; )
; (if (nonzero? (-> s5-3 colors-added))
; (time-of-day-interp-colors
; (-> *instance-shrub-work* colors)
; (the-as uint (-> s5-3 colors-added))
; (-> s4-3 mood-context)
; )
; )
; (set-background-regs! s4-3)
; (set-shrub-quard-planes! s4-3)
; (draw-drawable-tree-instance-shrub s5-3 s4-3)
; )
; )
; )
; )
(let ((gp-6 (the-as level #f)))
(when (or (nonzero? (-> *background-work* tfrag-tree-count))
(nonzero? (-> *background-work* tfrag-trans-tree-count))
(nonzero? (-> *background-work* tfrag-water-tree-count))
)
(let ((s5-7 (max (max (-> *background-work* tfrag-tree-count) (-> *background-work* tfrag-trans-tree-count))
(-> *background-work* tfrag-water-tree-count)
)
)
(s4-5 (the-as time-of-day-palette #f))
)
(with-profiler 'tfrag *profile-tfrag-color*
(dotimes (s3-3 s5-7)
(let ((s2-1 (-> *background-work* tfrag-trees s3-3)))
(when s2-1
(let ((s1-1 (-> *background-work* tfrag-levels s3-3)))
(let ((a2-23 (-> s1-1 bsp))
(s0-1 (-> s2-1 time-of-day-pal))
)
(upload-vis-bits s1-1 gp-6 a2-23)
(when (not (or (zero? s0-1) (= s4-5 s0-1)))
(flush-cache 0)
;; (time-of-day-interp-colors-scratch (the-as (pointer rgba) (+ 6144 #x70000000)) s0-1 (-> s1-1 mood-context))
(set! s4-5 s0-1)
)
)
(set! *draw-index* (-> s1-1 draw-index))
(set! (-> *tfrag-work* min-dist z) 4095996000.0)
(set-background-regs! s1-1)
)
(draw-drawable-tree-tfrag s2-1)
(set! (-> *level* draw-level *draw-index* closest-object) (-> *tfrag-work* min-dist z))
)
)
(let ((s2-2 (-> *background-work* tfrag-trans-trees s3-3)))
(when s2-2
(let ((s1-2 (-> *background-work* tfrag-trans-levels s3-3)))
(let ((a2-25 (-> s1-2 bsp))
(s0-2 (-> s2-2 time-of-day-pal))
)
(upload-vis-bits s1-2 gp-6 a2-25)
(when (not (or (zero? s0-2) (= s4-5 s0-2)))
(flush-cache 0)
;; (time-of-day-interp-colors-scratch (the-as (pointer rgba) (+ 6144 #x70000000)) s0-2 (-> s1-2 mood-context))
(set! s4-5 s0-2)
)
)
(set! *draw-index* (-> s1-2 draw-index))
(set! (-> *tfrag-work* min-dist z) 4095996000.0)
(set-background-regs! s1-2)
)
(draw-drawable-tree-tfrag-trans s2-2)
(set! (-> *level* draw-level *draw-index* closest-object-array 3) (-> *tfrag-work* min-dist z))
)
)
(let ((s2-3 (-> *background-work* tfrag-water-trees s3-3)))
(when s2-3
(let ((s1-3 (-> *background-work* tfrag-water-levels s3-3)))
(let ((a2-27 (-> s1-3 bsp))
(s0-3 (-> s2-3 time-of-day-pal))
)
(upload-vis-bits s1-3 gp-6 a2-27)
(when (not (or (zero? s0-3) (= s4-5 s0-3)))
(flush-cache 0)
;; (time-of-day-interp-colors-scratch (the-as (pointer rgba) (+ 6144 #x70000000)) s0-3 (-> s1-3 mood-context))
(set! s4-5 s0-3)
)
)
(set! *draw-index* (-> s1-3 draw-index))
(set! (-> *tfrag-work* min-dist z) 4095996000.0)
(set-background-regs! s1-3)
)
(draw-drawable-tree-tfrag-water s2-3)
(set! (-> *level* draw-level *draw-index* closest-object-array 4) (-> *tfrag-work* min-dist z))
)
)
)
)
)
)
; (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))
(let ((a1-46 (-> *level* level v1-282)))
(when (= (-> a1-46 status) 'active)
(let ((a0-120 (-> a1-46 bsp)))
(when (nonzero? (-> a0-120 tfrag-masks))
(let ((a2-34 (-> a1-46 texture-mask)))
(dotimes (a3-4 (-> a0-120 tfrag-masks length))
(let ((f0-12 (* (-> (the-as (pointer float) (&+ (-> a0-120 tfrag-closest) (* a3-4 4))) 0)
(-> *math-camera* fov-correction-factor)
)
)
)
(when (!= f0-12 4095996000.0)
(let ((t0-8 (-> a0-120 tfrag-masks data a3-4)))
(dotimes (t1-2 3)
(when (or (= t1-2 2) (>= f0-12 (-> t0-8 data t1-2 dist)))
(dotimes (t2-5 3)
(logior!
(-> (&-> a2-34 0 mask data t2-5) 0)
(-> (the-as (pointer int32) (+ (* t2-5 4) (the-as int t0-8) (* t1-2 16))) 0)
)
)
(goto cfg-158)
)
)
)
)
)
(label cfg-158)
)
)
)
(when (nonzero? (-> a0-120 shrub-masks))
(let ((a2-39 (-> a1-46 texture-mask 2)))
(dotimes (a3-5 (-> a0-120 shrub-masks length))
(let ((f0-14 (* (-> (the-as (pointer float) (&+ (-> a0-120 shrub-closest) (* a3-5 4))) 0)
(-> *math-camera* fov-correction-factor)
)
)
)
(when (!= f0-14 4095996000.0)
(let ((t0-24 (-> a0-120 shrub-masks data a3-5)))
(dotimes (t1-5 3)
(when (or (= t1-5 2) (>= f0-14 (-> t0-24 data t1-5 dist)))
(dotimes (t2-11 3)
(logior!
(-> a2-39 mask data t2-11)
(-> (the-as (pointer int32) (+ (* t2-11 4) (the-as int t0-24) (* t1-5 16))) 0)
)
)
(goto cfg-178)
)
)
)
)
)
(label cfg-178)
)
)
)
(when (nonzero? (-> a0-120 alpha-masks))
(let ((a2-44 (-> a1-46 texture-mask 3)))
(dotimes (a3-6 (-> a0-120 alpha-masks length))
(let ((f0-16 (* (-> (the-as (pointer float) (&+ (-> a0-120 alpha-closest) (* a3-6 4))) 0)
(-> *math-camera* fov-correction-factor)
)
)
)
(when (!= f0-16 4095996000.0)
(let ((t0-40 (-> a0-120 alpha-masks data a3-6)))
(dotimes (t1-8 3)
(when (or (= t1-8 2) (>= f0-16 (-> t0-40 data t1-8 dist)))
(dotimes (t2-17 3)
(logior!
(-> a2-44 mask data t2-17)
(-> (the-as (pointer int32) (+ (* t2-17 4) (the-as int t0-40) (* t1-8 16))) 0)
)
)
(goto cfg-198)
)
)
)
)
)
(label cfg-198)
)
)
)
(when (nonzero? (-> a0-120 water-masks))
(let ((a1-47 (-> a1-46 texture-mask 4)))
(dotimes (a2-49 (-> a0-120 water-masks length))
(let ((f0-18 (* (-> (the-as (pointer float) (&+ (-> a0-120 water-closest) (* a2-49 4))) 0)
(-> *math-camera* fov-correction-factor)
)
)
)
(when (!= f0-18 4095996000.0)
(let ((a3-15 (-> a0-120 water-masks data a2-49)))
(dotimes (t0-50 3)
(when (or (= t0-50 2) (>= f0-18 (-> a3-15 data t0-50 dist)))
(dotimes (t1-14 3)
(logior!
(-> a1-47 mask data t1-14)
(-> (the-as (pointer int32) (+ (* t1-14 4) (the-as int a3-15) (* t0-50 16))) 0)
)
)
(goto cfg-218)
)
)
)
)
)
(label cfg-218)
)
)
)
)
)
)
)
0
(none)
)
@@ -11,6 +11,7 @@
:bitfield #t
:type uint16
(disable 0)
;; (use-envmap 1) maybe
(tpage-alpha 2)
(vanish 3)
(tpage-water 7)
@@ -63,3 +63,6 @@
:size-assert #x3000
:flag-assert #x900003000
)
;; DECOMP ENDS
(define-extern level-update-wind (function wind-work none))
+2 -2
View File
@@ -94,8 +94,8 @@
(defconstant DEFAULT_ALL_RENDERERS
(vu1-renderer-mask
rn3 rn4 rn5 rn6 rn7 rn8 rn9 rn10 rn11 rn12 merc emerc rn15 rn16
rn17 rn18 rn19 rn20 rn21 rn22 rn23 rn24 rn25 rn26 rn27 rn28 rn29
rn3 rn4 rn5 tfrag rn7 rn8 rn9 rn10 rn11 rn12 merc emerc rn15 rn16
rn17 rn18 tfrag-trans rn20 rn21 rn22 rn23 tfrag-water rn25 rn26 rn27 rn28 rn29
rn30 rn31 rn32 rn34
)
)
+1 -1
View File
@@ -74,7 +74,7 @@
(.por a3-3 a3-2 t0-0)
(let ((f0-1 (fmax f0-0 f1-0)))
(set! (-> a2-3 mask quad) a3-3)
(set! (-> a2-3 mask w) (the-as int f0-1))
(set! (-> a2-3 dist) f0-1)
)
)
)
+6 -6
View File
@@ -183,12 +183,12 @@
(dotimes (a1-0 3)
(set! (-> (the-as (pointer int32) (+ (+ (* a0-5 16) (* a1-0 4)) (the-as int *texture-masks*))))
(logior (-> (the-as (pointer int32) (+ (* a1-0 4) (the-as int *texture-masks*) (* a0-5 16))) 0)
(-> (the-as (inline-array texture-masks) (+ (* a1-0 4) (the-as int v1-3) (* a0-5 16))) 1 data 0 mask w)
(-> (the-as (pointer int32) (+ (* a1-0 4) (the-as int v1-3) (* a0-5 16))) 15)
)
)
)
(set! (-> *texture-masks* data a0-5 mask w)
(the-as int (fmax (-> *texture-masks* data a0-5 dist) (-> v1-3 masks data a0-5 dist)))
(set! (-> *texture-masks* data a0-5 dist)
(fmax (-> *texture-masks* data a0-5 dist) (-> v1-3 masks data a0-5 dist))
)
)
)
@@ -472,7 +472,7 @@
(let ((dma-buff (-> *display* frames (-> *display* on-screen) global-buf)))
(when (nonzero? (-> tree length))
(let ((dma-start (-> *display* frames (-> *display* on-screen) global-buf base)))
(reset! (-> *perf-stats* data (perf-stat-bucket inst-shrub)))
(draw-inline-array-instance-shrub
dma-buff
@@ -481,11 +481,11 @@
proto-array-data
)
(read! (-> *perf-stats* data (perf-stat-bucket inst-shrub)))
(reset! (-> *perf-stats* data (perf-stat-bucket proto-shrub)))
(draw-prototype-inline-array-shrub proto-array-len proto-array-data)
(read! (-> *perf-stats* data (perf-stat-bucket proto-shrub)))
(let ((v1-33 *dma-mem-usage*))
(when (nonzero? v1-33)
(set! (-> v1-33 length) (max 28 (-> v1-33 length)))
+3 -6
View File
@@ -2594,13 +2594,10 @@
(def-mips2c adgif-shader<-texture-with-update! (function adgif-shader texture adgif-shader))
(defun hack-texture ((arg0 texture))
"Some sort of uv-dist hack for hi-res mode."
"Some sort of uv hack for hi-res mode"
(set! (-> arg0 uv-dist) 1000000.0)
(set! (-> arg0 masks data 0 mask w) (the-as int (+ 40960000.0 (-> arg0 masks data 0 dist))))
(let ((f0-4 (+ 40960000.0 (-> arg0 masks data 1 dist))))
(set! (-> arg0 masks data 1 mask w) (the-as int f0-4))
f0-4
)
(set! (-> arg0 masks data 0 dist) (+ 40960000.0 (-> arg0 masks data 0 dist)))
(set! (-> arg0 masks data 1 dist) (+ 40960000.0 (-> arg0 masks data 1 dist)))
)
(define-extern level-remap-texture (function texture-id texture-id))
@@ -9,6 +9,8 @@
(declare-type tfrag-work structure)
(define-extern *tfrag-work* tfrag-work)
(define-extern *pc-tfrag-draw-level* level) ;; added
;; DECOMP BEGINS
(deftype tfragment-stats (structure)
@@ -48,6 +50,7 @@
(dma-base uint32 :offset 36)
(dma-level-1 uint32 :offset 40)
(dma-qwc uint8 4 :offset 44)
(dma-u32 uint32 :offset 44)
(shader (inline-array adgif-shader) :offset 48)
(num-shaders uint8 :offset 52)
(num-base-colors uint8 :offset 53)
@@ -247,3 +250,7 @@
:size-assert #x37fc
:flag-assert #x9000037fc
)
(define-extern draw-drawable-tree-tfrag (function drawable-tree-tfrag none))
(define-extern draw-drawable-tree-tfrag-trans (function drawable-tree-tfrag none))
(define-extern draw-drawable-tree-tfrag-water (function drawable-tree-tfrag none))
@@ -7,3 +7,849 @@
;; DECOMP BEGINS
(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)
)
(defun draw-drawable-tree-tfrag ((arg0 drawable-tree-tfrag))
(local-vars (sv-16 (pointer uint8)))
(when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask tfrag))
(let ((s5-0 (+ (-> arg0 length) -1)))
(when (nonzero? s5-0)
;; TODO draw node cull (not really needed because c++ does it already)
; (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-13 (the-as drawable-inline-array-tfrag (-> arg0 arrays s5-0)))
(s4-1 (-> v1-13 data))
(s3-0 (-> v1-13 length))
)
(set! sv-16 (&-> (scratchpad-object terrain-context) work background vis-list (/ (-> s4-1 0 id) 8)))
(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)
)
(defun draw-drawable-tree-tfrag-trans ((arg0 drawable-tree-tfrag))
(local-vars sv-16 (pointer uint8))
(when (logtest? (vu1-renderer-mask tfrag-trans) (-> *display* vu1-enable-user))
(let ((s5-0 (+ (-> arg0 length) -1)))
;; TODO draw node cull (not really needed because c++ does it already)
; (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 (the-as drawable-inline-array-tfrag (-> arg0 arrays s5-0)))
(s5-1 (-> v1-13 data))
(s4-1 (-> v1-13 length))
)
(set! sv-16 (&-> (scratchpad-object terrain-context) work background vis-list (/ (-> s5-1 0 id) 8)))
(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)
)
(defun draw-drawable-tree-tfrag-water ((arg0 drawable-tree-tfrag))
(local-vars (sv-16 (pointer uint8)))
(when (logtest? (vu1-renderer-mask tfrag-water) (-> *display* vu1-enable-user))
(let ((s5-0 (+ (-> arg0 length) -1)))
;; TODO draw node cull (not really needed because c++ does it already)
; (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 (the-as drawable-inline-array-tfrag (-> arg0 arrays s5-0)))
(s5-1 (-> v1-13 data))
(s4-1 (-> v1-13 length))
)
(set! sv-16 (&-> (scratchpad-object terrain-context) work background vis-list (/ (-> s5-1 0 id) 8)))
(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)
)
(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)
)
(defun tfrag-scissor-vu1-init-buf ((arg0 bucket-id) (arg1 gs-test) (arg2 int) (arg3 uint) (arg4 symbol))
;; (break!) ;; no scissor
(none)
)
(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
)
(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)
)
)
)
(define *pc-tfrag-draw-level* (the level #f))
(defun tfrag-vu1-init-buffers ()
(dotimes (gp-0 6)
(let ((s5-0 (-> *level* draw-level gp-0))
(s4-0 (-> *tfrag-init-table* gp-0))
)
(set! *pc-tfrag-draw-level* s5-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)
)
(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)
)
(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)
)
(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)
)
(defmethod collect-stats tfragment ((obj tfragment))
(stats-tfrag-asm obj)
0
(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)
)
(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)
)
(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)
)
(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)
)
(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)
)
(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)
)
(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)
)
(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)
)
(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)
)
(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)
)
(defmethod debug-draw tfragment ((obj tfragment) (arg0 drawable) (arg1 display-frame))
(-> arg1 global-buf)
(edge-debug-lines (-> obj debug-data debug-lines))
0
(none)
)
@@ -7,3 +7,71 @@
;; DECOMP BEGINS
(define tnear-vu1-block (new 'static 'vu-function :length #x38b :qlength #x1c6))
(defun-debug tfrag-details ((arg0 tfragment))
(format 0 "id = ~d~%" (-> arg0 id))
(format 0 "common:~%")
(let ((s5-0 (-> arg0 dma-qwc 0))
(s4-0 (-> arg0 dma-common))
)
(format 0 "qwc = ~d, ref = ~x~%" s5-0 s4-0)
(disasm-vif-tag (the-as (pointer vif-tag) s4-0) (the-as int (* s5-0 4)) (the-as symbol 0) #t)
)
(format 0 "base:~%")
(let ((s5-1 (-> arg0 dma-qwc 1))
(s4-1 (-> arg0 dma-base))
)
(format 0 "qwc = ~d, ref = ~x~%" s5-1 s4-1)
(disasm-vif-tag (the-as (pointer vif-tag) s4-1) (the-as int (* s5-1 4)) (the-as symbol 0) #t)
)
(format 0 "level-0:~%")
(let ((s5-2 (-> arg0 dma-qwc 3))
(s4-2 (-> arg0 dma-u32)) ;; bug: this isn't actually the level0 chain... see jak 1.
)
(format 0 "qwc = ~d, ref = ~x~%" s5-2 s4-2)
(disasm-vif-tag (the-as (pointer vif-tag) s4-2) (the-as int (* s5-2 4)) (the-as symbol 0) #t)
)
(format 0 "level-1:~%")
(let ((s5-3 (-> arg0 dma-qwc 2))
(gp-1 (-> arg0 dma-level-1))
)
(format 0 "qwc = ~d, ref = ~x~%" s5-3 gp-1)
(disasm-vif-tag (the-as (pointer vif-tag) gp-1) (the-as int (* s5-3 4)) (the-as symbol 0) #t)
)
(none)
)
(defun-debug clip-restore ()
"Restore the camera to some place. Same as jak 1, so likely not a meaningful location."
(let ((a0-0 (new-stack-vector0))
(a1-0 (new-stack-matrix0))
)
(set! (-> a0-0 x) 92648.22)
(set! (-> a0-0 y) 238025.03)
(set! (-> a0-0 z) 199836.31)
(set! (-> a0-0 w) 1.0)
(set! (-> a1-0 vector 0 x) -0.9283)
(set! (-> a1-0 vector 0 y) 0.0)
(set! (-> a1-0 vector 0 z) 0.3716)
(set! (-> a1-0 vector 0 w) 0.0)
(set! (-> a1-0 vector 1 x) -0.2257)
(set! (-> a1-0 vector 1 y) 0.7945)
(set! (-> a1-0 vector 1 z) -0.5637)
(set! (-> a1-0 vector 1 w) 0.0)
(set! (-> a1-0 vector 2 x) -0.2952)
(set! (-> a1-0 vector 2 y) -0.6072)
(set! (-> a1-0 vector 2 z) -0.7375)
(set! (-> a1-0 vector 2 w) 0.0)
(set! (-> a1-0 trans x) 0.0)
(set! (-> a1-0 trans y) 0.0)
(set! (-> a1-0 trans z) 0.0)
(set! (-> a1-0 trans w) 1.0)
(debug-set-camera-pos-rot! a0-0 a1-0)
)
(none)
)
@@ -7,3 +7,37 @@
;; DECOMP BEGINS
(define *tfrag-work* (new 'static 'tfrag-work
:base-tmpl (new 'static 'dma-packet
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
:vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))
)
:level-0-tmpl (new 'static 'dma-packet
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
:vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))
)
:common-tmpl (new 'static 'dma-packet
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
:vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))
)
:level-1-tmpl (new 'static 'dma-packet
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
:vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))
)
:color-tmpl (new 'static 'dma-packet
:dma (new 'static 'dma-tag :id (dma-tag-id cnt))
:vif0 (new 'static 'vif-tag :imm #x102 :cmd (vif-cmd stcycl))
:vif1 (new 'static 'vif-tag :imm #xc000 :cmd (vif-cmd unpack-v4-8))
)
:max-fragment #xffff
)
)
(set! (-> *tfrag-work* color-ptr x) (+ 6144 (the-as int *fake-scratchpad-data*)))
(set! (-> *tfrag-work* color-ptr y) (+ 6144 (the-as int *fake-scratchpad-data*)))
(set! (-> *tfrag-work* color-ptr z) (+ 6144 (the-as int *fake-scratchpad-data*)))
(set! (-> *tfrag-work* color-ptr w) (+ 6144 (the-as int *fake-scratchpad-data*)))
+504
View File
@@ -7,3 +7,507 @@
;; DECOMP BEGINS
(defmethod login tfragment ((obj tfragment))
"Initialize a tfragment by linking the textures in adgif shaders"
(when (nonzero? *texture-masks-array*)
(dotimes (s5-0 (the-as int (-> obj num-shaders)))
(let ((v1-3 (adgif-shader-login-no-remap (-> obj shader s5-0)))
(a0-7 (-> *texture-masks-array* data (-> obj texture-masks-index)))
)
(when v1-3
(dotimes (a1-3 3)
(dotimes (a2-0 3)
(set! (-> (the-as (pointer int32) (+ (+ (* a1-3 16) (* a2-0 4)) (the-as int a0-7))))
(logior (-> (the-as (pointer int32) (+ (* a2-0 4) (the-as int a0-7) (* a1-3 16))) 0)
(-> (the-as texture (+ (* a2-0 4) (the-as int v1-3) (* a1-3 16))) masks data 0 mask x)
)
)
)
(set! (-> a0-7 data a1-3 dist) (fmax (-> a0-7 data a1-3 dist) (-> v1-3 masks data a1-3 dist)))
)
)
)
)
)
obj
)
(defmethod mem-usage tfragment ((obj tfragment) (arg0 memory-usage-block) (arg1 int))
"Compute the memory usage of a tfragment"
(when (logtest? arg1 2)
(+! (-> arg0 data 19 count) 1)
(let ((v1-6 (+ (-> obj num-base-colors) (-> obj num-level0-colors) (-> obj num-level1-colors))))
(+! (-> arg0 data 19 used) v1-6)
(+! (-> arg0 data 19 total) (logand -4 (+ v1-6 3)))
)
(set! obj obj)
(goto cfg-16)
)
(let ((s4-0 1))
(set! (-> arg0 length) (max (-> arg0 length) (+ s4-0 8)))
(set! (-> arg0 data s4-0 name) (symbol->string 'tfragment))
(+! (-> arg0 data s4-0 count) 1)
(let ((v1-22 (asize-of obj)))
(+! (-> arg0 data s4-0 used) v1-22)
(+! (-> arg0 data s4-0 total) (logand -16 (+ v1-22 15)))
)
(set! (-> arg0 data (+ s4-0 1) name) "tfragment-base")
(+! (-> arg0 data (+ s4-0 1) count) 1)
(let ((v1-33 (* (-> obj dma-qwc 0) 16)))
(+! (-> arg0 data (+ s4-0 1) used) v1-33)
(+! (-> arg0 data (+ s4-0 1) total) v1-33)
)
(set! (-> arg0 data (+ s4-0 2) name) "tfragment-common")
(+! (-> arg0 data (+ s4-0 2) count) 1)
(let ((v1-43 (* (- (-> obj dma-qwc 1) (-> obj dma-qwc 0)) 16)))
(+! (-> arg0 data (+ s4-0 2) used) v1-43)
(+! (-> arg0 data (+ s4-0 2) total) v1-43)
)
(set! (-> arg0 data (+ s4-0 3) name) "tfragment-level0")
(when (nonzero? (-> obj num-level0-colors))
(+! (-> arg0 data (+ s4-0 3) count) 1)
(let ((v1-55 (* (- (-> obj dma-qwc 2) (-> obj dma-qwc 0)) 16)))
(+! (-> arg0 data (+ s4-0 3) used) v1-55)
(+! (-> arg0 data (+ s4-0 3) total) v1-55)
)
)
(set! (-> arg0 data (+ s4-0 4) name) "tfragment-level1")
(when (not (or (= (-> obj dma-level-1) (-> obj dma-common))
(= (-> obj dma-level-1) (-> obj dma-base))
(zero? (-> obj num-level1-colors))
)
)
(+! (-> arg0 data (+ s4-0 4) count) 1)
(let ((v1-70
(* (- (-> obj dma-qwc 3)
(- (/ (the-as int (- (-> obj dma-level-1) (the-as uint (-> obj dma-common)))) 16) (-> obj dma-qwc 0))
)
16
)
)
)
(+! (-> arg0 data (+ s4-0 4) used) v1-70)
(+! (-> arg0 data (+ s4-0 4) total) v1-70)
)
)
(set! (-> arg0 data (+ s4-0 5) name) "tfragment-color")
(+! (-> arg0 data (+ s4-0 5) count) 1)
(let ((v1-79
(if (logtest? arg1 1)
0
(the-as int (* (+ (-> obj num-base-colors) (-> obj num-level0-colors) (-> obj num-level1-colors)) 2))
)
)
)
(+! (-> arg0 data (+ s4-0 5) used) v1-79)
(+! (-> arg0 data (+ s4-0 5) total) (logand -16 (+ v1-79 15)))
)
(set! (-> arg0 data (+ s4-0 6) name) "tfragment-debug")
)
(label cfg-16)
obj
)
(defmethod inspect drawable-inline-array-tfrag ((obj drawable-inline-array-tfrag))
(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 drawable-inline-array-tfrag ((obj drawable-inline-array-tfrag))
(set! *texture-masks-array* (-> *level* level *level-index* bsp tfrag-masks))
(dotimes (s5-0 (-> obj length))
(login (-> obj data s5-0))
)
obj
)
(defmethod login drawable-inline-array-tfrag-trans ((obj drawable-inline-array-tfrag-trans))
(set! *texture-masks-array* (-> *level* level *level-index* bsp alpha-masks))
(dotimes (s5-0 (-> obj length))
(login (-> obj data s5-0))
)
obj
)
(defmethod login drawable-inline-array-tfrag-water ((obj drawable-inline-array-tfrag-water))
(set! *texture-masks-array* (-> *level* level *level-index* bsp water-masks))
(dotimes (s5-0 (-> obj length))
(login (-> obj data s5-0))
)
obj
)
(defmethod mem-usage drawable-inline-array-tfrag ((obj drawable-inline-array-tfrag) (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 drawable-tree-tfrag
(defmethod mem-usage drawable-tree-tfrag ((obj drawable-tree-tfrag) (arg0 memory-usage-block) (arg1 int))
(set! (-> arg0 length) (max 1 (-> arg0 length)))
(set! (-> arg0 data 0 name) "drawable-group")
(+! (-> arg0 data 0 count) 1)
(let ((v1-6 (asize-of obj)))
(+! (-> arg0 data 0 used) v1-6)
(+! (-> arg0 data 0 total) (logand -16 (+ v1-6 15)))
)
(when (nonzero? (-> obj time-of-day-pal))
(set! (-> arg0 length) (max 9 (-> arg0 length)))
(set! (-> arg0 data 8 name) "tfragment-pal")
(+! (-> arg0 data 8 count) 1)
(let ((v1-18 (asize-of (-> obj time-of-day-pal))))
(+! (-> arg0 data 8 used) v1-18)
(+! (-> arg0 data 8 total) (logand -16 (+ v1-18 15)))
)
)
(dotimes (s3-0 (-> obj length))
(mem-usage (-> obj arrays s3-0) arg0 arg1)
)
obj
)
(defmethod asize-of drawable-inline-array-tfrag ((obj drawable-inline-array-tfrag))
(the-as int (+ (-> drawable-inline-array-tfrag size) (* (+ (-> obj length) -1) 64)))
)
(define *tfrag-display-stats* #f)
(define tfrag-vu1-block (new 'static 'vu-function :length 0 :qlength 0))
(defun tfrag-data-setup ((arg0 tfrag-data) (arg1 int) (arg2 int))
(let ((v1-0 *math-camera*))
(set-vector! (-> arg0 fog) (-> v1-0 pfog0) (-> v1-0 fog-min) (-> v1-0 fog-max) 3072.0)
(set-vector! (-> arg0 val) 0.5 1.0 2048.0 0.0)
(set-vector! (-> arg0 ambient) 1.0 1.0 1.0 1.0)
(let ((a0-4 arg2))
(cond
((zero? a0-4)
(set! (-> arg0 strgif tag)
(new 'static 'gif-tag64
:pre #x1
:nreg #x3
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :fge #x1 :abe arg1)
)
)
(set! (-> arg0 fangif tag)
(new 'static 'gif-tag64
:pre #x1
:nreg #x3
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :fge #x1 :abe arg1)
)
)
)
((= a0-4 1)
(set! (-> arg0 strgif tag)
(new 'static 'gif-tag64
:pre #x1
:nreg #x3
:prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1 :abe arg1)
)
)
(set! (-> arg0 fangif tag)
(new 'static 'gif-tag64
:pre #x1
:nreg #x3
:prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1 :abe arg1)
)
)
)
((= a0-4 2)
(set! (-> arg0 strgif tag)
(new 'static 'gif-tag64
:pre #x1
:nreg #x3
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :fge #x1 :abe arg1)
)
)
(set! (-> arg0 fangif tag)
(new 'static 'gif-tag64
:pre #x1
:nreg #x3
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :fge #x1 :abe arg1)
)
)
)
((= a0-4 3)
(set! (-> arg0 strgif tag)
(new 'static 'gif-tag64
:pre #x1
:nreg #x3
:prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1 :abe arg1)
)
)
(set! (-> arg0 fangif tag)
(new 'static 'gif-tag64
:pre #x1
:nreg #x3
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :fge #x1 :abe arg1)
)
)
)
)
)
(set! (-> arg0 strgif regs)
(new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2))
)
(set! (-> arg0 fangif regs)
(new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2))
)
(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)))
(set! (-> arg0 hvdf-offset quad) (-> v1-0 hvdf-off quad))
(set! (-> arg0 hmge-scale quad) (-> v1-0 hmge-scale quad))
(set! (-> arg0 invh-scale quad) (-> v1-0 inv-hmge-scale quad))
(set! (-> arg0 guard quad) (-> v1-0 guard quad))
)
(set-tfrag-dists! (-> arg0 dists))
(none)
)
(defun add-tfrag-mtx-0 ((arg0 dma-buffer) (arg1 symbol))
(let* ((a2-0 4)
(v1-0 arg0)
(a0-1 (the-as dma-packet (-> v1-0 base)))
)
(set! (-> a0-1 dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a2-0))
(set! (-> a0-1 vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)))
(set! (-> a0-1 vif1) (new 'static 'vif-tag :imm #x5 :cmd (vif-cmd unpack-v4-32) :num a2-0))
(set! (-> v1-0 base) (the-as pointer (&+ a0-1 16)))
)
(if arg1
(column-scale-matrix!
(the-as matrix (-> arg0 base))
(new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
(-> *math-camera* camera-temp-other)
)
(column-scale-matrix!
(the-as matrix (-> arg0 base))
(new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
(-> *math-camera* camera-temp)
)
)
(&+! (-> arg0 base) 64)
(none)
)
(defun add-tfrag-mtx-1 ((arg0 dma-buffer) (arg1 symbol))
(let* ((a2-0 4)
(v1-0 arg0)
(a0-1 (the-as dma-packet (-> v1-0 base)))
)
(set! (-> a0-1 dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a2-0))
(set! (-> a0-1 vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)))
(set! (-> a0-1 vif1) (new 'static 'vif-tag :imm #x14d :cmd (vif-cmd unpack-v4-32) :num a2-0))
(set! (-> v1-0 base) (the-as pointer (&+ a0-1 16)))
)
(if arg1
(column-scale-matrix!
(the-as matrix (-> arg0 base))
(new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
(-> *math-camera* camera-temp-other)
)
(column-scale-matrix!
(the-as matrix (-> arg0 base))
(new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
(-> *math-camera* camera-temp)
)
)
(&+! (-> arg0 base) 64)
(none)
)
(defun add-tfrag-data ((arg0 dma-buffer) (arg1 int) (arg2 int))
(let* ((a3-0 14)
(v1-0 arg0)
(a0-1 (the-as dma-packet (-> v1-0 base)))
)
(set! (-> a0-1 dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a3-0))
(set! (-> a0-1 vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)))
(set! (-> a0-1 vif1) (new 'static 'vif-tag :imm #x290 :cmd (vif-cmd unpack-v4-32) :num a3-0))
(set! (-> v1-0 base) (the-as pointer (&+ a0-1 16)))
)
(tfrag-data-setup (the-as tfrag-data (-> arg0 base)) arg1 arg2)
(&+! (-> arg0 base) 224)
(let ((v1-3 (the-as dma-packet (-> arg0 base))))
(set! (-> v1-3 dma) (new 'static 'dma-tag :id (dma-tag-id cnt)))
(set! (-> v1-3 vif0) (new 'static 'vif-tag))
(set! (-> v1-3 vif1) (new 'static 'vif-tag :cmd (vif-cmd mscal) :msk #x1))
(set! (-> arg0 base) (the-as pointer (&+ v1-3 16)))
)
(none)
)
(defun add-pc-tfrag3-data ((dma-buf dma-buffer) (lev level))
"Add PC-port specific tfrag data"
(let ((packet (the-as dma-packet (-> dma-buf base))))
(set! (-> packet dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc 16))
(set! (-> packet vif0) (new 'static 'vif-tag))
(set! (-> packet vif1) (new 'static 'vif-tag :cmd (vif-cmd pc-port)))
(set! (-> dma-buf base) (the pointer (&+ packet 16)))
)
;; first 4 quadwords are planes, then itimes
(let ((data-ptr (the-as (pointer uint128) (-> dma-buf base))))
(set! (-> data-ptr 0) (-> *math-camera* plane 0 quad))
(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
; (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))
(set! (-> data-ptr 8) (-> *math-camera* camera-temp vector 0 quad))
(set! (-> data-ptr 9) (-> *math-camera* camera-temp vector 1 quad))
(set! (-> data-ptr 10) (-> *math-camera* camera-temp vector 2 quad))
(set! (-> data-ptr 11) (-> *math-camera* camera-temp vector 3 quad))
(set! (-> data-ptr 12) (-> *math-camera* hvdf-off quad))
(let ((vec (-> (the (inline-array vector) data-ptr) 13)))
(set! (-> vec x) (-> *math-camera* pfog0))
(set! (-> vec y) (-> *math-camera* fog-min))
(set! (-> vec z) (-> *math-camera* fog-max))
)
(set! (-> data-ptr 14) (-> (math-camera-pos) quad))
(charp<-string (the (pointer uint8) (&-> data-ptr 15)) (symbol->string (-> lev nickname)))
)
(&+! (-> dma-buf base) (* 16 16))
)
(define t-stat (new 'global 'tfrag-stats))
(defun tfrag-print-stats ((arg0 symbol))
(when (and *tfrag-display-stats* (!= *master-mode* 'menu))
(format arg0 "~%")
(format arg0 "tris: ~8d~%" (-> t-stat tris))
(format arg0 "verts: ~8d~%" (+ (-> t-stat base-verts) (-> t-stat level0-verts) (-> t-stat level1-verts)))
(format arg0 " base: ~8d~%" (-> t-stat base-verts))
(format arg0 " lev0: ~8d~%" (-> t-stat level0-verts))
(format arg0 " lev1: ~8d~%" (-> t-stat level1-verts))
(format arg0 "tfaces: ~8d~%" (-> t-stat tfaces))
(format arg0 "tfrags: ~8d~%" (-> t-stat tfrags))
(format arg0 "dtris: ~8d~%" (-> t-stat dtris))
(format arg0 "dps: ~8d~%" (-> t-stat drawpoints))
(format arg0 "strips: ~8d~%" (-> t-stat strips))
(format arg0 "shaders:~8d~%" (-> t-stat dma-tex))
(format arg0 "tri/str:~8f~%" (/ (the float (-> t-stat dtris)) (the float (-> t-stat strips))))
(format arg0 "dma-cnt:~8d (~8d)~%" (-> t-stat dma-cnt) (* (-> t-stat dma-cnt) 32))
(format arg0 "dma-dta:~8d (~8d)~%" (-> t-stat dma-dta) (/ (* 33 (-> t-stat dma-dta)) 10))
(let ((f0-4 (* 32.0 (the float (-> t-stat dma-cnt))))
(f1-5 (* 3.3 (the float (-> t-stat dma-dta))))
(f2-3 (* 30.0 (the float (-> t-stat tfrags))))
)
(+ f0-4 f1-5 f2-3)
)
)
(none)
)
(set! (-> t-stat from) 0)
(set! (-> t-stat to) 0)
(set! (-> t-stat cnt) 0)
(defun tfrag-init-buffer ((arg0 dma-buffer) (arg1 gs-test) (arg2 int) (arg3 symbol))
(dma-buffer-add-vu-function arg0 tfrag-vu1-block 1)
(let* ((v1-0 arg0)
(a0-2 (the-as dma-packet (-> v1-0 base)))
)
(set! (-> a0-2 dma) (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt)))
(set! (-> a0-2 vif0) (new 'static 'vif-tag))
(set! (-> a0-2 vif1) (new 'static 'vif-tag :imm #x2 :cmd (vif-cmd direct) :msk #x1))
(set! (-> v1-0 base) (the-as pointer (&+ a0-2 16)))
)
(let* ((v1-1 arg0)
(a0-4 (the-as gs-gif-tag (-> v1-1 base)))
)
(set! (-> a0-4 tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1))
(set! (-> a0-4 regs) GIF_REGS_ALL_AD)
(set! (-> v1-1 base) (the-as pointer (&+ a0-4 16)))
)
(let* ((v1-2 arg0)
(a0-6 (-> v1-2 base))
)
(set! (-> (the-as (pointer gs-test) a0-6)) arg1)
(set! (-> (the-as (pointer gs-reg64) a0-6) 1) (gs-reg64 test-1))
(set! (-> v1-2 base) (&+ a0-6 16))
)
(add-tfrag-mtx-0 arg0 arg3)
(add-tfrag-mtx-1 arg0 arg3)
(add-tfrag-data arg0 arg2 (the-as int *subdivide-draw-mode*))
(#when PC_PORT
(add-pc-tfrag3-data arg0 *pc-tfrag-draw-level*)
)
(let ((v1-3 (the-as dma-packet (-> arg0 base))))
(set! (-> v1-3 dma) (new 'static 'dma-tag :id (dma-tag-id cnt)))
(set! (-> v1-3 vif0) (new 'static 'vif-tag :cmd (vif-cmd base)))
(set! (-> v1-3 vif1) (new 'static 'vif-tag :imm #x148 :cmd (vif-cmd offset)))
(set! (-> arg0 base) (the-as pointer (&+ v1-3 16)))
)
(none)
)
(defun tfrag-end-buffer ((arg0 dma-buffer) (arg1 int))
(let* ((v1-0 arg0)
(a2-0 (the-as dma-packet (-> v1-0 base)))
)
(set! (-> a2-0 dma) (new 'static 'dma-tag :qwc #x3 :id (dma-tag-id cnt)))
(set! (-> a2-0 vif0) (new 'static 'vif-tag :cmd (vif-cmd stmask)))
(set! (-> a2-0 vif1) (new 'static 'vif-tag))
(set! (-> v1-0 base) (the-as pointer (&+ a2-0 16)))
)
(let* ((v1-1 arg0)
(a0-1 (-> v1-1 base))
)
(set! (-> (the-as (pointer vif-tag) a0-1) 0) (the-as vif-tag arg1))
(set! (-> (the-as (pointer vif-tag) a0-1) 1) (new 'static 'vif-tag :cmd (vif-cmd flusha) :msk #x1))
(set! (-> (the-as (pointer vif-tag) a0-1) 2) (new 'static 'vif-tag :cmd (vif-cmd stmod)))
(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! (-> (the-as (pointer vif-tag) a0-1) 8) (new 'static 'vif-tag :cmd (vif-cmd base)))
(set! (-> (the-as (pointer vif-tag) a0-1) 9) (new 'static 'vif-tag :cmd (vif-cmd offset)))
(set! (-> (the-as (pointer vif-tag) a0-1) 10) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)))
(set! (-> (the-as (pointer vif-tag) a0-1) 11) (new 'static 'vif-tag))
(set! (-> v1-1 base) (&+ a0-1 48))
)
(none)
)
;; draw-inline-array-tfrag
;; definition for function tfrag-scissor-init-buffer
(defun tfrag-scissor-init-buffer ((arg0 dma-buffer) (arg1 gs-test) (arg2 int) (arg3 symbol))
(break!)
(none)
)
(defun tfrag-scissor-end-buffer ((arg0 dma-buffer) (arg1 uint))
(break!) ;; not ported
(none)
)
;; draw-inline-array-tfrag-scissor
;; stats-tfrag-asm
(defun stats-tfrag-asm ((frag tfragment))
(format 0 "no stats for you~%")
(none)
)
+269 -269
View File
@@ -27,10 +27,10 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(tex-l0-tfrag 7) ;; level 0 tex
(bucket-8 8) ;; tfrag
(tfrag-l0-tfrag 8) ;; tfrag
(bucket-9 9) ;; tie
(bucket-10 10) ;; tie
(bucket-11 11) ;; tfrag
(tfrag-s-l0-tfrag 11) ;; tfrag
(bucket-12 12) ;; tie
(bucket-13 13) ;; tie
(merc-l0-tfrag 14) ;; merc
@@ -39,10 +39,10 @@
(bucket-17 17) ;; tie
(tex-l1-tfrag 18) ;; tex
(bucket-19 19) ;; tfrag
(tfrag-l1-tfrag 19) ;; tfrag
(bucket-20 20) ;; tie
(bucket-21 21) ;; tie
(bucket-22 22) ;; tfrag
(tfrag-s-l1-tfrag 22) ;; tfrag
(bucket-23 23) ;; tie
(bucket-24 24) ;; tie
(merc-l1-tfrag 25) ;; merc
@@ -51,10 +51,10 @@
(bucket-28 28) ;; tie
(tex-l2-tfrag 29) ;; tex
(bucket-30 30) ;; tfrag
(tfrag-l2-tfrag 30) ;; tfrag
(bucket-31 31) ;; tie
(bucket-32 32) ;; tie
(bucket-33 33) ;; tfrag
(tfrag-s-l2-tfrag 33) ;; tfrag
(bucket-34 34) ;; tie
(bucket-35 35) ;; tie
(merc-l2-tfrag 36) ;; merc
@@ -63,10 +63,10 @@
(bucket-39 39) ;; tie
(tex-l3-tfrag 40) ;; tex
(bucket-41 41) ;; tfrag
(tfrag-l3-tfrag 41) ;; tfrag
(bucket-42 42) ;; tie
(bucket-43 43) ;; tie
(bucket-44 44) ;; tfrag
(tfrag-s-l3-tfrag 44) ;; tfrag
(bucket-45 45) ;; tie
(bucket-46 46) ;; tie
(merc-l3-tfrag 47) ;; merc
@@ -75,10 +75,10 @@
(bucket-50 50) ;; tie
(tex-l4-tfrag 51) ;; tex
(bucket-52 52) ;; tfrag
(tfrag-l4-tfrag 52) ;; tfrag
(bucket-53 53) ;; tie
(bucket-54 54) ;; tie
(bucket-55 55) ;; tfrag
(tfrag-s-l4-tfrag 55) ;; tfrag
(bucket-56 56) ;; tie
(bucket-57 57) ;; tie
(merc-l4-tfrag 58) ;; merc
@@ -87,10 +87,10 @@
(bucket-61 61) ;; tie
(tex-l5-tfrag 62) ;; tex
(bucket-63 63) ;; tfrag
(tfrag-l5-tfrag 63) ;; tfrag
(bucket-64 64) ;; tie
(bucket-65 65) ;; tie
(bucket-66 66) ;; tfrag
(tfrag-s-l5-tfrag 66) ;; tfrag
(bucket-67 67) ;; tie
(bucket-68 68) ;; tie
(merc-l5-tfrag 69) ;; merc
@@ -102,299 +102,299 @@
;; All levels with shrub tpage
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(tex-l0-shrub 73) ;; tex
(bucket-74 74) ;; shrub
(bucket-75 75) ;; shrub
(bucket-76 76) ;; shrub
(bucket-77 77) ;; shrub
(bucket-78 78) ;; shrub
(merc-l0-shrub 79) ;; merc
(emerc-l0-shrub 80) ;; emerc
(bucket-81 81) ;; mercneric
(tex-l0-shrub 73) ;; tex
(bucket-74 74) ;; shrub
(bucket-75 75) ;; shrub
(bucket-76 76) ;; shrub
(bucket-77 77) ;; shrub
(bucket-78 78) ;; shrub
(merc-l0-shrub 79) ;; merc
(emerc-l0-shrub 80) ;; emerc
(bucket-81 81) ;; mercneric
(tex-l1-shrub 82) ;; tex
(bucket-83 83) ;; shrub
(bucket-84 84) ;; shrub
(bucket-85 85) ;; shrub
(bucket-86 86) ;; shrub
(bucket-87 87) ;; shrub
(merc-l1-shrub 88) ;; merc
(emerc-l1-shrub 89) ;; emerc
(bucket-90 90) ;; mercneric
(tex-l1-shrub 82) ;; tex
(bucket-83 83) ;; shrub
(bucket-84 84) ;; shrub
(bucket-85 85) ;; shrub
(bucket-86 86) ;; shrub
(bucket-87 87) ;; shrub
(merc-l1-shrub 88) ;; merc
(emerc-l1-shrub 89) ;; emerc
(bucket-90 90) ;; mercneric
(tex-l2-shrub 91) ;; tex
(bucket-92 92) ;; shrub
(bucket-93 93) ;; shrub
(bucket-94 94) ;; shrub
(bucket-95 95) ;; shrub
(bucket-96 96) ;; shrub
(merc-l2-shrub 97) ;; merc
(emerc-l2-shrub 98) ;; emerc
(bucket-99 99) ;; mercneric
(tex-l2-shrub 91) ;; tex
(bucket-92 92) ;; shrub
(bucket-93 93) ;; shrub
(bucket-94 94) ;; shrub
(bucket-95 95) ;; shrub
(bucket-96 96) ;; shrub
(merc-l2-shrub 97) ;; merc
(emerc-l2-shrub 98) ;; emerc
(bucket-99 99) ;; mercneric
(tex-l3-shrub 100) ;; tex
(bucket-101 101) ;; shrub
(bucket-102 102) ;; shrub
(bucket-103 103) ;; shrub
(bucket-104 104) ;; shrub
(bucket-105 105) ;; shrub
(merc-l3-shrub 106) ;; merc
(emerc-l3-shrub 107) ;; emerc
(bucket-108 108) ;; mercneric
(tex-l3-shrub 100) ;; tex
(bucket-101 101) ;; shrub
(bucket-102 102) ;; shrub
(bucket-103 103) ;; shrub
(bucket-104 104) ;; shrub
(bucket-105 105) ;; shrub
(merc-l3-shrub 106) ;; merc
(emerc-l3-shrub 107) ;; emerc
(bucket-108 108) ;; mercneric
(tex-l4-shrub 109) ;; tex
(bucket-110 110) ;; shrub
(bucket-111 111) ;; shrub
(bucket-112 112) ;; shrub
(bucket-113 113) ;; shrub
(bucket-114 114) ;; shrub
(merc-l4-shrub 115) ;; merc
(emerc-l4-shrub 116) ;; emerc
(bucket-117 117) ;; mercneric
(tex-l4-shrub 109) ;; tex
(bucket-110 110) ;; shrub
(bucket-111 111) ;; shrub
(bucket-112 112) ;; shrub
(bucket-113 113) ;; shrub
(bucket-114 114) ;; shrub
(merc-l4-shrub 115) ;; merc
(emerc-l4-shrub 116) ;; emerc
(bucket-117 117) ;; mercneric
(tex-l5-shrub 118) ;; tex
(bucket-119 119) ;; shrub
(bucket-120 120) ;; shrub
(bucket-121 121) ;; shrub
(bucket-122 122) ;; shrub
(bucket-123 123) ;; shrub
(merc-l5-shrub 124) ;; merc
(emerc-l5-shrub 125) ;; emerc
(bucket-126 126) ;; mercneric
(tex-l5-shrub 118) ;; tex
(bucket-119 119) ;; shrub
(bucket-120 120) ;; shrub
(bucket-121 121) ;; shrub
(bucket-122 122) ;; shrub
(bucket-123 123) ;; shrub
(merc-l5-shrub 124) ;; merc
(emerc-l5-shrub 125) ;; emerc
(bucket-126 126) ;; mercneric
(tex-l0-alpha 127) ;; tex
(bucket-128 128) ;; tfrag
(bucket-129 129) ;; tie
(bucket-130 130) ;; tie
(merc-l0-alpha 131) ;; merc
(emerc-l0-alpha 132) ;; emerc
(bucket-133 133) ;; mercneric
(bucket-134 134) ;; tfrag
(bucket-135 135) ;; tie
(bucket-136 136) ;; tie
(tex-l0-alpha 127) ;; tex
(tfrag-t-l0-alpha 128) ;; tfrag
(bucket-129 129) ;; tie
(bucket-130 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
(tex-l1-alpha 137) ;; tex
(bucket-138 138) ;; tfrag
(bucket-139 139) ;; tie
(bucket-140 140) ;; tie
(merc-l1-alpha 141) ;; merc
(emerc-l1-alpha 142) ;; emerc
(bucket-143 143) ;; mercneric
(bucket-144 144) ;; tfrag
(bucket-145 145) ;; tie
(bucket-146 146) ;; tie
(tex-l1-alpha 137) ;; tex
(tfrag-t-l1-alpha 138) ;; tfrag
(bucket-139 139) ;; tie
(bucket-140 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
(tex-l2-alpha 147) ;; tex
(bucket-148 148) ;; tfrag
(bucket-149 149) ;; tie
(bucket-150 150) ;; tie
(merc-l2-alpha 151) ;; merc
(emerc-l2-alpha 152) ;; emerc
(bucket-153 153) ;; mercneric
(bucket-154 154) ;; tfrag
(bucket-155 155) ;; tie
(bucket-156 156) ;; tie
(tex-l2-alpha 147) ;; tex
(tfrag-t-l2-alpha 148) ;; tfrag
(bucket-149 149) ;; tie
(bucket-150 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
(tex-l3-alpha 157) ;; tex
(bucket-158 158) ;; tfrag
(bucket-159 159) ;; tie
(bucket-160 160) ;; tie
(merc-l3-alpha 161) ;; merc
(emerc-l3-alpha 162) ;; emerc
(bucket-163 163) ;; mercneric
(bucket-164 164) ;; tfrag
(bucket-165 165) ;; tie
(bucket-166 166) ;; tie
(tex-l3-alpha 157) ;; tex
(tfrag-t-l3-alpha 158) ;; tfrag
(bucket-159 159) ;; tie
(bucket-160 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
(tex-l4-alpha 167) ;; tex
(bucket-168 168) ;; tfrag
(bucket-169 169) ;; tie
(bucket-170 170) ;; tie
(merc-l4-alpha 171) ;; merc
(emerc-l4-alpha 172) ;; emerc
(bucket-173 173) ;; mercneric
(bucket-174 174) ;; tfrag
(bucket-175 175) ;; tie
(bucket-176 176) ;; tie
(tex-l4-alpha 167) ;; tex
(tfrag-t-l4-alpha 168) ;; tfrag
(bucket-169 169) ;; tie
(bucket-170 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
(tex-l5-alpha 177) ;; tex
(bucket-178 178) ;; tfrag
(bucket-179 179) ;; tie
(bucket-180 180) ;; tie
(merc-l5-alpha 181) ;; merc
(emerc-l5-alpha 182) ;; emerc
(bucket-183 183) ;; mercneric
(bucket-184 184) ;; tfrag
(bucket-185 185) ;; tie
(bucket-186 186) ;; tie
(tex-l5-alpha 177) ;; tex
(tfrag-t-l5-alpha 178) ;; tfrag
(bucket-179 179) ;; tie
(bucket-180 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
(tex-lcom-tfrag 187) ;; tex
(merc-lcom-tfrag 188) ;; merc
(emerc-lcom-tfrag 189) ;; emerc
(bucket-190 190) ;; mercneric
(tex-lcom-tfrag 187) ;; tex
(merc-lcom-tfrag 188) ;; merc
(emerc-lcom-tfrag 189) ;; emerc
(bucket-190 190) ;; mercneric
(tex-lcom-shrub 191) ;; tex
(merc-lcom-shrub 192) ;; merc
(emerc-lcom-shrub 193) ;; emerc
(bucket-194 194) ;; mercneric
(tex-lcom-shrub 191) ;; tex
(merc-lcom-shrub 192) ;; merc
(emerc-lcom-shrub 193) ;; emerc
(bucket-194 194) ;; mercneric
(bucket-195 195) ;; shadow
(bucket-195 195) ;; shadow
(tex-l0-pris 196) ;; tex
(merc-l0-pris 197) ;; merc
(emerc-l0-pris 198) ;; emerc
(bucket-199 199) ;; mercneric
(tex-l0-pris 196) ;; tex
(merc-l0-pris 197) ;; merc
(emerc-l0-pris 198) ;; emerc
(bucket-199 199) ;; mercneric
(tex-l1-pris 200) ;; tex
(merc-l1-pris 201) ;; merc
(emerc-l1-pris 202) ;; emerc
(bucket-203 203) ;; mercneric
(tex-l1-pris 200) ;; tex
(merc-l1-pris 201) ;; merc
(emerc-l1-pris 202) ;; emerc
(bucket-203 203) ;; mercneric
(tex-l2-pris 204) ;; tex
(merc-l2-pris 205) ;; merc
(emerc-l2-pris 206) ;; emerc
(bucket-207 207) ;; mercneric
(tex-l2-pris 204) ;; tex
(merc-l2-pris 205) ;; merc
(emerc-l2-pris 206) ;; emerc
(bucket-207 207) ;; mercneric
(tex-l3-pris 208) ;; tex
(merc-l3-pris 209) ;; merc
(emerc-l3-pris 210) ;; emerc
(bucket-211 211) ;; mercneric
(tex-l3-pris 208) ;; tex
(merc-l3-pris 209) ;; merc
(emerc-l3-pris 210) ;; emerc
(bucket-211 211) ;; mercneric
(tex-l4-pris 212) ;; tex
(merc-l4-pris 213) ;; merc
(emerc-l4-pris 214) ;; emerc
(bucket-215 215) ;; mercneric
(tex-l4-pris 212) ;; tex
(merc-l4-pris 213) ;; merc
(emerc-l4-pris 214) ;; emerc
(bucket-215 215) ;; mercneric
(tex-l5-pris 216) ;; tex
(merc-l5-pris 217) ;; merc
(emerc-l5-pris 218) ;; emerc
(bucket-219 219) ;; mercneric
(tex-l5-pris 216) ;; tex
(merc-l5-pris 217) ;; merc
(emerc-l5-pris 218) ;; emerc
(bucket-219 219) ;; mercneric
(tex-lcom-pris 220) ;; tex
(merc-lcom-pris 221) ;; merc
(emerc-lcom-pris 222) ;; emerc
(bucket-223 223) ;; mercneric
(tex-lcom-pris 220) ;; tex
(merc-lcom-pris 221) ;; merc
(emerc-lcom-pris 222) ;; emerc
(bucket-223 223) ;; mercneric
(tex-l0-pris2 224) ;; tex
(merc-l0-pris2 225) ;; merc
(emerc-l0-pris2 226) ;; emerc
(bucket-227 227) ;; mercneric
(tex-l0-pris2 224) ;; tex
(merc-l0-pris2 225) ;; merc
(emerc-l0-pris2 226) ;; emerc
(bucket-227 227) ;; mercneric
(tex-l1-pris2 228) ;; tex
(merc-l1-pris2 229) ;; merc
(emerc-l1-pris2 230) ;; emerc
(bucket-231 231) ;; mercneric
(tex-l1-pris2 228) ;; tex
(merc-l1-pris2 229) ;; merc
(emerc-l1-pris2 230) ;; emerc
(bucket-231 231) ;; mercneric
(tex-l2-pris2 232) ;; tex
(merc-l2-pris2 233) ;; merc
(emerc-l2-pris2 234) ;; emerc
(bucket-235 235) ;; mercneric
(tex-l2-pris2 232) ;; tex
(merc-l2-pris2 233) ;; merc
(emerc-l2-pris2 234) ;; emerc
(bucket-235 235) ;; mercneric
(tex-l3-pris2 236) ;; tex
(merc-l3-pris2 237) ;; merc
(emerc-l3-pris2 238) ;; emerc
(bucket-239 239) ;; mercneric
(tex-l3-pris2 236) ;; tex
(merc-l3-pris2 237) ;; merc
(emerc-l3-pris2 238) ;; emerc
(bucket-239 239) ;; mercneric
(tex-l4-pris2 240) ;; tex
(merc-l4-pris2 241) ;; merc
(emerc-l4-pris2 242) ;; emerc
(bucket-243 243) ;; mercneric
(tex-l4-pris2 240) ;; tex
(merc-l4-pris2 241) ;; merc
(emerc-l4-pris2 242) ;; emerc
(bucket-243 243) ;; mercneric
(tex-l5-pris2 244) ;; tex
(merc-l5-pris2 245) ;; merc
(emerc-l5-pris2 246) ;; emerc
(bucket-247 247) ;; mercneric
(tex-l5-pris2 244) ;; tex
(merc-l5-pris2 245) ;; merc
(emerc-l5-pris2 246) ;; emerc
(bucket-247 247) ;; mercneric
(tex-lcom-pris2 248) ;; tex
(merc-lcom-pris2 249) ;; merc
(emerc-lcom-pris2 250) ;; emerc
(bucket-251 251) ;; mercneric
(tex-lcom-pris2 248) ;; tex
(merc-lcom-pris2 249) ;; merc
(emerc-lcom-pris2 250) ;; emerc
(bucket-251 251) ;; mercneric
(tex-l0-water 252) ;; tex
(merc-l0-water 253) ;; merc
(bucket-254 254) ;; mercneric
(bucket-255 255) ;; tfrag
(bucket-256 256)
(bucket-257 257)
(bucket-258 258)
(bucket-259 259) ;; tfrag
(bucket-260 260)
(tex-l0-water 252) ;; tex
(merc-l0-water 253) ;; merc
(bucket-254 254) ;; mercneric
(tfrag-w-l0-water 255) ;; tfrag
(bucket-256 256)
(bucket-257 257)
(bucket-258 258)
(tfrag-ws-l0-water 259) ;; tfrag
(bucket-260 260)
(tex-l1-water 261) ;; tex
(merc-l1-water 262) ;; merc
(bucket-263 263) ;; mercneric
(bucket-264 264) ;; tfrag
(bucket-265 265)
(bucket-266 266)
(bucket-267 267)
(bucket-268 268) ;; tfrag
(bucket-269 269)
(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)
(tfrag-ws-l1-water 268) ;; tfrag
(bucket-269 269)
(tex-l2-water 270) ;; tex
(merc-l2-water 271) ;; merc
(bucket-272 272) ;; mercneric
(bucket-273 273) ;; tfrag
(bucket-274 274)
(bucket-275 275)
(bucket-276 276)
(bucket-277 277) ;; tfrag
(bucket-278 278)
(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)
(tfrag-ws-l2-water 277) ;; tfrag
(bucket-278 278)
(tex-l3-water 279) ;; tex
(merc-l3-water 280) ;; merc
(bucket-281 281) ;; mercneric
(bucket-282 282) ;; tfrag
(bucket-283 283)
(bucket-284 284)
(bucket-285 285)
(bucket-286 286) ;; tfrag
(bucket-287 287)
(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)
(tfrag-ws-l3-water 286) ;; tfrag
(bucket-287 287)
(tex-l4-water 288) ;; tex
(merc-l4-water 289) ;; merc
(bucket-290 290) ;; mercneric
(bucket-291 291) ;; tfrag
(bucket-292 292)
(bucket-293 293)
(bucket-294 294)
(bucket-295 295) ;; tfrag
(bucket-296 296)
(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)
(tfrag-ws-l4-water 295) ;; tfrag
(bucket-296 296)
(tex-l5-water 297) ;; tex
(merc-l5-water 298) ;; merc
(bucket-299 299) ;; mercneric
(bucket-300 300) ;; tfrag
(bucket-301 301)
(bucket-302 302)
(bucket-303 303)
(bucket-304 304) ;; tfrag
(bucket-305 305)
(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)
(tfrag-ws-l5-water 304) ;; tfrag
(bucket-305 305)
(tex-lcom-water 306) ;; tex
(merc-lcom-water 307) ;; merc
(bucket-308 308) ;; mercneric
(tex-lcom-water 306) ;; tex
(merc-lcom-water 307) ;; merc
(bucket-308 308) ;; mercneric
(tex-lcom-sky-post 309)
(tex-lcom-sky-post 309)
(bucket-310 310) ;; ocean
(bucket-311 311) ;; depth-cue
(bucket-310 310) ;; ocean
(bucket-311 311) ;; depth-cue
(tex-all-sprite 312)
(bucket-313 313) ;; particles
(bucket-314 314) ;; shadow
(bucket-315 315) ;; effects
(tex-all-warp 316) ;; tex
(bucket-317 317) ;; mercneric
(tex-all-sprite 312)
(bucket-313 313) ;; particles
(bucket-314 314) ;; shadow
(bucket-315 315) ;; effects
(tex-all-warp 316) ;; tex
(bucket-317 317) ;; mercneric
(debug-no-zbuf1 318) ;; debug, no zbuf
(tex-all-map 319) ;; tex
(bucket-320 320) ;; hud
(screen-filter 321) ;; hud letterbox, no zbuf
(bucket-322 322) ;; hud
(bucket-323 323) ;; hud
(debug2 324) ;; debug
(debug-no-zbuf2 325) ;; debug
(debug3 326)
(debug-no-zbuf1 318) ;; debug, no zbuf
(tex-all-map 319) ;; tex
(bucket-320 320) ;; hud
(screen-filter 321) ;; hud letterbox, no zbuf
(bucket-322 322) ;; hud
(bucket-323 323) ;; hud
(debug2 324) ;; debug
(debug-no-zbuf2 325) ;; debug
(debug3 326)
)
(defenum vu1-renderer-mask
@@ -406,7 +406,7 @@
(rn3)
(rn4)
(rn5)
(rn6)
(tfrag)
(rn7)
(rn8)
(rn9)
@@ -419,12 +419,12 @@
(rn16)
(rn17)
(rn18)
(rn19)
(tfrag-trans)
(rn20)
(rn21)
(rn22)
(rn23)
(rn24)
(tfrag-water)
(rn25)
(rn26)
(rn27)
+12 -5
View File
@@ -81,18 +81,25 @@
(region-array region-array :offset-assert 192)
(collide-hash collide-hash :offset-assert 196)
;; 200 is some array
;; 204 is maybe that array's length
(wind-array-length int32 :offset 204)
;; 216 is a vector array
;; (vec-array (pointer vector) :offset 216) ; TODO see - `update-visible` hits assertion
(region-tree drawable-tree-region-prim :offset 252)
(tfrag-masks texture-masks-array :offset-assert 256)
(tfrag-mask-count uint32 :offset-assert 260)
(tfrag-closest (pointer float) :offset-assert 260)
(tfrag-mask-count uint32 :offset 260)
(shrub-masks texture-masks-array :offset-assert 264)
(shrub-mask-count uint32 :offset-assert 268)
(shrub-closest (pointer float) :offset-assert 268)
(shrub-mask-count uint32 :offset 268)
(alpha-masks texture-masks-array :offset-assert 272)
(alpha-mask-count uint32 :offset-assert 276)
(alpha-closest (pointer float) :offset-assert 276)
(alpha-mask-count uint32 :offset 276)
(water-masks texture-masks-array :offset-assert 280)
(water-mask-count uint32 :offset-assert 284)
(water-closest (pointer float) :offset-assert 284)
(water-mask-count uint32 :offset 284)
(bsp-scale vector :inline :offset-assert 288)
(bsp-offset vector :inline :offset-assert 304)
+1
View File
@@ -288,6 +288,7 @@
(water-masks texture-masks-array :offset-assert 5064)
(water-dists pointer :offset-assert 5068)
(tfrag-last-calls int32 6 :offset-assert 5072)
(tfrag-last-calls-u32 uint32 6 :offset 5072)
(texture-anim-array texture-anim-array 10 :offset-assert 5096)
(light-hash light-hash :offset-assert 5136)
(draw-priority float :offset-assert 5140)
+31 -11
View File
@@ -763,6 +763,11 @@
)
(else
(start-debug "load-begin, no borrow~%")
(dotimes (i 7)
(start-debug "lev ~8S bits #b~b~%"
(-> *level* level i name)
(-> *level* level i memory-mask))
)
;; not borrowing, we have to find our own memory.
;; there's a bit mask to indicate which sections of memory are used, with 6 bits.
@@ -826,34 +831,34 @@
(((load-buffer-mode medium))
;; need 3 bits in the mask.
;; like large, check both ends.
(when (memory-unused? *level* #xb000111)
(when (memory-unused? *level* #b000111)
(set! bits-to-use 7)
(goto cfg-83)
)
(when (memory-unused? *level* #xb111000)
(when (memory-unused? *level* #b111000)
(set! offset-in-level-heap 73) ;; weird sizing
(set! bits-to-use #xb111000)
(set! bits-to-use #b111000)
(goto cfg-83)
)
)
(((load-buffer-mode small-center))
;; only one place for us to go, in the center
(when (memory-unused? *level* #xb001100)
(when (memory-unused? *level* #b001100)
(set! offset-in-level-heap 48)
(set! bits-to-use #xb1100)
(set! bits-to-use #b1100)
(goto cfg-83)
)
)
(((load-buffer-mode small-edge))
;; check one side
(when (memory-unused? *level* #xb000011)
(set! bits-to-use #xb000011)
(when (memory-unused? *level* #b000011)
(set! bits-to-use #b000011)
(goto cfg-83)
)
;; and the other
(when (memory-unused? *level* #xb110000)
(when (memory-unused? *level* #b110000)
(set! offset-in-level-heap 98)
(set! bits-to-use #xb110000)
(set! bits-to-use #b110000)
(goto cfg-83)
)
)
@@ -905,7 +910,7 @@
0
)
(else
(start-debug "successfully found load: size #x~X, bits #b~6,'0B, offset ~D~%"
(start-debug "successfully found load: size #x~X, bits #x~X, offset ~D~%"
heap-size bits-to-use offset-in-level-heap)
;; found a spot, set mask.
(set! (-> obj memory-mask) (the-as uint bits-to-use))
@@ -2148,7 +2153,7 @@
'demo
)
(*debug-segment*
'prison
'prison ;; 'ctysluma
)
(else
'title
@@ -2935,6 +2940,21 @@
(format *stdcon* "~3Lglobal heap fatally low at ~DK free~%~0L" (sar v1-186 10))
)
)
;; pc port added
(let ((lev-names (new 'stack-no-clear 'array 'string 6)))
(dotimes (i 6)
(cond
((= (-> obj level i status) 'inactive)
(set! (-> lev-names i) "none")
)
(else
(set! (-> lev-names i) (symbol->string (-> obj level i nickname)))
)
)
)
(__pc-set-levels lev-names)
)
0
(none)
)
+36 -36
View File
@@ -152,42 +152,42 @@
(defun profile-tfrag-test ((arg0 bucket-id))
"Is this a tfrag bucket?"
(or (= arg0 (bucket-id bucket-8))
(= arg0 (bucket-id bucket-19))
(= arg0 (bucket-id bucket-30))
(= arg0 (bucket-id bucket-41))
(= arg0 (bucket-id bucket-52))
(= arg0 (bucket-id bucket-63))
(= arg0 (bucket-id bucket-11))
(= arg0 (bucket-id bucket-22))
(= arg0 (bucket-id bucket-33))
(= arg0 (bucket-id bucket-44))
(= arg0 (bucket-id bucket-55))
(= arg0 (bucket-id bucket-66))
(= arg0 (bucket-id bucket-128))
(= arg0 (bucket-id bucket-138))
(= arg0 (bucket-id bucket-148))
(= arg0 (bucket-id bucket-158))
(= arg0 (bucket-id bucket-168))
(= arg0 (bucket-id bucket-178))
(= arg0 (bucket-id bucket-255))
(= arg0 (bucket-id bucket-264))
(= arg0 (bucket-id bucket-273))
(= arg0 (bucket-id bucket-282))
(= arg0 (bucket-id bucket-291))
(= arg0 (bucket-id bucket-300))
(= arg0 (bucket-id bucket-134))
(= arg0 (bucket-id bucket-144))
(= arg0 (bucket-id bucket-154))
(= arg0 (bucket-id bucket-164))
(= arg0 (bucket-id bucket-174))
(= arg0 (bucket-id bucket-184))
(= arg0 (bucket-id bucket-259))
(= arg0 (bucket-id bucket-268))
(= arg0 (bucket-id bucket-277))
(= arg0 (bucket-id bucket-286))
(= arg0 (bucket-id bucket-295))
(= arg0 (bucket-id bucket-304))
(or (= arg0 (bucket-id tfrag-l0-tfrag))
(= arg0 (bucket-id tfrag-l1-tfrag))
(= arg0 (bucket-id tfrag-l2-tfrag))
(= arg0 (bucket-id tfrag-l3-tfrag))
(= arg0 (bucket-id tfrag-l4-tfrag))
(= arg0 (bucket-id tfrag-l5-tfrag))
(= arg0 (bucket-id tfrag-s-l0-tfrag))
(= arg0 (bucket-id tfrag-s-l1-tfrag))
(= arg0 (bucket-id tfrag-s-l2-tfrag))
(= arg0 (bucket-id tfrag-s-l3-tfrag))
(= arg0 (bucket-id tfrag-s-l4-tfrag))
(= arg0 (bucket-id tfrag-s-l5-tfrag))
(= arg0 (bucket-id tfrag-t-l0-alpha))
(= arg0 (bucket-id tfrag-t-l1-alpha))
(= arg0 (bucket-id tfrag-t-l2-alpha))
(= arg0 (bucket-id tfrag-t-l3-alpha))
(= arg0 (bucket-id tfrag-t-l4-alpha))
(= arg0 (bucket-id tfrag-t-l5-alpha))
(= arg0 (bucket-id tfrag-w-l0-water))
(= arg0 (bucket-id tfrag-w-l1-water))
(= arg0 (bucket-id tfrag-w-l2-water))
(= arg0 (bucket-id tfrag-w-l3-water))
(= arg0 (bucket-id tfrag-w-l4-water))
(= arg0 (bucket-id tfrag-w-l5-water))
(= arg0 (bucket-id tfrag-st-l0-alpha))
(= arg0 (bucket-id tfrag-st-l1-alpha))
(= arg0 (bucket-id tfrag-st-l2-alpha))
(= arg0 (bucket-id tfrag-st-l3-alpha))
(= arg0 (bucket-id tfrag-st-l4-alpha))
(= arg0 (bucket-id tfrag-st-l5-alpha))
(= arg0 (bucket-id tfrag-ws-l0-water))
(= arg0 (bucket-id tfrag-ws-l1-water))
(= arg0 (bucket-id tfrag-ws-l2-water))
(= arg0 (bucket-id tfrag-ws-l3-water))
(= arg0 (bucket-id tfrag-ws-l4-water))
(= arg0 (bucket-id tfrag-ws-l5-water))
)
)
+103 -1
View File
@@ -659,6 +659,13 @@
"blocking-plane-ag"
)
;;;;;;;;;;;;;;;;;;;;;
;; COMMON CITY STUFF
;;;;;;;;;;;;;;;;;;;;;
(copy-gos
"fort-entry-gate-ag"
)
;;;;;;;;;;;;;;;;;;;;;
;; PRISON
@@ -683,11 +690,106 @@
"prsn-hang-cell-ag"
"warp-gate-b-ag"
"prsn-vent-fan-ag"
"fort-entry-gate-ag"
"prsn-cell-door-ag"
"prison-vis"
)
;;;;;;;;;;;;;;;;;;;;;
;; CITY WIDE
;;;;;;;;;;;;;;;;;;;;;
(cgo "CWI.DGO" "cwi.gd")
(goal-src-sequence
"levels/"
:deps ("$OUT/obj/los-control.o")
"city/common/nav-graph-h.gc"
"city/common/traffic-engine-h.gc"
"city/common/vehicle-h.gc"
"city/common/citizen-h.gc"
"city/common/height-map-h.gc"
"city/common/ctywide-obs-h.gc"
"city/common/height-map.gc"
"city/common/traffic-height-map.gc"
"city/common/nav-graph.gc"
"city/common/vehicle-rider.gc"
"city/common/vehicle-control.gc"
"city/common/vehicle-part.gc"
"city/common/vehicle-effects.gc"
"city/common/vehicle.gc"
"city/common/vehicle-util.gc"
"city/common/vehicle-physics.gc"
"city/common/vehicle-states.gc"
"city/common/vehicle-guard.gc"
"city/common/transport.gc"
"city/common/bike.gc"
"city/common/car.gc"
"city/common/test-bike.gc"
"city/common/test-car.gc"
"city/common/citizen.gc"
"city/common/civilian.gc"
"city/common/guard.gc"
"city/common/citizen-norm.gc"
"city/common/citizen-fat.gc"
"city/common/citizen-chick.gc"
"city/common/citizen-enemy.gc"
"city/common/metalhead-predator.gc"
"city/common/metalhead-grunt.gc"
"city/common/metalhead-flitter.gc"
"city/common/traffic-engine.gc"
"city/common/trail-graph.gc"
"city/common/trail.gc"
"city/common/traffic-manager.gc"
"city/common/ctywide-texture.gc"
"city/common/ctywide-part.gc"
"city/common/ctywide-obs.gc"
"city/common/ctywide-tasks.gc"
"city/common/ctywide-scenes.gc"
"city/common/ctywide-speech.gc"
"city/common/ctyport-obs.gc"
"city/common/target-pilot.gc"
"city/common/pilot-states.gc"
"city/common/searchlight.gc"
)
(copy-textures 1264 1266 1265 1674 1118 1657)
(copy-gos
"jak-pilot+0-ag"
"baron-statue-ag"
"cty-guard-turret-ag"
"vehicle-explosion-ag"
"barons-ship-lores-ag"
"propa-ag"
"vehicle-turret-ag"
"lurker-pipe-lid-ag"
"searchlight-ag"
"burning-bush-ag"
"stadium-barrier-ag"
"security-wall-ag"
"ctywide-vis"
)
;;;;;;;;;;;;;;;;;;;;;
;; CITY SLUM A
;;;;;;;;;;;;;;;;;;;;;
(cgo "CTA.DGO" "cta.gd")
(goal-src-sequence
"levels/city/slums/"
:deps ("$OUT/obj/los-control.o")
"ctysluma-part.gc"
"neon-baron-part.gc"
)
(copy-textures 974 973 1680 1021 1646)
(copy-gos
"cty-fruit-stand-ag"
"hide-door-a-ag"
"ctysluma-vis"
)
;;;;;;;;;;;;;;;;;;;;;
;; ISO Group
+1
View File
@@ -169,6 +169,7 @@
(define-extern unload (function string none))
(define-extern reset-graph (function int int int int none))
(define-extern __pc-set-levels (function (pointer string) none))
;; PC stuff
+8
View File
@@ -1376,6 +1376,14 @@
`(none)
)
(defmacro sext32 (in)
`(sar (shl ,in 32) 32)
)
(defmacro .sra (result in sa)
`(set! ,result (sext32 (sar (logand #xffffffff (the-as int ,in)) ,sa)))
)
;;;;;;;;;;;;;;;;;;;;;;;
;; PC Port asm macros
;;;;;;;;;;;;;;;;;;;;;;;
+5
View File
@@ -722,3 +722,8 @@
"Access an object on the scratchpad."
`(the-as ,type (&+ *fake-scratchpad-data* ,offset))
)
(defmacro scratchpad-ptr (type &key (offset 0))
"Create a pointer to an object on the scratchpad."
`(the-as (pointer ,type) (&+ *fake-scratchpad-data* ,offset))
)
+45
View File
@@ -0,0 +1,45 @@
;;-*-Lisp-*-
(in-package goal)
;; definition for symbol *tfrag-work*, type tfrag-work
(define *tfrag-work* (new 'static 'tfrag-work
:base-tmpl (new 'static 'dma-packet
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
:vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))
)
:level-0-tmpl (new 'static 'dma-packet
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
:vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))
)
:common-tmpl (new 'static 'dma-packet
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
:vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))
)
:level-1-tmpl (new 'static 'dma-packet
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
:vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))
)
:color-tmpl (new 'static 'dma-packet
:dma (new 'static 'dma-tag :id (dma-tag-id cnt))
:vif0 (new 'static 'vif-tag :imm #x102 :cmd (vif-cmd stcycl))
:vif1 (new 'static 'vif-tag :imm #xc000 :cmd (vif-cmd unpack-v4-8))
)
:max-fragment #xffff
)
)
;; failed to figure out what this is:
(set! (-> *tfrag-work* color-ptr x) (+ 6144 #x70000000))
;; failed to figure out what this is:
(set! (-> *tfrag-work* color-ptr y) (+ 6144 #x70000000))
;; failed to figure out what this is:
(set! (-> *tfrag-work* color-ptr z) (+ 6144 #x70000000))
;; failed to figure out what this is:
(set! (-> *tfrag-work* color-ptr w) (+ 6144 #x70000000))
+6 -6
View File
@@ -146,7 +146,7 @@
rn3
rn4
rn5
rn6
tfrag
rn7
rn8
rn9
@@ -159,12 +159,12 @@
rn16
rn17
rn18
rn19
tfrag-trans
rn20
rn21
rn22
rn23
rn24
tfrag-water
rn25
rn26
rn27
@@ -180,7 +180,7 @@
rn3
rn4
rn5
rn6
tfrag
rn7
rn8
rn9
@@ -193,12 +193,12 @@
rn16
rn17
rn18
rn19
tfrag-trans
rn20
rn21
rn22
rn23
rn24
tfrag-water
rn25
rn26
rn27
+1 -1
View File
@@ -89,7 +89,7 @@
(.por a3-3 a3-2 t0-0)
(let ((f0-1 (fmax f0-0 f1-0)))
(set! (-> a2-3 mask quad) a3-3)
(set! (-> a2-3 mask w) (the-as int f0-1))
(set! (-> a2-3 dist) f0-1)
)
)
)
+4 -8
View File
@@ -166,12 +166,12 @@
(dotimes (a1-0 3)
(set! (-> (the-as (pointer int32) (+ (+ (* a0-5 16) (* a1-0 4)) (the-as int *texture-masks*))))
(logior (-> (the-as (pointer int32) (+ (* a1-0 4) (the-as int *texture-masks*) (* a0-5 16))) 0)
(-> (the-as (inline-array texture-masks) (+ (* a1-0 4) (the-as int v1-3) (* a0-5 16))) 1 data 0 mask w)
(-> (the-as (pointer int32) (+ (* a1-0 4) (the-as int v1-3) (* a0-5 16))) 15)
)
)
)
(set! (-> *texture-masks* data a0-5 mask w)
(the-as int (fmax (-> *texture-masks* data a0-5 dist) (-> v1-3 masks data a0-5 dist)))
(set! (-> *texture-masks* data a0-5 dist)
(fmax (-> *texture-masks* data a0-5 dist) (-> v1-3 masks data a0-5 dist))
)
)
)
@@ -464,7 +464,7 @@
;; ERROR: Unsupported inline assembly instruction kind - [mfpc a0, pcr1]
(defun draw-drawable-tree-instance-shrub ((tree drawable-tree-instance-shrub) (level level))
(local-vars (a0-4 int) (a0-6 int) (a0-11 int) (a0-13 int))
(set! (-> *instance-shrub-work* texture-dists) (-> level bsp shrub-mask-count))
(set! (-> *instance-shrub-work* texture-dists) (the-as uint (-> level bsp shrub-closest)))
(set! (-> *instance-shrub-work* near-last) (the-as uint 0))
(set! (-> *instance-shrub-work* near-next) (the-as uint 0))
(set! (-> *instance-shrub-work* near-count) (the-as uint 0))
@@ -773,7 +773,3 @@
;; definition for function move-test-func
;; ERROR: function was not converted to expressions. Cannot decompile.
+2 -5
View File
@@ -2181,11 +2181,8 @@
;; definition for function hack-texture
(defun hack-texture ((arg0 texture))
(set! (-> arg0 uv-dist) 1000000.0)
(set! (-> arg0 masks data 0 mask w) (the-as int (+ 40960000.0 (-> arg0 masks data 0 dist))))
(let ((f0-4 (+ 40960000.0 (-> arg0 masks data 1 dist))))
(set! (-> arg0 masks data 1 mask w) (the-as int f0-4))
f0-4
)
(set! (-> arg0 masks data 0 dist) (+ 40960000.0 (-> arg0 masks data 0 dist)))
(set! (-> arg0 masks data 1 dist) (+ 40960000.0 (-> arg0 masks data 1 dist)))
)
;; definition for function adgif-shader-login
+1 -4
View File
@@ -80,6 +80,7 @@
(dma-base uint32 :offset 36)
(dma-level-1 uint32 :offset 40)
(dma-qwc uint8 4 :offset 44)
(dma-u32 uint32 :offset 44)
(shader (inline-array adgif-shader) :offset 48)
(num-shaders uint8 :offset 52)
(num-base-colors uint8 :offset 53)
@@ -490,7 +491,3 @@
;; failed to figure out what this is:
0
+76
View File
@@ -0,0 +1,76 @@
;;-*-Lisp-*-
(in-package goal)
;; definition for symbol tnear-vu1-block, type vu-function
(define tnear-vu1-block (new 'static 'vu-function :length #x38b :qlength #x1c6))
;; definition (debug) for function tfrag-details
;; WARN: Return type mismatch symbol vs none.
(defun-debug tfrag-details ((arg0 tfragment))
(format 0 "id = ~d~%" (-> arg0 id))
(format 0 "common:~%")
(let ((s5-0 (-> arg0 dma-qwc 0))
(s4-0 (-> arg0 dma-common))
)
(format 0 "qwc = ~d, ref = ~x~%" s5-0 s4-0)
(disasm-vif-tag (the-as (pointer vif-tag) s4-0) (the-as int (* s5-0 4)) (the-as symbol 0) #t)
)
(format 0 "base:~%")
(let ((s5-1 (-> arg0 dma-qwc 1))
(s4-1 (-> arg0 dma-base))
)
(format 0 "qwc = ~d, ref = ~x~%" s5-1 s4-1)
(disasm-vif-tag (the-as (pointer vif-tag) s4-1) (the-as int (* s5-1 4)) (the-as symbol 0) #t)
)
(format 0 "level-0:~%")
(let ((s5-2 (-> arg0 dma-qwc 3))
(s4-2 (-> arg0 dma-u32))
)
(format 0 "qwc = ~d, ref = ~x~%" s5-2 s4-2)
(disasm-vif-tag (the-as (pointer vif-tag) s4-2) (the-as int (* s5-2 4)) (the-as symbol 0) #t)
)
(format 0 "level-1:~%")
(let ((s5-3 (-> arg0 dma-qwc 2))
(gp-1 (-> arg0 dma-level-1))
)
(format 0 "qwc = ~d, ref = ~x~%" s5-3 gp-1)
(disasm-vif-tag (the-as (pointer vif-tag) gp-1) (the-as int (* s5-3 4)) (the-as symbol 0) #t)
)
(none)
)
;; definition (debug) for function clip-restore
;; INFO: Used lq/sq
;; WARN: Return type mismatch vector vs none.
(defun-debug clip-restore ()
(let ((a0-0 (new-stack-vector0))
(a1-0 (new-stack-matrix0))
)
(set! (-> a0-0 x) 92648.22)
(set! (-> a0-0 y) 238025.03)
(set! (-> a0-0 z) 199836.31)
(set! (-> a0-0 w) 1.0)
(set! (-> a1-0 vector 0 x) -0.9283)
(set! (-> a1-0 vector 0 y) 0.0)
(set! (-> a1-0 vector 0 z) 0.3716)
(set! (-> a1-0 vector 0 w) 0.0)
(set! (-> a1-0 vector 1 x) -0.2257)
(set! (-> a1-0 vector 1 y) 0.7945)
(set! (-> a1-0 vector 1 z) -0.5637)
(set! (-> a1-0 vector 1 w) 0.0)
(set! (-> a1-0 vector 2 x) -0.2952)
(set! (-> a1-0 vector 2 y) -0.6072)
(set! (-> a1-0 vector 2 z) -0.7375)
(set! (-> a1-0 vector 2 w) 0.0)
(set! (-> a1-0 trans x) 0.0)
(set! (-> a1-0 trans y) 0.0)
(set! (-> a1-0 trans z) 0.0)
(set! (-> a1-0 trans w) 1.0)
(debug-set-camera-pos-rot! a0-0 a1-0)
)
(none)
)
+9 -4
View File
@@ -69,15 +69,20 @@
(region-trees (array drawable-tree-region-prim) :offset-assert 188)
(region-array region-array :offset-assert 192)
(collide-hash collide-hash :offset-assert 196)
(wind-array-length int32 :offset 204)
(region-tree drawable-tree-region-prim :offset 252)
(tfrag-masks texture-masks-array :offset-assert 256)
(tfrag-mask-count uint32 :offset-assert 260)
(tfrag-closest (pointer float) :offset-assert 260)
(tfrag-mask-count uint32 :offset 260)
(shrub-masks texture-masks-array :offset-assert 264)
(shrub-mask-count uint32 :offset-assert 268)
(shrub-closest (pointer float) :offset-assert 268)
(shrub-mask-count uint32 :offset 268)
(alpha-masks texture-masks-array :offset-assert 272)
(alpha-mask-count uint32 :offset-assert 276)
(alpha-closest (pointer float) :offset-assert 276)
(alpha-mask-count uint32 :offset 276)
(water-masks texture-masks-array :offset-assert 280)
(water-mask-count uint32 :offset-assert 284)
(water-closest (pointer float) :offset-assert 284)
(water-mask-count uint32 :offset 284)
(bsp-scale vector :inline :offset-assert 288)
(bsp-offset vector :inline :offset-assert 304)
(unk-data uint32 18 :offset 180)
+23 -23
View File
@@ -609,12 +609,12 @@
;; WARN: Return type mismatch int vs none.
(defun build-masks ((arg0 bsp-header))
(let ((v1-0 (-> arg0 drawable-trees))
(s2-0 (-> arg0 tfrag-mask-count))
(s3-0 (-> arg0 shrub-mask-count))
(s4-0 (-> arg0 alpha-mask-count))
(gp-0 (-> arg0 water-mask-count))
(s2-0 (-> arg0 tfrag-closest))
(s3-0 (-> arg0 shrub-closest))
(s4-0 (-> arg0 alpha-closest))
(gp-0 (-> arg0 water-closest))
)
(when (zero? (+ s2-0 s3-0 s4-0 gp-0))
(when (zero? (&+ (+ (&+ s2-0 s3-0) (the-as int s4-0)) gp-0))
(dotimes (a0-5 (-> v1-0 length))
(let ((a1-2 (-> v1-0 trees a0-5)))
(cond
@@ -624,8 +624,8 @@
(a2-6 (-> (the-as drawable-inline-array-tfrag a2-5) data))
)
(dotimes (a3-1 a1-4)
(set! (-> a2-6 0 texture-masks-index) s2-0)
(+! s2-0 1)
(set! (-> a2-6 0 texture-masks-index) (the-as uint s2-0))
(&+! s2-0 1)
(set! a2-6 (the-as (inline-array tfragment) (-> a2-6 1)))
)
)
@@ -638,8 +638,8 @@
(a2-14 (-> (the-as drawable-inline-array-tfrag a2-13) data))
)
(dotimes (a3-3 a1-7)
(set! (-> a2-14 0 texture-masks-index) s4-0)
(+! s4-0 1)
(set! (-> a2-14 0 texture-masks-index) (the-as uint s4-0))
(&+! s4-0 1)
(set! a2-14 (the-as (inline-array tfragment) (-> a2-14 1)))
)
)
@@ -652,8 +652,8 @@
(a2-22 (-> (the-as drawable-inline-array-tfrag a2-21) data))
)
(dotimes (a3-5 a1-10)
(set! (-> a2-22 0 texture-masks-index) gp-0)
(+! gp-0 1)
(set! (-> a2-22 0 texture-masks-index) (the-as uint gp-0))
(&+! gp-0 1)
(set! a2-22 (the-as (inline-array tfragment) (-> a2-22 1)))
)
)
@@ -665,16 +665,16 @@
(dotimes (a3-7 a2-26)
(cond
((logtest? (-> a1-13 array-data a3-7 flags) (prototype-flags tpage-water))
(set! (-> a1-13 array-data a3-7 texture-masks-index) gp-0)
(+! gp-0 1)
(set! (-> a1-13 array-data a3-7 texture-masks-index) (the-as uint gp-0))
(&+! gp-0 1)
)
((logtest? (-> a1-13 array-data a3-7 flags) (prototype-flags tpage-alpha))
(set! (-> a1-13 array-data a3-7 texture-masks-index) s4-0)
(+! s4-0 1)
(set! (-> a1-13 array-data a3-7 texture-masks-index) (the-as uint s4-0))
(&+! s4-0 1)
)
(else
(set! (-> a1-13 array-data a3-7 texture-masks-index) s2-0)
(+! s2-0 1)
(set! (-> a1-13 array-data a3-7 texture-masks-index) (the-as uint s2-0))
(&+! s2-0 1)
)
)
)
@@ -686,8 +686,8 @@
(a2-31 (-> a2-30 data))
)
(dotimes (a3-9 a1-16)
(set! (-> a2-31 0 texture-masks-index) s3-0)
(+! s3-0 1)
(set! (-> a2-31 0 texture-masks-index) (the-as uint s3-0))
(&+! s3-0 1)
(set! a2-31 (the-as (inline-array prototype-bucket-shrub) (-> a2-31 1)))
)
)
@@ -698,7 +698,7 @@
)
(when (nonzero? s2-0)
(set! (-> arg0 tfrag-masks) (new 'loading-level 'texture-masks-array (the-as int s2-0)))
(set! (-> arg0 tfrag-mask-count) (the-as uint (malloc 'loading-level (the-as int (* s2-0 4)))))
(set! (-> arg0 tfrag-closest) (the-as (pointer float) (malloc 'loading-level (the-as int (* s2-0 4)))))
(let ((v1-5 (-> arg0 tfrag-masks)))
(dotimes (a0-8 (the-as int s2-0))
(let ((a1-24 (-> v1-5 data a0-8)))
@@ -711,7 +711,7 @@
)
(when (nonzero? s3-0)
(set! (-> arg0 shrub-masks) (new 'loading-level 'texture-masks-array (the-as int s3-0)))
(set! (-> arg0 shrub-mask-count) (the-as uint (malloc 'loading-level (the-as int (* s3-0 4)))))
(set! (-> arg0 shrub-closest) (the-as (pointer float) (malloc 'loading-level (the-as int (* s3-0 4)))))
(let ((v1-10 (-> arg0 shrub-masks)))
(dotimes (a0-11 (the-as int s3-0))
(let ((a1-32 (-> v1-10 data a0-11)))
@@ -724,7 +724,7 @@
)
(when (nonzero? s4-0)
(set! (-> arg0 alpha-masks) (new 'loading-level 'texture-masks-array (the-as int s4-0)))
(set! (-> arg0 alpha-mask-count) (the-as uint (malloc 'loading-level (the-as int (* s4-0 4)))))
(set! (-> arg0 alpha-closest) (the-as (pointer float) (malloc 'loading-level (the-as int (* s4-0 4)))))
(let ((v1-15 (-> arg0 alpha-masks)))
(dotimes (a0-14 (the-as int s4-0))
(let ((a1-40 (-> v1-15 data a0-14)))
@@ -737,7 +737,7 @@
)
(when (nonzero? gp-0)
(set! (-> arg0 water-masks) (new 'loading-level 'texture-masks-array (the-as int gp-0)))
(set! (-> arg0 water-mask-count) (the-as uint (malloc 'loading-level (the-as int (* gp-0 4)))))
(set! (-> arg0 water-closest) (the-as (pointer float) (malloc 'loading-level (the-as int (* gp-0 4)))))
(let ((v1-20 (-> arg0 water-masks)))
(dotimes (a0-17 (the-as int gp-0))
(let ((a1-48 (-> v1-20 data a0-17)))
+1
View File
@@ -455,6 +455,7 @@
(water-masks texture-masks-array :offset-assert 5064)
(water-dists pointer :offset-assert 5068)
(tfrag-last-calls int32 6 :offset-assert 5072)
(tfrag-last-calls-u32 uint32 6 :offset 5072)
(texture-anim-array texture-anim-array 10 :offset-assert 5096)
(light-hash light-hash :offset-assert 5136)
(draw-priority float :offset-assert 5140)
+36 -36
View File
@@ -155,42 +155,42 @@
;; definition for function profile-tfrag-test
(defun profile-tfrag-test ((arg0 bucket-id))
(or (= arg0 (bucket-id bucket-8))
(= arg0 (bucket-id bucket-19))
(= arg0 (bucket-id bucket-30))
(= arg0 (bucket-id bucket-41))
(= arg0 (bucket-id bucket-52))
(= arg0 (bucket-id bucket-63))
(= arg0 (bucket-id bucket-11))
(= arg0 (bucket-id bucket-22))
(= arg0 (bucket-id bucket-33))
(= arg0 (bucket-id bucket-44))
(= arg0 (bucket-id bucket-55))
(= arg0 (bucket-id bucket-66))
(= arg0 (bucket-id bucket-128))
(= arg0 (bucket-id bucket-138))
(= arg0 (bucket-id bucket-148))
(= arg0 (bucket-id bucket-158))
(= arg0 (bucket-id bucket-168))
(= arg0 (bucket-id bucket-178))
(= arg0 (bucket-id bucket-255))
(= arg0 (bucket-id bucket-264))
(= arg0 (bucket-id bucket-273))
(= arg0 (bucket-id bucket-282))
(= arg0 (bucket-id bucket-291))
(= arg0 (bucket-id bucket-300))
(= arg0 (bucket-id bucket-134))
(= arg0 (bucket-id bucket-144))
(= arg0 (bucket-id bucket-154))
(= arg0 (bucket-id bucket-164))
(= arg0 (bucket-id bucket-174))
(= arg0 (bucket-id bucket-184))
(= arg0 (bucket-id bucket-259))
(= arg0 (bucket-id bucket-268))
(= arg0 (bucket-id bucket-277))
(= arg0 (bucket-id bucket-286))
(= arg0 (bucket-id bucket-295))
(= arg0 (bucket-id bucket-304))
(or (= arg0 (bucket-id tfrag-l0-tfrag))
(= arg0 (bucket-id tfrag-l1-tfrag))
(= arg0 (bucket-id tfrag-l2-tfrag))
(= arg0 (bucket-id tfrag-l3-tfrag))
(= arg0 (bucket-id tfrag-l4-tfrag))
(= arg0 (bucket-id tfrag-l5-tfrag))
(= arg0 (bucket-id tfrag-s-l0-tfrag))
(= arg0 (bucket-id tfrag-s-l1-tfrag))
(= arg0 (bucket-id tfrag-s-l2-tfrag))
(= arg0 (bucket-id tfrag-s-l3-tfrag))
(= arg0 (bucket-id tfrag-s-l4-tfrag))
(= arg0 (bucket-id tfrag-s-l5-tfrag))
(= arg0 (bucket-id tfrag-t-l0-alpha))
(= arg0 (bucket-id tfrag-t-l1-alpha))
(= arg0 (bucket-id tfrag-t-l2-alpha))
(= arg0 (bucket-id tfrag-t-l3-alpha))
(= arg0 (bucket-id tfrag-t-l4-alpha))
(= arg0 (bucket-id tfrag-t-l5-alpha))
(= arg0 (bucket-id tfrag-w-l0-water))
(= arg0 (bucket-id tfrag-w-l1-water))
(= arg0 (bucket-id tfrag-w-l2-water))
(= arg0 (bucket-id tfrag-w-l3-water))
(= arg0 (bucket-id tfrag-w-l4-water))
(= arg0 (bucket-id tfrag-w-l5-water))
(= arg0 (bucket-id tfrag-st-l0-alpha))
(= arg0 (bucket-id tfrag-st-l1-alpha))
(= arg0 (bucket-id tfrag-st-l2-alpha))
(= arg0 (bucket-id tfrag-st-l3-alpha))
(= arg0 (bucket-id tfrag-st-l4-alpha))
(= arg0 (bucket-id tfrag-st-l5-alpha))
(= arg0 (bucket-id tfrag-ws-l0-water))
(= arg0 (bucket-id tfrag-ws-l1-water))
(= arg0 (bucket-id tfrag-ws-l2-water))
(= arg0 (bucket-id tfrag-ws-l3-water))
(= arg0 (bucket-id tfrag-ws-l4-water))
(= arg0 (bucket-id tfrag-ws-l5-water))
)
)
+1
View File
@@ -129,6 +129,7 @@
"(method 10 mysql-nav-graph)",
"bsp-camera-asm",
"build-masks",
"i-hopefully-will-never-exist-dont-add-anything-after-me-please"
],