Files
jak-project/goal_src/jak2/engine/gfx/tie/tie-methods.gc
T
water111 b5705bde96 [decomp] Partial implementation of tie (#1916)
Some stuff isn't working fully yet:
- fog color
- time of day
- draw order for multiple passes (currently all draws in the default tie
bucket)
- possibly settings for transparent stuff (untested, but might work)
- the "vanish" effect (we might not want this anyway?)
- environment mapping/etie completely not implemented.


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

![image](https://user-images.githubusercontent.com/48171810/192154316-457a7ee0-b5a4-4a40-b48e-8863114da735.png)
2022-09-25 12:50:51 -04:00

2093 lines
91 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: tie-methods.gc
;; name in dgo: tie-methods
;; dgos: ENGINE, GAME
;; DECOMP BEGINS
(deftype tie-debug (structure)
((max-instance uint32 :offset-assert 0)
(min-instance uint32 :offset-assert 4)
(test-fragment uint32 :offset-assert 8)
(frag-count uint32 :offset-assert 12)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
(define *tie* (new 'global 'tie-debug))
(defun tie-debug-between ((arg0 uint) (arg1 uint))
(set! (-> *instance-tie-work* test-id) arg1)
(set! (-> *instance-tie-work* test-id2) arg0)
arg0
)
(defun tie-debug-one ((arg0 uint) (arg1 uint))
(set! (-> *instance-tie-work* test-id) (+ arg1 -1 arg0))
(set! (-> *instance-tie-work* test-id2) arg0)
arg0
)
(defun tie-debug-frag-between ((arg0 uint) (arg1 uint))
(set! (-> *tie* test-fragment) arg0)
(let ((v0-0 (- arg1 arg0)))
(set! (-> *tie* frag-count) v0-0)
v0-0
)
)
(defun tie-debug-frag-one ((arg0 uint) (arg1 uint))
(set! (-> *tie* test-fragment) arg0)
(set! (-> *tie* frag-count) arg1)
arg1
)
(defun walk-tie-generic-prototypes ()
(none)
)
(define *pke-hack* (new 'global 'vector))
;; definition for function draw-inline-array-instance-tie
;; ERROR: function was not converted to expressions. Cannot decompile.
;; definition for function draw-inline-array-prototype-tie-asm
;; ERROR: function was not converted to expressions. Cannot decompile.
(defun instance-tie-patch-buckets ((arg0 dma-buffer) (arg1 level))
; (when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask tie))
; (when (nonzero? (-> *prototype-tie-work* scissor-count))
; (let ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf base)))
; (let* ((v1-17 (-> *display* frames (-> *display* on-screen) global-buf))
; (a2-0 (-> v1-17 base))
; )
; (let ((a1-1 (-> v1-17 base))
; (a0-5 (the-as object (-> *prototype-tie-work* scissor-last)))
; )
; (let ((a3-1 (-> *prototype-tie-work* scissor-next)))
; (set! (-> (the-as (pointer uint128) a1-1)) (-> *prototype-tie-work* model-next quad))
; (set! (-> (the-as (pointer uint64) a1-1))
; (logior (logand (-> (the-as (pointer uint64) a1-1)) (the-as uint #x80000000ffffffff))
; (shr (shl (the-as int a3-1) 33) 1)
; )
; )
; )
; (let ((a1-5
; (logior (logand (-> (the-as (pointer uint64) a0-5) 0) (the-as uint #x80000000ffffffff))
; (shr (shl (the-as int (&+ a1-1 16)) 33) 1)
; )
; )
; )
; (s.d! (the-as uint32 a0-5) a1-5)
; )
; )
; (&+! (-> v1-17 base) 16)
; (let ((a3-7 (-> v1-17 base)))
; (let ((a0-8 (the-as dma-packet (-> v1-17 base))))
; (set! (-> a0-8 dma) (new 'static 'dma-tag :id (dma-tag-id next)))
; (set! (-> a0-8 vif0) (new 'static 'vif-tag))
; (set! (-> a0-8 vif1) (new 'static 'vif-tag))
; (set! (-> v1-17 base) (the-as pointer (&+ a0-8 16)))
; )
; (let ((t9-0 dma-bucket-insert-tag)
; (a0-11 (-> *display* frames (-> *display* on-screen) bucket-group))
; (v1-23 (-> arg1 draw-index))
; )
; (t9-0
; a0-11
; (cond
; ((zero? v1-23)
; (bucket-id tie-s-l0-tfrag)
; )
; ((= v1-23 1)
; (bucket-id tie-s-l1-tfrag)
; )
; ((= v1-23 2)
; (bucket-id tie-s-l2-tfrag)
; )
; ((= v1-23 3)
; (bucket-id tie-s-l3-tfrag)
; )
; ((= v1-23 4)
; (bucket-id tie-s-l4-tfrag)
; )
; (else
; (bucket-id tie-s-l5-tfrag)
; )
; )
; a2-0
; (the-as (pointer dma-tag) a3-7)
; )
; )
; )
; )
; (let ((v1-24 *dma-mem-usage*))
; (when (nonzero? v1-24)
; (set! (-> v1-24 length) (max 16 (-> v1-24 length)))
; (set! (-> v1-24 data 15 name) "tie-scissor")
; (+! (-> v1-24 data 15 count) 1)
; (+! (-> v1-24 data 15 used)
; (&- (-> *display* frames (-> *display* on-screen) global-buf base) (the-as uint s5-0))
; )
; (set! (-> v1-24 data 15 total) (-> v1-24 data 15 used))
; )
; )
; )
; )
; )
(when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask tie-envmap))
;(when (nonzero? (-> *prototype-tie-work* tie-count))
(let ((s5-1 (-> *display* frames (-> *display* on-screen) global-buf base)))
(let* ((v1-42 (-> *display* frames (-> *display* on-screen) global-buf))
(a2-10 (-> v1-42 base))
)
; (let ((a1-21 (-> v1-42 base))
; (a0-17 (the-as object (-> *prototype-tie-work* tie-last)))
; )
; (let ((a3-10 (-> *prototype-tie-work* tie-next)))
; (set! (-> (the-as (pointer uint128) a1-21)) (-> *prototype-tie-work* model-next quad))
; (set! (-> (the-as (pointer uint64) a1-21))
; (logior (logand (-> (the-as (pointer uint64) a1-21)) (the-as uint #x80000000ffffffff))
; (shr (shl (the-as int a3-10) 33) 1)
; )
; )
; )
; (let ((a1-25
; (logior (logand (-> (the-as (pointer uint64) a0-17) 0) (the-as uint #x80000000ffffffff))
; (shr (shl (the-as int (&+ a1-21 16)) 33) 1)
; )
; )
; )
; (s.d! (the-as uint32 a0-17) a1-25)
; )
; )
; (&+! (-> v1-42 base) 16)
(add-pc-tfrag3-data v1-42 arg1)
(let ((a3-16 (-> v1-42 base)))
(let ((a0-20 (the-as dma-packet (-> v1-42 base))))
(set! (-> a0-20 dma) (new 'static 'dma-tag :id (dma-tag-id next)))
(set! (-> a0-20 vif0) (new 'static 'vif-tag))
(set! (-> a0-20 vif1) (new 'static 'vif-tag))
(set! (-> v1-42 base) (the-as pointer (&+ a0-20 16)))
)
(let ((t9-1 dma-bucket-insert-tag)
(a0-23 (-> *display* frames (-> *display* on-screen) bucket-group))
(v1-48 (-> arg1 draw-index))
)
(t9-1
a0-23
(cond
((zero? v1-48)
(bucket-id tie-l0-tfrag)
)
((= v1-48 1)
(bucket-id tie-l1-tfrag)
)
((= v1-48 2)
(bucket-id tie-l2-tfrag)
)
((= v1-48 3)
(bucket-id tie-l3-tfrag)
)
((= v1-48 4)
(bucket-id tie-l4-tfrag)
)
(else
(bucket-id tie-l5-tfrag)
)
)
a2-10
(the-as (pointer dma-tag) a3-16)
)
)
)
)
(let ((v1-49 *dma-mem-usage*))
(when (nonzero? v1-49)
(set! (-> v1-49 length) (max 10 (-> v1-49 length)))
(set! (-> v1-49 data 9 name) "tie-fragment")
(+! (-> v1-49 data 9 count) 1)
(+! (-> v1-49 data 9 used)
(&- (-> *display* frames (-> *display* on-screen) global-buf base) (the-as uint s5-1))
)
(set! (-> v1-49 data 9 total) (-> v1-49 data 9 used))
)
)
;)
)
)
; (when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask tie-scissor))
; (when (nonzero? (-> *prototype-tie-work* envmap-count))
; (let ((s5-2 (-> *display* frames (-> *display* on-screen) global-buf base)))
; (let* ((v1-67 (-> *display* frames (-> *display* on-screen) global-buf))
; (a2-20 (-> v1-67 base))
; )
; (let ((a1-41 (-> v1-67 base))
; (a0-29 (the-as object (-> *prototype-tie-work* envmap-last)))
; )
; (let ((a3-19 (-> *prototype-tie-work* envmap-next)))
; (set! (-> (the-as (pointer uint128) a1-41)) (-> *prototype-tie-work* model-next quad))
; (set! (-> (the-as (pointer uint64) a1-41))
; (logior (logand (-> (the-as (pointer uint64) a1-41)) (the-as uint #x80000000ffffffff))
; (shr (shl (the-as int a3-19) 33) 1)
; )
; )
; )
; (let ((a1-45
; (logior (logand (-> (the-as (pointer uint64) a0-29) 0) (the-as uint #x80000000ffffffff))
; (shr (shl (the-as int (&+ a1-41 16)) 33) 1)
; )
; )
; )
; (s.d! (the-as uint32 a0-29) a1-45)
; )
; )
; (&+! (-> v1-67 base) 16)
; (let ((a3-25 (-> v1-67 base)))
; (let ((a0-32 (-> v1-67 base)))
; (set! (-> (the-as (pointer int64) a0-32)) #x20000000)
; (s.w! (+ a0-32 8) 0)
; (s.w! (+ a0-32 12) 0)
; (set! (-> v1-67 base) (&+ a0-32 16))
; )
; (let ((t9-2 dma-bucket-insert-tag)
; (a0-35 (-> *display* frames (-> *display* on-screen) bucket-group))
; (v1-73 (-> arg1 draw-index))
; )
; (t9-2
; a0-35
; (cond
; ((zero? v1-73)
; (bucket-id etie-l0-tfrag)
; )
; ((= v1-73 1)
; (bucket-id etie-l1-tfrag)
; )
; ((= v1-73 2)
; (bucket-id etie-l2-tfrag)
; )
; ((= v1-73 3)
; (bucket-id etie-l3-tfrag)
; )
; ((= v1-73 4)
; (bucket-id etie-l4-tfrag)
; )
; (else
; (bucket-id etie-l5-tfrag)
; )
; )
; a2-20
; (the-as (pointer dma-tag) a3-25)
; )
; )
; )
; )
; (let ((v1-74 *dma-mem-usage*))
; (when (nonzero? v1-74)
; (set! (-> v1-74 length) (max 10 (-> v1-74 length)))
; (set! (-> v1-74 data 9 name) "tie-fragment")
; (+! (-> v1-74 data 9 count) 1)
; (+! (-> v1-74 data 9 used)
; (&- (-> *display* frames (-> *display* on-screen) global-buf base) (the-as uint s5-2))
; )
; (set! (-> v1-74 data 9 total) (-> v1-74 data 9 used))
; )
; )
; )
; )
; )
; (when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask tie-envmap-scissor))
; (when (nonzero? (-> *prototype-tie-work* envmap-scissor-count))
; (let ((s5-3 (-> *display* frames (-> *display* on-screen) global-buf base)))
; (let* ((v1-92 (-> *display* frames (-> *display* on-screen) global-buf))
; (a2-30 (-> v1-92 base))
; )
; (let ((a1-61 (-> v1-92 base))
; (a0-41 (the-as object (-> *prototype-tie-work* envmap-scissor-last)))
; )
; (let ((a3-28 (-> *prototype-tie-work* envmap-scissor-next)))
; (set! (-> (the-as (pointer uint128) a1-61)) (-> *prototype-tie-work* model-next quad))
; (set! (-> (the-as (pointer uint64) a1-61))
; (logior (logand (-> (the-as (pointer uint64) a1-61)) (the-as uint #x80000000ffffffff))
; (shr (shl (the-as int a3-28) 33) 1)
; )
; )
; )
; (let ((a1-65
; (logior (logand (-> (the-as (pointer uint64) a0-41) 0) (the-as uint #x80000000ffffffff))
; (shr (shl (the-as int (&+ a1-61 16)) 33) 1)
; )
; )
; )
; (s.d! (the-as uint32 a0-41) a1-65)
; )
; )
; (&+! (-> v1-92 base) 16)
; (let ((a3-34 (-> v1-92 base)))
; (let ((a0-44 (-> v1-92 base)))
; (set! (-> (the-as (pointer int64) a0-44)) #x20000000)
; (s.w! (+ a0-44 8) 0)
; (s.w! (+ a0-44 12) 0)
; (set! (-> v1-92 base) (&+ a0-44 16))
; )
; (let ((t9-3 dma-bucket-insert-tag)
; (a0-47 (-> *display* frames (-> *display* on-screen) bucket-group))
; (v1-98 (-> arg1 draw-index))
; )
; (t9-3
; a0-47
; (cond
; ((zero? v1-98)
; (bucket-id etie-s-l0-tfrag)
; )
; ((= v1-98 1)
; (bucket-id etie-s-l1-tfrag)
; )
; ((= v1-98 2)
; (bucket-id etie-s-l2-tfrag)
; )
; ((= v1-98 3)
; (bucket-id etie-s-l3-tfrag)
; )
; ((= v1-98 4)
; (bucket-id etie-s-l4-tfrag)
; )
; (else
; (bucket-id etie-s-l5-tfrag)
; )
; )
; a2-30
; (the-as (pointer dma-tag) a3-34)
; )
; )
; )
; )
; (let ((v1-99 *dma-mem-usage*))
; (when (nonzero? v1-99)
; (set! (-> v1-99 length) (max 10 (-> v1-99 length)))
; (set! (-> v1-99 data 9 name) "tie-fragment")
; (+! (-> v1-99 data 9 count) 1)
; (+! (-> v1-99 data 9 used)
; (&- (-> *display* frames (-> *display* on-screen) global-buf base) (the-as uint s5-3))
; )
; (set! (-> v1-99 data 9 total) (-> v1-99 data 9 used))
; )
; )
; )
; )
; )
; (when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask tie-vanish))
; (when (nonzero? (-> *prototype-tie-work* vanish-count))
; (let ((s5-4 (-> *display* frames (-> *display* on-screen) global-buf base)))
; (let* ((v1-117 (-> *display* frames (-> *display* on-screen) global-buf))
; (a2-40 (-> v1-117 base))
; )
; (let ((a1-81 (-> v1-117 base))
; (a0-53 (the-as object (-> *prototype-tie-work* vanish-last)))
; )
; (let ((a3-37 (-> *prototype-tie-work* vanish-next)))
; (set! (-> (the-as (pointer uint128) a1-81)) (-> *prototype-tie-work* model-next quad))
; (set! (-> (the-as (pointer uint64) a1-81))
; (logior (logand (-> (the-as (pointer uint64) a1-81)) (the-as uint #x80000000ffffffff))
; (shr (shl (the-as int a3-37) 33) 1)
; )
; )
; )
; (let ((a1-85
; (logior (logand (-> (the-as (pointer uint64) a0-53) 0) (the-as uint #x80000000ffffffff))
; (shr (shl (the-as int (&+ a1-81 16)) 33) 1)
; )
; )
; )
; (s.d! (the-as uint32 a0-53) a1-85)
; )
; )
; (&+! (-> v1-117 base) 16)
; (let ((a3-43 (-> v1-117 base)))
; (let ((a0-56 (-> v1-117 base)))
; (set! (-> (the-as (pointer int64) a0-56)) #x20000000)
; (s.w! (+ a0-56 8) 0)
; (s.w! (+ a0-56 12) 0)
; (set! (-> v1-117 base) (&+ a0-56 16))
; )
; (let ((t9-4 dma-bucket-insert-tag)
; (a0-59 (-> *display* frames (-> *display* on-screen) bucket-group))
; (v1-123 (-> arg1 draw-index))
; )
; (t9-4
; a0-59
; (cond
; ((zero? v1-123)
; (bucket-id tie-v-l0-tfrag)
; )
; ((= v1-123 1)
; (bucket-id tie-v-l1-tfrag)
; )
; ((= v1-123 2)
; (bucket-id tie-v-l2-tfrag)
; )
; ((= v1-123 3)
; (bucket-id tie-v-l3-tfrag)
; )
; ((= v1-123 4)
; (bucket-id tie-v-l4-tfrag)
; )
; (else
; (bucket-id tie-v-l5-tfrag)
; )
; )
; a2-40
; (the-as (pointer dma-tag) a3-43)
; )
; )
; )
; )
; (let ((v1-124 *dma-mem-usage*))
; (when (nonzero? v1-124)
; (set! (-> v1-124 length) (max 10 (-> v1-124 length)))
; (set! (-> v1-124 data 9 name) "tie-fragment")
; (+! (-> v1-124 data 9 count) 1)
; (+! (-> v1-124 data 9 used)
; (&- (-> *display* frames (-> *display* on-screen) global-buf base) (the-as uint s5-4))
; )
; (set! (-> v1-124 data 9 total) (-> v1-124 data 9 used))
; )
; )
; )
; )
; )
; (when (logtest? (vu1-renderer-mask tie-scissor-trans) (-> *display* vu1-enable-user))
; (when (nonzero? (-> *prototype-tie-work* scissor-trans-count))
; (let ((s5-5 (-> *display* frames (-> *display* on-screen) global-buf base)))
; (let* ((v1-141 (-> *display* frames (-> *display* on-screen) global-buf))
; (a2-50 (-> v1-141 base))
; )
; (let ((a1-101 (-> v1-141 base))
; (a0-67 (the-as object (-> *prototype-tie-work* scissor-trans-last)))
; )
; (let ((a3-46 (-> *prototype-tie-work* scissor-trans-next)))
; (set! (-> (the-as (pointer uint128) a1-101)) (-> *prototype-tie-work* model-next quad))
; (set! (-> (the-as (pointer uint64) a1-101))
; (logior (logand (-> (the-as (pointer uint64) a1-101)) (the-as uint #x80000000ffffffff))
; (shr (shl (the-as int a3-46) 33) 1)
; )
; )
; )
; (let ((a1-105
; (logior (logand (-> (the-as (pointer uint64) a0-67) 0) (the-as uint #x80000000ffffffff))
; (shr (shl (the-as int (&+ a1-101 16)) 33) 1)
; )
; )
; )
; (s.d! (the-as uint32 a0-67) a1-105)
; )
; )
; (&+! (-> v1-141 base) 16)
; (let ((a3-52 (-> v1-141 base)))
; (let ((a0-70 (-> v1-141 base)))
; (set! (-> (the-as (pointer int64) a0-70)) #x20000000)
; (s.w! (+ a0-70 8) 0)
; (s.w! (+ a0-70 12) 0)
; (set! (-> v1-141 base) (&+ a0-70 16))
; )
; (let ((t9-5 dma-bucket-insert-tag)
; (a0-73 (-> *display* frames (-> *display* on-screen) bucket-group))
; (v1-147 (-> arg1 draw-index))
; )
; (t9-5
; a0-73
; (cond
; ((zero? v1-147)
; (bucket-id tie-st-l0-alpha)
; )
; ((= v1-147 1)
; (bucket-id tie-st-l1-alpha)
; )
; ((= v1-147 2)
; (bucket-id tie-st-l2-alpha)
; )
; ((= v1-147 3)
; (bucket-id tie-st-l3-alpha)
; )
; ((= v1-147 4)
; (bucket-id tie-st-l4-alpha)
; )
; (else
; (bucket-id tie-st-l5-alpha)
; )
; )
; a2-50
; (the-as (pointer dma-tag) a3-52)
; )
; )
; )
; )
; (let ((v1-148 *dma-mem-usage*))
; (when (nonzero? v1-148)
; (set! (-> v1-148 length) (max 16 (-> v1-148 length)))
; (set! (-> v1-148 data 15 name) "tie-scissor")
; (+! (-> v1-148 data 15 count) 1)
; (+! (-> v1-148 data 15 used)
; (&- (-> *display* frames (-> *display* on-screen) global-buf base) (the-as uint s5-5))
; )
; (set! (-> v1-148 data 15 total) (-> v1-148 data 15 used))
; )
; )
; )
; )
; )
; (when (logtest? (vu1-renderer-mask tie-trans) (-> *display* vu1-enable-user))
; (when (nonzero? (-> *prototype-tie-work* trans-count))
; (let ((s5-6 (-> *display* frames (-> *display* on-screen) global-buf base)))
; (let* ((v1-165 (-> *display* frames (-> *display* on-screen) global-buf))
; (a2-60 (-> v1-165 base))
; )
; (let ((a1-121 (-> v1-165 base))
; (a0-81 (the-as object (-> *prototype-tie-work* trans-last)))
; )
; (let ((a3-55 (-> *prototype-tie-work* trans-next)))
; (set! (-> (the-as (pointer uint128) a1-121)) (-> *prototype-tie-work* model-next quad))
; (set! (-> (the-as (pointer uint64) a1-121))
; (logior (logand (-> (the-as (pointer uint64) a1-121)) (the-as uint #x80000000ffffffff))
; (shr (shl (the-as int a3-55) 33) 1)
; )
; )
; )
; (let ((a1-125
; (logior (logand (-> (the-as (pointer uint64) a0-81) 0) (the-as uint #x80000000ffffffff))
; (shr (shl (the-as int (&+ a1-121 16)) 33) 1)
; )
; )
; )
; (s.d! (the-as uint32 a0-81) a1-125)
; )
; )
; (&+! (-> v1-165 base) 16)
; (let ((a3-61 (-> v1-165 base)))
; (let ((a0-84 (-> v1-165 base)))
; (set! (-> (the-as (pointer int64) a0-84)) #x20000000)
; (s.w! (+ a0-84 8) 0)
; (s.w! (+ a0-84 12) 0)
; (set! (-> v1-165 base) (&+ a0-84 16))
; )
; (let ((t9-6 dma-bucket-insert-tag)
; (a0-87 (-> *display* frames (-> *display* on-screen) bucket-group))
; (v1-171 (-> arg1 draw-index))
; )
; (t9-6
; a0-87
; (cond
; ((zero? v1-171)
; (bucket-id tie-t-l0-alpha)
; )
; ((= v1-171 1)
; (bucket-id tie-t-l1-alpha)
; )
; ((= v1-171 2)
; (bucket-id tie-t-l2-alpha)
; )
; ((= v1-171 3)
; (bucket-id tie-t-l3-alpha)
; )
; ((= v1-171 4)
; (bucket-id tie-t-l4-alpha)
; )
; (else
; (bucket-id tie-t-l5-alpha)
; )
; )
; a2-60
; (the-as (pointer dma-tag) a3-61)
; )
; )
; )
; )
; (let ((v1-172 *dma-mem-usage*))
; (when (nonzero? v1-172)
; (set! (-> v1-172 length) (max 10 (-> v1-172 length)))
; (set! (-> v1-172 data 9 name) "tie-fragment")
; (+! (-> v1-172 data 9 count) 1)
; (+! (-> v1-172 data 9 used)
; (&- (-> *display* frames (-> *display* on-screen) global-buf base) (the-as uint s5-6))
; )
; (set! (-> v1-172 data 9 total) (-> v1-172 data 9 used))
; )
; )
; )
; )
; )
; (when (logtest? (vu1-renderer-mask tie-envmap-trans) (-> *display* vu1-enable-user))
; (when (nonzero? (-> *prototype-tie-work* envmap-trans-count))
; (let ((s5-7 (-> *display* frames (-> *display* on-screen) global-buf base)))
; (let* ((v1-189 (-> *display* frames (-> *display* on-screen) global-buf))
; (a2-70 (-> v1-189 base))
; )
; (let ((a1-141 (-> v1-189 base))
; (a0-95 (the-as object (-> *prototype-tie-work* envmap-trans-last)))
; )
; (let ((a3-64 (-> *prototype-tie-work* envmap-trans-next)))
; (set! (-> (the-as (pointer uint128) a1-141)) (-> *prototype-tie-work* model-next quad))
; (set! (-> (the-as (pointer uint64) a1-141))
; (logior (logand (-> (the-as (pointer uint64) a1-141)) (the-as uint #x80000000ffffffff))
; (shr (shl (the-as int a3-64) 33) 1)
; )
; )
; )
; (let ((a1-145
; (logior (logand (-> (the-as (pointer uint64) a0-95) 0) (the-as uint #x80000000ffffffff))
; (shr (shl (the-as int (&+ a1-141 16)) 33) 1)
; )
; )
; )
; (s.d! (the-as uint32 a0-95) a1-145)
; )
; )
; (&+! (-> v1-189 base) 16)
; (let ((a3-70 (-> v1-189 base)))
; (let ((a0-98 (-> v1-189 base)))
; (set! (-> (the-as (pointer int64) a0-98)) #x20000000)
; (s.w! (+ a0-98 8) 0)
; (s.w! (+ a0-98 12) 0)
; (set! (-> v1-189 base) (&+ a0-98 16))
; )
; (let ((t9-7 dma-bucket-insert-tag)
; (a0-101 (-> *display* frames (-> *display* on-screen) bucket-group))
; (v1-195 (-> arg1 draw-index))
; )
; (t9-7
; a0-101
; (cond
; ((zero? v1-195)
; (bucket-id etie-t-l0-alpha)
; )
; ((= v1-195 1)
; (bucket-id etie-t-l1-alpha)
; )
; ((= v1-195 2)
; (bucket-id etie-t-l2-alpha)
; )
; ((= v1-195 3)
; (bucket-id etie-t-l3-alpha)
; )
; ((= v1-195 4)
; (bucket-id etie-t-l4-alpha)
; )
; (else
; (bucket-id etie-t-l5-alpha)
; )
; )
; a2-70
; (the-as (pointer dma-tag) a3-70)
; )
; )
; )
; )
; (let ((v1-196 *dma-mem-usage*))
; (when (nonzero? v1-196)
; (set! (-> v1-196 length) (max 10 (-> v1-196 length)))
; (set! (-> v1-196 data 9 name) "tie-fragment")
; (+! (-> v1-196 data 9 count) 1)
; (+! (-> v1-196 data 9 used)
; (&- (-> *display* frames (-> *display* on-screen) global-buf base) (the-as uint s5-7))
; )
; (set! (-> v1-196 data 9 total) (-> v1-196 data 9 used))
; )
; )
; )
; )
; )
; (when (logtest? (vu1-renderer-mask tie-envmap-scissor-trans) (-> *display* vu1-enable-user))
; (when (nonzero? (-> *prototype-tie-work* envmap-scissor-trans-count))
; (let ((s5-8 (-> *display* frames (-> *display* on-screen) global-buf base)))
; (let* ((v1-213 (-> *display* frames (-> *display* on-screen) global-buf))
; (a2-80 (-> v1-213 base))
; )
; (let ((a1-161 (-> v1-213 base))
; (a0-109 (the-as object (-> *prototype-tie-work* envmap-scissor-trans-last)))
; )
; (let ((a3-73 (-> *prototype-tie-work* envmap-scissor-trans-next)))
; (set! (-> (the-as (pointer uint128) a1-161)) (-> *prototype-tie-work* model-next quad))
; (set! (-> (the-as (pointer uint64) a1-161))
; (logior (logand (-> (the-as (pointer uint64) a1-161)) (the-as uint #x80000000ffffffff))
; (shr (shl (the-as int a3-73) 33) 1)
; )
; )
; )
; (let ((a1-165
; (logior (logand (-> (the-as (pointer uint64) a0-109) 0) (the-as uint #x80000000ffffffff))
; (shr (shl (the-as int (&+ a1-161 16)) 33) 1)
; )
; )
; )
; (s.d! (the-as uint32 a0-109) a1-165)
; )
; )
; (&+! (-> v1-213 base) 16)
; (let ((a3-79 (-> v1-213 base)))
; (let ((a0-112 (-> v1-213 base)))
; (set! (-> (the-as (pointer int64) a0-112)) #x20000000)
; (s.w! (+ a0-112 8) 0)
; (s.w! (+ a0-112 12) 0)
; (set! (-> v1-213 base) (&+ a0-112 16))
; )
; (let ((t9-8 dma-bucket-insert-tag)
; (a0-115 (-> *display* frames (-> *display* on-screen) bucket-group))
; (v1-219 (-> arg1 draw-index))
; )
; (t9-8
; a0-115
; (cond
; ((zero? v1-219)
; (bucket-id etie-st-l0-alpha)
; )
; ((= v1-219 1)
; (bucket-id etie-st-l1-alpha)
; )
; ((= v1-219 2)
; (bucket-id etie-st-l2-alpha)
; )
; ((= v1-219 3)
; (bucket-id etie-st-l3-alpha)
; )
; ((= v1-219 4)
; (bucket-id etie-st-l4-alpha)
; )
; (else
; (bucket-id etie-st-l5-alpha)
; )
; )
; a2-80
; (the-as (pointer dma-tag) a3-79)
; )
; )
; )
; )
; (let ((v1-220 *dma-mem-usage*))
; (when (nonzero? v1-220)
; (set! (-> v1-220 length) (max 10 (-> v1-220 length)))
; (set! (-> v1-220 data 9 name) "tie-fragment")
; (+! (-> v1-220 data 9 count) 1)
; (+! (-> v1-220 data 9 used)
; (&- (-> *display* frames (-> *display* on-screen) global-buf base) (the-as uint s5-8))
; )
; (set! (-> v1-220 data 9 total) (-> v1-220 data 9 used))
; )
; )
; )
; )
; )
; (when (logtest? (vu1-renderer-mask tie-scissor-water) (-> *display* vu1-enable-user))
; (when (nonzero? (-> *prototype-tie-work* scissor-water-count))
; (let ((s5-9 (-> *display* frames (-> *display* on-screen) global-buf base)))
; (let* ((v1-237 (-> *display* frames (-> *display* on-screen) global-buf))
; (a2-90 (-> v1-237 base))
; )
; (let ((a1-181 (-> v1-237 base))
; (a0-123 (the-as object (-> *prototype-tie-work* scissor-water-last)))
; )
; (let ((a3-82 (-> *prototype-tie-work* scissor-water-next)))
; (set! (-> (the-as (pointer uint128) a1-181)) (-> *prototype-tie-work* model-next quad))
; (set! (-> (the-as (pointer uint64) a1-181))
; (logior (logand (-> (the-as (pointer uint64) a1-181)) (the-as uint #x80000000ffffffff))
; (shr (shl (the-as int a3-82) 33) 1)
; )
; )
; )
; (let ((a1-185
; (logior (logand (-> (the-as (pointer uint64) a0-123) 0) (the-as uint #x80000000ffffffff))
; (shr (shl (the-as int (&+ a1-181 16)) 33) 1)
; )
; )
; )
; (s.d! (the-as uint32 a0-123) a1-185)
; )
; )
; (&+! (-> v1-237 base) 16)
; (let ((a3-88 (-> v1-237 base)))
; (let ((a0-126 (-> v1-237 base)))
; (set! (-> (the-as (pointer int64) a0-126)) #x20000000)
; (s.w! (+ a0-126 8) 0)
; (s.w! (+ a0-126 12) 0)
; (set! (-> v1-237 base) (&+ a0-126 16))
; )
; (let ((t9-9 dma-bucket-insert-tag)
; (a0-129 (-> *display* frames (-> *display* on-screen) bucket-group))
; (v1-243 (-> arg1 draw-index))
; )
; (t9-9
; a0-129
; (cond
; ((zero? v1-243)
; (bucket-id tie-sw-l0-water)
; )
; ((= v1-243 1)
; (bucket-id tie-sw-l1-water)
; )
; ((= v1-243 2)
; (bucket-id tie-sw-l2-water)
; )
; ((= v1-243 3)
; (bucket-id tie-sw-l3-water)
; )
; ((= v1-243 4)
; (bucket-id tie-sw-l4-water)
; )
; (else
; (bucket-id tie-sw-l5-water)
; )
; )
; a2-90
; (the-as (pointer dma-tag) a3-88)
; )
; )
; )
; )
; (let ((v1-244 *dma-mem-usage*))
; (when (nonzero? v1-244)
; (set! (-> v1-244 length) (max 16 (-> v1-244 length)))
; (set! (-> v1-244 data 15 name) "tie-scissor")
; (+! (-> v1-244 data 15 count) 1)
; (+! (-> v1-244 data 15 used)
; (&- (-> *display* frames (-> *display* on-screen) global-buf base) (the-as uint s5-9))
; )
; (set! (-> v1-244 data 15 total) (-> v1-244 data 15 used))
; )
; )
; )
; )
; )
; (when (logtest? (vu1-renderer-mask tie-water) (-> *display* vu1-enable-user))
; (when (nonzero? (-> *prototype-tie-work* water-count))
; (let ((s5-10 (-> *display* frames (-> *display* on-screen) global-buf base)))
; (let* ((v1-261 (-> *display* frames (-> *display* on-screen) global-buf))
; (a2-100 (-> v1-261 base))
; )
; (let ((a1-201 (-> v1-261 base))
; (a0-137 (the-as object (-> *prototype-tie-work* water-last)))
; )
; (let ((a3-91 (-> *prototype-tie-work* water-next)))
; (set! (-> (the-as (pointer uint128) a1-201)) (-> *prototype-tie-work* model-next quad))
; (set! (-> (the-as (pointer uint64) a1-201))
; (logior (logand (-> (the-as (pointer uint64) a1-201)) (the-as uint #x80000000ffffffff))
; (shr (shl (the-as int a3-91) 33) 1)
; )
; )
; )
; (let ((a1-205
; (logior (logand (-> (the-as (pointer uint64) a0-137) 0) (the-as uint #x80000000ffffffff))
; (shr (shl (the-as int (&+ a1-201 16)) 33) 1)
; )
; )
; )
; (s.d! (the-as uint32 a0-137) a1-205)
; )
; )
; (&+! (-> v1-261 base) 16)
; (let ((a3-97 (-> v1-261 base)))
; (let ((a0-140 (-> v1-261 base)))
; (set! (-> (the-as (pointer int64) a0-140)) #x20000000)
; (s.w! (+ a0-140 8) 0)
; (s.w! (+ a0-140 12) 0)
; (set! (-> v1-261 base) (&+ a0-140 16))
; )
; (let ((t9-10 dma-bucket-insert-tag)
; (a0-143 (-> *display* frames (-> *display* on-screen) bucket-group))
; (v1-267 (-> arg1 draw-index))
; )
; (t9-10
; a0-143
; (cond
; ((zero? v1-267)
; (bucket-id tie-w-l0-water)
; )
; ((= v1-267 1)
; (bucket-id tie-w-l1-water)
; )
; ((= v1-267 2)
; (bucket-id tie-w-l2-water)
; )
; ((= v1-267 3)
; (bucket-id tie-w-l3-water)
; )
; ((= v1-267 4)
; (bucket-id tie-w-l4-water)
; )
; (else
; (bucket-id tie-w-l5-water)
; )
; )
; a2-100
; (the-as (pointer dma-tag) a3-97)
; )
; )
; )
; )
; (let ((v1-268 *dma-mem-usage*))
; (when (nonzero? v1-268)
; (set! (-> v1-268 length) (max 10 (-> v1-268 length)))
; (set! (-> v1-268 data 9 name) "tie-fragment")
; (+! (-> v1-268 data 9 count) 1)
; (+! (-> v1-268 data 9 used)
; (&- (-> *display* frames (-> *display* on-screen) global-buf base) (the-as uint s5-10))
; )
; (set! (-> v1-268 data 9 total) (-> v1-268 data 9 used))
; )
; )
; )
; )
; )
; (when (logtest? (vu1-renderer-mask tie-envmap-water) (-> *display* vu1-enable-user))
; (when (nonzero? (-> *prototype-tie-work* envmap-water-count))
; (let ((s5-11 (-> *display* frames (-> *display* on-screen) global-buf base)))
; (let* ((v1-285 (-> *display* frames (-> *display* on-screen) global-buf))
; (a2-110 (-> v1-285 base))
; )
; (let ((a1-221 (-> v1-285 base))
; (a0-151 (the-as object (-> *prototype-tie-work* envmap-water-last)))
; )
; (let ((a3-100 (-> *prototype-tie-work* envmap-water-next)))
; (set! (-> (the-as (pointer uint128) a1-221)) (-> *prototype-tie-work* model-next quad))
; (set! (-> (the-as (pointer uint64) a1-221))
; (logior (logand (-> (the-as (pointer uint64) a1-221)) (the-as uint #x80000000ffffffff))
; (shr (shl (the-as int a3-100) 33) 1)
; )
; )
; )
; (let ((a1-225
; (logior (logand (-> (the-as (pointer uint64) a0-151) 0) (the-as uint #x80000000ffffffff))
; (shr (shl (the-as int (&+ a1-221 16)) 33) 1)
; )
; )
; )
; (s.d! (the-as uint32 a0-151) a1-225)
; )
; )
; (&+! (-> v1-285 base) 16)
; (let ((a3-106 (-> v1-285 base)))
; (let ((a0-154 (-> v1-285 base)))
; (set! (-> (the-as (pointer int64) a0-154)) #x20000000)
; (s.w! (+ a0-154 8) 0)
; (s.w! (+ a0-154 12) 0)
; (set! (-> v1-285 base) (&+ a0-154 16))
; )
; (let ((t9-11 dma-bucket-insert-tag)
; (a0-157 (-> *display* frames (-> *display* on-screen) bucket-group))
; (v1-291 (-> arg1 draw-index))
; )
; (t9-11
; a0-157
; (cond
; ((zero? v1-291)
; (bucket-id etie-w-l0-water)
; )
; ((= v1-291 1)
; (bucket-id etie-w-l1-water)
; )
; ((= v1-291 2)
; (bucket-id etie-w-l2-water)
; )
; ((= v1-291 3)
; (bucket-id etie-w-l3-water)
; )
; ((= v1-291 4)
; (bucket-id etie-w-l4-water)
; )
; (else
; (bucket-id etie-w-l5-water)
; )
; )
; a2-110
; (the-as (pointer dma-tag) a3-106)
; )
; )
; )
; )
; (let ((v1-292 *dma-mem-usage*))
; (when (nonzero? v1-292)
; (set! (-> v1-292 length) (max 10 (-> v1-292 length)))
; (set! (-> v1-292 data 9 name) "tie-fragment")
; (+! (-> v1-292 data 9 count) 1)
; (+! (-> v1-292 data 9 used)
; (&- (-> *display* frames (-> *display* on-screen) global-buf base) (the-as uint s5-11))
; )
; (set! (-> v1-292 data 9 total) (-> v1-292 data 9 used))
; )
; )
; )
; )
; )
; (the-as
; object
; (when (logtest? (vu1-renderer-mask tie-envmap-scissor-water) (-> *display* vu1-enable-user))
; (when (nonzero? (-> *prototype-tie-work* envmap-scissor-water-count))
; (let* ((s5-12 (-> *display* frames (-> *display* on-screen) global-buf base))
; (v1-308 (-> *display* frames (-> *display* on-screen) global-buf))
; (a2-120 (-> v1-308 base))
; )
; (let ((a1-241 (-> v1-308 base))
; (a0-164 (the-as object (-> *prototype-tie-work* envmap-scissor-water-last)))
; )
; (let ((a3-109 (-> *prototype-tie-work* envmap-scissor-water-next)))
; (set! (-> (the-as (pointer uint128) a1-241)) (-> *prototype-tie-work* model-next quad))
; (set! (-> (the-as (pointer uint64) a1-241))
; (logior (logand (-> (the-as (pointer uint64) a1-241)) (the-as uint #x80000000ffffffff))
; (shr (shl (the-as int a3-109) 33) 1)
; )
; )
; )
; (let ((a1-245 (logior (logand (-> (the-as (pointer uint64) a0-164) 0) (the-as uint #x80000000ffffffff))
; (shr (shl (the-as int (&+ a1-241 16)) 33) 1)
; )
; )
; )
; (s.d! (the-as uint32 a0-164) a1-245)
; )
; )
; (&+! (-> v1-308 base) 16)
; (let ((a3-115 (-> v1-308 base)))
; (let ((a0-167 (-> v1-308 base)))
; (set! (-> (the-as (pointer int64) a0-167)) #x20000000)
; (s.w! (+ a0-167 8) 0)
; (s.w! (+ a0-167 12) 0)
; (set! (-> v1-308 base) (&+ a0-167 16))
; )
; (let* ((t9-12 dma-bucket-insert-tag)
; (a0-170 (-> *display* frames (-> *display* on-screen) bucket-group))
; (v1-314 (-> arg1 draw-index))
; (v0-12 (t9-12
; a0-170
; (cond
; ((zero? v1-314)
; (bucket-id etie-sw-l0-water)
; )
; ((= v1-314 1)
; (bucket-id etie-sw-l1-water)
; )
; ((= v1-314 2)
; (bucket-id tie-esw-l2-water)
; )
; ((= v1-314 3)
; (bucket-id etie-sw-l3-water)
; )
; ((= v1-314 4)
; (bucket-id etie-sw-l4-water)
; )
; (else
; (bucket-id etie-sw-l5-water)
; )
; )
; a2-120
; (the-as (pointer dma-tag) a3-115)
; )
; )
; )
; (let ((v1-315 *dma-mem-usage*))
; (when (nonzero? v1-315)
; (set! (-> v1-315 length) (max 10 (-> v1-315 length)))
; (set! (-> v1-315 data 9 name) "tie-fragment")
; (+! (-> v1-315 data 9 count) 1)
; (+! (-> v1-315 data 9 used)
; (&- (-> *display* frames (-> *display* on-screen) global-buf base) (the-as uint s5-12))
; )
; (set! (-> v1-315 data 9 total) (-> v1-315 data 9 used))
; )
; )
; v0-12
; )
; )
; )
; )
; )
; )
(the object #f)
)
(defun draw-drawable-tree-instance-tie ((arg0 drawable-tree-instance-tie) (arg1 level))
(local-vars (v0-9 object) (a0-42 int) (a0-44 int) (a0-55 int) (a0-57 int) (sv-16 int))
(when (logtest? (vu1-renderer-mask
tie
tie-envmap
tie-scissor
tie-envmap-scissor
tie-vanish
generic
tie-scissor-trans
tie-trans
tie-envmap-trans
tie-envmap-scissor-trans
)
(-> *display* vu1-enable-user)
)
(set! (-> *instance-tie-work* wind-vectors) (-> arg0 prototypes wind-vectors))
(let ((s5-0 (+ (-> arg0 length) -1)))
(when (nonzero? s5-0)
; (dotimes (s4-0 s5-0)
; (let* ((v1-9 (-> arg0 data s4-0))
; (a0-7 (-> arg0 data (+ s4-0 1)))
; (a1-2 (/ (-> (the-as drawable-inline-array-node v1-9) data 0 id) 8))
; (a0-9 (/ (-> (the-as drawable-inline-array-node a0-7) data 0 id) 8))
; (a1-4 (+ a1-2 #x38a0 #x70000000))
; (a0-11 (+ a0-9 #x38a0 #x70000000))
; )
; (draw-node-cull
; (the-as pointer a0-11)
; (the-as pointer a1-4)
; (-> (the-as drawable-inline-array-node v1-9) data)
; (-> (the-as drawable-inline-array-node v1-9) length)
; )
; )
; )
)
(let* ((s2-0 (-> arg0 data s5-0))
(s3-0 (-> arg0 prototypes prototype-array-tie))
(s4-1 (-> s3-0 length))
(s5-1 (-> *display* frames (-> *display* on-screen) global-buf))
(s0-0 (-> s5-1 base))
(s1-1 (&- (-> s5-1 end) (the-as uint (* (-> arg0 prototypes prototype-max-qwc) 16))))
)
(when *debug-segment*
(if (>= (the-as uint s0-0) (the-as uint s1-1))
(format *stdcon* "out of tie memory~%")
)
)
(when (< (the-as uint s0-0) (the-as uint s1-1))
(set! (-> *instance-tie-work* buffer-start) (the-as uint (-> s5-1 base)))
(set! (-> *instance-tie-work* buffer-end) (the-as uint s1-1))
(dotimes (v1-28 16)
(set! (-> *prototype-tie-work* last v1-28) (the-as uint 0))
(set! (-> *prototype-tie-work* next v1-28) (the-as uint 0))
(set! (-> *prototype-tie-work* count v1-28) (the-as uint 0))
)
(dotimes (v1-31 s4-1)
(let ((a0-26 (-> s3-0 array-data v1-31)))
(dotimes (a1-9 3)
(set! (-> a0-26 next-clear a1-9) (the-as uint128 0))
(set! (-> a0-26 count-clear a1-9) (the-as uint 0))
)
)
)
(let* ((s1-2 (&+ s2-0 32))
(s0-1 (+ (/ (-> s1-2 id) 8) #x38a0 #x70000000))
)
(set! sv-16 (-> (the-as drawable-inline-array-instance-tie s2-0) length))
(when (nonzero? sv-16)
(let* ((v1-41 (logand (the-as int *gsf-buffer*) 8191))
(v1-43
(the-as
object
(logand (the-as int (&- (logand (the-as int (&-> (-> s3-0 data) -640)) 8191) (the-as uint v1-41))) 8191)
)
)
)
(set! *instance-tie-work-copy* (the-as instance-tie-work (+ (the-as int *gsf-buffer*) (the-as int v1-43))))
)
(quad-copy! (the-as pointer *instance-tie-work-copy*) (the-as pointer *instance-tie-work*) 35)
(let ((s2-1 (-> *display* frames (-> *display* on-screen) global-buf base)))
(set! (-> *instance-tie-work-copy* wait-to-spr) (the-as uint 0))
(set! (-> *instance-tie-work-copy* wait-from-spr) (the-as uint 0))
(set! (-> *instance-tie-work-copy* tfrag-dists) (the-as uint (-> arg1 bsp tfrag-closest)))
(set! (-> *instance-tie-work-copy* alpha-dists) (the-as uint (-> arg1 bsp alpha-closest)))
(set! (-> *instance-tie-work-copy* water-dists) (the-as uint (-> arg1 bsp water-closest)))
; (let* ((v1-61 (-> *perf-stats* data 46))
; (a0-39 (-> v1-61 ctrl))
; )
; (+! (-> v1-61 count) 1)
; (b! (zero? a0-39) cfg-23 :delay (nop!))
; (.mtc0 Perf r0)
; (.sync.l)
; (.sync.p)
; (.mtpc pcr0 r0)
; (.mtpc pcr1 r0)
; (.sync.l)
; (.sync.p)
; (.mtc0 Perf a0-39)
; )
; (.sync.l)
; (.sync.p)
; (label cfg-23)
; 0
; (let ((t9-3 draw-inline-array-instance-tie)
; (a3-1 s5-1)
; )
; (t9-3 (the-as pointer s0-1) (the-as (inline-array instance-tie) s1-2) sv-16 a3-1)
; )
; (let ((v1-64 (-> *perf-stats* data 46)))
; (b! (zero? (-> v1-64 ctrl)) cfg-25 :delay (nop!))
; (.mtc0 Perf r0)
; (.sync.l)
; (.sync.p)
; (.mfpc a0-42 pcr0)
; (+! (-> v1-64 accum0) a0-42)
; (.mfpc a0-44 pcr1)
; (+! (-> v1-64 accum1) a0-44)
; )
; (label cfg-25)
; 0
(update-wait-stats
(-> *perf-stats* data 46)
(the-as uint 0)
(-> *instance-tie-work-copy* wait-to-spr)
(-> *instance-tie-work-copy* wait-from-spr)
)
(let ((v1-71 (-> *instance-tie-work-copy* min-dist quad)))
(set! (-> *instance-tie-work* min-dist quad) v1-71)
)
(set! (-> *instance-tie-work* flags) (-> *instance-tie-work-copy* flags))
(if (and *debug-segment* (< (the-as int (-> *instance-tie-work* buffer-end)) (the-as int (-> s5-1 base))))
(format *stdcon* "out of tie memory~%")
)
(when (>= (the-as int (-> *instance-tie-work* buffer-end)) (the-as int (-> s5-1 base)))
(set! (-> *prototype-tie-work* wait-to-spr) (the-as uint 0))
(set! (-> *prototype-tie-work* wait-from-spr) (the-as uint 0))
; (let* ((v1-85 (-> *perf-stats* data 47))
; (a0-52 (-> v1-85 ctrl))
; )
; (+! (-> v1-85 count) 1)
; (b! (zero? a0-52) cfg-33 :delay (nop!))
; (.mtc0 Perf r0)
; (.sync.l)
; (.sync.p)
; (.mtpc pcr0 r0)
; (.mtpc pcr1 r0)
; (.sync.l)
; (.sync.p)
; (.mtc0 Perf a0-52)
; )
; (.sync.l)
; (.sync.p)
; (label cfg-33)
; 0
; (draw-inline-array-prototype-tie-asm s5-1 s4-1 s3-0)
; (let ((v1-88 (-> *perf-stats* data 47)))
; (b! (zero? (-> v1-88 ctrl)) cfg-35 :delay (nop!))
; (.mtc0 Perf r0)
; (.sync.l)
; (.sync.p)
; (.mfpc a0-55 pcr0)
; (+! (-> v1-88 accum0) a0-55)
; (.mfpc a0-57 pcr1)
; (+! (-> v1-88 accum1) a0-57)
; )
; (label cfg-35)
; 0
(update-wait-stats
(-> *perf-stats* data 47)
(the-as uint 0)
(-> *prototype-tie-work* wait-to-spr)
(-> *prototype-tie-work* wait-from-spr)
)
)
(let ((a0-60 *dma-mem-usage*))
(when (nonzero? a0-60)
(set! (-> a0-60 length) (max 10 (-> a0-60 length)))
(set! (-> a0-60 data 9 name) "tie-fragment")
(+! (-> a0-60 data 9 count) 1)
(+! (-> a0-60 data 9 used)
(&- (-> *display* frames (-> *display* on-screen) global-buf base) (the-as uint s2-1))
)
(set! (-> a0-60 data 9 total) (-> a0-60 data 9 used))
)
)
)
)
)
(set! v0-9 (cond
((< (the-as int (-> *instance-tie-work* buffer-end)) (the-as int (-> s5-1 base)))
(if *debug-segment*
(format *stdcon* "out of tie memory~%")
)
(set! v0-9 (-> *instance-tie-work* buffer-start))
(set! (-> s5-1 base) (the-as pointer v0-9))
v0-9
)
(else
(instance-tie-patch-buckets s5-1 arg1)
)
)
)
)
)
)
)
(set! (-> arg1 closest-object-array 10) (-> *instance-tie-work* min-dist x))
0
(none)
)
;; definition for function tie-init-scissor-buf
;; WARN: Return type mismatch pointer vs none.
(defun tie-init-scissor-buf ((arg0 bucket-id) (arg1 gs-alpha) (arg2 gs-test) (arg3 gs-test))
;; nothing in PC
(none)
)
;; definition for function tie-init-buf
;; WARN: Return type mismatch pointer vs none.
(defun tie-init-buf ((arg0 bucket-id) (arg1 gs-alpha) (arg2 gs-test) (arg3 gs-test))
(let ((s5-0 (-> *display* frames (-> *display* on-screen) bucket-group arg0)))
(when (!= s5-0 (-> s5-0 last))
(let* ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf))
(s3-1 (-> s4-0 base))
)
(tie-init-engine s4-0 arg1 arg2 arg3)
(let* ((v1-12 s4-0)
(a0-5 (the-as dma-packet (-> v1-12 base)))
)
(set! (-> a0-5 dma) (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt)))
(set! (-> a0-5 vif0) (new 'static 'vif-tag))
(set! (-> a0-5 vif1) (new 'static 'vif-tag :imm #x2 :cmd (vif-cmd direct) :msk #x1))
(set! (-> v1-12 base) (the-as pointer (&+ a0-5 16)))
)
(let* ((v1-13 s4-0)
(a0-7 (the-as gs-gif-tag (-> v1-13 base)))
)
(set! (-> a0-7 tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1))
(set! (-> a0-7 regs) GIF_REGS_ALL_AD)
(set! (-> v1-13 base) (the-as pointer (&+ a0-7 16)))
)
(let* ((v1-14 s4-0)
(a0-9 (-> v1-14 base))
)
(set! (-> (the-as (pointer gs-zbuf) a0-9) 0) (new 'static 'gs-zbuf :zbp #x130 :psm (gs-psm ct24)))
(set! (-> (the-as (pointer gs-reg64) a0-9) 1) (gs-reg64 zbuf-1))
(set! (-> v1-14 base) (&+ a0-9 16))
)
(let ((v1-15 (the-as dma-packet (-> s4-0 base))))
(set! (-> v1-15 dma) (new 'static 'dma-tag :id (dma-tag-id next) :addr (-> s5-0 next)))
(set! (-> v1-15 vif0) (new 'static 'vif-tag))
(set! (-> v1-15 vif1) (new 'static 'vif-tag))
(set! (-> s4-0 base) (the-as pointer (&+ v1-15 16)))
)
(set! (-> s5-0 next) (the-as uint s3-1))
)
)
)
(let ((gp-1 (-> *display* frames (-> *display* on-screen) bucket-group arg0)))
(when (!= gp-1 (-> gp-1 last))
(let* ((s4-1 (-> *display* frames (-> *display* on-screen) global-buf))
(s5-1 (-> s4-1 base))
)
(tie-end-buffer s4-1)
(let ((v0-3 (-> s4-1 base)))
(let ((v1-29 (the-as dma-packet (-> s4-1 base))))
(set! (-> v1-29 dma) (new 'static 'dma-tag :id (dma-tag-id next)))
(set! (-> v1-29 vif0) (new 'static 'vif-tag))
(set! (-> v1-29 vif1) (new 'static 'vif-tag))
(set! (-> s4-1 base) (the-as pointer (&+ v1-29 16)))
)
(set! (-> (the-as (pointer int32) (-> gp-1 last)) 1) (the-as int s5-1))
(set! (-> gp-1 last) (the-as (pointer dma-tag) v0-3))
)
)
)
)
(none)
)
(defun tie-init-envmap-buf ((arg0 bucket-id) (arg1 gs-alpha) (arg2 int) (arg3 int))
;; nothing yet
; (let ((s5-0 (-> *display* frames (-> *display* on-screen) bucket-group arg0)))
; (when (!= s5-0 (-> s5-0 last))
; (let* ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf))
; (s3-1 (-> s4-0 base))
; )
; (etie-init-engine s4-0)
; (let ((v1-12 (the-as dma-packet (-> s4-0 base))))
; (set! (-> v1-12 dma) (new 'static 'dma-tag :id (dma-tag-id next) :addr (-> s5-0 next)))
; (set! (-> v1-12 vif0) (new 'static 'vif-tag))
; (set! (-> v1-12 vif1) (new 'static 'vif-tag))
; (set! (-> s4-0 base) (the-as pointer (&+ v1-12 16)))
; )
; (set! (-> s5-0 next) (the-as uint s3-1))
; )
; )
; )
; (let ((gp-1 (-> *display* frames (-> *display* on-screen) bucket-group arg0)))
; (when (!= gp-1 (-> gp-1 last))
; (let* ((s4-1 (-> *display* frames (-> *display* on-screen) global-buf))
; (s5-1 (-> s4-1 base))
; )
; (etie-end-buffer s4-1)
; (let ((v0-3 (-> s4-1 base)))
; (let ((v1-26 (the-as dma-packet (-> s4-1 base))))
; (set! (-> v1-26 dma) (new 'static 'dma-tag :id (dma-tag-id next)))
; (set! (-> v1-26 vif0) (new 'static 'vif-tag))
; (set! (-> v1-26 vif1) (new 'static 'vif-tag))
; (set! (-> s4-1 base) (the-as pointer (&+ v1-26 16)))
; )
; (set! (-> (the-as (pointer int32) (-> gp-1 last)) 1) (the-as int s5-1))
; (set! (-> gp-1 last) (the-as (pointer dma-tag) v0-3))
; )
; )
; )
; )
(none)
)
(defun tie-init-envmap-scissor-buf ((arg0 bucket-id) (arg1 gs-alpha) (arg2 int) (arg3 int))
;; no etn
(none)
)
(deftype tie-init-data (structure)
((tie-bucket bucket-id :offset-assert 0)
(tie-scissor-bucket bucket-id :offset-assert 4)
(tie-envmap-bucket bucket-id :offset-assert 8)
(tie-envmap-scissor-bucket bucket-id :offset-assert 12)
(tie-vanish-bucket bucket-id :offset-assert 16)
(tie-trans-bucket bucket-id :offset-assert 20)
(tie-scissor-trans-bucket bucket-id :offset-assert 24)
(tie-envmap-trans-bucket bucket-id :offset-assert 28)
(tie-envmap-scissor-trans-bucket bucket-id :offset-assert 32)
(tie-water-bucket bucket-id :offset-assert 36)
(tie-scissor-water-bucket bucket-id :offset-assert 40)
(tie-envmap-water-bucket bucket-id :offset-assert 44)
(tie-envmap-scissor-water-bucket bucket-id :offset-assert 48)
)
:method-count-assert 9
:size-assert #x34
:flag-assert #x900000034
)
(define *tie-init-table* (new 'static 'inline-array tie-init-data 6
(new 'static 'tie-init-data
:tie-bucket (bucket-id tie-l0-tfrag)
:tie-scissor-bucket (bucket-id tie-s-l0-tfrag)
:tie-envmap-bucket (bucket-id etie-l0-tfrag)
:tie-envmap-scissor-bucket (bucket-id etie-s-l0-tfrag)
:tie-vanish-bucket (bucket-id tie-v-l0-tfrag)
:tie-trans-bucket (bucket-id tie-t-l0-alpha)
:tie-scissor-trans-bucket (bucket-id tie-st-l0-alpha)
:tie-envmap-trans-bucket (bucket-id etie-t-l0-alpha)
:tie-envmap-scissor-trans-bucket (bucket-id etie-st-l0-alpha)
:tie-water-bucket (bucket-id tie-w-l0-water)
:tie-scissor-water-bucket (bucket-id tie-sw-l0-water)
:tie-envmap-water-bucket (bucket-id etie-w-l0-water)
:tie-envmap-scissor-water-bucket (bucket-id etie-sw-l0-water)
)
(new 'static 'tie-init-data
:tie-bucket (bucket-id tie-l1-tfrag)
:tie-scissor-bucket (bucket-id tie-s-l1-tfrag)
:tie-envmap-bucket (bucket-id etie-l1-tfrag)
:tie-envmap-scissor-bucket (bucket-id etie-s-l1-tfrag)
:tie-vanish-bucket (bucket-id tie-v-l1-tfrag)
:tie-trans-bucket (bucket-id tie-t-l1-alpha)
:tie-scissor-trans-bucket (bucket-id tie-st-l1-alpha)
:tie-envmap-trans-bucket (bucket-id etie-t-l1-alpha)
:tie-envmap-scissor-trans-bucket (bucket-id etie-st-l1-alpha)
:tie-water-bucket (bucket-id tie-w-l1-water)
:tie-scissor-water-bucket (bucket-id tie-sw-l1-water)
:tie-envmap-water-bucket (bucket-id etie-w-l1-water)
:tie-envmap-scissor-water-bucket (bucket-id etie-sw-l1-water)
)
(new 'static 'tie-init-data
:tie-bucket (bucket-id tie-l2-tfrag)
:tie-scissor-bucket (bucket-id tie-s-l2-tfrag)
:tie-envmap-bucket (bucket-id etie-l2-tfrag)
:tie-envmap-scissor-bucket (bucket-id etie-s-l2-tfrag)
:tie-vanish-bucket (bucket-id tie-v-l2-tfrag)
:tie-trans-bucket (bucket-id tie-t-l2-alpha)
:tie-scissor-trans-bucket (bucket-id tie-st-l2-alpha)
:tie-envmap-trans-bucket (bucket-id etie-t-l2-alpha)
:tie-envmap-scissor-trans-bucket (bucket-id etie-st-l2-alpha)
:tie-water-bucket (bucket-id tie-w-l2-water)
:tie-scissor-water-bucket (bucket-id tie-sw-l2-water)
:tie-envmap-water-bucket (bucket-id etie-w-l2-water)
:tie-envmap-scissor-water-bucket (bucket-id tie-esw-l2-water)
)
(new 'static 'tie-init-data
:tie-bucket (bucket-id tie-l3-tfrag)
:tie-scissor-bucket (bucket-id tie-s-l3-tfrag)
:tie-envmap-bucket (bucket-id etie-l3-tfrag)
:tie-envmap-scissor-bucket (bucket-id etie-s-l3-tfrag)
:tie-vanish-bucket (bucket-id tie-v-l3-tfrag)
:tie-trans-bucket (bucket-id tie-t-l3-alpha)
:tie-scissor-trans-bucket (bucket-id tie-st-l3-alpha)
:tie-envmap-trans-bucket (bucket-id etie-t-l3-alpha)
:tie-envmap-scissor-trans-bucket (bucket-id etie-st-l3-alpha)
:tie-water-bucket (bucket-id tie-w-l3-water)
:tie-scissor-water-bucket (bucket-id tie-sw-l3-water)
:tie-envmap-water-bucket (bucket-id etie-w-l3-water)
:tie-envmap-scissor-water-bucket (bucket-id etie-sw-l3-water)
)
(new 'static 'tie-init-data
:tie-bucket (bucket-id tie-l4-tfrag)
:tie-scissor-bucket (bucket-id tie-s-l4-tfrag)
:tie-envmap-bucket (bucket-id etie-l4-tfrag)
:tie-envmap-scissor-bucket (bucket-id etie-s-l4-tfrag)
:tie-vanish-bucket (bucket-id tie-v-l4-tfrag)
:tie-trans-bucket (bucket-id tie-t-l4-alpha)
:tie-scissor-trans-bucket (bucket-id tie-st-l4-alpha)
:tie-envmap-trans-bucket (bucket-id etie-t-l4-alpha)
:tie-envmap-scissor-trans-bucket (bucket-id etie-st-l4-alpha)
:tie-water-bucket (bucket-id tie-w-l4-water)
:tie-scissor-water-bucket (bucket-id tie-sw-l4-water)
:tie-envmap-water-bucket (bucket-id etie-w-l4-water)
:tie-envmap-scissor-water-bucket (bucket-id etie-sw-l4-water)
)
(new 'static 'tie-init-data
:tie-bucket (bucket-id tie-l5-tfrag)
:tie-scissor-bucket (bucket-id tie-s-l5-tfrag)
:tie-envmap-bucket (bucket-id etie-l5-tfrag)
:tie-envmap-scissor-bucket (bucket-id etie-s-l5-tfrag)
:tie-vanish-bucket (bucket-id tie-v-l5-tfrag)
:tie-trans-bucket (bucket-id tie-t-l5-alpha)
:tie-scissor-trans-bucket (bucket-id tie-st-l5-alpha)
:tie-envmap-trans-bucket (bucket-id etie-t-l5-alpha)
:tie-envmap-scissor-trans-bucket (bucket-id etie-st-l5-alpha)
:tie-water-bucket (bucket-id tie-w-l5-water)
:tie-scissor-water-bucket (bucket-id tie-sw-l5-water)
:tie-envmap-water-bucket (bucket-id etie-w-l5-water)
:tie-envmap-scissor-water-bucket (bucket-id etie-sw-l5-water)
)
)
)
(defun tie-vu1-init-buffers ()
(let ((gp-0 0)
(s5-0 100)
(s4-0 68)
)
(dotimes (s3-0 6)
(let ((v1-2 (-> *level* draw-level s3-0))
(s2-0 (-> *tie-init-table* s3-0))
)
(when v1-2
(tie-init-buf
(-> s2-0 tie-bucket)
(the-as gs-alpha gp-0)
(new 'static 'gs-test
:ate #x1
:atst (gs-atest greater-equal)
:aref #x26
:zte #x1
:ztst (gs-ztest greater-equal)
)
(new 'static 'gs-test :zte #x1 :ztst (gs-ztest greater-equal))
)
(let ((t9-1 tie-init-scissor-buf)
(a0-3 (-> s2-0 tie-scissor-bucket))
(a1-2 0)
(a2-1 #x5026b)
(a3-1 #x50000)
)
(t9-1 a0-3 (the-as gs-alpha a1-2) (the-as gs-test a2-1) (the-as gs-test a3-1))
(tie-init-envmap-buf (-> s2-0 tie-envmap-bucket) (the-as gs-alpha gp-0) #x50000 a3-1)
(tie-init-envmap-scissor-buf (-> s2-0 tie-envmap-scissor-bucket) (the-as gs-alpha gp-0) #x50000 a3-1)
)
(tie-init-buf
(-> s2-0 tie-vanish-bucket)
(the-as gs-alpha s5-0)
(new 'static 'gs-test
:ate #x1
:atst (gs-atest greater-equal)
:aref #x26
:zte #x1
:ztst (gs-ztest greater-equal)
)
(new 'static 'gs-test :zte #x1 :ztst (gs-ztest greater-equal))
)
(tie-init-buf
(-> s2-0 tie-trans-bucket)
(the-as gs-alpha s4-0)
(new 'static 'gs-test
:ate #x1
:atst (gs-atest greater-equal)
:aref #x26
:zte #x1
:ztst (gs-ztest greater-equal)
)
(new 'static 'gs-test :zte #x1 :ztst (gs-ztest greater-equal))
)
(let ((t9-6 tie-init-scissor-buf)
(a0-8 (-> s2-0 tie-scissor-trans-bucket))
(a1-7 1)
(a2-6 #x5026b)
(a3-4 #x50000)
)
(t9-6 a0-8 (the-as gs-alpha a1-7) (the-as gs-test a2-6) (the-as gs-test a3-4))
(tie-init-envmap-buf (-> s2-0 tie-envmap-trans-bucket) (the-as gs-alpha s4-0) #x50000 a3-4)
(tie-init-envmap-scissor-buf (-> s2-0 tie-envmap-scissor-trans-bucket) (the-as gs-alpha s4-0) #x50000 a3-4)
)
(tie-init-buf
(-> s2-0 tie-water-bucket)
(the-as gs-alpha s4-0)
(new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest greater-equal))
(new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest greater-equal))
)
(let ((t9-10 tie-init-scissor-buf)
(a0-12 (-> s2-0 tie-scissor-water-bucket))
(a1-11 1)
(a2-10 #x51001)
(a3-6 #x51001)
)
(t9-10 a0-12 (the-as gs-alpha a1-11) (the-as gs-test a2-10) (the-as gs-test a3-6))
(tie-init-envmap-buf (-> s2-0 tie-envmap-water-bucket) (the-as gs-alpha s4-0) #x51001 a3-6)
(tie-init-envmap-scissor-buf (-> s2-0 tie-envmap-scissor-water-bucket) (the-as gs-alpha s4-0) #x51001 a3-6)
)
)
)
)
)
(none)
)
(defmethod draw drawable-tree-instance-tie ((obj drawable-tree-instance-tie) (arg0 drawable-tree-instance-tie) (arg1 display-frame))
(let ((v1-1 (-> *background-work* tie-tree-count))
(a1-4 (-> *level* draw-level *draw-index*))
)
(set! (-> *background-work* tie-trees v1-1) obj)
(set! (-> *background-work* tie-levels v1-1) a1-4)
)
(+! (-> *background-work* tie-tree-count) 1)
0
(none)
)
(defmethod collect-stats drawable-tree-instance-tie ((obj drawable-tree-instance-tie))
(when (logtest? (vu1-renderer-mask
tie
tie-envmap
tie-scissor
tie-vanish
generic
tie-scissor-trans
tie-trans
tie-envmap-trans
tie-scissor-water
tie-water
tie-envmap-water
)
(-> *display* vu1-enable-user)
)
(-> obj data (+ (-> obj length) -1))
(let ((v1-9 (-> obj prototypes prototype-array-tie)))
(dotimes (a0-1 (-> v1-9 length))
(let ((a1-4 (-> v1-9 array-data a0-1)))
(when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask generic))
(let ((a2-4 0)
(a3-0 2)
)
(while (>= a3-0 a2-4)
(let ((t0-2 (-> a1-4 generic-count a2-4))
(t2-0 (-> a1-4 tie-geom (+ a2-4 1)))
)
(when (nonzero? t0-2)
(let ((t1-4 (the-as object (-> t2-0 data)))
(t2-1 (-> t2-0 length))
)
(+! (-> *terrain-stats* tie-generic groups) 1)
(+! (-> *terrain-stats* tie-generic fragments) t2-1)
(+! (-> *terrain-stats* tie-generic instances) t0-2)
(dotimes (t3-9 t2-1)
(let ((t5-0 (* (-> (the-as tie-fragment t1-4) debug num-tris) t0-2))
(t4-7 (* (-> (the-as tie-fragment t1-4) debug num-dverts) t0-2))
)
(+! (-> *terrain-stats* tie-generic tris) t5-0)
(+! (-> *terrain-stats* tie-generic dverts) t4-7)
)
(set! t1-4 (&+ (the-as tie-fragment t1-4) 64))
)
)
)
)
(+! a2-4 1)
)
)
)
(when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask tie-vanish))
(let ((a2-11 (-> a1-4 vanish-count))
(t0-4 (-> a1-4 tie-geom 3))
)
(when (nonzero? a2-11)
(let ((a3-2 (the-as object (-> t0-4 data)))
(t0-5 (-> t0-4 length))
)
(+! (-> *terrain-stats* tie-vanish groups) 1)
(+! (-> *terrain-stats* tie-vanish fragments) t0-5)
(+! (-> *terrain-stats* tie-vanish instances) (the-as uint a2-11))
(dotimes (t1-15 t0-5)
(let ((t3-10 (* (-> (the-as tie-fragment a3-2) debug num-tris) (the-as uint a2-11)))
(t2-9 (* (-> (the-as tie-fragment a3-2) debug num-dverts) (the-as uint a2-11)))
)
(+! (-> *terrain-stats* tie-vanish tris) t3-10)
(+! (-> *terrain-stats* tie-vanish dverts) t2-9)
)
(set! a3-2 (&+ (the-as tie-fragment a3-2) 64))
)
)
)
)
)
(cond
((logtest? (-> a1-4 flags) (prototype-flags tpage-water))
(when (logtest? (vu1-renderer-mask tie-water) (-> *display* vu1-enable-user))
(let ((a2-18 1)
(a3-6 3)
)
(while (>= a3-6 a2-18)
(let ((t0-8 (-> a1-4 count a2-18))
(t2-11 (-> a1-4 tie-geom a2-18))
)
(when (nonzero? t0-8)
(let ((t1-19 (the-as object (-> t2-11 data)))
(t2-12 (-> t2-11 length))
)
(+! (-> *terrain-stats* tie-water groups) 1)
(+! (-> *terrain-stats* tie-water fragments) t2-12)
(+! (-> *terrain-stats* tie-water instances) (the-as uint t0-8))
(dotimes (t3-24 t2-12)
(let ((t5-5 (* (-> (the-as tie-fragment t1-19) debug num-tris) (the-as uint t0-8)))
(t4-19 (* (-> (the-as tie-fragment t1-19) debug num-dverts) (the-as uint t0-8)))
)
(+! (-> *terrain-stats* tie-water tris) t5-5)
(+! (-> *terrain-stats* tie-water dverts) t4-19)
)
(set! t1-19 (&+ (the-as tie-fragment t1-19) 64))
)
)
)
)
(+! a2-18 1)
)
)
)
(when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask tie))
(let ((a2-25 (-> a1-4 tie-scissor-count))
(t0-10 (-> a1-4 tie-geom 0))
)
(when (nonzero? a2-25)
(let ((a3-8 (the-as object (-> t0-10 data)))
(t0-11 (-> t0-10 length))
)
(+! (-> *terrain-stats* tie-scissor-water groups) 1)
(+! (-> *terrain-stats* tie-scissor-water fragments) t0-11)
(+! (-> *terrain-stats* tie-scissor-water instances) (the-as uint a2-25))
(dotimes (t1-30 t0-11)
(let ((t3-25 (* (-> (the-as tie-fragment a3-8) debug num-tris) (the-as uint a2-25)))
(t2-20 (* (-> (the-as tie-fragment a3-8) debug num-dverts) (the-as uint a2-25)))
)
(+! (-> *terrain-stats* tie-scissor-water tris) t3-25)
(+! (-> *terrain-stats* tie-scissor-water dverts) t2-20)
)
(set! a3-8 (&+ (the-as tie-fragment a3-8) 64))
)
)
)
)
)
(when (logtest? (vu1-renderer-mask tie-envmap-water) (-> *display* vu1-enable-user))
(let ((a2-30 1)
(a3-12 3)
)
(while (>= a3-12 a2-30)
(let ((t0-14 (-> a1-4 envmap-count a2-30))
(t2-22 (-> a1-4 tie-geom a2-30))
)
(when (nonzero? t0-14)
(let ((t1-34 (the-as object (-> t2-22 data)))
(t2-23 (-> t2-22 length))
)
(+! (-> *terrain-stats* tie-envmap-water groups) 1)
(+! (-> *terrain-stats* tie-envmap-water fragments) t2-23)
(+! (-> *terrain-stats* tie-envmap-water instances) t0-14)
(dotimes (t3-39 t2-23)
(let ((t5-10 (* (* t0-14 (-> (the-as tie-fragment t1-34) debug num-tris)) 2))
(t4-33 (* (* t0-14 (-> (the-as tie-fragment t1-34) debug num-dverts)) 2))
)
(+! (-> *terrain-stats* tie-envmap-water tris) t5-10)
(+! (-> *terrain-stats* tie-envmap-water dverts) t4-33)
)
(set! t1-34 (&+ (the-as tie-fragment t1-34) 64))
)
)
)
)
(+! a2-30 1)
)
)
)
(when (logtest? (vu1-renderer-mask tie-envmap-scissor-water) (-> *display* vu1-enable-user))
(let ((a2-35 (-> a1-4 envmap-scissor-count))
(t0-16 (-> a1-4 tie-geom 0))
)
(when (nonzero? a2-35)
(let ((a1-5 (the-as object (-> t0-16 data)))
(a3-17 (-> t0-16 length))
)
(+! (-> *terrain-stats* tie-envmap-scissor-water groups) 1)
(+! (-> *terrain-stats* tie-envmap-scissor-water fragments) a3-17)
(+! (-> *terrain-stats* tie-envmap-scissor-water instances) (the-as uint a2-35))
(dotimes (t0-26 a3-17)
(let ((t2-24 (* (* (the-as uint a2-35) (-> (the-as tie-fragment a1-5) debug num-tris)) 2))
(t1-45 (* (* (the-as uint a2-35) (-> (the-as tie-fragment a1-5) debug num-dverts)) 2))
)
(+! (-> *terrain-stats* tie-envmap-scissor-water tris) t2-24)
(+! (-> *terrain-stats* tie-envmap-scissor-water dverts) t1-45)
)
(set! a1-5 (&+ (the-as tie-fragment a1-5) 64))
)
)
)
)
)
)
((logtest? (-> a1-4 flags) (prototype-flags tpage-alpha))
(when (logtest? (vu1-renderer-mask tie-trans) (-> *display* vu1-enable-user))
(let ((a2-41 1)
(a3-21 3)
)
(while (>= a3-21 a2-41)
(let ((t0-29 (-> a1-4 count a2-41))
(t2-29 (-> a1-4 tie-geom a2-41))
)
(when (nonzero? t0-29)
(let ((t1-50 (the-as object (-> t2-29 data)))
(t2-30 (-> t2-29 length))
)
(+! (-> *terrain-stats* tie-trans groups) 1)
(+! (-> *terrain-stats* tie-trans fragments) t2-30)
(+! (-> *terrain-stats* tie-trans instances) (the-as uint t0-29))
(dotimes (t3-52 t2-30)
(let ((t5-15 (* (-> (the-as tie-fragment t1-50) debug num-tris) (the-as uint t0-29)))
(t4-42 (* (-> (the-as tie-fragment t1-50) debug num-dverts) (the-as uint t0-29)))
)
(+! (-> *terrain-stats* tie-trans tris) t5-15)
(+! (-> *terrain-stats* tie-trans dverts) t4-42)
)
(set! t1-50 (&+ (the-as tie-fragment t1-50) 64))
)
)
)
)
(+! a2-41 1)
)
)
)
(when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask tie))
(let ((a2-48 (-> a1-4 tie-scissor-count))
(t0-31 (-> a1-4 tie-geom 0))
)
(when (nonzero? a2-48)
(let ((a3-23 (the-as object (-> t0-31 data)))
(t0-32 (-> t0-31 length))
)
(+! (-> *terrain-stats* tie-scissor-trans groups) 1)
(+! (-> *terrain-stats* tie-scissor-trans fragments) t0-32)
(+! (-> *terrain-stats* tie-scissor-trans instances) (the-as uint a2-48))
(dotimes (t1-61 t0-32)
(let ((t3-53 (* (-> (the-as tie-fragment a3-23) debug num-tris) (the-as uint a2-48)))
(t2-38 (* (-> (the-as tie-fragment a3-23) debug num-dverts) (the-as uint a2-48)))
)
(+! (-> *terrain-stats* tie-scissor-trans tris) t3-53)
(+! (-> *terrain-stats* tie-scissor-trans dverts) t2-38)
)
(set! a3-23 (&+ (the-as tie-fragment a3-23) 64))
)
)
)
)
)
(when (logtest? (vu1-renderer-mask tie-envmap-trans) (-> *display* vu1-enable-user))
(let ((a2-53 1)
(a3-27 3)
)
(while (>= a3-27 a2-53)
(let ((t0-35 (-> a1-4 envmap-count a2-53))
(t2-40 (-> a1-4 tie-geom a2-53))
)
(when (nonzero? t0-35)
(let ((t1-65 (the-as object (-> t2-40 data)))
(t2-41 (-> t2-40 length))
)
(+! (-> *terrain-stats* tie-envmap-trans groups) 1)
(+! (-> *terrain-stats* tie-envmap-trans fragments) t2-41)
(+! (-> *terrain-stats* tie-envmap-trans instances) t0-35)
(dotimes (t3-67 t2-41)
(let ((t5-20 (* (* t0-35 (-> (the-as tie-fragment t1-65) debug num-tris)) 2))
(t4-56 (* (* t0-35 (-> (the-as tie-fragment t1-65) debug num-dverts)) 2))
)
(+! (-> *terrain-stats* tie-envmap-trans tris) t5-20)
(+! (-> *terrain-stats* tie-envmap-trans dverts) t4-56)
)
(set! t1-65 (&+ (the-as tie-fragment t1-65) 64))
)
)
)
)
(+! a2-53 1)
)
)
)
(when (logtest? (vu1-renderer-mask tie-envmap-scissor-trans) (-> *display* vu1-enable-user))
(let ((a2-58 (-> a1-4 envmap-scissor-count))
(t0-37 (-> a1-4 tie-geom 0))
)
(when (nonzero? a2-58)
(let ((a1-7 (the-as object (-> t0-37 data)))
(a3-32 (-> t0-37 length))
)
(+! (-> *terrain-stats* tie-envmap-scissor-trans groups) 1)
(+! (-> *terrain-stats* tie-envmap-scissor-trans fragments) a3-32)
(+! (-> *terrain-stats* tie-envmap-scissor-trans instances) (the-as uint a2-58))
(dotimes (t0-47 a3-32)
(let ((t2-42 (* (* (the-as uint a2-58) (-> (the-as tie-fragment a1-7) debug num-tris)) 2))
(t1-76 (* (* (the-as uint a2-58) (-> (the-as tie-fragment a1-7) debug num-dverts)) 2))
)
(+! (-> *terrain-stats* tie-envmap-scissor-trans tris) t2-42)
(+! (-> *terrain-stats* tie-envmap-scissor-trans dverts) t1-76)
)
(set! a1-7 (&+ (the-as tie-fragment a1-7) 64))
)
)
)
)
)
)
(else
(when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask tie-envmap))
(let ((a2-63 1)
(a3-34 3)
)
(while (>= a3-34 a2-63)
(let ((t0-50 (-> a1-4 count a2-63))
(t2-47 (-> a1-4 tie-geom a2-63))
)
(when (nonzero? t0-50)
(let ((t1-81 (the-as object (-> t2-47 data)))
(t2-48 (-> t2-47 length))
)
(+! (-> *terrain-stats* tie groups) 1)
(+! (-> *terrain-stats* tie fragments) t2-48)
(+! (-> *terrain-stats* tie instances) (the-as uint t0-50))
(dotimes (t3-80 t2-48)
(let ((t5-25 (* (-> (the-as tie-fragment t1-81) debug num-tris) (the-as uint t0-50)))
(t4-65 (* (-> (the-as tie-fragment t1-81) debug num-dverts) (the-as uint t0-50)))
)
(+! (-> *terrain-stats* tie tris) t5-25)
(+! (-> *terrain-stats* tie dverts) t4-65)
)
(set! t1-81 (&+ (the-as tie-fragment t1-81) 64))
)
)
)
)
(+! a2-63 1)
)
)
)
(when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask tie))
(let ((a2-70 (-> a1-4 tie-scissor-count))
(t0-52 (-> a1-4 tie-geom 0))
)
(when (nonzero? a2-70)
(let ((a3-36 (the-as object (-> t0-52 data)))
(t0-53 (-> t0-52 length))
)
(+! (-> *terrain-stats* tie-scissor groups) 1)
(+! (-> *terrain-stats* tie-scissor fragments) t0-53)
(+! (-> *terrain-stats* tie-scissor instances) (the-as uint a2-70))
(dotimes (t1-92 t0-53)
(let ((t3-81 (* (-> (the-as tie-fragment a3-36) debug num-tris) (the-as uint a2-70)))
(t2-56 (* (-> (the-as tie-fragment a3-36) debug num-dverts) (the-as uint a2-70)))
)
(+! (-> *terrain-stats* tie-scissor tris) t3-81)
(+! (-> *terrain-stats* tie-scissor dverts) t2-56)
)
(set! a3-36 (&+ (the-as tie-fragment a3-36) 64))
)
)
)
)
)
(when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask tie-scissor))
(let ((a2-76 1)
(a3-38 3)
)
(while (>= a3-38 a2-76)
(let ((t0-56 (-> a1-4 envmap-count a2-76))
(t2-58 (-> a1-4 tie-geom a2-76))
)
(when (nonzero? t0-56)
(let ((t1-96 (the-as object (-> t2-58 data)))
(t2-59 (-> t2-58 length))
)
(+! (-> *terrain-stats* tie-envmap groups) 1)
(+! (-> *terrain-stats* tie-envmap fragments) t2-59)
(+! (-> *terrain-stats* tie-envmap instances) t0-56)
(dotimes (t3-95 t2-59)
(let ((t5-30 (* (* t0-56 (-> (the-as tie-fragment t1-96) debug num-tris)) 2))
(t4-79 (* (* t0-56 (-> (the-as tie-fragment t1-96) debug num-dverts)) 2))
)
(+! (-> *terrain-stats* tie-envmap tris) t5-30)
(+! (-> *terrain-stats* tie-envmap dverts) t4-79)
)
(set! t1-96 (&+ (the-as tie-fragment t1-96) 64))
)
)
)
)
(+! a2-76 1)
)
)
)
(when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask tie-envmap-scissor))
(let ((a2-82 (-> a1-4 envmap-scissor-count))
(t0-58 (-> a1-4 tie-geom 0))
)
(when (nonzero? a2-82)
(let ((a1-9 (the-as object (-> t0-58 data)))
(a3-41 (-> t0-58 length))
)
(+! (-> *terrain-stats* tie-envmap-scissor groups) 1)
(+! (-> *terrain-stats* tie-envmap-scissor fragments) a3-41)
(+! (-> *terrain-stats* tie-envmap-scissor instances) (the-as uint a2-82))
(dotimes (t0-68 a3-41)
(let ((t2-60 (* (* (the-as uint a2-82) (-> (the-as tie-fragment a1-9) debug num-tris)) 2))
(t1-107 (* (* (the-as uint a2-82) (-> (the-as tie-fragment a1-9) debug num-dverts)) 2))
)
(+! (-> *terrain-stats* tie-envmap-scissor tris) t2-60)
(+! (-> *terrain-stats* tie-envmap-scissor dverts) t1-107)
)
(set! a1-9 (&+ (the-as tie-fragment a1-9) 64))
)
)
)
)
)
)
)
)
)
)
)
0
(none)
)
(defmethod debug-draw drawable-tree-instance-tie ((obj drawable-tree-instance-tie) (arg0 drawable) (arg1 display-frame))
(-> obj data (+ (-> obj length) -1))
(let* ((s5-0 (-> obj prototypes prototype-array-tie))
(s4-0 (-> s5-0 length))
)
(dotimes (s3-0 s4-0)
(let ((a1-1 (-> s5-0 array-data s3-0 tie-geom 0)))
(debug-draw a1-1 a1-1 arg1)
)
)
)
0
(none)
)