[decomp] jak2: shrubbery (#1898)

Some notes:
- `draw-prototype-inline-array-shrub` can probably be decompiled but I'm
not comfortable doing this function myself. It's got a ton of inline
assembly (or at least I think it's inline assembly) and is very long. I
left this marked as asm for now but I am confident in the function
definition.
- The VU program is identical to Jak 1 (yay)
- There's some new `dma-test` stuff at the end of the file, not really
sure what it's doing but it runs in the top-level.
This commit is contained in:
Ethan Lafrenais 2022-09-18 12:19:16 -04:00 committed by GitHub
parent 1b45aab3cc
commit dc5dc9c76c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 3598 additions and 103 deletions

View file

@ -12311,13 +12311,14 @@
)
(deftype prototype-bucket-shrub (prototype-bucket)
((next uint32 4 :offset-assert 64) ;; guessed by decompiler
(count uint16 4 :offset-assert 80) ;; guessed by decompiler
(mod-count uint16 4 :offset-assert 88) ;; guessed by decompiler
(last dma-packet 4 :offset-assert 96) ;; guessed by decompiler
(next-clear uint128 :offset 64)
(count-clear uint64 :offset 80)
(last-clear uint128 :offset 96)
((next uint32 4 :offset-assert 64) ;; guessed by decompiler
(count uint16 4 :offset-assert 80) ;; guessed by decompiler
(mod-count uint16 4 :offset-assert 88) ;; guessed by decompiler
(last dma-packet 4 :offset-assert 96) ;; guessed by decompiler
(next-clear uint128 :offset 64)
(count-clear uint64 :offset 80)
(count-clear-qword uint128 :offset 80)
(last-clear uint128 :offset 96)
)
:method-count-assert 9
:size-assert #x70
@ -17231,7 +17232,7 @@
(deftype shrub-view-data (structure)
((data uint128 3 :offset-assert 0) ;; guessed by decompiler
(texture-giftag gs-gif-tag :inline :offset 0) ;; was qword
(consts vector :inline :offset 16)
(consts vector :inline :offset 16 :score -1)
(fog-clamp vector :inline :offset 32)
(tex-start-ptr int32 :offset 16)
(gifbufsum float :offset 16)
@ -17359,7 +17360,7 @@
(vertex-tmpl dma-packet :inline :offset-assert 64)
(mscal-tmpl dma-packet :inline :offset-assert 80)
(init-tmpl dma-packet :inline :offset-assert 96)
(init-data uint32 8 :offset-assert 112) ;; guessed by decompiler
(init-data qword 2 :inline :offset-assert 112)
)
:method-count-assert 9
:size-assert #x90
@ -22512,8 +22513,8 @@
;; (define-extern generic-setup-constants function) ;; (function generic-constants int none)
;; (define-extern generic-add-constants function) ;; (function dma-buffer int none)
;; (define-extern generic-setup-shrub-constants function)
;; (define-extern generic-add-shrub-constants function)
;; (define-extern generic-init-buf function) ;; (function dma-buffer int gs-zbuf none)
(define-extern generic-add-shrub-constants (function dma-buffer int int int none))
(define-extern generic-init-buf (function dma-buffer int gs-zbuf none))
;; (define-extern generic-vu1-init-buf function)
;; (define-extern generic-vu1-init-buf-special function)
(define-extern generic-vu1-init-buffers (function none))
@ -22890,18 +22891,14 @@
;; shrubbery ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#|
(deftype dma-test (structure)
((data UNKNOWN 101 :offset-assert 0)
((data qword 101 :inline :offset-assert 0)
)
:method-count-assert 9
:size-assert #x650
:flag-assert #x900000650
)
|#
#|
(deftype dma-test-work (structure)
((upload dma-packet :inline :offset-assert 0)
(end dma-packet :inline :offset-assert 16)
@ -22910,26 +22907,25 @@
:size-assert #x20
:flag-assert #x900000020
)
|#
;; (define-extern mem-usage-shrub-walk function) ;; (function draw-node int memory-usage-block int draw-node)
;; (define-extern shrub-vu1-block object) ;; vu-function
;; (define-extern shrub-num-tris function) ;; (function shrubbery uint)
(define-extern shrub-make-perspective-matrix (function matrix matrix)) ;;
;; (define-extern shrub-init-view-data function) ;; (function shrub-view-data symbol)
;; (define-extern shrub-upload-view-data function) ;; (function dma-buffer symbol)
;; (define-extern shrub-time function) ;; (function int int int int int int)
;; (define-extern shrub-do-init-frame function) ;; (function dma-buffer symbol)
;; (define-extern shrub-init-frame function) ;; (function dma-buffer gs-test none)
;; (define-extern shrub-upload-model function) ;; (function shrubbery dma-buffer int symbol)
;; (define-extern draw-inline-array-instance-shrub function) ;; (function dma-buffer drawable int (inline-array prototype-bucket-shrub) none)
;; (define-extern draw-prototype-inline-array-shrub function) ;; (function int (inline-array prototype-bucket-shrub) pointer)
;; (define-extern draw-drawable-tree-instance-shrub function) ;; (function drawable-tree-instance-shrub level none)
;; (define-extern *dma-test* object)
;; (define-extern *dma-test-work* object)
;; (define-extern init-dma-test function)
;; (define-extern dma-test-func function)
;; (define-extern move-test-func function)
(define-extern mem-usage-shrub-walk (function draw-node int memory-usage-block int draw-node))
(define-extern shrub-vu1-block vu-function)
(define-extern shrub-num-tris (function shrubbery uint))
(define-extern shrub-make-perspective-matrix (function matrix matrix matrix))
(define-extern shrub-init-view-data (function shrub-view-data symbol))
(define-extern shrub-upload-view-data (function dma-buffer symbol))
(define-extern shrub-time (function int int int int int int))
(define-extern shrub-do-init-frame (function dma-buffer symbol))
(define-extern shrub-init-frame (function dma-buffer gs-test symbol))
(define-extern shrub-upload-model (function shrubbery dma-buffer int symbol))
(define-extern draw-inline-array-instance-shrub (function dma-buffer drawable int (inline-array prototype-bucket-shrub) none))
(define-extern draw-prototype-inline-array-shrub (function int (inline-array prototype-bucket-shrub) pointer))
(define-extern draw-drawable-tree-instance-shrub (function drawable-tree-instance-shrub level none))
(define-extern *dma-test* dma-test)
(define-extern *dma-test-work* dma-test-work)
(define-extern init-dma-test (function none))
(define-extern dma-test-func (function none))
(define-extern move-test-func (function none))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; shrub-work ;;

View file

@ -90,6 +90,8 @@
"(method 11 collide-mesh-cache)",
"cpu-delay",
"qword-read-time",
"dma-test-func",
"move-test-func",
"symlink2",
"blerc-a-fragment",
@ -114,6 +116,10 @@
"debug-line-clip?",
// logand with #f arg
"bugfix?",
// CFG failed
"draw-inline-array-instance-shrub",
// todo
"draw-prototype-inline-array-shrub",
// "reset-target-tracking",
"(anon-function 1 target)",
@ -248,6 +254,7 @@
"real-main-draw-hook": [114, 115, 116, 118],
"sprite-draw-distorters": [4, 5],
"draw-drawable-tree-instance-shrub": [5, 7, 9, 11],
"add-debug-box-with-transform": [0, 3],
"add-debug-line-sphere": [0],

View file

@ -1511,6 +1511,70 @@
[[38, 41], "v1", "vector"],
[[55, 59], "s0", "(inline-array vector)"]
],
// shrubbery
"shrub-upload-view-data": [
[[8, 16], "a0", "dma-packet"]
],
"shrub-do-init-frame": [
[[12, 21], "a0", "dma-packet"],
[[26, 29], "a0", "dma-packet"],
[33, "v1", "(pointer vif-tag)"],
[[35, 41], "v1", "(pointer uint32)"],
[42, "v1", "(pointer vif-tag)"],
[[44, 51], "v1", "(pointer uint32)"],
[52, "v1", "(pointer vif-tag)"],
[54, "v1", "(pointer uint32)"]
],
"shrub-init-frame": [
[[8, 12], "a0", "dma-packet"],
[[18, 21], "a0", "gs-gif-tag"],
[24, "v1", "(pointer gs-test)"],
[26, "v1", "(pointer gs-reg64)"]
],
"shrub-upload-model": [
[[17, 26], "a3", "dma-packet"],
[[33, 41], "a0", "dma-packet"],
[[47, 55], "a0", "dma-packet"]
],
"draw-drawable-tree-instance-shrub": [
[86, "a0", "drawable-group"]
],
"draw-prototype-inline-array-shrub": [
[[13, 56], "v1", "prototype-bucket-shrub"],
[[102, 114], "a0", "shrub-near-packet"],
[[114, 117], "v1", "vector4w-3"],
[118, "a1", "vector4w"],
[123, "v1", "dma-packet"],
[[124, 126], "v1", "vector4w"],
[[334, 364], "s1", "prototype-bucket-shrub"],
[416, "a0", "drawable-group"],
[420, "s1", "prototype-bucket-shrub"],
[525, "v1", "drawable-group"],
[[518, 535], "s1", "prototype-bucket-shrub"],
[558, "s1", "prototype-bucket-shrub"],
[[677, 718], "gp", "prototype-bucket-shrub"],
[[696, 706], "a1", "prototype-bucket-shrub"]
],
"(method 8 drawable-tree-instance-shrub)": [
[54, "v1", "drawable-group"]
],
"(method 13 drawable-tree-instance-shrub)": [
[[12, 151], "gp", "prototype-bucket-shrub"],
[19, "a1", "drawable-group"],
[44, "v1", "drawable-group"],
[66, "s3", "shrubbery"],
[92, "v1", "drawable-group"],
[114, "s3", "shrubbery"],
[160, "gp", "(inline-array prototype-bucket-shrub)"]
],
"(method 9 shrubbery)": [
[23, "a2", "(pointer int32)"],
[28, "a3", "(inline-array texture-masks)"]
],
"init-dma-test": [
[29, "v1", "(inline-array qword)"]
],
"drawable-load": [[[25, 28], "s5", "drawable"]],
"art-load": [[[13, 16], "s5", "art"]],
"art-group-load-check": [[[43, 53], "s3", "art-group"]],

View file

@ -648,6 +648,67 @@
}
},
// shrubbery
"shrub-num-tris": {
"args": "shrub"
},
"shrub-make-perspective-matrix": {
"args": ["out", "camera-temp"]
},
"shrub-init-view-data": {
"args": "view-data"
},
"shrub-upload-view-data": {
"args": "dma-buff",
"vars": {
"v1-0": "buf",
"a0-1": ["pkt", "dma-packet"],
"s5-0": "qwc"
}
},
"shrub-do-init-frame": {
"args": "dma-buff",
"vars": {
"a0-3": ["pkt1", "dma-packet"],
"a0-5": ["pkt2", "dma-packet"]
}
},
"shrub-init-frame": {
"args": ["dma-buff", "test"],
"vars": {
"a0-2": ["pkt", "dma-packet"],
"a0-4": ["giftag", "gs-gif-tag"]
}
},
"shrub-upload-model": {
"args": ["shrub", "dma-buff", "arg2"],
"vars": {
"a3-0": ["a3-0", "dma-packet"],
"a0-9": ["a0-9", "dma-packet"],
"a0-11": ["a0-11", "dma-packet"]
}
},
"draw-drawable-tree-instance-shrub": {
"args": ["tree", "level"],
"vars": {
"v1-24": "dma-buff",
"v1-16": "proto-array",
"s5-0": "proto-array-len",
"s4-0": "proto-array-data",
"a2-3": "proto",
"a1-5": "i",
"gp-0": "dma-start"
}
},
"draw-prototype-inline-array-shrub": {
"args": ["proto-array-len", "proto-array"],
"vars": {
"v1-0": ["v1-0", "prototype-bucket-shrub"],
"a2-6": "dma-ptr",
"a0-14": ["a0-14", "shrub-near-packet"]
}
},
"(method 10 cam-setting-data)": {
"vars": {
"v1-5": ["v1-5", "handle"],

View file

@ -451,30 +451,24 @@
)
(update-view-planes gp-0 (-> gp-0 plane) 1.0 (-> gp-0 inv-camera-rot))
(update-view-planes gp-0 (-> gp-0 guard-plane) 4.0 (-> gp-0 inv-camera-rot))
(let ((t9-20 shrub-make-perspective-matrix)
(a0-56 (-> gp-0 shrub-mat))
)
(-> gp-0 camera-temp)
(t9-20 a0-56)
)
(shrub-make-perspective-matrix (-> gp-0 shrub-mat) (-> gp-0 camera-temp))
(update-visible gp-0)
(when (-> *time-of-day-context* use-camera-other)
(let ((s5-4 (-> gp-0 camera-rot))
(s4-2 (-> gp-0 camera-rot-other))
(s3-2 (-> gp-0 inv-camera-rot-other))
(s2-1 (-> gp-0 camera-temp-other))
)
(let ((s2-1 (-> gp-0 camera-temp-other)))
(quaternion->matrix s4-2 (-> gp-0 quat-other))
(set! (-> s4-2 trans quad) (-> gp-0 trans-other quad))
(set! (-> s4-2 trans w) 1.0)
(matrix*! s4-2 s4-2 s5-4)
(matrix-inverse-of-rot-trans! s3-2 s4-2)
(matrix*! s2-1 s4-2 (-> gp-0 perspective))
)
(quaternion->matrix s4-2 (-> gp-0 quat-other))
(set! (-> s4-2 trans quad) (-> gp-0 trans-other quad))
(set! (-> s4-2 trans w) 1.0)
(matrix*! s4-2 s4-2 s5-4)
(matrix-inverse-of-rot-trans! s3-2 s4-2)
(matrix*! s2-1 s4-2 (-> gp-0 perspective))
(update-view-planes gp-0 (-> gp-0 plane-other) 1.0 s3-2)
(update-view-planes gp-0 (-> gp-0 guard-plane-other) 4.0 s3-2)
(shrub-make-perspective-matrix (-> gp-0 shrub-mat-other) s2-1)
)
(shrub-make-perspective-matrix (-> gp-0 shrub-mat-other))
)
)
#f

View file

@ -43,13 +43,14 @@
)
(deftype prototype-bucket-shrub (prototype-bucket)
((next uint32 4 :offset-assert 64)
(count uint16 4 :offset-assert 80)
(mod-count uint16 4 :offset-assert 88)
(last dma-packet 4 :offset-assert 96)
(next-clear uint128 :offset 64)
(count-clear uint64 :offset 80)
(last-clear uint128 :offset 96)
((next uint32 4 :offset-assert 64)
(count uint16 4 :offset-assert 80)
(mod-count uint16 4 :offset-assert 88)
(last dma-packet 4 :offset-assert 96)
(next-clear uint128 :offset 64)
(count-clear uint64 :offset 80)
(count-clear-qword uint128 :offset 80)
(last-clear uint128 :offset 96)
)
:method-count-assert 9
:size-assert #x70

View file

@ -8,7 +8,7 @@
;; NOTE - for cam-update
(declare-type instance-shrub-work structure)
(define-extern *instance-shrub-work* instance-shrub-work)
(define-extern shrub-make-perspective-matrix (function matrix matrix))
(define-extern shrub-make-perspective-matrix (function matrix matrix matrix))
;; DECOMP BEGINS
@ -167,14 +167,14 @@
(define *shrub-state* 0)
(deftype shrub-near-packet (structure)
((matrix-tmpl dma-packet :inline :offset-assert 0)
(header-tmpl dma-packet :inline :offset-assert 16)
(stq-tmpl dma-packet :inline :offset-assert 32)
(color-tmpl dma-packet :inline :offset-assert 48)
(vertex-tmpl dma-packet :inline :offset-assert 64)
(mscal-tmpl dma-packet :inline :offset-assert 80)
(init-tmpl dma-packet :inline :offset-assert 96)
(init-data uint32 8 :offset-assert 112)
((matrix-tmpl dma-packet :inline :offset-assert 0)
(header-tmpl dma-packet :inline :offset-assert 16)
(stq-tmpl dma-packet :inline :offset-assert 32)
(color-tmpl dma-packet :inline :offset-assert 48)
(vertex-tmpl dma-packet :inline :offset-assert 64)
(mscal-tmpl dma-packet :inline :offset-assert 80)
(init-tmpl dma-packet :inline :offset-assert 96)
(init-data qword 2 :inline :offset-assert 112)
)
:method-count-assert 9
:size-assert #x90

View file

@ -5,5 +5,679 @@
;; name in dgo: shrubbery
;; dgos: ENGINE, GAME
(define-extern draw-inline-array-instance-shrub (function dma-buffer drawable int (inline-array prototype-bucket-shrub) none))
(define-extern draw-prototype-inline-array-shrub (function int (inline-array prototype-bucket-shrub) pointer))
;; DECOMP BEGINS
;;-*-Lisp-*-
(in-package goal)
(defmethod login billboard ((obj billboard))
"Set up the billboard adgif shader"
(adgif-shader-login (-> obj flat))
obj
)
(defmethod mem-usage billboard ((obj billboard) (arg0 memory-usage-block) (arg1 int))
"Compute the memory used for the billboard."
(set! (-> arg0 length) (max 34 (-> arg0 length)))
(set! (-> arg0 data 33 name) "billboard")
(+! (-> arg0 data 33 count) 1)
(let ((v1-6 (asize-of obj)))
(+! (-> arg0 data 33 used) v1-6)
(+! (-> arg0 data 33 total) (logand -16 (+ v1-6 15)))
)
obj
)
(define-extern mem-usage-shrub-walk (function draw-node int memory-usage-block int draw-node))
(defun mem-usage-shrub-walk ((arg0 draw-node) (arg1 int) (arg2 memory-usage-block) (arg3 int))
"Recursively iterate through the entire shrub tree and compute memory usage for instances."
(set! (-> arg2 length) (max 64 (-> arg2 length)))
(set! (-> arg2 data 63 name) "draw-node")
(+! (-> arg2 data 63 count) arg1)
(let ((v1-5 (* arg1 32)))
(+! (-> arg2 data 63 used) v1-5)
(+! (-> arg2 data 63 total) (logand -16 (+ v1-5 15)))
)
(let ((s2-0 arg0))
(dotimes (s1-0 arg1)
(let ((a1-2 (-> s2-0 child-count)))
(cond
((logtest? (-> s2-0 flags) 1)
(mem-usage-shrub-walk (the-as draw-node (-> s2-0 child)) (the-as int a1-2) arg2 arg3)
)
(else
(set! (-> arg2 length) (max 35 (-> arg2 length)))
(set! (-> arg2 data 34 name) "instance-shrubbery")
(+! (-> arg2 data 34 count) a1-2)
(let ((v1-18 (* (the-as uint 80) a1-2)))
(+! (-> arg2 data 34 used) v1-18)
(+! (-> arg2 data 34 total) (logand -16 (+ v1-18 15)))
)
)
)
)
(&+! s2-0 32)
)
)
arg0
)
(defmethod mem-usage drawable-tree-instance-shrub ((obj drawable-tree-instance-shrub) (arg0 memory-usage-block) (arg1 int))
"Compute memory usage for an entire shrub tree"
(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)))
)
;; time of day colors
(when (nonzero? (-> obj colors-added))
(set! (-> arg0 length) (max 33 (-> arg0 length)))
(set! (-> arg0 data 32 name) "shrubbery-pal")
(+! (-> arg0 data 32 count) 1)
(let ((v1-19 (asize-of (-> obj colors-added))))
(+! (-> arg0 data 32 used) v1-19)
(+! (-> arg0 data 32 total) (logand -16 (+ v1-19 15)))
)
)
;; instance tree
(mem-usage-shrub-walk
(the-as draw-node (&+ (-> obj data 0) 32))
(-> (the-as drawable-group (-> obj data 0)) length)
arg0
arg1
)
;; prototypes
(mem-usage (-> obj info prototype-inline-array-shrub) arg0 (logior arg1 1))
obj
)
(defmethod login generic-shrub-fragment ((obj generic-shrub-fragment))
"Set up shaders in a generic shrub fragment"
(let ((s5-0 (/ (-> obj cnt-qwc) (the-as uint 5))))
(dotimes (s4-0 (the-as int s5-0))
(adgif-shader-login-no-remap (-> obj textures s4-0))
)
)
obj
)
(defmethod mem-usage generic-shrub-fragment ((obj generic-shrub-fragment) (arg0 memory-usage-block) (arg1 int))
"Compute memory usage of generic shrub fragment"
(set! (-> arg0 length) (max 27 (-> arg0 length)))
(set! (-> arg0 data 25 name) "generic-shrub")
(+! (-> arg0 data 25 count) 1)
;; the actual fragment object
(let ((v1-6 (asize-of obj)))
(+! (-> arg0 data 25 used) v1-6)
(+! (-> arg0 data 25 total) (logand -16 (+ v1-6 15)))
)
;; the referenced data
(set! (-> arg0 data 26 name) "generic-shrub-data")
(+! (-> arg0 data 26 count) 1)
(let ((v1-17 (* (+ (-> obj cnt-qwc) (-> obj vtx-qwc) (-> obj col-qwc) (-> obj stq-qwc)) 16)))
(+! (-> arg0 data 26 used) v1-17)
(+! (-> arg0 data 26 total) (logand -16 (+ v1-17 15)))
)
obj
)
(defmethod inspect prototype-shrubbery ((obj prototype-shrubbery))
"Inspect all prototypes in a prototype array."
(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 prototype-shrubbery ((obj prototype-shrubbery) (arg0 memory-usage-block) (arg1 int))
"Compute memory usage of all prototypes in a prototype array."
(set! (-> arg0 length) (max 1 (-> arg0 length)))
(set! (-> arg0 data 0 name) (symbol->string 'drawable-group))
(+! (-> arg0 data 0 count) 1)
(let ((v1-7 32))
(+! (-> arg0 data 0 used) v1-7)
(+! (-> arg0 data 0 total) (logand -16 (+ v1-7 15)))
)
(dotimes (s3-0 (-> obj length))
(mem-usage (-> obj data s3-0) arg0 arg1)
)
obj
)
(defmethod login prototype-shrubbery ((obj prototype-shrubbery))
"Login all prototypes in a prototype array"
(dotimes (s5-0 (-> obj length))
(login (-> obj data s5-0))
)
obj
)
(defmethod asize-of prototype-shrubbery ((obj prototype-shrubbery))
"Compute the allocation size of a prototype shrubbery array (dynamically sized)"
(the-as int (+ (-> prototype-shrubbery size) (* (+ (-> obj length) -1) 32)))
)
(defmethod login prototype-generic-shrub ((obj prototype-generic-shrub))
"Initialize all fragments in a generic prototype."
(dotimes (s5-0 (-> obj length))
(login (-> obj data s5-0))
)
obj
)
(defmethod login shrubbery ((obj shrubbery))
"Initialize a shrubbery fragment."
(let ((s5-0 (* (-> obj header data 0) 2)))
(dotimes (s4-0 (the-as int s5-0))
(let ((v1-3 (adgif-shader-login-no-remap (-> obj textures s4-0))))
(when v1-3
(dotimes (a0-5 3)
(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)
)
)
)
(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)))
)
)
)
)
)
)
(shrubbery-login-post-texture obj)
obj
)
(defmethod mem-usage shrubbery ((obj shrubbery) (arg0 memory-usage-block) (arg1 int))
"Compute the memory usage of a shrubbery fragment."
(set! (-> arg0 length) (max 28 (-> arg0 length)))
(set! (-> arg0 data 27 name) "shrubbery")
(+! (-> arg0 data 27 count) 1)
(let ((v1-6 (asize-of obj)))
(+! (-> arg0 data 27 used) v1-6)
(+! (-> arg0 data 27 total) (logand -16 (+ v1-6 15)))
)
(set! (-> arg0 length) (max 30 (-> arg0 length)))
(set! (-> arg0 data 29 name) "shrubbery-vertex")
(+! (-> arg0 data 29 count) 1)
(let ((v1-16 (* (-> obj vtx-qwc) 16)))
(+! (-> arg0 data 29 used) v1-16)
(+! (-> arg0 data 29 total) (logand -16 (+ v1-16 15)))
)
(set! (-> arg0 length) (max 31 (-> arg0 length)))
(set! (-> arg0 data 30 name) "shrubbery-color")
(+! (-> arg0 data 30 count) 1)
(let ((v1-26 (* (-> obj col-qwc) 16)))
(+! (-> arg0 data 30 used) v1-26)
(+! (-> arg0 data 30 total) (logand -16 (+ v1-26 15)))
)
(set! (-> arg0 length) (max 29 (-> arg0 length)))
(set! (-> arg0 data 28 name) "shrubbery-object")
(+! (-> arg0 data 28 count) 1)
(let ((v1-36 (* (-> obj obj-qwc) 16)))
(+! (-> arg0 data 28 used) v1-36)
(+! (-> arg0 data 28 total) (logand -16 (+ v1-36 15)))
)
(set! (-> arg0 length) (max 32 (-> arg0 length)))
(set! (-> arg0 data 31 name) "shrubbery-stq")
(+! (-> arg0 data 31 count) 1)
(let ((v1-46 (* (-> obj stq-qwc) 16)))
(+! (-> arg0 data 31 used) v1-46)
(+! (-> arg0 data 31 total) (logand -16 (+ v1-46 15)))
)
obj
)
(defmethod login drawable-tree-instance-shrub ((obj drawable-tree-instance-shrub))
"Initialize a shrubbery tree."
(if (nonzero? (-> obj info prototype-inline-array-shrub))
(login (-> obj info prototype-inline-array-shrub))
)
obj
)
(define shrub-vu1-block (new 'static 'vu-function :length #x26a :qlength #x135))
(defun shrub-num-tris ((shrub shrubbery))
"Get the number of triangles in a shrubbery fragment."
(the-as uint (- (-> shrub header data 2) (the-as uint (* (-> shrub header data 1) 2))))
)
(defun shrub-make-perspective-matrix ((out matrix) (camera-temp matrix))
"Compute the matrix used by the shrubbery VU1 program."
(let* ((v1-0 out)
(t0-0 camera-temp)
(a1-1 (-> t0-0 vector 0 quad))
(a2-0 (-> t0-0 vector 1 quad))
(a3-0 (-> t0-0 vector 2 quad))
(t0-1 (-> t0-0 trans quad))
)
(set! (-> v1-0 vector 0 quad) a1-1)
(set! (-> v1-0 vector 1 quad) a2-0)
(set! (-> v1-0 vector 2 quad) a3-0)
(set! (-> v1-0 trans quad) t0-1)
)
(let ((f0-1 (/ 1.0 (-> *math-camera* pfog0))))
(set! (-> out vector 0 w) (* (-> out vector 0 w) f0-1))
(set! (-> out vector 1 w) (* (-> out vector 1 w) f0-1))
(set! (-> out vector 2 w) (* (-> out vector 2 w) f0-1))
(set! (-> out trans w) (* (-> out trans w) f0-1))
)
(+! (-> out vector 0 x) (* (-> out vector 0 w) (-> *math-camera* hvdf-off x)))
(+! (-> out vector 1 x) (* (-> out vector 1 w) (-> *math-camera* hvdf-off x)))
(+! (-> out vector 2 x) (* (-> out vector 2 w) (-> *math-camera* hvdf-off x)))
(+! (-> out trans x) (* (-> out trans w) (-> *math-camera* hvdf-off x)))
(+! (-> out vector 0 y) (* (-> out vector 0 w) (-> *math-camera* hvdf-off y)))
(+! (-> out vector 1 y) (* (-> out vector 1 w) (-> *math-camera* hvdf-off y)))
(+! (-> out vector 2 y) (* (-> out vector 2 w) (-> *math-camera* hvdf-off y)))
(+! (-> out trans y) (* (-> out trans w) (-> *math-camera* hvdf-off y)))
(+! (-> out vector 0 z) (* (-> out vector 0 w) (-> *math-camera* hvdf-off z)))
(+! (-> out vector 1 z) (* (-> out vector 1 w) (-> *math-camera* hvdf-off z)))
(+! (-> out vector 2 z) (* (-> out vector 2 w) (-> *math-camera* hvdf-off z)))
(+! (-> out trans z) (* (-> out trans w) (-> *math-camera* hvdf-off z)))
out
)
(defun shrub-init-view-data ((view-data shrub-view-data))
"Initialize shrubbery constants in place"
(set! (-> view-data texture-giftag tag) (new 'static 'gif-tag64 :nloop #x1 :nreg #x4))
(set! (-> view-data texture-giftag regs) (new 'static 'gif-tag-regs
:regs0 (gif-reg-id a+d)
:regs1 (gif-reg-id a+d)
:regs2 (gif-reg-id a+d)
:regs3 (gif-reg-id a+d)
)
)
(set! (-> view-data texture-giftag word 3) (the-as uint #x40a00000))
(set! (-> view-data tex-start-ptr) (the-as int 25167696.0))
(set! (-> view-data mtx-buf-ptr) (the-as int 8388608.0))
(set! (-> view-data fog-0) (-> *math-camera* pfog0))
(set! (-> view-data fog-1) (-> *math-camera* pfog1))
(set! (-> view-data fog-clamp x) (-> *math-camera* fog-min))
(set! (-> view-data fog-clamp y) (-> *math-camera* fog-max))
#f
)
(defun shrub-upload-view-data ((dma-buff dma-buffer))
"Generate DMA data to upload shrubbery constants to VU1."
(let ((qwc 3))
(let* ((buf dma-buff)
(pkt (the-as dma-packet (-> buf base)))
)
(set! (-> pkt dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc qwc))
(set! (-> pkt vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)))
(set! (-> pkt vif1) (new 'static 'vif-tag :cmd (vif-cmd unpack-v4-32) :num qwc))
(set! (-> buf base) (&+ (the-as pointer pkt) 16))
)
(shrub-init-view-data (the-as shrub-view-data (-> dma-buff base)))
(&+! (-> dma-buff base) (* qwc 16))
)
#f
)
(defun shrub-time ((arg0 int) (arg1 int) (arg2 int) (arg3 int) (arg4 int))
(+ (* arg0 8) 29 (* 22 arg2) (* 11 arg1) (* (+ (* arg4 2) 15 (* 5 arg2) (* 13 arg0)) arg3) 53)
)
(defun shrub-do-init-frame ((dma-buff dma-buffer))
"Generate DMA to initialize the shrubbery renderer on VU1."
;; upload VU1 program
(dma-buffer-add-vu-function dma-buff shrub-vu1-block 1)
;; upload constants
(shrub-upload-view-data dma-buff)
;; run program initialization function
(let* ((v1-0 dma-buff)
(pkt1 (the-as dma-packet (-> v1-0 base)))
)
(set! (-> pkt1 dma) (new 'static 'dma-tag :id (dma-tag-id cnt)))
(set! (-> pkt1 vif0) (new 'static 'vif-tag :cmd (vif-cmd mscalf) :msk #x1 :imm #x0))
(set! (-> pkt1 vif1) (new 'static 'vif-tag :cmd (vif-cmd flushe) :msk #x1))
(set! (-> v1-0 base) (&+ (the-as pointer pkt1) 16))
)
;; initialize VIF for shrubbery chains.
(let* ((v1-1 dma-buff)
(pkt2 (the-as dma-packet (-> v1-1 base)))
)
(set! (-> pkt2 dma) (new 'static 'dma-tag :qwc #x3 :id (dma-tag-id cnt)))
(set! (-> pkt2 vif0) (new 'static 'vif-tag))
(set! (-> pkt2 vif1) (new 'static 'vif-tag))
(set! (-> v1-1 base) (&+ (the-as pointer pkt2) 16))
)
(let ((v1-2 (-> dma-buff base)))
(set! (-> (the-as (pointer vif-tag) v1-2) 0) (new 'static 'vif-tag :cmd (vif-cmd strow) :msk #x1))
(set! (-> (the-as (pointer uint32) v1-2) 1) (the-as uint #x8080))
(set! (-> (the-as (pointer uint32) v1-2) 2) (the-as uint #x8080))
(set! (-> (the-as (pointer uint32) v1-2) 3) (the-as uint #x8080))
(set! (-> (the-as (pointer uint32) v1-2) 4) (the-as uint 0))
(set! (-> (the-as (pointer vif-tag) v1-2) 5) (new 'static 'vif-tag :cmd (vif-cmd stcol) :msk #x1))
(set! (-> (the-as (pointer uint32) v1-2) 6) (the-as uint 4096))
(set! (-> (the-as (pointer uint32) v1-2) 7) (the-as uint 4096))
(set! (-> (the-as (pointer uint32) v1-2) 8) (the-as uint 4096))
(set! (-> (the-as (pointer uint32) v1-2) 9) (the-as uint 4096))
(set! (-> (the-as (pointer vif-tag) v1-2) 10) (new 'static 'vif-tag :cmd (vif-cmd stmask)))
(set! (-> (the-as (pointer uint32) v1-2) 11) (the-as uint #xa0a0a0a0))
(set! (-> dma-buff base) (&+ v1-2 48))
)
(set! *shrub-state* 2)
#f
)
(defun shrub-init-frame ((dma-buff dma-buffer) (test gs-test))
"Generate DMA to initialize to shrubbery renderer VU1 and GS."
;; init VU1
(shrub-do-init-frame dma-buff)
;; init GS.
(let* ((v1-0 dma-buff)
(pkt (the-as dma-packet (-> v1-0 base)))
)
(set! (-> pkt dma) (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt)))
(set! (-> pkt vif0) (new 'static 'vif-tag))
(set! (-> pkt vif1) (new 'static 'vif-tag :imm #x2 :cmd (vif-cmd direct) :msk #x1))
(set! (-> v1-0 base) (&+ (the-as pointer pkt) 16))
)
(let* ((v1-1 dma-buff)
(giftag (the-as gs-gif-tag (-> v1-1 base)))
)
(set! (-> giftag tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1))
(set! (-> giftag regs) GIF_REGS_ALL_AD)
(set! (-> v1-1 base) (&+ (the-as pointer giftag) 16))
)
(let ((v1-2 (-> dma-buff base)))
(set! (-> (the-as (pointer gs-test) v1-2) 0) test)
(set! (-> (the-as (pointer gs-reg64) v1-2) 1) (gs-reg64 test-1))
(set! (-> dma-buff base) (&+ v1-2 16))
)
#f
)
(defun shrub-upload-model ((shrub shrubbery) (dma-buff dma-buffer) (arg2 int))
"Generate DMA to upload a shrub model"
(let* ((v1-0 dma-buff)
(a3-0 (the-as dma-packet (-> v1-0 base)))
)
;; upload the data
(set! (-> a3-0 dma) (new 'static 'dma-tag
:id (dma-tag-id ref)
:addr (the-as int (-> shrub obj))
:qwc (+ (-> shrub obj-qwc) (-> shrub vtx-qwc) (-> shrub col-qwc) (-> shrub stq-qwc))
)
)
(set! (-> a3-0 vif0) (new 'static 'vif-tag :cmd (vif-cmd base) :imm *shrub-state*))
(set! (-> a3-0 vif1) (new 'static 'vif-tag :cmd (vif-cmd offset)))
(set! (-> v1-0 base) (&+ (the-as pointer a3-0) 16))
)
;; run the program to init a model
(cond
((= arg2 1)
(let* ((v1-2 dma-buff)
(a0-9 (the-as dma-packet (-> v1-2 base)))
)
(set! (-> a0-9 dma) (new 'static 'dma-tag :id (dma-tag-id cnt)))
(set! (-> a0-9 vif0) (new 'static 'vif-tag))
(set! (-> a0-9 vif1) (new 'static 'vif-tag :cmd (vif-cmd mscal) :msk #x1 :imm #x11))
(set! (-> v1-2 base) (&+ (the-as pointer a0-9) 16))
)
)
(else
(let* ((v1-3 dma-buff)
(a0-11 (the-as dma-packet (-> v1-3 base)))
)
(set! (-> a0-11 dma) (new 'static 'dma-tag :id (dma-tag-id cnt)))
(set! (-> a0-11 vif0) (new 'static 'vif-tag))
(set! (-> a0-11 vif1) (new 'static 'vif-tag :cmd (vif-cmd mscal) :msk #x1 :imm #x15))
(set! (-> v1-3 base) (&+ (the-as pointer a0-11) 16))
)
)
)
(set! *shrub-state* (- 164 *shrub-state*))
#f
)
(defun draw-drawable-tree-instance-shrub ((tree drawable-tree-instance-shrub) (level level))
(set! (-> *instance-shrub-work* texture-dists) (-> level bsp shrub-mask-count))
(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))
(set! (-> *instance-shrub-work* near-trans-last) (the-as uint 0))
(set! (-> *instance-shrub-work* near-trans-next) (the-as uint 0))
(set! (-> *instance-shrub-work* near-trans-count) (the-as uint 0))
(set! (-> *instance-shrub-work* wind-vectors) (-> tree info wind-vectors))
(set! (-> *instance-shrub-work* wait-to-spr) (the-as uint 0))
(set! (-> *instance-shrub-work* wait-from-spr) (the-as uint 0))
(when (logtest? (vu1-renderer-mask rn15 rn16 rn17 rn18) (-> *display* vu1-enable-user))
(let* ((proto-array (-> tree info prototype-inline-array-shrub))
(proto-array-len (-> proto-array length))
(proto-array-data (-> proto-array data))
)
(countdown (i proto-array-len)
(let ((proto (-> proto-array data i)))
(set! (-> proto next-clear) (the-as uint128 0))
(set! (-> proto last-clear) (the-as uint128 0))
(set! (-> proto count-clear) (the-as uint 0))
)
0
)
(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
(&+ (-> tree data 0) 32)
(-> (the-as drawable-group (-> tree data 0)) length)
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)))
(set! (-> v1-33 data 27 name) "shrubbery")
(+! (-> v1-33 data 27 count) 1)
(+! (-> v1-33 data 27 used)
(&- (-> *display* frames (-> *display* on-screen) global-buf base) (the-as uint dma-start))
)
(set! (-> v1-33 data 27 total) (-> v1-33 data 27 used))
)
)
)
)
)
)
(update-wait-stats
(-> *perf-stats* data (perf-stat-bucket inst-shrub))
(the-as uint 0)
(-> *instance-shrub-work* wait-to-spr)
(-> *instance-shrub-work* wait-from-spr)
)
)
0
(none)
)
(defmethod draw drawable-tree-instance-shrub ((obj drawable-tree-instance-shrub) (arg0 drawable-tree-instance-shrub) (arg1 display-frame))
(let ((v1-1 (-> *background-work* shrub-tree-count))
(a1-4 (-> *level* draw-level *draw-index*))
)
(set! (-> *background-work* shrub-trees v1-1) obj)
(set! (-> *background-work* shrub-levels v1-1) a1-4)
)
(+! (-> *background-work* shrub-tree-count) 1)
0
(none)
)
(defmethod unpack-vis drawable-tree-instance-shrub ((obj drawable-tree-instance-shrub) (arg0 (pointer int8)) (arg1 (pointer int8)))
arg1
)
(defmethod collect-stats drawable-tree-instance-shrub ((obj drawable-tree-instance-shrub))
(when (logtest? (vu1-renderer-mask rn15 rn16 rn17 rn18) (-> *display* vu1-enable-user))
(let* ((v1-4 (-> obj info prototype-inline-array-shrub))
(gp-0 (the-as object (-> v1-4 data)))
)
(countdown (s5-0 (-> v1-4 length))
(when (logtest? (vu1-renderer-mask rn16) (-> *display* vu1-enable-user))
(let ((v1-8 (-> (the-as prototype-bucket-shrub gp-0) count 0))
(a1-2 (-> (the-as prototype-bucket-shrub gp-0) geometry 0))
)
(when (nonzero? v1-8)
(let ((a0-4 (-> (the-as drawable-group a1-2) length)))
(+! (-> *terrain-stats* shrub groups) 1)
(+! (-> *terrain-stats* shrub fragments) (* a0-4 (the-as int v1-8)))
)
(+! (-> *terrain-stats* shrub instances) v1-8)
)
)
)
(when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask rn15))
(let ((s4-0 (-> (the-as prototype-bucket-shrub gp-0) count 1))
(v1-14 (-> (the-as prototype-bucket-shrub gp-0) geometry 1))
)
(when (nonzero? s4-0)
(let ((s3-0 (&+ v1-14 32))
(s2-0 (-> (the-as drawable-group v1-14) length))
)
(+! (-> *terrain-stats* shrub groups) 1)
(+! (-> *terrain-stats* shrub fragments) s2-0)
(+! (-> *terrain-stats* shrub instances) s4-0)
(while (nonzero? s2-0)
(+! s2-0 -1)
(let ((a0-15 (* (shrub-num-tris (the-as shrubbery s3-0)) s4-0))
(v1-26 (* (the-as uint (-> (the-as shrubbery s3-0) header data 2)) s4-0))
)
(+! (-> *terrain-stats* shrub tris) a0-15)
(+! (-> *terrain-stats* shrub dverts) v1-26)
)
(&+! s3-0 32)
)
)
)
)
)
(when (logtest? (vu1-renderer-mask rn18) (-> *display* vu1-enable-user))
(let ((s4-1 (-> (the-as prototype-bucket-shrub gp-0) count 2))
(v1-32 (-> (the-as prototype-bucket-shrub gp-0) geometry 2))
)
(when (nonzero? s4-1)
(let ((s3-1 (&+ v1-32 32))
(s2-1 (-> (the-as drawable-group v1-32) length))
)
(+! (-> *terrain-stats* trans-shrub groups) 1)
(+! (-> *terrain-stats* trans-shrub fragments) s2-1)
(+! (-> *terrain-stats* trans-shrub instances) s4-1)
(while (nonzero? s2-1)
(+! s2-1 -1)
(let ((a0-28 (* (shrub-num-tris (the-as shrubbery s3-1)) s4-1))
(v1-44 (* (the-as uint (-> (the-as shrubbery s3-1) header data 2)) s4-1))
)
(+! (-> *terrain-stats* trans-shrub tris) a0-28)
(+! (-> *terrain-stats* trans-shrub dverts) v1-44)
)
(&+! s3-1 32)
)
)
)
)
)
(when (logtest? (vu1-renderer-mask rn17) (-> *display* vu1-enable-user))
(let ((v1-50 (-> (the-as prototype-bucket-shrub gp-0) count 3)))
(when (nonzero? v1-50)
(+! (-> *terrain-stats* billboard groups) 1)
(+! (-> *terrain-stats* billboard instances) v1-50)
(+! (-> *terrain-stats* billboard tris) (* v1-50 2))
(+! (-> *terrain-stats* billboard dverts) (* v1-50 4))
)
)
)
(set! gp-0 (-> (the-as (inline-array prototype-bucket-shrub) gp-0) 1))
)
)
)
0
(none)
)
(deftype dma-test (structure)
((data qword 101 :inline :offset-assert 0)
)
:method-count-assert 9
:size-assert #x650
:flag-assert #x900000650
)
(defmethod inspect dma-test ((obj dma-test))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj 'dma-test)
(format #t "~1Tdata[101] @ #x~X~%" (-> obj data))
(label cfg-4)
obj
)
(define *dma-test* (new 'global 'dma-test))
(deftype dma-test-work (structure)
((upload dma-packet :inline :offset-assert 0)
(end dma-packet :inline :offset-assert 16)
)
:method-count-assert 9
:size-assert #x20
:flag-assert #x900000020
)
(defmethod inspect dma-test-work ((obj dma-test-work))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj 'dma-test-work)
(format #t "~1Tupload: #<dma-packet @ #x~X>~%" (-> obj upload))
(format #t "~1Tend: #<dma-packet @ #x~X>~%" (-> obj end))
(label cfg-4)
obj
)
(define *dma-test-work*
(new 'static 'dma-test-work
:upload (new 'static 'dma-packet :dma (new 'static 'dma-tag :qwc #x20 :id (dma-tag-id ref)))
:end (new 'static 'dma-packet :dma (new 'static 'dma-tag :id (dma-tag-id end)))
)
)
(defun init-dma-test ()
(let ((a0-0 *dma-test-work*)
(v1-0 (the-as object *dma-test*))
)
(let ((a1-6 (-> *display* frames (-> *display* on-screen) calc-buf base)))
(dotimes (a2-1 100)
(set! (-> a0-0 upload dma addr) (the-as int a1-6))
(set! (-> (the-as dma-test v1-0) data a2-1 quad) (-> a0-0 upload quad))
(&+! a1-6 256)
)
)
(set! (-> (the-as (inline-array qword) v1-0) 101 quad) (-> a0-0 end quad))
)
(none)
)
(init-dma-test)

View file

@ -1286,30 +1286,24 @@
)
(update-view-planes gp-0 (-> gp-0 plane) 1.0 (-> gp-0 inv-camera-rot))
(update-view-planes gp-0 (-> gp-0 guard-plane) 4.0 (-> gp-0 inv-camera-rot))
(let ((t9-20 shrub-make-perspective-matrix)
(a0-56 (-> gp-0 shrub-mat))
)
(-> gp-0 camera-temp)
(t9-20 a0-56)
)
(shrub-make-perspective-matrix (-> gp-0 shrub-mat) (-> gp-0 camera-temp))
(update-visible gp-0)
(when (-> *time-of-day-context* use-camera-other)
(let ((s5-4 (-> gp-0 camera-rot))
(s4-2 (-> gp-0 camera-rot-other))
(s3-2 (-> gp-0 inv-camera-rot-other))
(s2-1 (-> gp-0 camera-temp-other))
)
(let ((s2-1 (-> gp-0 camera-temp-other)))
(quaternion->matrix s4-2 (-> gp-0 quat-other))
(set! (-> s4-2 trans quad) (-> gp-0 trans-other quad))
(set! (-> s4-2 trans w) 1.0)
(matrix*! s4-2 s4-2 s5-4)
(matrix-inverse-of-rot-trans! s3-2 s4-2)
(matrix*! s2-1 s4-2 (-> gp-0 perspective))
)
(quaternion->matrix s4-2 (-> gp-0 quat-other))
(set! (-> s4-2 trans quad) (-> gp-0 trans-other quad))
(set! (-> s4-2 trans w) 1.0)
(matrix*! s4-2 s4-2 s5-4)
(matrix-inverse-of-rot-trans! s3-2 s4-2)
(matrix*! s2-1 s4-2 (-> gp-0 perspective))
(update-view-planes gp-0 (-> gp-0 plane-other) 1.0 s3-2)
(update-view-planes gp-0 (-> gp-0 guard-plane-other) 4.0 s3-2)
(shrub-make-perspective-matrix (-> gp-0 shrub-mat-other) s2-1)
)
(shrub-make-perspective-matrix (-> gp-0 shrub-mat-other))
)
)
#f

View file

@ -54,13 +54,14 @@
;; definition of type prototype-bucket-shrub
(deftype prototype-bucket-shrub (prototype-bucket)
((next uint32 4 :offset-assert 64)
(count uint16 4 :offset-assert 80)
(mod-count uint16 4 :offset-assert 88)
(last dma-packet 4 :offset-assert 96)
(next-clear uint128 :offset 64)
(count-clear uint64 :offset 80)
(last-clear uint128 :offset 96)
((next uint32 4 :offset-assert 64)
(count uint16 4 :offset-assert 80)
(mod-count uint16 4 :offset-assert 88)
(last dma-packet 4 :offset-assert 96)
(next-clear uint128 :offset 64)
(count-clear uint64 :offset 80)
(count-clear-qword uint128 :offset 80)
(last-clear uint128 :offset 96)
)
:method-count-assert 9
:size-assert #x70

View file

@ -53,14 +53,14 @@
(format #t "[~8x] ~A~%" obj 'shrub-view-data)
(format #t "~1Tdata[3] @ #x~X~%" (-> obj data))
(format #t "~1Ttexture-giftag: #<qword @ #x~X>~%" (-> obj data))
(format #t "~1Tconsts: #<vector @ #x~X>~%" (-> obj consts))
(format #t "~1Tconsts: #<vector @ #x~X>~%" (&-> obj tex-start-ptr))
(format #t "~1Tfog-clamp: #<vector @ #x~X>~%" (-> obj fog-clamp))
(format #t "~1Ttex-start-ptr: ~D~%" (-> obj consts x))
(format #t "~1Tgifbufsum: ~f~%" (-> obj consts x))
(format #t "~1Tmtx-buf-ptr: ~D~%" (-> obj consts y))
(format #t "~1Texp23: ~f~%" (-> obj consts y))
(format #t "~1Tfog-0: ~f~%" (-> obj consts z))
(format #t "~1Tfog-1: ~f~%" (-> obj consts w))
(format #t "~1Ttex-start-ptr: ~D~%" (-> obj tex-start-ptr))
(format #t "~1Tgifbufsum: ~f~%" (-> obj gifbufsum))
(format #t "~1Tmtx-buf-ptr: ~D~%" (-> obj mtx-buf-ptr))
(format #t "~1Texp23: ~f~%" (-> obj exp23))
(format #t "~1Tfog-0: ~f~%" (-> obj fog-0))
(format #t "~1Tfog-1: ~f~%" (-> obj fog-1))
(format #t "~1Tfog-min: ~f~%" (-> obj fog-clamp x))
(format #t "~1Tfog-max: ~f~%" (-> obj fog-clamp y))
(label cfg-4)
@ -288,14 +288,14 @@
;; definition of type shrub-near-packet
(deftype shrub-near-packet (structure)
((matrix-tmpl dma-packet :inline :offset-assert 0)
(header-tmpl dma-packet :inline :offset-assert 16)
(stq-tmpl dma-packet :inline :offset-assert 32)
(color-tmpl dma-packet :inline :offset-assert 48)
(vertex-tmpl dma-packet :inline :offset-assert 64)
(mscal-tmpl dma-packet :inline :offset-assert 80)
(init-tmpl dma-packet :inline :offset-assert 96)
(init-data uint32 8 :offset-assert 112)
((matrix-tmpl dma-packet :inline :offset-assert 0)
(header-tmpl dma-packet :inline :offset-assert 16)
(stq-tmpl dma-packet :inline :offset-assert 32)
(color-tmpl dma-packet :inline :offset-assert 48)
(vertex-tmpl dma-packet :inline :offset-assert 64)
(mscal-tmpl dma-packet :inline :offset-assert 80)
(init-tmpl dma-packet :inline :offset-assert 96)
(init-data qword 2 :inline :offset-assert 112)
)
:method-count-assert 9
:size-assert #x90

View file

@ -0,0 +1,779 @@
;;-*-Lisp-*-
(in-package goal)
;; definition for method 9 of type billboard
(defmethod login billboard ((obj billboard))
(adgif-shader-login (-> obj flat))
obj
)
;; definition for method 8 of type billboard
(defmethod mem-usage billboard ((obj billboard) (arg0 memory-usage-block) (arg1 int))
(set! (-> arg0 length) (max 34 (-> arg0 length)))
(set! (-> arg0 data 33 name) "billboard")
(+! (-> arg0 data 33 count) 1)
(let ((v1-6 (asize-of obj)))
(+! (-> arg0 data 33 used) v1-6)
(+! (-> arg0 data 33 total) (logand -16 (+ v1-6 15)))
)
obj
)
;; definition for function mem-usage-shrub-walk
(defun mem-usage-shrub-walk ((arg0 draw-node) (arg1 int) (arg2 memory-usage-block) (arg3 int))
(set! (-> arg2 length) (max 64 (-> arg2 length)))
(set! (-> arg2 data 63 name) "draw-node")
(+! (-> arg2 data 63 count) arg1)
(let ((v1-5 (* arg1 32)))
(+! (-> arg2 data 63 used) v1-5)
(+! (-> arg2 data 63 total) (logand -16 (+ v1-5 15)))
)
(let ((s2-0 arg0))
(dotimes (s1-0 arg1)
(let ((a1-2 (-> s2-0 child-count)))
(cond
((logtest? (-> s2-0 flags) 1)
(mem-usage-shrub-walk (the-as draw-node (-> s2-0 child)) (the-as int a1-2) arg2 arg3)
)
(else
(set! (-> arg2 length) (max 35 (-> arg2 length)))
(set! (-> arg2 data 34 name) "instance-shrubbery")
(+! (-> arg2 data 34 count) a1-2)
(let ((v1-18 (* (the-as uint 80) a1-2)))
(+! (-> arg2 data 34 used) v1-18)
(+! (-> arg2 data 34 total) (logand -16 (+ v1-18 15)))
)
)
)
)
(&+! s2-0 32)
)
)
arg0
)
;; definition for method 8 of type drawable-tree-instance-shrub
(defmethod mem-usage drawable-tree-instance-shrub ((obj drawable-tree-instance-shrub) (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)))
)
(when (nonzero? (-> obj colors-added))
(set! (-> arg0 length) (max 33 (-> arg0 length)))
(set! (-> arg0 data 32 name) "shrubbery-pal")
(+! (-> arg0 data 32 count) 1)
(let ((v1-19 (asize-of (-> obj colors-added))))
(+! (-> arg0 data 32 used) v1-19)
(+! (-> arg0 data 32 total) (logand -16 (+ v1-19 15)))
)
)
(mem-usage-shrub-walk
(the-as draw-node (&+ (-> obj data 0) 32))
(-> (the-as drawable-group (-> obj data 0)) length)
arg0
arg1
)
(mem-usage (-> obj info prototype-inline-array-shrub) arg0 (logior arg1 1))
obj
)
;; definition for method 9 of type generic-shrub-fragment
(defmethod login generic-shrub-fragment ((obj generic-shrub-fragment))
(let ((s5-0 (/ (-> obj cnt-qwc) (the-as uint 5))))
(dotimes (s4-0 (the-as int s5-0))
(adgif-shader-login-no-remap (-> obj textures s4-0))
)
)
obj
)
;; definition for method 8 of type generic-shrub-fragment
(defmethod mem-usage generic-shrub-fragment ((obj generic-shrub-fragment) (arg0 memory-usage-block) (arg1 int))
(set! (-> arg0 length) (max 27 (-> arg0 length)))
(set! (-> arg0 data 25 name) "generic-shrub")
(+! (-> arg0 data 25 count) 1)
(let ((v1-6 (asize-of obj)))
(+! (-> arg0 data 25 used) v1-6)
(+! (-> arg0 data 25 total) (logand -16 (+ v1-6 15)))
)
(set! (-> arg0 data 26 name) "generic-shrub-data")
(+! (-> arg0 data 26 count) 1)
(let ((v1-17 (* (+ (-> obj cnt-qwc) (-> obj vtx-qwc) (-> obj col-qwc) (-> obj stq-qwc)) 16)))
(+! (-> arg0 data 26 used) v1-17)
(+! (-> arg0 data 26 total) (logand -16 (+ v1-17 15)))
)
obj
)
;; definition for method 3 of type prototype-shrubbery
(defmethod inspect prototype-shrubbery ((obj prototype-shrubbery))
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~Tlength: ~D~%" (-> obj length))
(format #t "~Tdata[~D]: @ #x~X~%" (-> obj length) (-> obj data))
(dotimes (s5-0 (-> obj length))
(format #t "~T [~D] ~A~%" s5-0 (-> obj data s5-0))
)
obj
)
;; definition for method 8 of type prototype-shrubbery
(defmethod mem-usage prototype-shrubbery ((obj prototype-shrubbery) (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 9 of type prototype-shrubbery
(defmethod login prototype-shrubbery ((obj prototype-shrubbery))
(dotimes (s5-0 (-> obj length))
(login (-> obj data s5-0))
)
obj
)
;; definition for method 5 of type prototype-shrubbery
;; WARN: Return type mismatch uint vs int.
(defmethod asize-of prototype-shrubbery ((obj prototype-shrubbery))
(the-as int (+ (-> prototype-shrubbery size) (* (+ (-> obj length) -1) 32)))
)
;; definition for method 9 of type prototype-generic-shrub
(defmethod login prototype-generic-shrub ((obj prototype-generic-shrub))
(dotimes (s5-0 (-> obj length))
(login (-> obj data s5-0))
)
obj
)
;; definition for method 9 of type shrubbery
(defmethod login shrubbery ((obj shrubbery))
(let ((s5-0 (* (-> obj header data 0) 2)))
(dotimes (s4-0 (the-as int s5-0))
(let ((v1-3 (adgif-shader-login-no-remap (-> obj textures s4-0))))
(when v1-3
(dotimes (a0-5 3)
(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)
)
)
)
(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)))
)
)
)
)
)
)
(shrubbery-login-post-texture obj)
obj
)
;; definition for method 8 of type shrubbery
(defmethod mem-usage shrubbery ((obj shrubbery) (arg0 memory-usage-block) (arg1 int))
(set! (-> arg0 length) (max 28 (-> arg0 length)))
(set! (-> arg0 data 27 name) "shrubbery")
(+! (-> arg0 data 27 count) 1)
(let ((v1-6 (asize-of obj)))
(+! (-> arg0 data 27 used) v1-6)
(+! (-> arg0 data 27 total) (logand -16 (+ v1-6 15)))
)
(set! (-> arg0 length) (max 30 (-> arg0 length)))
(set! (-> arg0 data 29 name) "shrubbery-vertex")
(+! (-> arg0 data 29 count) 1)
(let ((v1-16 (* (-> obj vtx-qwc) 16)))
(+! (-> arg0 data 29 used) v1-16)
(+! (-> arg0 data 29 total) (logand -16 (+ v1-16 15)))
)
(set! (-> arg0 length) (max 31 (-> arg0 length)))
(set! (-> arg0 data 30 name) "shrubbery-color")
(+! (-> arg0 data 30 count) 1)
(let ((v1-26 (* (-> obj col-qwc) 16)))
(+! (-> arg0 data 30 used) v1-26)
(+! (-> arg0 data 30 total) (logand -16 (+ v1-26 15)))
)
(set! (-> arg0 length) (max 29 (-> arg0 length)))
(set! (-> arg0 data 28 name) "shrubbery-object")
(+! (-> arg0 data 28 count) 1)
(let ((v1-36 (* (-> obj obj-qwc) 16)))
(+! (-> arg0 data 28 used) v1-36)
(+! (-> arg0 data 28 total) (logand -16 (+ v1-36 15)))
)
(set! (-> arg0 length) (max 32 (-> arg0 length)))
(set! (-> arg0 data 31 name) "shrubbery-stq")
(+! (-> arg0 data 31 count) 1)
(let ((v1-46 (* (-> obj stq-qwc) 16)))
(+! (-> arg0 data 31 used) v1-46)
(+! (-> arg0 data 31 total) (logand -16 (+ v1-46 15)))
)
obj
)
;; definition for method 9 of type drawable-tree-instance-shrub
(defmethod login drawable-tree-instance-shrub ((obj drawable-tree-instance-shrub))
(if (nonzero? (-> obj info prototype-inline-array-shrub))
(login (-> obj info prototype-inline-array-shrub))
)
obj
)
;; definition for symbol shrub-vu1-block, type vu-function
(define shrub-vu1-block (new 'static 'vu-function :length #x26a :qlength #x135))
;; definition for function shrub-num-tris
;; WARN: Return type mismatch uint32 vs uint.
(defun shrub-num-tris ((shrub shrubbery))
(the-as uint (- (-> shrub header data 2) (the-as uint (* (-> shrub header data 1) 2))))
)
;; definition for function shrub-make-perspective-matrix
;; INFO: Used lq/sq
(defun shrub-make-perspective-matrix ((out matrix) (camera-temp matrix))
(let* ((v1-0 out)
(t0-0 camera-temp)
(a1-1 (-> t0-0 vector 0 quad))
(a2-0 (-> t0-0 vector 1 quad))
(a3-0 (-> t0-0 vector 2 quad))
(t0-1 (-> t0-0 trans quad))
)
(set! (-> v1-0 vector 0 quad) a1-1)
(set! (-> v1-0 vector 1 quad) a2-0)
(set! (-> v1-0 vector 2 quad) a3-0)
(set! (-> v1-0 trans quad) t0-1)
)
(let ((f0-1 (/ 1.0 (-> *math-camera* pfog0))))
(set! (-> out vector 0 w) (* (-> out vector 0 w) f0-1))
(set! (-> out vector 1 w) (* (-> out vector 1 w) f0-1))
(set! (-> out vector 2 w) (* (-> out vector 2 w) f0-1))
(set! (-> out trans w) (* (-> out trans w) f0-1))
)
(+! (-> out vector 0 x) (* (-> out vector 0 w) (-> *math-camera* hvdf-off x)))
(+! (-> out vector 1 x) (* (-> out vector 1 w) (-> *math-camera* hvdf-off x)))
(+! (-> out vector 2 x) (* (-> out vector 2 w) (-> *math-camera* hvdf-off x)))
(+! (-> out trans x) (* (-> out trans w) (-> *math-camera* hvdf-off x)))
(+! (-> out vector 0 y) (* (-> out vector 0 w) (-> *math-camera* hvdf-off y)))
(+! (-> out vector 1 y) (* (-> out vector 1 w) (-> *math-camera* hvdf-off y)))
(+! (-> out vector 2 y) (* (-> out vector 2 w) (-> *math-camera* hvdf-off y)))
(+! (-> out trans y) (* (-> out trans w) (-> *math-camera* hvdf-off y)))
(+! (-> out vector 0 z) (* (-> out vector 0 w) (-> *math-camera* hvdf-off z)))
(+! (-> out vector 1 z) (* (-> out vector 1 w) (-> *math-camera* hvdf-off z)))
(+! (-> out vector 2 z) (* (-> out vector 2 w) (-> *math-camera* hvdf-off z)))
(+! (-> out trans z) (* (-> out trans w) (-> *math-camera* hvdf-off z)))
out
)
;; definition for function shrub-init-view-data
(defun shrub-init-view-data ((view-data shrub-view-data))
(set! (-> view-data texture-giftag tag) (new 'static 'gif-tag64 :nloop #x1 :nreg #x4))
(set! (-> view-data texture-giftag regs) (new 'static 'gif-tag-regs
:regs0 (gif-reg-id a+d)
:regs1 (gif-reg-id a+d)
:regs2 (gif-reg-id a+d)
:regs3 (gif-reg-id a+d)
)
)
(set! (-> view-data texture-giftag word 3) (the-as uint #x40a00000))
(set! (-> view-data tex-start-ptr) (the-as int 25167696.0))
(set! (-> view-data mtx-buf-ptr) (the-as int 8388608.0))
(set! (-> view-data fog-0) (-> *math-camera* pfog0))
(set! (-> view-data fog-1) (-> *math-camera* pfog1))
(set! (-> view-data fog-clamp x) (-> *math-camera* fog-min))
(set! (-> view-data fog-clamp y) (-> *math-camera* fog-max))
#f
)
;; definition for function shrub-upload-view-data
(defun shrub-upload-view-data ((dma-buff dma-buffer))
(let ((qwc 3))
(let* ((buf dma-buff)
(pkt (the-as dma-packet (-> buf base)))
)
(set! (-> pkt dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc qwc))
(set! (-> pkt vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)))
(set! (-> pkt vif1) (new 'static 'vif-tag :cmd (vif-cmd unpack-v4-32) :num qwc))
(set! (-> buf base) (&+ (the-as pointer pkt) 16))
)
(shrub-init-view-data (the-as shrub-view-data (-> dma-buff base)))
(&+! (-> dma-buff base) (* qwc 16))
)
#f
)
;; definition for function shrub-time
(defun shrub-time ((arg0 int) (arg1 int) (arg2 int) (arg3 int) (arg4 int))
(+ (* arg0 8) 29 (* 22 arg2) (* 11 arg1) (* (+ (* arg4 2) 15 (* 5 arg2) (* 13 arg0)) arg3) 53)
)
;; definition for function shrub-do-init-frame
(defun shrub-do-init-frame ((dma-buff dma-buffer))
(dma-buffer-add-vu-function dma-buff shrub-vu1-block 1)
(shrub-upload-view-data dma-buff)
(let* ((v1-0 dma-buff)
(pkt1 (the-as dma-packet (-> v1-0 base)))
)
(set! (-> pkt1 dma) (new 'static 'dma-tag :id (dma-tag-id cnt)))
(set! (-> pkt1 vif0) (new 'static 'vif-tag :cmd (vif-cmd mscalf) :msk #x1 :imm #x0))
(set! (-> pkt1 vif1) (new 'static 'vif-tag :cmd (vif-cmd flushe) :msk #x1))
(set! (-> v1-0 base) (&+ (the-as pointer pkt1) 16))
)
(let* ((v1-1 dma-buff)
(pkt2 (the-as dma-packet (-> v1-1 base)))
)
(set! (-> pkt2 dma) (new 'static 'dma-tag :qwc #x3 :id (dma-tag-id cnt)))
(set! (-> pkt2 vif0) (new 'static 'vif-tag))
(set! (-> pkt2 vif1) (new 'static 'vif-tag))
(set! (-> v1-1 base) (&+ (the-as pointer pkt2) 16))
)
(let ((v1-2 (-> dma-buff base)))
(set! (-> (the-as (pointer vif-tag) v1-2) 0) (new 'static 'vif-tag :cmd (vif-cmd strow) :msk #x1))
(set! (-> (the-as (pointer uint32) v1-2) 1) (the-as uint #x8080))
(set! (-> (the-as (pointer uint32) v1-2) 2) (the-as uint #x8080))
(set! (-> (the-as (pointer uint32) v1-2) 3) (the-as uint #x8080))
(set! (-> (the-as (pointer uint32) v1-2) 4) (the-as uint 0))
(set! (-> (the-as (pointer vif-tag) v1-2) 5) (new 'static 'vif-tag :cmd (vif-cmd stcol) :msk #x1))
(set! (-> (the-as (pointer uint32) v1-2) 6) (the-as uint 4096))
(set! (-> (the-as (pointer uint32) v1-2) 7) (the-as uint 4096))
(set! (-> (the-as (pointer uint32) v1-2) 8) (the-as uint 4096))
(set! (-> (the-as (pointer uint32) v1-2) 9) (the-as uint 4096))
(set! (-> (the-as (pointer vif-tag) v1-2) 10) (new 'static 'vif-tag :cmd (vif-cmd stmask)))
(set! (-> (the-as (pointer uint32) v1-2) 11) (the-as uint #xa0a0a0a0))
(set! (-> dma-buff base) (&+ v1-2 48))
)
(set! *shrub-state* 2)
#f
)
;; definition for function shrub-init-frame
(defun shrub-init-frame ((dma-buff dma-buffer) (test gs-test))
(shrub-do-init-frame dma-buff)
(let* ((v1-0 dma-buff)
(pkt (the-as dma-packet (-> v1-0 base)))
)
(set! (-> pkt dma) (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt)))
(set! (-> pkt vif0) (new 'static 'vif-tag))
(set! (-> pkt vif1) (new 'static 'vif-tag :imm #x2 :cmd (vif-cmd direct) :msk #x1))
(set! (-> v1-0 base) (&+ (the-as pointer pkt) 16))
)
(let* ((v1-1 dma-buff)
(giftag (the-as gs-gif-tag (-> v1-1 base)))
)
(set! (-> giftag tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1))
(set! (-> giftag regs) GIF_REGS_ALL_AD)
(set! (-> v1-1 base) (&+ (the-as pointer giftag) 16))
)
(let ((v1-2 (-> dma-buff base)))
(set! (-> (the-as (pointer gs-test) v1-2) 0) test)
(set! (-> (the-as (pointer gs-reg64) v1-2) 1) (gs-reg64 test-1))
(set! (-> dma-buff base) (&+ v1-2 16))
)
#f
)
;; definition for function shrub-upload-model
(defun shrub-upload-model ((shrub shrubbery) (dma-buff dma-buffer) (arg2 int))
(let* ((v1-0 dma-buff)
(a3-0 (the-as dma-packet (-> v1-0 base)))
)
(set! (-> a3-0 dma) (new 'static 'dma-tag
:id (dma-tag-id ref)
:addr (the-as int (-> shrub obj))
:qwc (+ (-> shrub obj-qwc) (-> shrub vtx-qwc) (-> shrub col-qwc) (-> shrub stq-qwc))
)
)
(set! (-> a3-0 vif0) (new 'static 'vif-tag :cmd (vif-cmd base) :imm *shrub-state*))
(set! (-> a3-0 vif1) (new 'static 'vif-tag :cmd (vif-cmd offset)))
(set! (-> v1-0 base) (&+ (the-as pointer a3-0) 16))
)
(cond
((= arg2 1)
(let* ((v1-2 dma-buff)
(a0-9 (the-as dma-packet (-> v1-2 base)))
)
(set! (-> a0-9 dma) (new 'static 'dma-tag :id (dma-tag-id cnt)))
(set! (-> a0-9 vif0) (new 'static 'vif-tag))
(set! (-> a0-9 vif1) (new 'static 'vif-tag :cmd (vif-cmd mscal) :msk #x1 :imm #x11))
(set! (-> v1-2 base) (&+ (the-as pointer a0-9) 16))
)
)
(else
(let* ((v1-3 dma-buff)
(a0-11 (the-as dma-packet (-> v1-3 base)))
)
(set! (-> a0-11 dma) (new 'static 'dma-tag :id (dma-tag-id cnt)))
(set! (-> a0-11 vif0) (new 'static 'vif-tag))
(set! (-> a0-11 vif1) (new 'static 'vif-tag :cmd (vif-cmd mscal) :msk #x1 :imm #x15))
(set! (-> v1-3 base) (&+ (the-as pointer a0-11) 16))
)
)
)
(set! *shrub-state* (- 164 *shrub-state*))
#f
)
;; definition for function draw-inline-array-instance-shrub
;; ERROR: function was not converted to expressions. Cannot decompile.
;; definition for function draw-prototype-inline-array-shrub
;; ERROR: function was not converted to expressions. Cannot decompile.
;; definition for function draw-drawable-tree-instance-shrub
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
;; ERROR: Unsupported inline assembly instruction kind - [mtc0 Perf, r0]
;; ERROR: Unsupported inline assembly instruction kind - [sync.l]
;; ERROR: Unsupported inline assembly instruction kind - [sync.p]
;; ERROR: Unsupported inline assembly instruction kind - [mtpc pcr0, r0]
;; ERROR: Unsupported inline assembly instruction kind - [mtpc pcr1, r0]
;; ERROR: Unsupported inline assembly instruction kind - [sync.l]
;; ERROR: Unsupported inline assembly instruction kind - [sync.p]
;; ERROR: Unsupported inline assembly instruction kind - [mtc0 Perf, a2]
;; ERROR: Unsupported inline assembly instruction kind - [sync.l]
;; ERROR: Unsupported inline assembly instruction kind - [sync.p]
;; ERROR: Unsupported inline assembly instruction kind - [mtc0 Perf, r0]
;; ERROR: Unsupported inline assembly instruction kind - [sync.l]
;; ERROR: Unsupported inline assembly instruction kind - [sync.p]
;; ERROR: Unsupported inline assembly instruction kind - [mfpc a0, pcr0]
;; ERROR: Unsupported inline assembly instruction kind - [mfpc a0, pcr1]
;; ERROR: Unsupported inline assembly instruction kind - [mtc0 Perf, r0]
;; ERROR: Unsupported inline assembly instruction kind - [sync.l]
;; ERROR: Unsupported inline assembly instruction kind - [sync.p]
;; ERROR: Unsupported inline assembly instruction kind - [mtpc pcr0, r0]
;; ERROR: Unsupported inline assembly instruction kind - [mtpc pcr1, r0]
;; ERROR: Unsupported inline assembly instruction kind - [sync.l]
;; ERROR: Unsupported inline assembly instruction kind - [sync.p]
;; ERROR: Unsupported inline assembly instruction kind - [mtc0 Perf, a0]
;; ERROR: Unsupported inline assembly instruction kind - [sync.l]
;; ERROR: Unsupported inline assembly instruction kind - [sync.p]
;; ERROR: Unsupported inline assembly instruction kind - [mtc0 Perf, r0]
;; ERROR: Unsupported inline assembly instruction kind - [sync.l]
;; ERROR: Unsupported inline assembly instruction kind - [sync.p]
;; ERROR: Unsupported inline assembly instruction kind - [mfpc a0, pcr0]
;; 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* 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))
(set! (-> *instance-shrub-work* near-trans-last) (the-as uint 0))
(set! (-> *instance-shrub-work* near-trans-next) (the-as uint 0))
(set! (-> *instance-shrub-work* near-trans-count) (the-as uint 0))
(set! (-> *instance-shrub-work* wind-vectors) (-> tree info wind-vectors))
(set! (-> *instance-shrub-work* wait-to-spr) (the-as uint 0))
(set! (-> *instance-shrub-work* wait-from-spr) (the-as uint 0))
(when (logtest? (vu1-renderer-mask rn15 rn16 rn17 rn18) (-> *display* vu1-enable-user))
(let* ((proto-array (-> tree info prototype-inline-array-shrub))
(proto-array-len (-> proto-array length))
(proto-array-data (-> proto-array data))
)
(countdown (i proto-array-len)
(let ((proto (-> proto-array data i)))
(set! (-> proto next-clear) (the-as uint128 0))
(set! (-> proto last-clear) (the-as uint128 0))
(set! (-> proto count-clear) (the-as uint 0))
)
0
)
(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)))
(let* ((a1-16 (-> *perf-stats* data 44))
(a2-6 (-> a1-16 ctrl))
)
(+! (-> a1-16 count) 1)
(b! (zero? a2-6) cfg-7 :delay (nop!))
(.mtc0 Perf r0)
(.sync.l)
(.sync.p)
(.mtpc pcr0 r0)
(.mtpc pcr1 r0)
(.sync.l)
(.sync.p)
(.mtc0 Perf a2-6)
)
(.sync.l)
(.sync.p)
(label cfg-7)
0
(draw-inline-array-instance-shrub
dma-buff
(&+ (-> tree data 0) 32)
(-> (the-as drawable-group (-> tree data 0)) length)
proto-array-data
)
(let ((v1-26 (-> *perf-stats* data 44)))
(b! (zero? (-> v1-26 ctrl)) cfg-9 :delay (nop!))
(.mtc0 Perf r0)
(.sync.l)
(.sync.p)
(.mfpc a0-4 pcr0)
(+! (-> v1-26 accum0) a0-4)
(.mfpc a0-6 pcr1)
(+! (-> v1-26 accum1) a0-6)
)
(label cfg-9)
0
(let* ((v1-29 (-> *perf-stats* data 45))
(a0-8 (-> v1-29 ctrl))
)
(+! (-> v1-29 count) 1)
(b! (zero? a0-8) cfg-11 :delay (nop!))
(.mtc0 Perf r0)
(.sync.l)
(.sync.p)
(.mtpc pcr0 r0)
(.mtpc pcr1 r0)
(.sync.l)
(.sync.p)
(.mtc0 Perf a0-8)
)
(.sync.l)
(.sync.p)
(label cfg-11)
0
(draw-prototype-inline-array-shrub proto-array-len proto-array-data)
(let ((v1-32 (-> *perf-stats* data 45)))
(b! (zero? (-> v1-32 ctrl)) cfg-13 :delay (nop!))
(.mtc0 Perf r0)
(.sync.l)
(.sync.p)
(.mfpc a0-11 pcr0)
(+! (-> v1-32 accum0) a0-11)
(.mfpc a0-13 pcr1)
(+! (-> v1-32 accum1) a0-13)
)
(label cfg-13)
0
(let ((v1-33 *dma-mem-usage*))
(when (nonzero? v1-33)
(set! (-> v1-33 length) (max 28 (-> v1-33 length)))
(set! (-> v1-33 data 27 name) "shrubbery")
(+! (-> v1-33 data 27 count) 1)
(+! (-> v1-33 data 27 used)
(&- (-> *display* frames (-> *display* on-screen) global-buf base) (the-as uint dma-start))
)
(set! (-> v1-33 data 27 total) (-> v1-33 data 27 used))
)
)
)
)
)
)
(update-wait-stats
(-> *perf-stats* data 44)
(the-as uint 0)
(-> *instance-shrub-work* wait-to-spr)
(-> *instance-shrub-work* wait-from-spr)
)
)
0
(none)
)
;; definition for method 10 of type drawable-tree-instance-shrub
;; WARN: Return type mismatch int vs none.
(defmethod draw drawable-tree-instance-shrub ((obj drawable-tree-instance-shrub) (arg0 drawable-tree-instance-shrub) (arg1 display-frame))
(let ((v1-1 (-> *background-work* shrub-tree-count))
(a1-4 (-> *level* draw-level *draw-index*))
)
(set! (-> *background-work* shrub-trees v1-1) obj)
(set! (-> *background-work* shrub-levels v1-1) a1-4)
)
(+! (-> *background-work* shrub-tree-count) 1)
0
(none)
)
;; definition for method 15 of type drawable-tree-instance-shrub
(defmethod unpack-vis drawable-tree-instance-shrub ((obj drawable-tree-instance-shrub) (arg0 (pointer int8)) (arg1 (pointer int8)))
arg1
)
;; definition for method 13 of type drawable-tree-instance-shrub
;; WARN: Return type mismatch int vs none.
(defmethod collect-stats drawable-tree-instance-shrub ((obj drawable-tree-instance-shrub))
(when (logtest? (vu1-renderer-mask rn15 rn16 rn17 rn18) (-> *display* vu1-enable-user))
(let* ((v1-4 (-> obj info prototype-inline-array-shrub))
(gp-0 (the-as object (-> v1-4 data)))
)
(countdown (s5-0 (-> v1-4 length))
(when (logtest? (vu1-renderer-mask rn16) (-> *display* vu1-enable-user))
(let ((v1-8 (-> (the-as prototype-bucket-shrub gp-0) count 0))
(a1-2 (-> (the-as prototype-bucket-shrub gp-0) geometry 0))
)
(when (nonzero? v1-8)
(let ((a0-4 (-> (the-as drawable-group a1-2) length)))
(+! (-> *terrain-stats* shrub groups) 1)
(+! (-> *terrain-stats* shrub fragments) (* a0-4 (the-as int v1-8)))
)
(+! (-> *terrain-stats* shrub instances) v1-8)
)
)
)
(when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask rn15))
(let ((s4-0 (-> (the-as prototype-bucket-shrub gp-0) count 1))
(v1-14 (-> (the-as prototype-bucket-shrub gp-0) geometry 1))
)
(when (nonzero? s4-0)
(let ((s3-0 (&+ v1-14 32))
(s2-0 (-> (the-as drawable-group v1-14) length))
)
(+! (-> *terrain-stats* shrub groups) 1)
(+! (-> *terrain-stats* shrub fragments) s2-0)
(+! (-> *terrain-stats* shrub instances) s4-0)
(while (nonzero? s2-0)
(+! s2-0 -1)
(let ((a0-15 (* (shrub-num-tris (the-as shrubbery s3-0)) s4-0))
(v1-26 (* (the-as uint (-> (the-as shrubbery s3-0) header data 2)) s4-0))
)
(+! (-> *terrain-stats* shrub tris) a0-15)
(+! (-> *terrain-stats* shrub dverts) v1-26)
)
(&+! s3-0 32)
)
)
)
)
)
(when (logtest? (vu1-renderer-mask rn18) (-> *display* vu1-enable-user))
(let ((s4-1 (-> (the-as prototype-bucket-shrub gp-0) count 2))
(v1-32 (-> (the-as prototype-bucket-shrub gp-0) geometry 2))
)
(when (nonzero? s4-1)
(let ((s3-1 (&+ v1-32 32))
(s2-1 (-> (the-as drawable-group v1-32) length))
)
(+! (-> *terrain-stats* trans-shrub groups) 1)
(+! (-> *terrain-stats* trans-shrub fragments) s2-1)
(+! (-> *terrain-stats* trans-shrub instances) s4-1)
(while (nonzero? s2-1)
(+! s2-1 -1)
(let ((a0-28 (* (shrub-num-tris (the-as shrubbery s3-1)) s4-1))
(v1-44 (* (the-as uint (-> (the-as shrubbery s3-1) header data 2)) s4-1))
)
(+! (-> *terrain-stats* trans-shrub tris) a0-28)
(+! (-> *terrain-stats* trans-shrub dverts) v1-44)
)
(&+! s3-1 32)
)
)
)
)
)
(when (logtest? (vu1-renderer-mask rn17) (-> *display* vu1-enable-user))
(let ((v1-50 (-> (the-as prototype-bucket-shrub gp-0) count 3)))
(when (nonzero? v1-50)
(+! (-> *terrain-stats* billboard groups) 1)
(+! (-> *terrain-stats* billboard instances) v1-50)
(+! (-> *terrain-stats* billboard tris) (* v1-50 2))
(+! (-> *terrain-stats* billboard dverts) (* v1-50 4))
)
)
)
(set! gp-0 (-> (the-as (inline-array prototype-bucket-shrub) gp-0) 1))
)
)
)
0
(none)
)
;; definition of type dma-test
(deftype dma-test (structure)
((data qword 101 :inline :offset-assert 0)
)
:method-count-assert 9
:size-assert #x650
:flag-assert #x900000650
)
;; definition for method 3 of type dma-test
(defmethod inspect dma-test ((obj dma-test))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj 'dma-test)
(format #t "~1Tdata[101] @ #x~X~%" (-> obj data))
(label cfg-4)
obj
)
;; definition for symbol *dma-test*, type dma-test
(define *dma-test* (new 'global 'dma-test))
;; definition of type dma-test-work
(deftype dma-test-work (structure)
((upload dma-packet :inline :offset-assert 0)
(end dma-packet :inline :offset-assert 16)
)
:method-count-assert 9
:size-assert #x20
:flag-assert #x900000020
)
;; definition for method 3 of type dma-test-work
(defmethod inspect dma-test-work ((obj dma-test-work))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj 'dma-test-work)
(format #t "~1Tupload: #<dma-packet @ #x~X>~%" (-> obj upload))
(format #t "~1Tend: #<dma-packet @ #x~X>~%" (-> obj end))
(label cfg-4)
obj
)
;; definition for symbol *dma-test-work*, type dma-test-work
(define *dma-test-work*
(new 'static 'dma-test-work
:upload (new 'static 'dma-packet :dma (new 'static 'dma-tag :qwc #x20 :id (dma-tag-id ref)))
:end (new 'static 'dma-packet :dma (new 'static 'dma-tag :id (dma-tag-id end)))
)
)
;; definition for function init-dma-test
;; INFO: Used lq/sq
;; WARN: Return type mismatch uint128 vs none.
(defun init-dma-test ()
(let ((a0-0 *dma-test-work*)
(v1-0 (the-as object *dma-test*))
)
(let ((a1-6 (-> *display* frames (-> *display* on-screen) calc-buf base)))
(dotimes (a2-1 100)
(set! (-> a0-0 upload dma addr) (the-as int a1-6))
(set! (-> (the-as dma-test v1-0) data a2-1 quad) (-> a0-0 upload quad))
(&+! a1-6 256)
)
)
(set! (-> (the-as (inline-array qword) v1-0) 101 quad) (-> a0-0 end quad))
)
(none)
)
;; failed to figure out what this is:
(init-dma-test)
;; definition for function dma-test-func
;; ERROR: function was not converted to expressions. Cannot decompile.
;; definition for function move-test-func
;; ERROR: function was not converted to expressions. Cannot decompile.

View file

@ -44,6 +44,13 @@ TEST(VuDisasm, Emerc) {
EXPECT_EQ(disasm.to_string(prog), get_expected("jak2/emerc-vu1"));
}
TEST(VuDisasm, Shrub_Jak2) {
auto data = get_test_data("jak2/shrub");
VuDisassembler disasm(VuDisassembler::VuKind::VU1);
auto prog = disasm.disassemble(data.data(), data.size() * 4, false);
EXPECT_EQ(disasm.to_string(prog), get_expected("jak2/shrub"));
}
TEST(VuDisasm, Sprite_Jak2) {
auto data = get_test_data("jak2/sprite");
VuDisassembler disasm(VuDisassembler::VuKind::VU1);

View file

@ -0,0 +1,681 @@
lq.xyzw vf31, 0(vi00) | nop
lq.xyzw vf30, 1(vi00) | nop
lq.xyzw vf29, 2(vi00) | nop
iaddiu vi11, vi00, 0xa2 | nop
iaddiu vi01, vi00, 0x338 | nop
mfir.x vf17, vi01 | nop
mfir.z vf17, vi01 | nop
iaddiu vi01, vi00, 0x1a8 | nop
mfir.y vf17, vi01 | nop
mfir.w vf17, vi01 | nop
iaddi vi01, vi00, 0x1 | nop
mfir.z vf25, vi01 | nop
iaddi vi01, vi00, 0x1 | itof0.xyzw vf17, vf17
mfir.z vf26, vi01 | nop
iaddi vi01, vi00, 0x1 | nop
mfir.z vf27, vi01 | nop :e
nop | addy.xyzw vf17, vf17, vf30
iaddiu vi01, vi00, 0xa4 | subx.xz vf17, vf00, vf17
isub vi11, vi01, vi11 | addy.xyzw vf28, vf00, vf30
b L1 | nop
iaddiu vi13, vi00, 0x175 | nop
iaddiu vi01, vi00, 0xa4 | subx.xz vf17, vf00, vf17
isub vi11, vi01, vi11 | addy.xyzw vf28, vf00, vf30
iaddiu vi13, vi00, 0x142 | nop
L1:
isw.y vi13, 1(vi00) | nop
iaddi vi09, vi11, 0x1 | suby.xz vf17, vf17, vf17
ilwr.y vi05, vi11 | nop
ilwr.x vi15, vi11 | nop
lqi.xyzw vf01, vi09 | nop
nop | addx.xz vf17, vf17, vf30
nop | nop
iaddi vi15, vi15, -0x1 | nop
mtir vi04, vf01.w | nop
mtir vi02, vf17.x | nop
ibne vi00, vi15, L2 | nop
mtir vi03, vf17.y | nop
nop | addz.y vf28, vf28, vf31
L2:
lqi.xyzw vf02, vi09 | nop
iadd vi01, vi04, vi02 | nop
iadd vi14, vi04, vi03 | nop
iaddi vi05, vi05, -0x1 | nop
mtir vi04, vf02.w | nop
sq.xyzw vf01, 0(vi01) | nop
ibeq vi00, vi05, L3 | nop
sq.xyzw vf01, 0(vi14) | nop
lqi.xyzw vf01, vi09 | nop
iadd vi01, vi04, vi02 | nop
iadd vi14, vi04, vi03 | nop
iaddi vi05, vi05, -0x1 | nop
mtir vi04, vf01.w | nop
sq.xyzw vf02, 0(vi01) | nop
ibne vi00, vi05, L2 | nop
sq.xyzw vf02, 0(vi14) | nop
L3:
iaddi vi09, vi09, -0x1 | nop
ilwr.x vi05, vi11 | nop
L4:
lqi.xyzw vf01, vi09 | nop
lqi.xyzw vf02, vi09 | nop
lqi.xyzw vf03, vi09 | nop
lqi.xyzw vf04, vi09 | nop
mtir vi04, vf01.w | nop
iaddi vi05, vi05, -0x1 | nop
nop | nop
nop | nop
iadd vi01, vi04, vi02 | nop
sq.xyzw vf31, 0(vi01) | nop
sq.xyzw vf01, 1(vi01) | nop
sq.xyzw vf02, 2(vi01) | nop
sq.xyzw vf03, 3(vi01) | nop
sq.xyzw vf04, 4(vi01) | nop
iadd vi01, vi04, vi03 | nop
sq.xyzw vf31, 0(vi01) | nop
sq.xyzw vf01, 1(vi01) | nop
sq.xyzw vf02, 2(vi01) | nop
sq.xyzw vf03, 3(vi01) | nop
ibne vi00, vi05, L4 | nop
sq.xyzw vf04, 4(vi01) | nop
ilwr.z vi12, vi11 | nop
ilwr.w vi06, vi11 | nop
isw.x vi09, 1(vi00) | nop
iaddi vi15, vi00, 0x1 | nop
ior vi05, vi12, vi00 | nop
iadd vi06, vi06, vi11 | nop
iadd vi07, vi06, vi12 | nop
iadd vi08, vi07, vi12 | nop
iaddi vi05, vi05, 0x1 | nop
L5:
lq.xyzw vf01, 0(vi06) | nop
lq.xyz vf03, 0(vi07) | nop
lq.xyz vf05, 0(vi08) | nop
iaddi vi05, vi05, -0x2 | nop
lq.xyzw vf08, 1(vi06) | itof0.xyzw vf01, vf01
lq.xyz vf10, 1(vi07) | itof0.xyzw vf03, vf03
lq.xyz vf12, 1(vi08) | itof12.xyzw vf05, vf05
nop | nop
sqi.xyzw vf01, vi06 | itof0.xyzw vf08, vf08
sqi.xyz vf03, vi07 | itof0.xyzw vf10, vf10
ibeq vi00, vi05, L6 | itof12.xyzw vf12, vf12
sqi.xyz vf05, vi08 | nop
sqi.xyzw vf08, vi06 | nop
sqi.xyz vf10, vi07 | nop
ibne vi15, vi05, L5 | nop
sqi.xyz vf12, vi08 | nop
L6:
nop | nop :e
nop | nop
ilw.y vi13, 1(vi00) | nop
iaddiu vi01, vi00, 0x2b7 | nop
ilwr.w vi06, vi11 | nop
ilw.x vi09, 1(vi00) | nop
isub vi13, vi01, vi13 | nop
isw.y vi13, 1(vi00) | nop
ilwr.x vi14, vi13 | nop
lq.xyzw vf21, 4(vi13) | nop
lq.xyzw vf18, 1(vi13) | nop
lq.xyzw vf19, 2(vi13) | nop
lq.xyzw vf20, 3(vi13) | nop
lq.xyzw vf22, 5(vi13) | mulaz.w ACC, vf21, vf30
iaddi vi13, vi13, 0x6 | maddw.w vf09, vf30, vf00
iadd vi06, vi06, vi11 | nop
iadd vi07, vi06, vi12 | nop
iadd vi08, vi07, vi12 | nop
move.w vf04, vf22 | miniy.w vf09, vf09, vf29
move.w vf11, vf22 | nop
lqi.xyzw vf01, vi06 | nop
lqi.xyzw vf05, vi08 | nop
lqi.xyzw vf03, vi07 | ftoi4.w vf02, vf09
lqi.xyzw vf08, vi06 | ftoi4.w vf09, vf09
lqi.xyzw vf12, vi08 | add.xyzw vf07, vf01, vf17
lqi.xyzw vf10, vi07 | mulaw.xyzw ACC, vf21, vf00
nop | maddax.xyzw ACC, vf18, vf01
nop | madday.xyzw ACC, vf19, vf01
nop | maddz.xyzw vf01, vf20, vf01
nop | add.xyzw vf14, vf08, vf17
nop | mulaw.xyzw ACC, vf21, vf00
nop | maddax.xyzw ACC, vf18, vf08
div Q, vf00.w, vf01.w | madday.xyzw ACC, vf19, vf08
nop | maddz.xyzw vf08, vf20, vf08
nop | nop
nop | nop
nop | nop
nop | nop
nop | nop
nop | mul.xyz vf02, vf01, Q
nop | mul.xyzw vf06, vf05, Q
lqi.xyzw vf01, vi06 | mul.xyz vf04, vf03, vf22
div Q, vf00.w, vf08.w | nop
lqi.xyzw vf05, vi08 | nop
mtir vi02, vf07.w | nop
lqi.xyzw vf03, vi07 | nop
nop | nop
nop | add.xyzw vf07, vf01, vf17
nop | mulaw.xyzw ACC, vf21, vf00
nop | maddax.xyzw ACC, vf18, vf01
nop | madday.xyzw ACC, vf19, vf01
nop | maddz.xyzw vf01, vf20, vf01
nop | mul.xyz vf09, vf08, Q
nop | mul.xyzw vf13, vf12, Q
L7:
lqi.xyzw vf08, vi06 | mul.xyz vf11, vf10, vf22
div Q, vf00.w, vf01.w | nop
lqi.xyzw vf12, vi08 | nop
mtir vi05, vf14.w | nop
lqi.xyzw vf10, vi07 | sub.xyzw vf15, vf02, vf09
sq.xyzw vf06, 1(vi02) | ftoi4.xyz vf02, vf02
sq.xyzw vf04, 2(vi02) | add.xyzw vf14, vf08, vf17
lqi.xyzw vf23, vi09 | mulaw.xyzw ACC, vf21, vf00
lqi.xyzw vf24, vi09 | maddax.xyzw ACC, vf18, vf08
sq.xyzw vf02, 3(vi02) | madday.xyzw ACC, vf19, vf08
isubiu vi10, vi00, 0x40 | maddz.xyzw vf08, vf20, vf08
L8:
mtir vi01, vf03.w | mul.xyz vf02, vf01, Q
sq.xyzw vf25, 0(vi02) | mul.xyzw vf06, vf05, Q
lqi.xyzw vf01, vi06 | mul.xyz vf04, vf03, vf22
div Q, vf00.w, vf08.w | nop
lqi.xyzw vf05, vi08 | nop
mtir vi02, vf07.w | nop
lqi.xyzw vf03, vi07 | sub.xyzw vf16, vf09, vf02
sq.xyzw vf13, 1(vi05) | ftoi4.xyz vf09, vf09
sq.xyzw vf11, 2(vi05) | add.xyzw vf07, vf01, vf17
nop | mulaw.xyzw ACC, vf21, vf00
nop | maddax.xyzw ACC, vf18, vf01
sq.xyzw vf09, 3(vi05) | madday.xyzw ACC, vf19, vf01
nop | maddz.xyzw vf01, vf20, vf01
mtir vi04, vf10.w | mul.xyz vf09, vf08, Q
sq.xyzw vf25, 0(vi05) | mul.xyzw vf13, vf12, Q
lqi.xyzw vf08, vi06 | mul.xyz vf11, vf10, vf22
div Q, vf00.w, vf01.w | nop
lqi.xyzw vf12, vi08 | mulay.x ACC, vf15, vf16
mtir vi05, vf14.w | msubay.x ACC, vf16, vf15
lqi.xyzw vf10, vi07 | sub.xyzw vf15, vf02, vf09
sq.xyzw vf06, 1(vi02) | ftoi4.xyz vf02, vf02
sq.xyzw vf04, 2(vi02) | add.xyzw vf14, vf08, vf17
fsand vi03, 0x2 | mulaw.xyzw ACC, vf21, vf00
ibltz vi01, L27 | maddax.xyzw ACC, vf18, vf08
sq.xyzw vf02, 3(vi02) | madday.xyzw ACC, vf19, vf08
L9:
ibeq vi01, vi03, L16 | maddz.xyzw vf08, vf20, vf08
mtir vi01, vf03.w | mul.xyz vf02, vf01, Q
b L14 | nop
sq.xyzw vf23, 0(vi02) | mul.xyzw vf06, vf05, Q
nop | mul.xyzw vf06, vf05, Q
L10:
lqi.xyzw vf01, vi06 | mul.xyz vf04, vf03, vf22
div Q, vf00.w, vf08.w | nop
lqi.xyzw vf05, vi08 | nop
mtir vi02, vf07.w | nop
lqi.xyzw vf03, vi07 | sub.xyzw vf16, vf09, vf02
sq.xyzw vf13, 1(vi05) | ftoi4.xyz vf09, vf09
sq.xyzw vf11, 2(vi05) | add.xyzw vf07, vf01, vf17
lqi.xyzw vf23, vi09 | mulaw.xyzw ACC, vf21, vf00
lqi.xyzw vf24, vi09 | maddax.xyzw ACC, vf18, vf01
sq.xyzw vf09, 3(vi05) | madday.xyzw ACC, vf19, vf01
isubiu vi10, vi00, 0x40 | maddz.xyzw vf01, vf20, vf01
L11:
mtir vi04, vf10.w | mul.xyz vf09, vf08, Q
sq.xyzw vf25, 0(vi05) | mul.xyzw vf13, vf12, Q
lqi.xyzw vf08, vi06 | mul.xyz vf11, vf10, vf22
div Q, vf00.w, vf01.w | nop
lqi.xyzw vf12, vi08 | nop
mtir vi05, vf14.w | nop
lqi.xyzw vf10, vi07 | sub.xyzw vf15, vf02, vf09
sq.xyzw vf06, 1(vi02) | ftoi4.xyz vf02, vf02
sq.xyzw vf04, 2(vi02) | add.xyzw vf14, vf08, vf17
nop | mulaw.xyzw ACC, vf21, vf00
nop | maddax.xyzw ACC, vf18, vf08
sq.xyzw vf02, 3(vi02) | madday.xyzw ACC, vf19, vf08
nop | maddz.xyzw vf08, vf20, vf08
mtir vi01, vf03.w | mul.xyz vf02, vf01, Q
sq.xyzw vf25, 0(vi02) | mul.xyzw vf06, vf05, Q
lqi.xyzw vf01, vi06 | mul.xyz vf04, vf03, vf22
div Q, vf00.w, vf08.w | nop
lqi.xyzw vf05, vi08 | mulay.x ACC, vf15, vf16
mtir vi02, vf07.w | msubay.x ACC, vf16, vf15
lqi.xyzw vf03, vi07 | sub.xyzw vf16, vf09, vf02
sq.xyzw vf13, 1(vi05) | ftoi4.xyz vf09, vf09
sq.xyzw vf11, 2(vi05) | add.xyzw vf07, vf01, vf17
fsand vi03, 0x2 | mulaw.xyzw ACC, vf21, vf00
ibltz vi04, L26 | maddax.xyzw ACC, vf18, vf01
sq.xyzw vf09, 3(vi05) | madday.xyzw ACC, vf19, vf01
L12:
ibeq vi04, vi03, L17 | maddz.xyzw vf01, vf20, vf01
mtir vi04, vf10.w | mul.xyz vf09, vf08, Q
b L15 | nop
sq.xyzw vf23, 0(vi05) | mul.xyzw vf13, vf12, Q
L13:
sq.xyzw vf26, 0(vi02) | mul.xyzw vf06, vf05, Q
L14:
lqi.xyzw vf01, vi06 | mul.xyz vf04, vf03, vf22
div Q, vf00.w, vf08.w | nop
lqi.xyzw vf05, vi08 | mulay.x ACC, vf15, vf16
mtir vi02, vf07.w | msubay.x ACC, vf16, vf15
lqi.xyzw vf03, vi07 | sub.xyzw vf16, vf09, vf02
sq.xyzw vf13, 1(vi05) | ftoi4.xyz vf09, vf09
sq.xyzw vf11, 2(vi05) | add.xyzw vf07, vf01, vf17
fsand vi03, 0x2 | mulaw.xyzw ACC, vf21, vf00
ibltz vi04, L22 | maddax.xyzw ACC, vf18, vf01
sq.xyzw vf09, 3(vi05) | madday.xyzw ACC, vf19, vf01
ibeq vi04, vi03, L17 | maddz.xyzw vf01, vf20, vf01
mtir vi04, vf10.w | mul.xyz vf09, vf08, Q
sq.xyzw vf26, 0(vi05) | mul.xyzw vf13, vf12, Q
L15:
lqi.xyzw vf08, vi06 | mul.xyz vf11, vf10, vf22
div Q, vf00.w, vf01.w | nop
lqi.xyzw vf12, vi08 | mulay.x ACC, vf15, vf16
mtir vi05, vf14.w | msubay.x ACC, vf16, vf15
lqi.xyzw vf10, vi07 | sub.xyzw vf15, vf02, vf09
sq.xyzw vf06, 1(vi02) | ftoi4.xyz vf02, vf02
sq.xyzw vf04, 2(vi02) | add.xyzw vf14, vf08, vf17
fsand vi03, 0x2 | mulaw.xyzw ACC, vf21, vf00
ibltz vi01, L23 | maddax.xyzw ACC, vf18, vf08
sq.xyzw vf02, 3(vi02) | madday.xyzw ACC, vf19, vf08
ibne vi01, vi03, L13 | maddz.xyzw vf08, vf20, vf08
mtir vi01, vf03.w | mul.xyz vf02, vf01, Q
L16:
b L19 | nop
sq.xyzw vf24, 0(vi02) | mul.xyzw vf06, vf05, Q
L17:
b L20 | nop
sq.xyzw vf24, 0(vi05) | mul.xyzw vf13, vf12, Q
L18:
sq.xyzw vf27, 0(vi02) | mul.xyzw vf06, vf05, Q
L19:
lqi.xyzw vf01, vi06 | mul.xyz vf04, vf03, vf22
div Q, vf00.w, vf08.w | nop
lqi.xyzw vf05, vi08 | mulax.y ACC, vf15, vf16
mtir vi02, vf07.w | msubax.y ACC, vf16, vf15
lqi.xyzw vf03, vi07 | sub.xyzw vf16, vf09, vf02
sq.xyzw vf13, 1(vi05) | ftoi4.xyz vf09, vf09
sq.xyzw vf11, 2(vi05) | add.xyzw vf07, vf01, vf17
fsand vi03, 0x2 | mulaw.xyzw ACC, vf21, vf00
ibltz vi04, L24 | maddax.xyzw ACC, vf18, vf01
sq.xyzw vf09, 3(vi05) | madday.xyzw ACC, vf19, vf01
ibeq vi04, vi03, L21 | maddz.xyzw vf01, vf20, vf01
mtir vi04, vf10.w | mul.xyz vf09, vf08, Q
sq.xyzw vf27, 0(vi05) | mul.xyzw vf13, vf12, Q
L20:
lqi.xyzw vf08, vi06 | mul.xyz vf11, vf10, vf22
div Q, vf00.w, vf01.w | nop
lqi.xyzw vf12, vi08 | mulax.y ACC, vf15, vf16
mtir vi05, vf14.w | msubax.y ACC, vf16, vf15
lqi.xyzw vf10, vi07 | sub.xyzw vf15, vf02, vf09
sq.xyzw vf06, 1(vi02) | ftoi4.xyz vf02, vf02
sq.xyzw vf04, 2(vi02) | add.xyzw vf14, vf08, vf17
fsand vi03, 0x2 | mulaw.xyzw ACC, vf21, vf00
ibltz vi01, L25 | maddax.xyzw ACC, vf18, vf08
sq.xyzw vf02, 3(vi02) | madday.xyzw ACC, vf19, vf08
ibne vi01, vi03, L18 | maddz.xyzw vf08, vf20, vf08
mtir vi01, vf03.w | mul.xyz vf02, vf01, Q
b L14 | nop
sq.xyzw vf23, 0(vi02) | mul.xyzw vf06, vf05, Q
L21:
b L15 | nop
sq.xyzw vf23, 0(vi05) | mul.xyzw vf13, vf12, Q
L22:
ibne vi10, vi04, L28 | nop
iaddiu vi04, vi04, 0x80 | nop
lqi.xyzw vf23, vi09 | nop
b L11 | nop
lqi.xyzw vf24, vi09 | maddz.xyzw vf01, vf20, vf01
L23:
ibne vi10, vi01, L33 | nop
iaddiu vi01, vi01, 0x80 | nop
lqi.xyzw vf23, vi09 | nop
b L8 | nop
lqi.xyzw vf24, vi09 | maddz.xyzw vf08, vf20, vf08
L24:
ibne vi10, vi04, L38 | nop
iaddiu vi04, vi04, 0x80 | nop
lqi.xyzw vf23, vi09 | nop
b L11 | nop
lqi.xyzw vf24, vi09 | maddz.xyzw vf01, vf20, vf01
L25:
ibne vi10, vi01, L43 | nop
iaddiu vi01, vi01, 0x80 | nop
lqi.xyzw vf23, vi09 | nop
b L8 | nop
lqi.xyzw vf24, vi09 | maddz.xyzw vf08, vf20, vf08
L26:
ibeq vi10, vi04, L12 | nop
iaddiu vi04, vi04, 0x80 | nop
ilwr.w vi06, vi11 | maddz.xyzw vf01, vf20, vf01
mr32.xyzw vf17, vf17 | mul.xyz vf09, vf08, Q
lqi.xyzw vf18, vi13 | nop
lqi.xyzw vf19, vi13 | nop
lqi.xyzw vf20, vi13 | nop
lqi.xyzw vf21, vi13 | nop
iadd vi06, vi06, vi11 | nop
iadd vi07, vi06, vi12 | nop
iadd vi08, vi07, vi12 | nop
ibeq vi04, vi03, L48 | nop
mtir vi04, vf10.w | nop
b L29 | nop
sq.xyzw vf23, 0(vi05) | mul.xyzw vf13, vf12, Q
L27:
ibeq vi10, vi01, L9 | nop
iaddiu vi01, vi01, 0x80 | nop
ilwr.w vi06, vi11 | maddz.xyzw vf08, vf20, vf08
mr32.xyzw vf17, vf17 | mul.xyz vf02, vf01, Q
lqi.xyzw vf18, vi13 | nop
lqi.xyzw vf19, vi13 | nop
lqi.xyzw vf20, vi13 | nop
lqi.xyzw vf21, vi13 | nop
iadd vi06, vi06, vi11 | nop
iadd vi07, vi06, vi12 | nop
iadd vi08, vi07, vi12 | nop
ibeq vi01, vi03, L52 | nop
mtir vi01, vf03.w | nop
b L34 | nop
sq.xyzw vf23, 0(vi02) | mul.xyzw vf06, vf05, Q
L28:
ilwr.w vi06, vi11 | maddz.xyzw vf01, vf20, vf01
mr32.xyzw vf17, vf17 | mul.xyz vf09, vf08, Q
lqi.xyzw vf18, vi13 | nop
lqi.xyzw vf19, vi13 | nop
lqi.xyzw vf20, vi13 | nop
lqi.xyzw vf21, vi13 | nop
iadd vi06, vi06, vi11 | nop
iadd vi07, vi06, vi12 | nop
iadd vi08, vi07, vi12 | nop
ibeq vi04, vi03, L48 | nop
mtir vi04, vf10.w | nop
sq.xyzw vf26, 0(vi05) | mul.xyzw vf13, vf12, Q
L29:
lqi.xyzw vf08, vi06 | mul.xyz vf11, vf10, vf22
div Q, vf00.w, vf01.w | nop
lqi.xyzw vf12, vi08 | mulay.x ACC, vf15, vf16
mtir vi05, vf14.w | msubay.x ACC, vf16, vf15
lqi.xyzw vf10, vi07 | sub.xyzw vf15, vf02, vf09
sq.xyzw vf06, 1(vi02) | ftoi4.xyz vf02, vf02
sq.xyzw vf04, 2(vi02) | add.xyzw vf14, vf08, vf17
fsand vi03, 0x2 | mulaw.xyzw ACC, vf21, vf00
ilw.x vi09, 1(vi00) | maddax.xyzw ACC, vf18, vf08
sq.xyzw vf02, 3(vi02) | madday.xyzw ACC, vf19, vf08
ibeq vi01, vi03, L49 | maddz.xyzw vf08, vf20, vf08
mtir vi01, vf03.w | mul.xyz vf02, vf01, Q
sq.xyzw vf26, 0(vi02) | mul.xyzw vf06, vf05, Q
L30:
lqi.xyzw vf01, vi06 | mul.xyz vf04, vf03, vf22
div Q, vf00.w, vf08.w | nop
lqi.xyzw vf05, vi08 | mulay.x ACC, vf15, vf16
mtir vi02, vf07.w | msubay.x ACC, vf16, vf15
lqi.xyzw vf03, vi07 | sub.xyzw vf16, vf09, vf02
sq.xyzw vf13, 1(vi05) | ftoi4.xyz vf09, vf09
sq.xyzw vf11, 2(vi05) | add.xyzw vf07, vf01, vf17
fsand vi03, 0x2 | mulaw.xyzw ACC, vf21, vf00
mtir vi10, vf28.x | maddax.xyzw ACC, vf18, vf01
sq.xyzw vf09, 3(vi05) | madday.xyzw ACC, vf19, vf01
lqi.xyzw vf22, vi13 | mulz.w vf09, vf21, vf30
ibeq vi04, vi03, L50 | maddz.xyzw vf01, vf20, vf01
mtir vi04, vf10.w | mul.xyz vf09, vf08, Q
sq.xyzw vf26, 0(vi05) | mul.xyzw vf13, vf12, Q
L31:
lqi.xyzw vf08, vi06 | mul.xyz vf11, vf10, vf22
div Q, vf00.w, vf01.w | mulay.x ACC, vf15, vf16
lqi.xyzw vf12, vi08 | addw.w vf09, vf30, vf09
mtir vi05, vf14.w | msubay.x ACC, vf16, vf15
lqi.xyzw vf10, vi07 | sub.xyzw vf15, vf02, vf09
sq.xyzw vf06, 1(vi02) | ftoi4.xyz vf02, vf02
sq.xyzw vf04, 2(vi02) | add.xyzw vf14, vf08, vf17
fsand vi03, 0x2 | mulaw.xyzw ACC, vf21, vf00
iaddi vi14, vi14, -0x1 | maddax.xyzw ACC, vf18, vf08
sq.xyzw vf02, 3(vi02) | madday.xyzw ACC, vf19, vf08
mtir vi15, vf17.x | miniy.w vf09, vf09, vf29
ibeq vi01, vi03, L51 | maddz.xyzw vf08, vf20, vf08
mtir vi01, vf03.w | mul.xyz vf02, vf01, Q
sq.xyzw vf26, 0(vi02) | mul.xyzw vf06, vf05, Q
L32:
move.w vf04, vf22 | addy.x vf28, vf00, vf28
move.w vf11, vf22 | nop
iadd vi15, vi15, vi10 | nop
ibne vi00, vi14, L10 | ftoi4.w vf02, vf09
xgkick vi15 | ftoi4.w vf09, vf09
nop | nop :e
nop | nop
L33:
ilwr.w vi06, vi11 | maddz.xyzw vf08, vf20, vf08
mr32.xyzw vf17, vf17 | mul.xyz vf02, vf01, Q
lqi.xyzw vf18, vi13 | nop
lqi.xyzw vf19, vi13 | nop
lqi.xyzw vf20, vi13 | nop
lqi.xyzw vf21, vi13 | nop
iadd vi06, vi06, vi11 | nop
iadd vi07, vi06, vi12 | nop
iadd vi08, vi07, vi12 | nop
ibeq vi01, vi03, L52 | nop
mtir vi01, vf03.w | nop
sq.xyzw vf26, 0(vi02) | mul.xyzw vf06, vf05, Q
L34:
lqi.xyzw vf01, vi06 | mul.xyz vf04, vf03, vf22
div Q, vf00.w, vf08.w | nop
lqi.xyzw vf05, vi08 | mulay.x ACC, vf15, vf16
mtir vi02, vf07.w | msubay.x ACC, vf16, vf15
lqi.xyzw vf03, vi07 | sub.xyzw vf16, vf09, vf02
sq.xyzw vf13, 1(vi05) | ftoi4.xyz vf09, vf09
sq.xyzw vf11, 2(vi05) | add.xyzw vf07, vf01, vf17
fsand vi03, 0x2 | mulaw.xyzw ACC, vf21, vf00
ilw.x vi09, 1(vi00) | maddax.xyzw ACC, vf18, vf01
sq.xyzw vf09, 3(vi05) | madday.xyzw ACC, vf19, vf01
ibeq vi04, vi03, L53 | maddz.xyzw vf01, vf20, vf01
mtir vi04, vf10.w | mul.xyz vf09, vf08, Q
sq.xyzw vf26, 0(vi05) | mul.xyzw vf13, vf12, Q
L35:
lqi.xyzw vf08, vi06 | mul.xyz vf11, vf10, vf22
div Q, vf00.w, vf01.w | nop
lqi.xyzw vf12, vi08 | mulay.x ACC, vf15, vf16
mtir vi05, vf14.w | msubay.x ACC, vf16, vf15
lqi.xyzw vf10, vi07 | sub.xyzw vf15, vf02, vf09
sq.xyzw vf06, 1(vi02) | ftoi4.xyz vf02, vf02
sq.xyzw vf04, 2(vi02) | add.xyzw vf14, vf08, vf17
fsand vi03, 0x2 | mulaw.xyzw ACC, vf21, vf00
mtir vi10, vf28.x | maddax.xyzw ACC, vf18, vf08
sq.xyzw vf02, 3(vi02) | madday.xyzw ACC, vf19, vf08
lqi.xyzw vf22, vi13 | mulz.w vf02, vf21, vf30
ibeq vi01, vi03, L54 | maddz.xyzw vf08, vf20, vf08
mtir vi01, vf03.w | mul.xyz vf02, vf01, Q
sq.xyzw vf26, 0(vi02) | mul.xyzw vf06, vf05, Q
L36:
lqi.xyzw vf01, vi06 | mul.xyz vf04, vf03, vf22
div Q, vf00.w, vf08.w | mulay.x ACC, vf15, vf16
lqi.xyzw vf05, vi08 | addw.w vf02, vf30, vf02
mtir vi02, vf07.w | msubay.x ACC, vf16, vf15
lqi.xyzw vf03, vi07 | sub.xyzw vf16, vf09, vf02
sq.xyzw vf13, 1(vi05) | ftoi4.xyz vf09, vf09
sq.xyzw vf11, 2(vi05) | add.xyzw vf07, vf01, vf17
fsand vi03, 0x2 | mulaw.xyzw ACC, vf21, vf00
iaddi vi14, vi14, -0x1 | maddax.xyzw ACC, vf18, vf01
sq.xyzw vf09, 3(vi05) | madday.xyzw ACC, vf19, vf01
mtir vi15, vf17.x | miniy.w vf02, vf02, vf29
ibeq vi04, vi03, L55 | maddz.xyzw vf01, vf20, vf01
mtir vi04, vf10.w | mul.xyz vf09, vf08, Q
sq.xyzw vf26, 0(vi05) | mul.xyzw vf13, vf12, Q
L37:
move.w vf04, vf22 | addy.x vf28, vf00, vf28
move.w vf11, vf22 | nop
iadd vi15, vi15, vi10 | nop
ibne vi00, vi14, L7 | ftoi4.w vf09, vf02
xgkick vi15 | ftoi4.w vf02, vf02
nop | nop :e
nop | nop
L38:
ilwr.w vi06, vi11 | maddz.xyzw vf01, vf20, vf01
mr32.xyzw vf17, vf17 | mul.xyz vf09, vf08, Q
lqi.xyzw vf18, vi13 | nop
lqi.xyzw vf19, vi13 | nop
lqi.xyzw vf20, vi13 | nop
lqi.xyzw vf21, vi13 | nop
iadd vi06, vi06, vi11 | nop
iadd vi07, vi06, vi12 | nop
iadd vi08, vi07, vi12 | nop
ibeq vi04, vi03, L56 | nop
mtir vi04, vf10.w | nop
sq.xyzw vf27, 0(vi05) | mul.xyzw vf13, vf12, Q
L39:
lqi.xyzw vf08, vi06 | mul.xyz vf11, vf10, vf22
div Q, vf00.w, vf01.w | nop
lqi.xyzw vf12, vi08 | mulax.y ACC, vf15, vf16
mtir vi05, vf14.w | msubax.y ACC, vf16, vf15
lqi.xyzw vf10, vi07 | sub.xyzw vf15, vf02, vf09
sq.xyzw vf06, 1(vi02) | ftoi4.xyz vf02, vf02
sq.xyzw vf04, 2(vi02) | add.xyzw vf14, vf08, vf17
fsand vi03, 0x2 | mulaw.xyzw ACC, vf21, vf00
ilw.x vi09, 1(vi00) | maddax.xyzw ACC, vf18, vf08
sq.xyzw vf02, 3(vi02) | madday.xyzw ACC, vf19, vf08
ibeq vi01, vi03, L57 | maddz.xyzw vf08, vf20, vf08
mtir vi01, vf03.w | mul.xyz vf02, vf01, Q
sq.xyzw vf27, 0(vi02) | mul.xyzw vf06, vf05, Q
L40:
lqi.xyzw vf01, vi06 | mul.xyz vf04, vf03, vf22
div Q, vf00.w, vf08.w | nop
lqi.xyzw vf05, vi08 | mulax.y ACC, vf15, vf16
mtir vi02, vf07.w | msubax.y ACC, vf16, vf15
lqi.xyzw vf03, vi07 | sub.xyzw vf16, vf09, vf02
sq.xyzw vf13, 1(vi05) | ftoi4.xyz vf09, vf09
sq.xyzw vf11, 2(vi05) | add.xyzw vf07, vf01, vf17
fsand vi03, 0x2 | mulaw.xyzw ACC, vf21, vf00
mtir vi10, vf28.x | maddax.xyzw ACC, vf18, vf01
sq.xyzw vf09, 3(vi05) | madday.xyzw ACC, vf19, vf01
lqi.xyzw vf22, vi13 | mulz.w vf09, vf21, vf30
ibeq vi04, vi03, L58 | maddz.xyzw vf01, vf20, vf01
mtir vi04, vf10.w | mul.xyz vf09, vf08, Q
sq.xyzw vf27, 0(vi05) | mul.xyzw vf13, vf12, Q
L41:
lqi.xyzw vf08, vi06 | mul.xyz vf11, vf10, vf22
div Q, vf00.w, vf01.w | mulax.y ACC, vf15, vf16
lqi.xyzw vf12, vi08 | addw.w vf09, vf30, vf09
mtir vi05, vf14.w | msubax.y ACC, vf16, vf15
lqi.xyzw vf10, vi07 | sub.xyzw vf15, vf02, vf09
sq.xyzw vf06, 1(vi02) | ftoi4.xyz vf02, vf02
sq.xyzw vf04, 2(vi02) | add.xyzw vf14, vf08, vf17
fsand vi03, 0x2 | mulaw.xyzw ACC, vf21, vf00
iaddi vi14, vi14, -0x1 | maddax.xyzw ACC, vf18, vf08
sq.xyzw vf02, 3(vi02) | madday.xyzw ACC, vf19, vf08
mtir vi15, vf17.x | miniy.w vf09, vf09, vf29
ibeq vi01, vi03, L59 | maddz.xyzw vf08, vf20, vf08
mtir vi01, vf03.w | mul.xyz vf02, vf01, Q
sq.xyzw vf27, 0(vi02) | mul.xyzw vf06, vf05, Q
L42:
move.w vf04, vf22 | addy.x vf28, vf00, vf28
move.w vf11, vf22 | nop
iadd vi15, vi15, vi10 | nop
ibne vi00, vi14, L10 | ftoi4.w vf02, vf09
xgkick vi15 | ftoi4.w vf09, vf09
nop | nop :e
nop | nop
L43:
ilwr.w vi06, vi11 | maddz.xyzw vf08, vf20, vf08
mr32.xyzw vf17, vf17 | mul.xyz vf02, vf01, Q
lqi.xyzw vf18, vi13 | nop
lqi.xyzw vf19, vi13 | nop
lqi.xyzw vf20, vi13 | nop
lqi.xyzw vf21, vi13 | nop
iadd vi06, vi06, vi11 | nop
iadd vi07, vi06, vi12 | nop
iadd vi08, vi07, vi12 | nop
ibeq vi01, vi03, L60 | nop
mtir vi01, vf03.w | nop
sq.xyzw vf27, 0(vi02) | mul.xyzw vf06, vf05, Q
L44:
lqi.xyzw vf01, vi06 | mul.xyz vf04, vf03, vf22
div Q, vf00.w, vf08.w | nop
lqi.xyzw vf05, vi08 | mulax.y ACC, vf15, vf16
mtir vi02, vf07.w | msubax.y ACC, vf16, vf15
lqi.xyzw vf03, vi07 | sub.xyzw vf16, vf09, vf02
sq.xyzw vf13, 1(vi05) | ftoi4.xyz vf09, vf09
sq.xyzw vf11, 2(vi05) | add.xyzw vf07, vf01, vf17
fsand vi03, 0x2 | mulaw.xyzw ACC, vf21, vf00
ilw.x vi09, 1(vi00) | maddax.xyzw ACC, vf18, vf01
sq.xyzw vf09, 3(vi05) | madday.xyzw ACC, vf19, vf01
ibeq vi04, vi03, L61 | maddz.xyzw vf01, vf20, vf01
mtir vi04, vf10.w | mul.xyz vf09, vf08, Q
sq.xyzw vf27, 0(vi05) | mul.xyzw vf13, vf12, Q
L45:
lqi.xyzw vf08, vi06 | mul.xyz vf11, vf10, vf22
div Q, vf00.w, vf01.w | nop
lqi.xyzw vf12, vi08 | mulax.y ACC, vf15, vf16
mtir vi05, vf14.w | msubax.y ACC, vf16, vf15
lqi.xyzw vf10, vi07 | sub.xyzw vf15, vf02, vf09
sq.xyzw vf06, 1(vi02) | ftoi4.xyz vf02, vf02
sq.xyzw vf04, 2(vi02) | add.xyzw vf14, vf08, vf17
fsand vi03, 0x2 | mulaw.xyzw ACC, vf21, vf00
mtir vi10, vf28.x | maddax.xyzw ACC, vf18, vf08
sq.xyzw vf02, 3(vi02) | madday.xyzw ACC, vf19, vf08
lqi.xyzw vf22, vi13 | mulz.w vf02, vf21, vf30
ibeq vi01, vi03, L62 | maddz.xyzw vf08, vf20, vf08
mtir vi01, vf03.w | mul.xyz vf02, vf01, Q
sq.xyzw vf27, 0(vi02) | mul.xyzw vf06, vf05, Q
L46:
lqi.xyzw vf01, vi06 | mul.xyz vf04, vf03, vf22
div Q, vf00.w, vf08.w | mulax.y ACC, vf15, vf16
lqi.xyzw vf05, vi08 | addw.w vf02, vf30, vf02
mtir vi02, vf07.w | msubax.y ACC, vf16, vf15
lqi.xyzw vf03, vi07 | sub.xyzw vf16, vf09, vf02
sq.xyzw vf13, 1(vi05) | ftoi4.xyz vf09, vf09
sq.xyzw vf11, 2(vi05) | add.xyzw vf07, vf01, vf17
fsand vi03, 0x2 | mulaw.xyzw ACC, vf21, vf00
iaddi vi14, vi14, -0x1 | maddax.xyzw ACC, vf18, vf01
sq.xyzw vf09, 3(vi05) | madday.xyzw ACC, vf19, vf01
mtir vi15, vf17.x | miniy.w vf02, vf02, vf29
ibeq vi04, vi03, L63 | maddz.xyzw vf01, vf20, vf01
mtir vi04, vf10.w | mul.xyz vf09, vf08, Q
sq.xyzw vf27, 0(vi05) | mul.xyzw vf13, vf12, Q
L47:
move.w vf04, vf22 | addy.x vf28, vf00, vf28
move.w vf11, vf22 | nop
iadd vi15, vi15, vi10 | nop
ibne vi00, vi14, L7 | ftoi4.w vf09, vf02
xgkick vi15 | ftoi4.w vf02, vf02
nop | nop :e
nop | nop
L48:
b L39 | nop
sq.xyzw vf24, 0(vi05) | mul.xyzw vf13, vf12, Q
L49:
b L40 | nop
sq.xyzw vf24, 0(vi02) | mul.xyzw vf06, vf05, Q
L50:
b L41 | nop
sq.xyzw vf24, 0(vi05) | mul.xyzw vf13, vf12, Q
L51:
b L42 | nop
sq.xyzw vf24, 0(vi02) | mul.xyzw vf06, vf05, Q
L52:
b L44 | nop
sq.xyzw vf24, 0(vi02) | mul.xyzw vf06, vf05, Q
L53:
b L45 | nop
sq.xyzw vf24, 0(vi05) | mul.xyzw vf13, vf12, Q
L54:
b L46 | nop
sq.xyzw vf24, 0(vi02) | mul.xyzw vf06, vf05, Q
L55:
b L47 | nop
sq.xyzw vf24, 0(vi05) | mul.xyzw vf13, vf12, Q
L56:
b L29 | nop
sq.xyzw vf23, 0(vi05) | mul.xyzw vf13, vf12, Q
L57:
b L30 | nop
sq.xyzw vf23, 0(vi02) | mul.xyzw vf06, vf05, Q
L58:
b L31 | nop
sq.xyzw vf23, 0(vi05) | mul.xyzw vf13, vf12, Q
L59:
b L32 | nop
sq.xyzw vf23, 0(vi02) | mul.xyzw vf06, vf05, Q
L60:
b L34 | nop
sq.xyzw vf23, 0(vi02) | mul.xyzw vf06, vf05, Q
L61:
b L35 | nop
sq.xyzw vf23, 0(vi05) | mul.xyzw vf13, vf12, Q
L62:
b L36 | nop
sq.xyzw vf23, 0(vi02) | mul.xyzw vf06, vf05, Q
L63:
b L37 | nop
sq.xyzw vf23, 0(vi05) | mul.xyzw vf13, vf12, Q

File diff suppressed because it is too large Load diff