diff --git a/decompiler/config/jak2/all-types.gc b/decompiler/config/jak2/all-types.gc index bf449ad964..8b579db47d 100644 --- a/decompiler/config/jak2/all-types.gc +++ b/decompiler/config/jak2/all-types.gc @@ -10473,7 +10473,7 @@ (drw2-frame qword :inline :offset-assert 464) (drw2-strip gs-gif-tag :inline :offset-assert 480) ;; gs-gif-tag :inline (drw3-adgif gs-gif-tag :inline :offset-assert 496) ;; gs-gif-tag :inline - (drw3-frame qword :inline :offset-assert 512) + (drw3-frame gs-adcmd :inline :offset-assert 512) (index-table vector4w 4 :inline :offset-assert 528) ;; guessed by decompiler ) :method-count-assert 9 @@ -10544,20 +10544,20 @@ :flag-assert #xb00000038 (:methods (set-height! (_type_ float) none 9) - (ocean-map-method-10 (_type_) float 10) + (get-base-height (_type_) float 10) ) ) (deftype ocean (ocean-map) - ((off basic :offset-assert 56) - (near-off basic :offset-assert 60) - (mid-off basic :offset-assert 64) - (far-on basic :offset-assert 68) + ((off symbol :offset-assert 56) + (near-off symbol :offset-assert 60) + (mid-off symbol :offset-assert 64) + (far-on symbol :offset-assert 68) (ocean-facing uint32 :offset-assert 72) (heights ocean-height-array :offset-assert 76) (heights2 ocean-height-array :offset-assert 80) (verts ocean-vert-array :offset-assert 84) - (ocean-near-translucent? basic :offset-assert 88) + (ocean-near-translucent? symbol :offset-assert 88) (deltas vector :inline :offset-assert 96) (map-min vector :inline :offset-assert 112) (map-max vector :inline :offset-assert 128) @@ -10568,7 +10568,7 @@ (mid-mask-ptrs pointer 36 :offset-assert 2240) (mid-camera-masks uint64 36 :offset-assert 2384) (trans-mask-ptrs pointer 64 :offset-assert 2672) - (trans-camera-masks uint32 16 :offset-assert 2928) + (trans-camera-masks ocean-trans-mask 16 :offset-assert 2928) (trans-temp-masks uint32 16 :offset-assert 2992) (sprite-tmpl dma-gif-packet :inline :offset-assert 3056) (sprite-tmpl2 dma-gif-packet :inline :offset-assert 3088) @@ -10610,8 +10610,8 @@ (xy2020 vector4w :inline :offset-assert 7920) (xy4040 vector4w :inline :offset-assert 7936) (xy8080 vector4w :inline :offset-assert 7952) - (cloud-alpha uint8 36 :offset-assert 7968) - (near-mask-indices uint16 16 :offset-assert 8004) + (cloud-alpha uint8 36 :offset-assert 7968) + (near-mask-indices uint16 16 :offset-assert 8004) (mid-minx uint8 :offset-assert 8036) (mid-maxx uint8 :offset-assert 8037) (mid-minz uint8 :offset-assert 8038) @@ -10624,8 +10624,8 @@ (temp-maxx uint8 :offset-assert 8045) (temp-minz uint8 :offset-assert 8046) (temp-maxz uint8 :offset-assert 8047) - (tex1 uint64 :offset-assert 8048) - (tex1-near uint64 :offset-assert 8056) + (tex1 gs-tex1 :offset-assert 8048) + (tex1-near gs-tex1 :offset-assert 8056) (corner00 float :offset-assert 8064) (corner01 float :offset-assert 8068) (corner10 float :offset-assert 8072) @@ -10648,87 +10648,90 @@ :size-assert #x206c :flag-assert #x5c0000206c (:methods - (ocean-method-11 (_type_ vector symbol) float 11) + (get-height (_type_ vector symbol) float 11) (draw! (_type_) none 12) (update-map (_type_) none 13) - (ocean-method-14 () none 14) - (ocean-method-15 () none 15) - (ocean-method-16 () none 16) - (ocean-method-17 () none 17) - (ocean-method-18 (_type_ object object) none 18) - (ocean-method-19 () none 19) - (ocean-method-20 () none 20) - (ocean-method-21 (_type_ float float) float 21) - (ocean-method-22 () none 22) - (ocean-method-23 () none 23) - (ocean-method-24 () none 24) - (ocean-method-25 () none 25) - (ocean-method-26 () none 26) - (ocean-method-27 () none 27) - (ocean-method-28 () none 28) - (ocean-method-29 () none 29) - (ocean-method-30 () none 30) - (ocean-method-31 () none 31) - (ocean-method-32 () none 32) - (ocean-method-33 () none 33) - (ocean-method-34 () none 34) - (ocean-method-35 () none 35) - (ocean-method-36 () none 36) - (ocean-method-37 () none 37) - (ocean-method-38 () none 38) - (ocean-method-39 () none 39) - (ocean-method-40 () none 40) - (ocean-method-41 () none 41) - (ocean-method-42 () none 42) - (ocean-method-43 () none 43) - (ocean-method-44 () none 44) - (ocean-method-45 () none 45) - (ocean-method-46 () none 46) - (ocean-method-47 () none 47) - (ocean-method-48 () none 48) - (ocean-method-49 () none 49) - (ocean-method-50 () none 50) - (ocean-method-51 () none 51) - (ocean-method-52 () none 52) - (ocean-method-53 () none 53) - (ocean-method-54 () none 54) - (ocean-method-55 () none 55) - (ocean-method-56 () none 56) - (ocean-method-57 () none 57) - (ocean-method-58 () none 58) - (ocean-method-59 () none 59) - (ocean-method-60 () none 60) - (ocean-method-61 () none 61) - (ocean-method-62 () none 62) - (ocean-method-63 () none 63) - (ocean-method-64 () none 64) - (ocean-method-65 () none 65) - (ocean-method-66 () none 66) - (ocean-method-67 () none 67) - (ocean-method-68 () none 68) - (ocean-method-69 () none 69) - (ocean-method-70 () none 70) - (ocean-method-71 () none 71) - (ocean-method-72 () none 72) - (ocean-method-73 () none 73) - (ocean-method-74 () none 74) - (ocean-method-75 () none 75) - (ocean-method-76 () none 76) - (ocean-method-77 () none 77) - (ocean-method-78 () none 78) - (ocean-method-79 () none 79) - (ocean-method-80 () none 80) - (ocean-method-81 () none 81) - (ocean-method-82 () none 82) - (ocean-method-83 () none 83) - (ocean-method-84 () none 84) - (ocean-method-85 () none 85) - (ocean-method-86 () none 86) - (ocean-method-87 () none 87) - (ocean-method-88 () none 88) - (ocean-method-89 () none 89) - (ocean-method-90 () none 90) - (ocean-method-91 () none 91) + (interp-wave (_type_ ocean-wave-info uint float) none 14) + (ocean-method-15 (_type_ matrix matrix) none 15) + (generate-verts () none 16) + (add-colors! (_type_ vector ocean-vertex) none 17) + (ocean-method-18 "Unused" (_type_ (pointer ocean-colors) (pointer ocean-colors)) none 18) ;; args are guesses + (init-buffer! + "Initialize [[ocean]] DMA buffer. + @returns Pointer to the next DMA buffer" + (_type_ dma-buffer) pointer 19) + (end-buffer! (_type_ dma-buffer) none 20) + (set-corners! (_type_ float float) float 21) + (ocean-near-add-call (_type_ dma-buffer int) none 22) ;; start ocean-near + (ocean-near-add-call-flush (_type_ dma-buffer int) none 23) + (ocean-near-setup-constants (_type_ ocean-near-constants) none 24) + (ocean-near-add-constants (_type_ dma-buffer) none 25) + (ocean-near-add-heights (_type_ dma-buffer) none 26) + (ocean-near-add-matrices (_type_ dma-buffer vector) none 27) + (ocean-near-add-upload (_type_ dma-buffer uint uint) none 28) + (draw-ocean-near (_type_ dma-buffer) none 29) ;; end ocean-near + (ocean-trans-camera-masks-bit? (_type_ uint uint) symbol 30) ;; start ocean-transition + (ocean-trans-mask-ptrs-bit? (_type_ int int) symbol 31) + (ocean-trans-mask-ptrs-set! (_type_ uint uint) symbol 32) + (ocean-trans-add-upload-table (_type_ dma-buffer uint uint int int symbol) none 33) + (ocean-trans-add-upload-strip (_type_ dma-buffer uint uint int int int) none 34) + (ocean-transition-check (_type_ ocean-trans-mask int int vector) none 35) + (ocean-make-trans-camera-masks (_type_ uint uint uint uint) none 36) + (ocean-trans-add-upload (_type_ dma-buffer uint uint) none 37) + (draw-ocean-transition-seams (_type_ dma-buffer) none 38) + (ocean-trans-add-constants (_type_ dma-buffer) none 39) + (draw-ocean-transition (_type_ dma-buffer) none 40) ;; end ocean-transition + (ocean-mid-add-call (_type_ dma-buffer int) none 41) ;; start ocean-mid + (ocean-mid-add-call-flush (_type_ dma-buffer uint) none 42) + (ocean-matrix*! (_type_ matrix matrix matrix) matrix 43) + (ocean-vector-matrix*! (_type_ vector vector matrix) vector 44) + (ocean-mid-add-matrices (_type_ dma-buffer vector) none 45) + (ocean-mid-check (_type_ pointer int int vector) symbol 46) + (ocean-mid-setup-constants (_type_ ocean-mid-constants) none 47) + (ocean-mid-add-constants (_type_ dma-buffer) none 48) + (ocean-mid-camera-masks-bit? (_type_ uint uint) symbol 49) + (ocean-mid-mask-ptrs-bit? (_type_ uint uint) symbol 50) + (ocean-mid-camera-masks-set! (_type_ uint uint) symbol 51) + (ocean-mid-add-upload (_type_ dma-buffer int int int int float) none 52) + (ocean-mid-add-upload-table (_type_ dma-buffer uint uint (pointer float) int symbol) none 53) + (ocean-mid-add-upload-top (_type_ dma-buffer uint uint) none 54) + (ocean-mid-add-upload-middle (_type_ dma-buffer uint uint) none 55) + (ocean-mid-add-upload-bottom (_type_ dma-buffer uint uint) none 56) + (ocean-seams-add-constants (_type_ dma-buffer) none 57) + (draw-ocean-mid-seams (_type_ dma-buffer) none 58) + (draw-ocean-mid (_type_ dma-buffer) none 59) ;; end ocean-mid + (ocean-method-60 (_type_ dma-buffer) none 60) ;; start ocean-far + (ocean-method-61 (_type_ dma-buffer) none 61) + (ocean-method-62 (_type_ dma-buffer) none 62) + (ocean-method-63 (_type_ dma-buffer) none 63) + (ocean-method-64 (_type_ dma-buffer) none 64) + (ocean-method-65 (_type_ dma-buffer) none 65) + (ocean-method-66 (_type_ dma-buffer) none 66) + (ocean-method-67 (_type_ dma-buffer) none 67) + (render-ocean-far (_type_ dma-buffer int) none 68) + (draw-ocean-far (_type_ dma-buffer) none 69) ;; end ocean-far + (ocean-texture-setup-constants (_type_ ocean-texture-constants) none 70) ;; start ocean-texture + (ocean-texture-add-constants (_type_ dma-buffer) none 71) + (ocean-texture-add-envmap (_type_ dma-buffer) none 72) + (ocean-texture-add-verts (_type_ dma-buffer int) none 73) + (ocean-texture-add-verts-last (_type_ dma-buffer int int) none 74) + (ocean-texture-add-call-start (_type_ dma-buffer) none 75) + (ocean-texture-add-call-rest (_type_ dma-buffer) none 76) + (ocean-texture-add-call-done (_type_ dma-buffer) none 77) + (draw-ocean-texture (_type_ dma-buffer int) none 78) + (ocean-method-79 (_type_ dma-buffer) none 79) + (ocean-method-80 (_type_ (pointer rgba)) none 80) + (ocean-method-81 (_type_ dma-buffer) none 81) + (draw-envmap-debug (_type_ dma-buffer) none 82) + (ocean-method-83 (_type_ dma-buffer float) none 83) + (ocean-method-84 (_type_ dma-buffer sky-upload-data vector4w float) none 84) + (ocean-method-85 (_type_ dma-buffer) none 85) + (ocean-method-86 (_type_ vector vector vector vector) none 86) + (ocean-method-87 (_type_ vector vector vector) none 87) + (ocean-method-88 (_type_ dma-buffer) none 88) + (ocean-method-89 (_type_ dma-buffer) none 89) ;; end ocean-texture + (rgba-to-vector! "Pack an [[rgba]]'s bytes into a vector." (_type_ vector (pointer rgba)) none 90) + (do-tex-scroll! (_type_) none 91) ) ) @@ -30366,9 +30369,9 @@ ;; ocean ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern init-ocean-far-regs function) ;; (function none) -;; (define-extern draw-large-polygon-ocean function) ;; (function none) -;; (define-extern render-ocean-quad function) ;; (function (inline-array ocean-vertex) dma-buffer symbol) +(define-extern init-ocean-far-regs (function none)) +(define-extern draw-large-polygon-ocean (function none)) +(define-extern render-ocean-quad (function (inline-array ocean-vertex) dma-buffer symbol)) ;; (define-extern test-seq-read function) ;; (define-extern test-worst-read function) ;; (define-extern test-seq-write function) @@ -30381,24 +30384,24 @@ ;; ocean-vu0 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern ocean-vu0-block object) ;; vu-function +(define-extern ocean-vu0-block vu-function) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ocean-texture ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern ocean-texture-vu1-block object) ;; vu-function -;; (define-extern check-normals function) -;; (define-extern generate-cloud-verts function) -;; (define-extern generate-cloud-nrms function) -;; (define-extern set-ocean-lk function) -;; (define-extern set-ocean-normal-scale function) +(define-extern ocean-texture-vu1-block vu-function) +(define-extern check-normals (function symbol)) +(define-extern generate-cloud-verts (function int float symbol)) +(define-extern generate-cloud-nrms (function int float symbol)) +(define-extern set-ocean-lk (function int int none)) +(define-extern set-ocean-normal-scale (function float vector)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ocean-mid ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern ocean-mid-block object) ;; vu-function +(define-extern ocean-mid-block vu-function) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ocean-transition ;; @@ -30409,7 +30412,7 @@ ;; ocean-near ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern ocean-near-block object) ;; vu-function +(define-extern ocean-near-block vu-function) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; minimap ;; diff --git a/decompiler/config/jak2/hacks.jsonc b/decompiler/config/jak2/hacks.jsonc index 2e3a2c0a04..987a27b2d9 100644 --- a/decompiler/config/jak2/hacks.jsonc +++ b/decompiler/config/jak2/hacks.jsonc @@ -137,6 +137,13 @@ "(anon-function 4 gun-states)", "(anon-function 28 grenadier)", "(anon-function 24 grenadier)", + "test-to-from-spr", + "test-from-spr", + "test-to-spr", + "test-seq-read", + "test-worst-read", + "test-seq-write", + "test-worst-write", // texture "adgif-shader<-texture!" ], @@ -444,9 +451,13 @@ "(method 9 edge-grab-info)", "(method 16 collide-edge-work)", "(method 17 collide-edge-work)", - "(method 18 collide-edge-work)" - - + "(method 18 collide-edge-work)", + "draw-large-polygon-ocean", + "render-ocean-quad", + "init-ocean-far-regs", + "(method 14 ocean)", + "(method 15 ocean)", + "(method 16 ocean)" ], "mips2c_jump_table_functions": {}, diff --git a/decompiler/config/jak2/label_types.jsonc b/decompiler/config/jak2/label_types.jsonc index 984f50a10c..c2a563d4a6 100644 --- a/decompiler/config/jak2/label_types.jsonc +++ b/decompiler/config/jak2/label_types.jsonc @@ -485,5 +485,9 @@ ["L1158", "vector"], ["L1222", "uint64", true], ["L1223", "uint64", true] + ], + "ocean-texture": [ + ["L55", "vector4w"], + ["L56", "vector"] ] } diff --git a/decompiler/config/jak2/stack_structures.jsonc b/decompiler/config/jak2/stack_structures.jsonc index b4c1177835..7292ea7152 100644 --- a/decompiler/config/jak2/stack_structures.jsonc +++ b/decompiler/config/jak2/stack_structures.jsonc @@ -1123,5 +1123,40 @@ [16, "vector"] ], "(method 13 collide-edge-work)": [[16, "faei-stack-vars"]], - "(method 9 collide-edge-edge)": [[16, "matrix"], [80, ["inline-array", "sphere", 6]]] + "(method 9 collide-edge-edge)": [[16, "matrix"], [80, ["inline-array", "sphere", 6]]], + "(method 12 ocean)": [[16, "vector"]], + "(method 18 ocean)": [ + [16, "vector"], + [32, "vector4"], + [48, "vector"] + ], + "(method 28 ocean)": [[16, "vector"]], + "(method 33 ocean)": [[16, "vector"]], + "(method 34 ocean)": [[16, "vector"]], + "(method 35 ocean)": [[16, "vector"]], + "(method 36 ocean)": [ + [16, "vector"], + [32, "vector"] + ], + "(method 46 ocean)": [[16, "vector"]], + "(method 59 ocean)": [[16, "vector"]], + "(method 60 ocean)": [ + [16, "vector"], + [32, "vector"] + ], + "(method 61 ocean)": [ + [16, "vector"], + [32, "vector"] + ], + "(method 62 ocean)": [ + [16, "vector"], + [32, "vector"] + ], + "(method 63 ocean)": [ + [16, "vector"], + [32, "vector"] + ], + "(method 67 ocean)": [[16, "vector"]], + // placeholder + "placeholder-do-not-add-below": [] } diff --git a/decompiler/config/jak2/type_casts.jsonc b/decompiler/config/jak2/type_casts.jsonc index e117df4bfe..8a9b9f6c22 100644 --- a/decompiler/config/jak2/type_casts.jsonc +++ b/decompiler/config/jak2/type_casts.jsonc @@ -4111,5 +4111,448 @@ ], "(method 9 collide-edge-edge)": [ [20, "a0", "collide-shape-moving"] - ] + ], + "(method 13 ocean)": [ + [248, "v1", "dma-packet"], + [249, "v1", "dma-packet"], + [250, "v1", "dma-packet"], + [318, "v1", "dma-packet"], + [319, "v1", "dma-packet"], + [320, "v1", "dma-packet"] + ], + "(method 19 ocean)": [ + [[2, 8], "a0", "dma-packet"], + [[11, 17], "a0", "gs-gif-tag"], + [22, "s4", "(pointer gs-test)"], + [24, "s4", "(pointer gs-reg64)"], + [26, "s4", "(pointer gs-alpha)"], + [28, "s4", "(pointer gs-reg64)"], + [41, "s4", "(pointer gs-tex0)"], + [43, "s4", "(pointer gs-reg64)"], + [45, "s4", "(pointer gs-tex1)"], + [47, "s4", "(pointer gs-reg64)"], + [49, "s4", "(pointer gs-texa)"], + [51, "s4", "(pointer gs-reg64)"], + [53, "s4", "(pointer gs-miptbp)"], + [55, "s4", "(pointer gs-reg64)"], + [57, "s4", "(pointer gs-miptbp)"], + [59, "s4", "(pointer gs-reg64)"], + [60, "s4", "(pointer gs-clamp)"], + [62, "s4", "(pointer gs-reg64)"], + [64, "s4", "(pointer gs-fogcol)"], + [66, "s4", "(pointer gs-reg64)"] + ], + "(method 20 ocean)": [ + [[3, 7], "a0", "dma-packet"], + [[13, 16], "a0", "gs-gif-tag"], + [22, "a0", "(pointer gs-texa)"], + [24, "a0", "(pointer gs-reg64)"] + ], + "(method 22 ocean)": [[[3, 11], "a0", "dma-packet"]], + "(method 23 ocean)": [[[3, 11], "a0", "dma-packet"]], + "(method 25 ocean)": [[[8, 16], "a1", "dma-packet"]], + "(method 26 ocean)": [ + [[11, 19], "a3", "dma-packet"], + [[30, 38], "a2", "dma-packet"] + ], + "(method 27 ocean)": [ + [[19, 27], "a0", "dma-packet"], + [30, "s3", "matrix"], + [[49, 54], "s2", "vector"] + ], + "(method 28 ocean)": [ + [[43, 51], "a0", "dma-packet"], + [66, "a2", "(pointer int16)"], + [[81, 89], "a1", "vector4w"], + [[90, 98], "v1", "vector4w"], + [[111, 127], "t0", "vector4w"], + [[130, 268], "a1", "(inline-array vector4w)"] + ], + "(method 29 ocean)": [ + [[5, 9], "a0", "dma-packet"], + [[15, 18], "a0", "gs-gif-tag"], + [23, "a0", "(pointer gs-test)"], + [25, "a0", "(pointer gs-reg64)"], + [[36, 41], "a0", "dma-packet"], + [91, "a1", "(pointer int16)"] + ], + "(method 30 ocean)": [[29, "a0", "(pointer uint8)"]], + "(method 31 ocean)": [[32, "a0", "(pointer int32)"]], + "(method 32 ocean)": [ + [31, "t0", "(pointer int32)"], + [47, "a2", "(pointer uint8)"], + [55, "v1", "(pointer int8)"] + ], + "(method 33 ocean)": [ + [[52, 60], "a0", "dma-packet"], + [[63, 67], "v1", "vector4w"], + [[93, 232], "v1", "(inline-array vector4w)"], + [[245, 253], "a0", "dma-packet"] + ], + "(method 34 ocean)": [ + [[44, 52], "a0", "dma-packet"], + [[61, 65], "v1", "vector4w"], + [[68, 147], "v1", "(inline-array vector4w)"], + [[166, 174], "a0", "dma-packet"] + ], + "(method 36 ocean)": [["_stack_", 48, "ocean-trans-mask"]], + "(method 38 ocean)": [ + [104, "a1", "(pointer int32)"], + [108, "a3", "(pointer uint8)"], + [110, "a1", "(pointer int32)"] + ], + "(method 39 ocean)": [ + [[7, 15], "a0", "dma-packet"], + [[17, 51], "v1", "matrix"] + ], + "(method 40 ocean)": [["_stack_", 40, "ocean-trans-mask"]], + "(method 41 ocean)": [[[3, 11], "a0", "dma-packet"]], + "(method 42 ocean)": [[[3, 11], "a0", "dma-packet"]], + "(method 45 ocean)": [ + [[19, 27], "a1", "dma-packet"], + [30, "s3", "matrix"], + [[47, 52], "s2", "vector"] + ], + "(method 48 ocean)": [[[8, 16], "a1", "dma-packet"]], + "(method 49 ocean)": [[24, "a0", "(pointer uint8)"]], + "(method 51 ocean)": [ + [39, "a0", "(pointer uint8)"], + [47, "v1", "(pointer uint8)"] + ], + "(method 52 ocean)": [ + [[54, 68], "a2", "dma-packet"], + [[82, 87], "a0", "dma-packet"], + [99, "v1", "(pointer uint64)"] + ], + "(method 53 ocean)": [ + [[52, 60], "a0", "dma-packet"], + [[62, 67], "v1", "vector4w"], + [[70, 149], "v1", "(inline-array vector4w)"], + [[162, 170], "a0", "dma-packet"] + ], + "(method 57 ocean)": [ + [[7, 15], "a0", "dma-packet"], + [[18, 28], "a0", "vector"], + [[28, 39], "a0", "vector"], + [[39, 50], "a0", "vector"], + [[51, 62], "v1", "vector"] + ], + "(method 59 ocean)": [ + [[22, 27], "a0", "dma-packet"], + [195, "t3", "(pointer uint8)"] + ], + "(method 60 ocean)": [[[3, 191], "s4", "(inline-array ocean-vertex)"]], + "(method 61 ocean)": [[[3, 194], "s4", "(inline-array ocean-vertex)"]], + "(method 62 ocean)": [[[3, 193], "s4", "(inline-array ocean-vertex)"]], + "(method 63 ocean)": [[[3, 200], "s4", "(inline-array ocean-vertex)"]], + "(method 64 ocean)": [[[3, 228], "s5", "(inline-array ocean-vertex)"]], + "(method 65 ocean)": [[[3, 234], "s5", "(inline-array ocean-vertex)"]], + "(method 66 ocean)": [[[3, 234], "s4", "(inline-array ocean-vertex)"]], + "(method 67 ocean)": [[[3, 240], "s4", "(inline-array ocean-vertex)"]], + "(method 68 ocean)": [[[4, 179], "s3", "(inline-array ocean-vertex)"]], + "(method 69 ocean)": [[[59, 66], "gp", "dma-packet"]], + "(method 71 ocean)": [[[8, 16], "a1", "dma-packet"]], + "(method 72 ocean)": [[[2, 6], "v1", "(inline-array vector4w)"]], + "(method 73 ocean)": [[[6, 11], "a0", "dma-packet"]], + "(method 74 ocean)": [ + [[6, 11], "a0", "dma-packet"], + [[19, 24], "a0", "dma-packet"] + ], + "(method 75 ocean)": [[[3, 8], "a0", "dma-packet"]], + "(method 76 ocean)": [[[3, 8], "a0", "dma-packet"]], + "(method 77 ocean)": [[[3, 8], "a0", "dma-packet"]], + "(method 78 ocean)": [ + [[20, 24], "a0", "dma-packet"], + [[27, 33], "a0", "gs-gif-tag"], + [38, "a0", "(pointer gs-test)"], + [40, "a0", "(pointer gs-reg64)"], + [42, "a0", "(pointer gs-alpha)"], + [44, "a0", "(pointer gs-reg64)"], + [45, "a0", "(pointer gs-tex1)"], + [47, "a0", "(pointer gs-reg64)"], + [[58, 63], "a0", "dma-packet"] + ], + "(method 79 ocean)": [ + [[13, 17], "a0", "dma-packet"], + [[23, 26], "a0", "gs-gif-tag"], + [31, "s3", "(pointer gs-test)"], + [33, "s3", "(pointer gs-reg64)"], + [35, "s3", "(pointer gs-alpha)"], + [37, "s3", "(pointer gs-reg64)"], + [51, "s3", "(pointer gs-tex0)"], + [53, "s3", "(pointer gs-reg64)"], + [55, "s3", "(pointer gs-tex1)"], + [57, "s3", "(pointer gs-reg64)"], + [58, "s3", "(pointer gs-clamp)"], + [60, "s3", "(pointer gs-reg64)"], + [61, "s3", "(pointer uint64)"], + [63, "s3", "(pointer gs-reg64)"], + [[66, 81], "v1", "(inline-array vector4w)"], + [[95, 99], "a0", "dma-packet"], + [[105, 108], "a0", "gs-gif-tag"], + [125, "s3", "(pointer gs-tex0)"], + [127, "s3", "(pointer gs-reg64)"], + [128, "s3", "(pointer uint64)"], + [130, "s3", "(pointer gs-reg64)"], + [[133, 148], "v1", "(inline-array vector4w)"], + [[162, 166], "a0", "dma-packet"], + [[172, 175], "a0", "gs-gif-tag"], + [192, "s3", "(pointer gs-tex0)"], + [194, "s3", "(pointer gs-reg64)"], + [195, "s3", "(pointer uint64)"], + [197, "s3", "(pointer gs-reg64)"], + [[200, 215], "v1", "(inline-array vector4w)"], + [[229, 233], "a0", "dma-packet"], + [[239, 242], "a0", "gs-gif-tag"], + [259, "s3", "(pointer gs-tex0)"], + [261, "s3", "(pointer gs-reg64)"], + [262, "s3", "(pointer uint64)"], + [264, "s3", "(pointer gs-reg64)"], + [[267, 282], "v1", "(inline-array vector4w)"], + [[296, 300], "a0", "dma-packet"], + [[306, 309], "a0", "gs-gif-tag"], + [326, "s3", "(pointer gs-tex0)"], + [328, "s3", "(pointer gs-reg64)"], + [329, "s3", "(pointer uint64)"], + [331, "s3", "(pointer gs-reg64)"], + [[333, 349], "v1", "(inline-array vector4w)"], + [[360, 373], "v1", "(inline-array vector4w)"] + ], + "(method 81 ocean)": [ + [[13, 17], "a0", "dma-packet"], + [[23, 26], "a0", "gs-gif-tag"], + [31, "s3", "(pointer gs-test)"], + [33, "s3", "(pointer gs-reg64)"], + [35, "s3", "(pointer gs-alpha)"], + [37, "s3", "(pointer gs-reg64)"], + [51, "s3", "(pointer gs-tex0)"], + [53, "s3", "(pointer gs-reg64)"], + [55, "s3", "(pointer gs-tex1)"], + [57, "s3", "(pointer gs-reg64)"], + [58, "s3", "(pointer gs-clamp)"], + [60, "s3", "(pointer gs-reg64)"], + [61, "s3", "(pointer uint64)"], + [63, "s3", "(pointer gs-reg64)"], + [[66, 81], "v1", "(inline-array vector4w)"], + [[87, 91], "a0", "dma-packet"], + [[97, 100], "a0", "gs-gif-tag"], + [106, "a0", "(pointer gs-bitbltbuf)"], + [108, "a0", "(pointer gs-reg64)"], + [109, "a0", "(pointer gs-trxpos)"], + [111, "a0", "(pointer gs-reg64)"], + [113, "a0", "(pointer gs-trxreg)"], + [115, "a0", "(pointer gs-reg64)"], + [116, "a0", "(pointer gs-trxdir)"], + [118, "a0", "(pointer gs-reg64)"], + [[121, 126], "v1", "(inline-array vector4w)"], + [[146, 150], "a0", "dma-packet"], + [[156, 159], "a0", "gs-gif-tag"], + [163, "s3", "(pointer gs-alpha)"], + [165, "s3", "(pointer gs-reg64)"], + [179, "s3", "(pointer gs-tex0)"], + [181, "s3", "(pointer gs-reg64)"], + [182, "s3", "(pointer gs-tex1)"], + [184, "s3", "(pointer gs-reg64)"], + [185, "s3", "(pointer gs-clamp)"], + [187, "s3", "(pointer gs-reg64)"], + [188, "s3", "(pointer uint64)"], + [190, "s3", "(pointer gs-reg64)"], + [[193, 215], "v1", "(inline-array vector4w)"], + [[221, 225], "a0", "dma-packet"], + [[231, 234], "a0", "gs-gif-tag"], + [239, "a0", "(pointer gs-alpha)"], + [241, "a0", "(pointer gs-reg64)"], + [243, "a0", "(pointer gs-tex1)"], + [245, "a0", "(pointer gs-reg64)"], + [246, "a0", "(pointer uint64)"], + [248, "a0", "(pointer gs-reg64)"], + [[251, 273], "v1", "(inline-array vector4w)"], + [[287, 291], "a0", "dma-packet"], + [[297, 300], "a0", "gs-gif-tag"], + [305, "s3", "(pointer gs-alpha)"], + [307, "s3", "(pointer gs-reg64)"], + [320, "s3", "(pointer gs-tex0)"], + [322, "s3", "(pointer gs-reg64)"], + [324, "s3", "(pointer gs-tex1)"], + [326, "s3", "(pointer gs-reg64)"], + [327, "s3", "(pointer uint64)"], + [329, "s3", "(pointer gs-reg64)"], + [[332, 354], "v1", "(inline-array vector4w)"], + [[376, 381], "a3", "dma-packet"], + [[387, 390], "a3", "gs-gif-tag"], + [394, "a3", "(pointer gs-xy-offset)"], + [396, "a3", "(pointer gs-reg64)"], + [406, "a3", "(pointer gs-frame)"], + [408, "a3", "(pointer gs-reg64)"], + [416, "a3", "(pointer gs-scissor)"], + [418, "a3", "(pointer gs-reg64)"], + [420, "a3", "(pointer gs-test)"], + [422, "a3", "(pointer gs-reg64)"], + [424, "a3", "(pointer gs-alpha)"], + [426, "a3", "(pointer gs-reg64)"], + [440, "a3", "(pointer gs-tex0)"], + [442, "a3", "(pointer gs-reg64)"], + [443, "a3", "(pointer uint64)"], + [445, "a3", "(pointer gs-reg64)"], + [448, "a3", "(pointer gs-texa)"], + [450, "a3", "(pointer gs-reg64)"], + [452, "a3", "(pointer gs-tex1)"], + [454, "a3", "(pointer gs-reg64)"], + [455, "a3", "(pointer uint64)"], + [457, "a3", "(pointer gs-reg64)"], + [459, "a3", "(pointer gs-prim)"], + [460, "a3", "(pointer gs-reg64)"], + [[469, 473], "t1", "dma-packet"], + [[479, 482], "t1", "gs-gif-tag"], + [492, "t1", "(pointer gs-xyz)"], + [494, "t1", "(pointer gs-reg64)"], + [499, "t1", "(pointer gs-xyz)"], + [501, "t1", "(pointer gs-reg64)"], + [511, "t1", "(pointer gs-xyz)"], + [513, "t1", "(pointer gs-reg64)"], + [522, "t1", "(pointer gs-xyz)"], + [524, "t1", "(pointer gs-reg64)"], + [[536, 540], "a3", "dma-packet"], + [[546, 549], "a3", "gs-gif-tag"], + [563, "a3", "(pointer gs-frame)"], + [565, "a3", "(pointer gs-reg64)"], + [581, "a3", "(pointer gs-tex0)"], + [583, "a3", "(pointer gs-reg64)"], + [585, "a3", "(pointer gs-prim)"], + [586, "a3", "(pointer gs-reg64)"], + [[594, 598], "a1", "dma-packet"], + [[604, 607], "a1", "gs-gif-tag"], + [617, "a1", "(pointer gs-xyz)"], + [619, "a1", "(pointer gs-reg64)"], + [624, "a1", "(pointer gs-xyz)"], + [626, "a1", "(pointer gs-reg64)"], + [636, "a1", "(pointer gs-xyz)"], + [638, "a1", "(pointer gs-reg64)"], + [647, "a1", "(pointer gs-xyz)"], + [649, "a1", "(pointer gs-reg64)"] + ], + "(method 82 ocean)": [ + [[10, 14], "a0", "dma-packet"], + [[20, 23], "a0", "gs-gif-tag"], + [28, "s3", "(pointer gs-test)"], + [30, "s3", "(pointer gs-reg64)"], + [32, "s3", "(pointer gs-alpha)"], + [34, "s3", "(pointer gs-reg64)"], + [54, "s3", "(pointer gs-tex0)"], + [56, "s3", "(pointer gs-reg64)"], + [58, "s3", "(pointer gs-tex1)"], + [60, "s3", "(pointer gs-reg64)"], + [62, "s3", "(pointer gs-clamp)"], + [64, "s3", "(pointer gs-reg64)"], + [65, "s3", "(pointer uint64)"], + [67, "s3", "(pointer gs-reg64)"], + [[70, 90], "v1", "(inline-array vector4w)"], + [[103, 107], "a0", "dma-packet"], + [[113, 116], "a0", "gs-gif-tag"], + [121, "s3", "(pointer gs-test)"], + [123, "s3", "(pointer gs-reg64)"], + [124, "s3", "(pointer gs-alpha)"], + [126, "s3", "(pointer gs-reg64)"], + [144, "s3", "(pointer gs-tex0)"], + [146, "s3", "(pointer gs-reg64)"], + [147, "s3", "(pointer gs-tex1)"], + [149, "s3", "(pointer gs-reg64)"], + [151, "s3", "(pointer gs-clamp)"], + [153, "s3", "(pointer gs-reg64)"], + [154, "s3", "(pointer uint64)"], + [156, "s3", "(pointer gs-reg64)"], + [[159, 179], "v1", "(inline-array vector4w)"] + ], + "(method 83 ocean)": [ + [[13, 17], "a0", "dma-packet"], + [[23, 26], "a0", "gs-gif-tag"], + [31, "s1", "(pointer gs-alpha)"], + [33, "s1", "(pointer gs-reg64)"], + [53, "s1", "(pointer gs-tex0)"], + [55, "s1", "(pointer gs-reg64)"], + [57, "s1", "(pointer gs-clamp)"], + [59, "s1", "(pointer gs-reg64)"], + [60, "s1", "(pointer uint64)"], + [62, "s1", "(pointer gs-reg64)"], + [69, "v1", "(pointer uint128)"], + [[97, 115], "s1", "(inline-array vector4w)"] + ], + "(method 84 ocean)": [[[66, 92], "t1", "(inline-array vector4w)"]], + "(method 85 ocean)": [ + [[5, 9], "a0", "dma-packet"], + [[15, 18], "a0", "gs-gif-tag"], + [23, "a0", "(pointer gs-alpha)"], + [25, "a0", "(pointer gs-reg64)"], + [32, "v1", "(pointer uint128)"], + [[89, 118], "s0", "(inline-array vector4w)"], + [[128, 137], "s4", "(pointer uint128)"], + [[128, 137], "v1", "(pointer uint128)"] + ], + "(method 88 ocean)": [ + [[5, 9], "a0", "dma-packet"], + [[15, 18], "a0", "gs-gif-tag"], + [23, "s3", "(pointer gs-test)"], + [25, "s3", "(pointer gs-reg64)"], + [39, "s3", "(pointer gs-tex0)"], + [41, "s3", "(pointer gs-reg64)"], + [43, "s3", "(pointer gs-tex1)"], + [45, "s3", "(pointer gs-reg64)"], + [46, "s3", "(pointer gs-clamp)"], + [48, "s3", "(pointer gs-reg64)"], + [50, "s3", "(pointer gs-alpha)"], + [52, "s3", "(pointer gs-reg64)"], + [53, "s3", "(pointer uint64)"], + [55, "s3", "(pointer gs-reg64)"], + [[227, 232], "a0", "(inline-array vector4w)"], + [[244, 270], "a1", "(inline-array vector4w)"], + [[282, 288], "a0", "(inline-array vector4w)"], + [[299, 324], "a1", "(inline-array vector4w)"] + ], + "(method 89 ocean)": [ + [[39, 43], "a0", "dma-packet"], + [[49, 52], "a0", "gs-gif-tag"], + [57, "a0", "(pointer gs-test)"], + [59, "a0", "(pointer gs-reg64)"], + [61, "a0", "(pointer gs-alpha)"], + [63, "a0", "(pointer gs-reg64)"], + [64, "a0", "(pointer uint64)"], + [66, "a0", "(pointer gs-reg64)"], + [[69, 87], "v1", "(inline-array vector4w)"], + [[88, 93], "a0", "(inline-array vector4w)"], + [[93, 101], "v1", "(inline-array vector4w)"], + [[107, 111], "a0", "dma-packet"], + [[117, 120], "a0", "gs-gif-tag"], + [125, "a0", "(pointer gs-xy-offset)"], + [127, "a0", "(pointer gs-reg64)"], + [130, "a0", "(pointer gs-texa)"], + [132, "a0", "(pointer gs-reg64)"], + [133, "a0", "(pointer uint64)"], + [135, "a0", "(pointer gs-reg64)"], + [[138, 144], "v1", "adgif-shader"], + [[234, 240], "v1", "adgif-shader"], + [[295, 299], "a0", "dma-packet"], + [[305, 308], "a0", "gs-gif-tag"], + [313, "s3", "(pointer gs-alpha)"], + [315, "s3", "(pointer gs-reg64)"], + [334, "s3", "(pointer gs-tex0)"], + [336, "s3", "(pointer gs-reg64)"], + [338, "s3", "(pointer gs-tex1)"], + [340, "s3", "(pointer gs-reg64)"], + [342, "s3", "(pointer gs-clamp)"], + [344, "s3", "(pointer gs-reg64)"], + [346, "s3", "(pointer gs-rgbaq)"], + [348, "s3", "(pointer gs-reg64)"], + [349, "s3", "(pointer uint64)"], + [351, "s3", "(pointer gs-reg64)"], + [[357, 361], "a0", "dma-packet"], + [[367, 370], "a0", "gs-gif-tag"], + [374, "a0", "(pointer gs-tex1)"], + [376, "a0", "(pointer gs-reg64)"], + [377, "a0", "(pointer uint64)"], + [379, "a0", "(pointer gs-reg64)"], + [[382, 421], "v1", "(inline-array vector4w)"] + ], + "(method 90 ocean)": [[0, "a2", "(pointer int32)"]], + // placeholder + "placeholder-do-not-add-below": [] } diff --git a/decompiler/config/jak2/var_names.jsonc b/decompiler/config/jak2/var_names.jsonc index bcc16c3989..c787761a92 100644 --- a/decompiler/config/jak2/var_names.jsonc +++ b/decompiler/config/jak2/var_names.jsonc @@ -2093,5 +2093,54 @@ "vars": { "v0-0":["entry", "touching-shapes-entry"] } + }, + "(method 68 ocean)": { + "vars": { + "s3-0": "vertices" + }, + "args": ["obj", "arg1", "facing"] + }, + "(method 67 ocean)": { + "vars": { + "s4-0": "vertices" + } + }, + "(method 66 ocean)": { + "vars": { + "s4-0": "vertices" + } + }, + "(method 65 ocean)": { + "vars": { + "s5-0": "vertices" + } + }, + "(method 64 ocean)": { + "vars": { + "s5-0": "vertices" + } + }, + "(method 63 ocean)": { + "vars": { + "s4-0": "vertices" + } + }, + "(method 62 ocean)": { + "vars": { + "s4-0": "vertices" + } + }, + "(method 61 ocean)": { + "vars": { + "s4-0": "vertices" + } + }, + "(method 60 ocean)": { + "vars": { + "s4-0": "vertices" + } + }, + "(method 21 ocean)": { + "args": ["obj", "corner-x", "corner-z"] } } diff --git a/game/CMakeLists.txt b/game/CMakeLists.txt index 3d0f628963..8e293798e5 100644 --- a/game/CMakeLists.txt +++ b/game/CMakeLists.txt @@ -93,6 +93,8 @@ set(RUNTIME_SOURCE mips2c/jak2_functions/sparticle.cpp mips2c/jak2_functions/sparticle_launcher.cpp mips2c/jak2_functions/texture.cpp + mips2c/jak2_functions/ocean.cpp + mips2c/jak2_functions/ocean_vu0.cpp overlord/dma.cpp overlord/fake_iso.cpp overlord/iso.cpp diff --git a/game/mips2c/jak2_functions/ocean.cpp b/game/mips2c/jak2_functions/ocean.cpp new file mode 100644 index 0000000000..09fcf55c7c --- /dev/null +++ b/game/mips2c/jak2_functions/ocean.cpp @@ -0,0 +1,383 @@ +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak2/kscheme.h" +using ::jak2::intern_from_c; +namespace Mips2C::jak2 { +ExecutionContext ocean_regs_vfs; + +namespace init_ocean_far_regs { +struct Cache { + void* math_camera; // *math-camera* + void* sky_work; // *sky-work* + void* time_of_day_context; // *time-of-day-context* +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + c->load_symbol2(v1, cache.math_camera); // lw v1, *math-camera*(s7) + c->load_symbol2(a0, cache.sky_work); // lw a0, *sky-work*(s7) + c->daddiu(a0, a0, 1008); // daddiu a0, a0, 1008 + c->lwc1(f0, 908, v1); // lwc1 f0, 908(v1) + c->swc1(f0, 0, a0); // swc1 f0, 0(a0) + c->lwc1(f0, 128, v1); // lwc1 f0, 128(v1) + c->swc1(f0, 4, a0); // swc1 f0, 4(a0) + c->lwc1(f0, 124, v1); // lwc1 f0, 124(v1) + c->swc1(f0, 8, a0); // swc1 f0, 8(a0) + c->lui(a1, 17727); // lui a1, 17727 + c->ori(a1, a1, 61440); // ori a1, a1, 61440 + c->mtc1(f0, a1); // mtc1 f0, a1 + c->swc1(f0, 12, a0); // swc1 f0, 12(a0) + c->load_symbol2(a0, cache.time_of_day_context); // lw a0, *time-of-day-context*(s7) + c->lwu(a0, 2060, a0); // lwu a0, 2060(a0) + bc = c->sgpr64(s7) == c->sgpr64(a0); // beq s7, a0, L126 + // nop // sll r0, r0, 0 + if (bc) {goto block_2;} // branch non-likely + + c->lqc2(vf31, 1228, v1); // lqc2 vf31, 1228(v1) + c->lqc2(vf30, 1244, v1); // lqc2 vf30, 1244(v1) + c->lqc2(vf29, 1260, v1); // lqc2 vf29, 1260(v1) + c->lqc2(vf28, 1276, v1); // lqc2 vf28, 1276(v1) + c->mov128_gpr_vf(a0, vf28); // qmfc2.i a0, vf28 + //beq r0, r0, L127 // beq r0, r0, L127 + // nop // sll r0, r0, 0 + goto block_3; // branch always + + +block_2: + c->lqc2(vf31, 572, v1); // lqc2 vf31, 572(v1) + c->lqc2(vf30, 588, v1); // lqc2 vf30, 588(v1) + c->lqc2(vf29, 604, v1); // lqc2 vf29, 604(v1) + c->lqc2(vf28, 620, v1); // lqc2 vf28, 620(v1) + c->mov128_gpr_vf(a0, vf28); // qmfc2.i a0, vf28 + +block_3: + c->lqc2(vf26, 796, v1); // lqc2 vf26, 796(v1) + c->lqc2(vf14, 780, v1); // lqc2 vf14, 780(v1) + c->lqc2(vf25, 812, v1); // lqc2 vf25, 812(v1) + c->load_symbol2(v1, cache.sky_work); // lw v1, *sky-work*(s7) + c->lqc2(vf13, 1008, v1); // lqc2 vf13, 1008(v1) + c->load_symbol2(v1, cache.sky_work); // lw v1, *sky-work*(s7) + c->lqc2(vf27, 992, v1); // lqc2 vf27, 992(v1) + c->mov128_gpr_vf(v1, vf27); // qmfc2.i v1, vf27 + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + //jr ra // jr ra + c->daddu(sp, sp, r0); // daddu sp, sp, r0 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + ocean_regs_vfs.copy_vfs_from_other(c); + return c->gprs[v0].du64[0]; +} + +void link() { + cache.math_camera = intern_from_c("*math-camera*").c(); + cache.sky_work = intern_from_c("*sky-work*").c(); + cache.time_of_day_context = intern_from_c("*time-of-day-context*").c(); + gLinkedFunctionTable.reg("init-ocean-far-regs", execute, 128); +} + +} // namespace init_ocean_far_regs +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak2/kscheme.h" +#include "game/mips2c/jak2_functions/sky.h" +using ::jak2::intern_from_c; +namespace Mips2C::jak2 { +namespace draw_large_polygon_ocean { +struct Cache { + void* clip_polygon_against_negative_hyperplane; // clip-polygon-against-negative-hyperplane + void* clip_polygon_against_positive_hyperplane; // clip-polygon-against-positive-hyperplane +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + // nop // sll r0, r0, 0 + c->daddiu(sp, sp, -8); // daddiu sp, sp, -8 + c->mov64(t6, s7); // or t6, s7, r0 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->load_symbol2(t9, cache.clip_polygon_against_positive_hyperplane);// lw t9, clip-polygon-against-positive-hyperplane(s7) + c->mov64(a2, t4); // or a2, t4, r0 + c->mov64(a3, t5); // or a3, t5, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->daddu(t2, a2, r0); // daddu t2, a2, r0 + //c->jalr(call_addr); // jalr ra, t9 + clip_polygon_against_positive_hyperplane::execute(ctxt); + bc = c->sgpr64(t0) == 0; // beq t0, r0, L124 + // nop // sll r0, r0, 0 + if (bc) {goto block_11;} // branch non-likely + + c->mov64(a2, t5); // or a2, t5, r0 + c->mov64(a3, t4); // or a3, t4, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->daddiu(t2, a2, 4); // daddiu t2, a2, 4 + c->jalr(call_addr); // jalr ra, t9 + bc = c->sgpr64(t0) == 0; // beq t0, r0, L124 + c->load_symbol2(t9, cache.clip_polygon_against_negative_hyperplane);// lw t9, clip-polygon-against-negative-hyperplane(s7) + if (bc) {goto block_11;} // branch non-likely + + c->mov64(a2, t4); // or a2, t4, r0 + c->mov64(a3, t5); // or a3, t5, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->daddu(t2, a2, r0); // daddu t2, a2, r0 + //c->jalr(call_addr); // jalr ra, t9 + clip_polygon_against_positive_hyperplane::execute(ctxt); + bc = c->sgpr64(t0) == 0; // beq t0, r0, L124 + // nop // sll r0, r0, 0 + if (bc) {goto block_11;} // branch non-likely + + c->mov64(a2, t5); // or a2, t5, r0 + c->mov64(a3, t4); // or a3, t4, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->daddiu(t2, a2, 4); // daddiu t2, a2, 4 + c->jalr(call_addr); // jalr ra, t9 + bc = c->sgpr64(t0) == 0; // beq t0, r0, L124 + c->lw(a3, 4, a1); // lw a3, 4(a1) + if (bc) {goto block_11;} // branch non-likely + + bc = c->sgpr64(t6) == c->sgpr64(s7); // beq t6, s7, L122 + c->mov64(a2, t4); // or a2, t4, r0 + if (bc) {goto block_8;} // branch non-likely + + c->sqc2(vf27, 0, a3); // sqc2 vf27, 0(a3) + c->daddiu(a3, a3, 16); // daddiu a3, a3, 16 + c->sw(t0, -16, a3); // sw t0, -16(a3) + // nop // sll r0, r0, 0 + +block_6: + c->lqc2(vf1, 0, a2); // lqc2 vf1, 0(a2) + // nop // sll r0, r0, 0 + c->lqc2(vf2, 16, a2); // lqc2 vf2, 16(a2) + // nop // sll r0, r0, 0 + c->lqc2(vf3, 32, a2); // lqc2 vf3, 32(a2) + c->vdiv(vf0, BC::w, vf1, BC::w); // vdiv Q, vf0.w, vf1.w + c->vmul(DEST::xyzw, vf1, vf1, vf26); // vmul.xyzw vf1, vf1, vf26 + // nop // sll r0, r0, 0 + c->vftoi0(DEST::xyzw, vf3, vf3); // vftoi0.xyzw vf3, vf3 + // nop // sll r0, r0, 0 + c->vwaitq(); // vwaitq + // nop // sll r0, r0, 0 + c->vmulq(DEST::xyz, vf1, vf1); // vmulq.xyz vf1, vf1, Q + c->sqc2(vf3, 16, a3); // sqc2 vf3, 16(a3) + c->vmulq(DEST::xyzw, vf2, vf2); // vmulq.xyzw vf2, vf2, Q + c->daddiu(a2, a2, 48); // daddiu a2, a2, 48 + c->vadd(DEST::xyzw, vf1, vf1, vf25); // vadd.xyzw vf1, vf1, vf25 + c->daddiu(a3, a3, 48); // daddiu a3, a3, 48 + c->vmax_bc(DEST::z, BC::z, vf1, vf1, vf0); // vmaxz.z vf1, vf1, vf0 + // nop // sll r0, r0, 0 + c->vmini_bc(DEST::w, BC::z, vf1, vf1, vf13); // vminiz.w vf1, vf1, vf13 + // nop // sll r0, r0, 0 + c->vmax_bc(DEST::w, BC::y, vf1, vf1, vf13); // vmaxy.w vf1, vf1, vf13 + // nop // sll r0, r0, 0 + c->sqc2(vf2, -48, a3); // sqc2 vf2, -48(a3) + c->daddiu(t0, t0, -1); // daddiu t0, t0, -1 + c->vftoi4(DEST::xyzw, vf1, vf1); // vftoi4.xyzw vf1, vf1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(t0) != 0; // bne t0, r0, L121 + c->sqc2(vf1, -16, a3); // sqc2 vf1, -16(a3) + if (bc) {goto block_6;} // branch non-likely + + c->sw(a3, 4, a1); // sw a3, 4(a1) + // nop // sll r0, r0, 0 + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->daddiu(v0, s7, 4); // daddiu v0, s7, 4 + //jr ra // jr ra + c->daddiu(sp, sp, 8); // daddiu sp, sp, 8 + goto end_of_function; // return + + +block_8: + c->sqc2(vf27, 0, a3); // sqc2 vf27, 0(a3) + c->daddiu(a3, a3, 16); // daddiu a3, a3, 16 + c->sw(t0, -16, a3); // sw t0, -16(a3) + // nop // sll r0, r0, 0 + c->sqc2(vf15, 0, a2); // sqc2 vf15, 0(a2) + // nop // sll r0, r0, 0 + c->sqc2(vf15, 192, a2); // sqc2 vf15, 192(a2) + // nop // sll r0, r0, 0 + c->sqc2(vf16, 48, a2); // sqc2 vf16, 48(a2) + // nop // sll r0, r0, 0 + c->sqc2(vf17, 96, a2); // sqc2 vf17, 96(a2) + // nop // sll r0, r0, 0 + c->sqc2(vf18, 144, a2); // sqc2 vf18, 144(a2) + // nop // sll r0, r0, 0 + +block_9: + c->lqc2(vf1, 0, a2); // lqc2 vf1, 0(a2) + // nop // sll r0, r0, 0 + c->lqc2(vf3, 32, a2); // lqc2 vf3, 32(a2) + // nop // sll r0, r0, 0 + c->lqc2(vf2, 16, a2); // lqc2 vf2, 16(a2) + c->vdiv(vf13, BC::x, vf1, BC::w); // vdiv Q, vf13.x, vf1.w + c->vftoi0(DEST::xyzw, vf3, vf3); // vftoi0.xyzw vf3, vf3 + // nop // sll r0, r0, 0 + c->vwaitq(); // vwaitq + // nop // sll r0, r0, 0 + c->vmulq(DEST::xyz, vf1, vf1); // vmulq.xyz vf1, vf1, Q + c->sqc2(vf3, 16, a3); // sqc2 vf3, 16(a3) + c->vmulq(DEST::xyzw, vf2, vf2); // vmulq.xyzw vf2, vf2, Q + c->daddiu(a2, a2, 48); // daddiu a2, a2, 48 + c->vadd(DEST::xyzw, vf1, vf1, vf25); // vadd.xyzw vf1, vf1, vf25 + c->daddiu(a3, a3, 48); // daddiu a3, a3, 48 + c->vmax_bc(DEST::z, BC::z, vf1, vf1, vf0); // vmaxz.z vf1, vf1, vf0 + // nop // sll r0, r0, 0 + c->vmini_bc(DEST::w, BC::z, vf1, vf1, vf13); // vminiz.w vf1, vf1, vf13 + // nop // sll r0, r0, 0 + c->vmax_bc(DEST::w, BC::y, vf1, vf1, vf13); // vmaxy.w vf1, vf1, vf13 + // nop // sll r0, r0, 0 + c->sqc2(vf2, -48, a3); // sqc2 vf2, -48(a3) + c->daddiu(t0, t0, -1); // daddiu t0, t0, -1 + c->vftoi4(DEST::xyzw, vf1, vf1); // vftoi4.xyzw vf1, vf1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(t0) != 0; // bne t0, r0, L123 + c->sqc2(vf1, -16, a3); // sqc2 vf1, -16(a3) + if (bc) {goto block_9;} // branch non-likely + + c->sw(a3, 4, a1); // sw a3, 4(a1) + // nop // sll r0, r0, 0 + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->daddiu(v0, s7, 4); // daddiu v0, s7, 4 + //jr ra // jr ra + c->daddiu(sp, sp, 8); // daddiu sp, sp, 8 + goto end_of_function; // return + + +block_11: + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->mov64(v0, s7); // or v0, s7, r0 + //jr ra // jr ra + c->daddiu(sp, sp, 8); // daddiu sp, sp, 8 + goto end_of_function; // return + + //jr ra // jr ra + c->daddu(sp, sp, r0); // daddu sp, sp, r0 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.clip_polygon_against_negative_hyperplane = intern_from_c("clip-polygon-against-negative-hyperplane").c(); + cache.clip_polygon_against_positive_hyperplane = intern_from_c("clip-polygon-against-positive-hyperplane").c(); + gLinkedFunctionTable.reg("draw-large-polygon-ocean", execute, 128); +} + +} // namespace draw_large_polygon_ocean +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak2/kscheme.h" +using ::jak2::intern_from_c; +namespace Mips2C::jak2 { +namespace render_ocean_quad { +struct Cache { + void* fake_scratchpad_data; // *fake-scratchpad-data* + void* draw_large_polygon_ocean; // draw-large-polygon-ocean +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + c->copy_vfs_from_other(&ocean_regs_vfs); + bool bc = false; + u32 call_addr = 0; + c->mov64(v1, a0); // or v1, a0, r0 + get_fake_spad_addr2(t4, cache.fake_scratchpad_data, 0, c);// lui t4, 28672 + c->ori(t4, t4, 12288); // ori t4, t4, 12288 + get_fake_spad_addr2(t5, cache.fake_scratchpad_data, 0, c);// lui t5, 28672 + c->ori(t5, t5, 14336); // ori t5, t5, 14336 + c->mov64(a3, t4); // or a3, t4, r0 + // nop // sll r0, r0, 0 + c->lqc2(vf1, 0, a0); // lqc2 vf1, 0(a0) + c->addiu(t0, r0, 4); // addiu t0, r0, 4 + c->lqc2(vf2, 16, a0); // lqc2 vf2, 16(a0) + // nop // sll r0, r0, 0 + c->lqc2(vf3, 32, a0); // lqc2 vf3, 32(a0) + c->vmula_bc(DEST::xyzw, BC::x, vf31, vf1); // vmulax.xyzw acc, vf31, vf1 + c->lqc2(vf4, 48, a0); // lqc2 vf4, 48(a0) + c->vmadda_bc(DEST::xyzw, BC::y, vf30, vf1); // vmadday.xyzw acc, vf30, vf1 + c->lqc2(vf5, 64, a0); // lqc2 vf5, 64(a0) + c->vmadda_bc(DEST::xyzw, BC::z, vf29, vf1); // vmaddaz.xyzw acc, vf29, vf1 + c->lqc2(vf6, 80, a0); // lqc2 vf6, 80(a0) + c->vmadd_bc(DEST::xyzw, BC::w, vf15, vf28, vf1); // vmaddw.xyzw vf15, vf28, vf1 + c->lqc2(vf7, 96, a0); // lqc2 vf7, 96(a0) + // nop // sll r0, r0, 0 + c->lqc2(vf8, 112, a0); // lqc2 vf8, 112(a0) + c->vmula_bc(DEST::xyzw, BC::x, vf31, vf4); // vmulax.xyzw acc, vf31, vf4 + c->lqc2(vf9, 128, a0); // lqc2 vf9, 128(a0) + c->vmadda_bc(DEST::xyzw, BC::y, vf30, vf4); // vmadday.xyzw acc, vf30, vf4 + c->lqc2(vf10, 144, a0); // lqc2 vf10, 144(a0) + c->vmadda_bc(DEST::xyzw, BC::z, vf29, vf4); // vmaddaz.xyzw acc, vf29, vf4 + c->lqc2(vf11, 160, a0); // lqc2 vf11, 160(a0) + c->vmadd_bc(DEST::xyzw, BC::w, vf16, vf28, vf4); // vmaddw.xyzw vf16, vf28, vf4 + c->lqc2(vf12, 176, a0); // lqc2 vf12, 176(a0) + c->vmul(DEST::xyzw, vf1, vf15, vf14); // vmul.xyzw vf1, vf15, vf14 + c->sqc2(vf2, 16, a3); // sqc2 vf2, 16(a3) + c->vmula_bc(DEST::xyzw, BC::x, vf31, vf7); // vmulax.xyzw acc, vf31, vf7 + c->sqc2(vf3, 32, a3); // sqc2 vf3, 32(a3) + c->vmadda_bc(DEST::xyzw, BC::y, vf30, vf7); // vmadday.xyzw acc, vf30, vf7 + c->sqc2(vf5, 64, a3); // sqc2 vf5, 64(a3) + c->vmadda_bc(DEST::xyzw, BC::z, vf29, vf7); // vmaddaz.xyzw acc, vf29, vf7 + c->sqc2(vf6, 80, a3); // sqc2 vf6, 80(a3) + c->vmadd_bc(DEST::xyzw, BC::w, vf17, vf28, vf7); // vmaddw.xyzw vf17, vf28, vf7 + c->sqc2(vf8, 112, a3); // sqc2 vf8, 112(a3) + c->vmul(DEST::xyzw, vf4, vf16, vf14); // vmul.xyzw vf4, vf16, vf14 + c->sqc2(vf9, 128, a3); // sqc2 vf9, 128(a3) + c->vmula_bc(DEST::xyzw, BC::x, vf31, vf10); // vmulax.xyzw acc, vf31, vf10 + c->sqc2(vf11, 160, a3); // sqc2 vf11, 160(a3) + c->vmadda_bc(DEST::xyzw, BC::y, vf30, vf10); // vmadday.xyzw acc, vf30, vf10 + c->sqc2(vf12, 176, a3); // sqc2 vf12, 176(a3) + c->vmadda_bc(DEST::xyzw, BC::z, vf29, vf10); // vmaddaz.xyzw acc, vf29, vf10 + c->sqc2(vf2, 208, a3); // sqc2 vf2, 208(a3) + c->vmadd_bc(DEST::xyzw, BC::w, vf18, vf28, vf10); // vmaddw.xyzw vf18, vf28, vf10 + c->sqc2(vf3, 224, a3); // sqc2 vf3, 224(a3) + c->vmul(DEST::xyzw, vf7, vf17, vf14); // vmul.xyzw vf7, vf17, vf14 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->sqc2(vf1, 0, a3); // sqc2 vf1, 0(a3) + c->vmul(DEST::xyzw, vf10, vf18, vf14); // vmul.xyzw vf10, vf18, vf14 + c->sqc2(vf1, 192, a3); // sqc2 vf1, 192(a3) + // nop // sll r0, r0, 0 + c->sqc2(vf4, 48, a3); // sqc2 vf4, 48(a3) + // nop // sll r0, r0, 0 + c->sqc2(vf7, 96, a3); // sqc2 vf7, 96(a3) + // nop // sll r0, r0, 0 + c->sqc2(vf10, 144, a3); // sqc2 vf10, 144(a3) + c->load_symbol2(t9, cache.draw_large_polygon_ocean);// lw t9, draw-large-polygon-ocean(s7) + // Unknown instr: jr t9 + return draw_large_polygon_ocean::execute(c); + // nop // sll r0, r0, 0 + //jr ra // jr ra + c->daddu(sp, sp, r0); // daddu sp, sp, r0 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.fake_scratchpad_data = intern_from_c("*fake-scratchpad-data*").c(); + cache.draw_large_polygon_ocean = intern_from_c("draw-large-polygon-ocean").c(); + gLinkedFunctionTable.reg("render-ocean-quad", execute, 256); +} + +} // namespace render_ocean_quad +} // namespace Mips2C \ No newline at end of file diff --git a/game/mips2c/jak2_functions/ocean_vu0.cpp b/game/mips2c/jak2_functions/ocean_vu0.cpp new file mode 100644 index 0000000000..c007d0ea11 --- /dev/null +++ b/game/mips2c/jak2_functions/ocean_vu0.cpp @@ -0,0 +1,861 @@ +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak2/kscheme.h" +using ::jak2::intern_from_c; +namespace Mips2C::jak2 { +namespace method_14_ocean { +struct Cache { + void* ocean_wave_frames; // *ocean-wave-frames* +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + c->mtc1(f0, a2); // mtc1 f0, a2 + c->cvtws(f0, f0); // cvt.w.s f0, f0 + c->mfc1(t1, f0); // mfc1 t1, f0 + c->dsll(v1, t1, 10); // dsll v1, t1, 10 + c->daddu(v1, r0, v1); // daddu v1, r0, v1 + c->load_symbol2(t0, cache.ocean_wave_frames); // lw t0, *ocean-wave-frames*(s7) + c->daddu(v1, v1, t0); // daddu v1, v1, t0 + c->daddiu(t0, t1, 1); // daddiu t0, t1, 1 + c->andi(t0, t0, 63); // andi t0, t0, 63 + c->dsll(t0, t0, 10); // dsll t0, t0, 10 + c->daddu(t0, r0, t0); // daddu t0, r0, t0 + c->load_symbol2(t2, cache.ocean_wave_frames); // lw t2, *ocean-wave-frames*(s7) + c->daddu(t0, t0, t2); // daddu t0, t0, t2 + c->mtc1(f0, a2); // mtc1 f0, a2 + c->mtc1(f1, t1); // mtc1 f1, t1 + c->cvtsw(f1, f1); // cvt.s.w f1, f1 + c->subs(f0, f0, f1); // sub.s f0, f0, f1 + c->swc1(f0, 148, a0); // swc1 f0, 148(a0) + c->lui(a2, 16256); // lui a2, 16256 + c->mtc1(f0, a2); // mtc1 f0, a2 + c->lwc1(f1, 148, a0); // lwc1 f1, 148(a0) + c->subs(f0, f0, f1); // sub.s f0, f0, f1 + c->swc1(f0, 144, a0); // swc1 f0, 144(a0) + c->lwc1(f0, 144, a0); // lwc1 f0, 144(a0) + c->mtc1(f1, a3); // mtc1 f1, a3 + c->muls(f0, f0, f1); // mul.s f0, f0, f1 + c->swc1(f0, 144, a0); // swc1 f0, 144(a0) + c->lwc1(f0, 148, a0); // lwc1 f0, 148(a0) + c->mtc1(f1, a3); // mtc1 f1, a3 + c->muls(f0, f0, f1); // mul.s f0, f0, f1 + c->swc1(f0, 148, a0); // swc1 f0, 148(a0) + c->addiu(a2, r0, 32); // addiu a2, r0, 32 + c->lqc2(vf1, 144, a0); // lqc2 vf1, 144(a0) + // nop // sll r0, r0, 0 + c->lw(a0, 0, v1); // lw a0, 0(v1) + // nop // sll r0, r0, 0 + c->lw(a3, 0, t0); // lw a3, 0(t0) + +block_1: + c->pextlb(t1, a0, r0); // pextlb t1, a0, r0 + c->lw(a0, 4, v1); // lw a0, 4(v1) + c->pextlb(t2, a3, r0); // pextlb t2, a3, r0 + c->lw(a3, 4, t0); // lw a3, 4(t0) + c->pextlb(t3, a0, r0); // pextlb t3, a0, r0 + c->lw(a0, 8, v1); // lw a0, 8(v1) + c->pextlb(t4, a3, r0); // pextlb t4, a3, r0 + c->lw(a3, 8, t0); // lw a3, 8(t0) + c->pextlh(t5, t1, r0); // pextlh t5, t1, r0 + c->lw(t1, 12, v1); // lw t1, 12(v1) + c->pextlh(t6, t2, r0); // pextlh t6, t2, r0 + c->lw(t2, 12, t0); // lw t2, 12(t0) + c->pextlh(t3, t3, r0); // pextlh t3, t3, r0 + c->mov128_vf_gpr(vf2, t5); // qmtc2.i vf2, t5 + c->pextlh(t4, t4, r0); // pextlh t4, t4, r0 + c->mov128_vf_gpr(vf10, t6); // qmtc2.i vf10, t6 + c->pextlb(a0, a0, r0); // pextlb a0, a0, r0 + c->mov128_vf_gpr(vf3, t3); // qmtc2.i vf3, t3 + c->pextlb(a3, a3, r0); // pextlb a3, a3, r0 + c->mov128_vf_gpr(vf11, t4); // qmtc2.i vf11, t4 + c->pextlb(t4, t1, r0); // pextlb t4, t1, r0 + c->vitof15(DEST::xyzw, vf2, vf2); // vitof15.xyzw vf2, vf2 + c->pextlb(t3, t2, r0); // pextlb t3, t2, r0 + c->vitof15(DEST::xyzw, vf10, vf10); // vitof15.xyzw vf10, vf10 + c->pextlh(a0, a0, r0); // pextlh a0, a0, r0 + c->vitof15(DEST::xyzw, vf3, vf3); // vitof15.xyzw vf3, vf3 + c->pextlh(t1, a3, r0); // pextlh t1, a3, r0 + c->vitof15(DEST::xyzw, vf11, vf11); // vitof15.xyzw vf11, vf11 + c->pextlh(t2, t4, r0); // pextlh t2, t4, r0 + c->lw(t5, 16, v1); // lw t5, 16(v1) + c->pextlh(t3, t3, r0); // pextlh t3, t3, r0 + c->lw(t6, 16, t0); // lw t6, 16(t0) + c->vmula_bc(DEST::xyzw, BC::x, vf2, vf1); // vmulax.xyzw acc, vf2, vf1 + c->lw(t4, 20, v1); // lw t4, 20(v1) + c->vmadd_bc(DEST::xyzw, BC::y, vf2, vf10, vf1); // vmaddy.xyzw vf2, vf10, vf1 + c->lw(a3, 20, t0); // lw a3, 20(t0) + c->vmula_bc(DEST::xyzw, BC::x, vf3, vf1); // vmulax.xyzw acc, vf3, vf1 + c->mov128_vf_gpr(vf4, a0); // qmtc2.i vf4, a0 + c->vmadd_bc(DEST::xyzw, BC::y, vf3, vf11, vf1); // vmaddy.xyzw vf3, vf11, vf1 + c->mov128_vf_gpr(vf12, t1); // qmtc2.i vf12, t1 + c->pextlb(a0, t5, r0); // pextlb a0, t5, r0 + c->mov128_vf_gpr(vf5, t2); // qmtc2.i vf5, t2 + c->pextlb(t1, t6, r0); // pextlb t1, t6, r0 + c->mov128_vf_gpr(vf13, t3); // qmtc2.i vf13, t3 + c->pextlb(t2, t4, r0); // pextlb t2, t4, r0 + c->vitof15(DEST::xyzw, vf4, vf4); // vitof15.xyzw vf4, vf4 + c->pextlb(a3, a3, r0); // pextlb a3, a3, r0 + c->vitof15(DEST::xyzw, vf12, vf12); // vitof15.xyzw vf12, vf12 + c->pextlh(a0, a0, r0); // pextlh a0, a0, r0 + c->vitof15(DEST::xyzw, vf5, vf5); // vitof15.xyzw vf5, vf5 + c->pextlh(t1, t1, r0); // pextlh t1, t1, r0 + c->vitof15(DEST::xyzw, vf13, vf13); // vitof15.xyzw vf13, vf13 + c->pextlh(t2, t2, r0); // pextlh t2, t2, r0 + c->lw(t5, 24, v1); // lw t5, 24(v1) + c->pextlh(t3, a3, r0); // pextlh t3, a3, r0 + c->lw(t6, 24, t0); // lw t6, 24(t0) + c->vmula_bc(DEST::xyzw, BC::x, vf4, vf1); // vmulax.xyzw acc, vf4, vf1 + c->lw(t4, 28, v1); // lw t4, 28(v1) + c->vmadd_bc(DEST::xyzw, BC::y, vf4, vf12, vf1); // vmaddy.xyzw vf4, vf12, vf1 + c->lw(a3, 28, t0); // lw a3, 28(t0) + c->vmula_bc(DEST::xyzw, BC::x, vf5, vf1); // vmulax.xyzw acc, vf5, vf1 + c->mov128_vf_gpr(vf6, a0); // qmtc2.i vf6, a0 + c->vmadd_bc(DEST::xyzw, BC::y, vf5, vf13, vf1); // vmaddy.xyzw vf5, vf13, vf1 + c->mov128_vf_gpr(vf14, t1); // qmtc2.i vf14, t1 + c->pextlb(a0, t5, r0); // pextlb a0, t5, r0 + c->mov128_vf_gpr(vf7, t2); // qmtc2.i vf7, t2 + c->pextlb(t1, t6, r0); // pextlb t1, t6, r0 + c->mov128_vf_gpr(vf15, t3); // qmtc2.i vf15, t3 + c->pextlb(t2, t4, r0); // pextlb t2, t4, r0 + c->vitof15(DEST::xyzw, vf6, vf6); // vitof15.xyzw vf6, vf6 + c->pextlb(a3, a3, r0); // pextlb a3, a3, r0 + c->vitof15(DEST::xyzw, vf14, vf14); // vitof15.xyzw vf14, vf14 + c->pextlh(a0, a0, r0); // pextlh a0, a0, r0 + c->vitof15(DEST::xyzw, vf7, vf7); // vitof15.xyzw vf7, vf7 + c->pextlh(t1, t1, r0); // pextlh t1, t1, r0 + c->vitof15(DEST::xyzw, vf15, vf15); // vitof15.xyzw vf15, vf15 + c->pextlh(t2, t2, r0); // pextlh t2, t2, r0 + c->sqc2(vf2, 0, a1); // sqc2 vf2, 0(a1) + c->pextlh(a3, a3, r0); // pextlh a3, a3, r0 + c->sqc2(vf3, 16, a1); // sqc2 vf3, 16(a1) + c->vmula_bc(DEST::xyzw, BC::x, vf6, vf1); // vmulax.xyzw acc, vf6, vf1 + c->sqc2(vf4, 32, a1); // sqc2 vf4, 32(a1) + c->vmadd_bc(DEST::xyzw, BC::y, vf6, vf14, vf1); // vmaddy.xyzw vf6, vf14, vf1 + c->sqc2(vf5, 48, a1); // sqc2 vf5, 48(a1) + c->vmula_bc(DEST::xyzw, BC::x, vf7, vf1); // vmulax.xyzw acc, vf7, vf1 + c->mov128_vf_gpr(vf8, a0); // qmtc2.i vf8, a0 + c->vmadd_bc(DEST::xyzw, BC::y, vf7, vf15, vf1); // vmaddy.xyzw vf7, vf15, vf1 + c->mov128_vf_gpr(vf16, t1); // qmtc2.i vf16, t1 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf9, t2); // qmtc2.i vf9, t2 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf17, a3); // qmtc2.i vf17, a3 + // nop // sll r0, r0, 0 + c->vitof15(DEST::xyzw, vf8, vf8); // vitof15.xyzw vf8, vf8 + c->daddiu(a1, a1, 128); // daddiu a1, a1, 128 + c->vitof15(DEST::xyzw, vf16, vf16); // vitof15.xyzw vf16, vf16 + c->lw(a0, 32, v1); // lw a0, 32(v1) + c->vitof15(DEST::xyzw, vf9, vf9); // vitof15.xyzw vf9, vf9 + c->lw(a3, 32, t0); // lw a3, 32(t0) + c->vitof15(DEST::xyzw, vf17, vf17); // vitof15.xyzw vf17, vf17 + c->vmula_bc(DEST::xyzw, BC::x, vf8, vf1); // vmulax.xyzw acc, vf8, vf1 + c->sqc2(vf6, -64, a1); // sqc2 vf6, -64(a1) + c->vmadd_bc(DEST::xyzw, BC::y, vf8, vf16, vf1); // vmaddy.xyzw vf8, vf16, vf1 + c->sqc2(vf7, -48, a1); // sqc2 vf7, -48(a1) + c->vmula_bc(DEST::xyzw, BC::x, vf9, vf1); // vmulax.xyzw acc, vf9, vf1 + c->daddiu(a2, a2, -1); // daddiu a2, a2, -1 + c->vmadd_bc(DEST::xyzw, BC::y, vf9, vf17, vf1); // vmaddy.xyzw vf9, vf17, vf1 + c->daddiu(v1, v1, 32); // daddiu v1, v1, 32 + // nop // sll r0, r0, 0 + c->daddiu(t0, t0, 32); // daddiu t0, t0, 32 + // nop // sll r0, r0, 0 + c->sqc2(vf8, -32, a1); // sqc2 vf8, -32(a1) + bc = ((s64)c->sgpr64(a2)) > 0; // bgtz a2, L16 + c->sqc2(vf9, -16, a1); // sqc2 vf9, -16(a1) + if (bc) {goto block_1;} // branch non-likely + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->gprs[v1].du64[0] = 0; // or v1, r0, r0 + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + //jr ra // jr ra + c->daddu(sp, sp, r0); // daddu sp, sp, r0 + goto end_of_function; // return + +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.ocean_wave_frames = intern_from_c("*ocean-wave-frames*").c(); + gLinkedFunctionTable.reg("(method 14 ocean)", execute, 256); +} + +} // namespace method_14_ocean +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak2/kscheme.h" +using ::jak2::intern_from_c; +namespace Mips2C::jak2 { +namespace method_15_ocean { +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + // nop // sll r0, r0, 0 + c->mov64(v1, a1); // or v1, a1, r0 + c->mov64(a0, a2); // or a0, a2, r0 + c->addiu(a1, r0, 64); // addiu a1, r0, 64 + // nop // sll r0, r0, 0 + +block_1: + c->lqc2(vf1, 0, v1); // lqc2 vf1, 0(v1) + // nop // sll r0, r0, 0 + c->lqc2(vf2, 16, v1); // lqc2 vf2, 16(v1) + // nop // sll r0, r0, 0 + c->lqc2(vf3, 32, v1); // lqc2 vf3, 32(v1) + // nop // sll r0, r0, 0 + c->lqc2(vf4, 48, v1); // lqc2 vf4, 48(v1) + // nop // sll r0, r0, 0 + c->lqc2(vf5, 0, a0); // lqc2 vf5, 0(a0) + // nop // sll r0, r0, 0 + c->lqc2(vf6, 16, a0); // lqc2 vf6, 16(a0) + // nop // sll r0, r0, 0 + c->lqc2(vf7, 32, a0); // lqc2 vf7, 32(a0) + // nop // sll r0, r0, 0 + c->lqc2(vf8, 48, a0); // lqc2 vf8, 48(a0) + // nop // sll r0, r0, 0 + c->vadd(DEST::xyzw, vf1, vf1, vf5); // vadd.xyzw vf1, vf1, vf5 + // nop // sll r0, r0, 0 + c->vadd(DEST::xyzw, vf2, vf2, vf6); // vadd.xyzw vf2, vf2, vf6 + // nop // sll r0, r0, 0 + c->vadd(DEST::xyzw, vf3, vf3, vf7); // vadd.xyzw vf3, vf3, vf7 + // nop // sll r0, r0, 0 + c->vadd(DEST::xyzw, vf4, vf4, vf8); // vadd.xyzw vf4, vf4, vf8 + // nop // sll r0, r0, 0 + c->sqc2(vf1, 0, v1); // sqc2 vf1, 0(v1) + // nop // sll r0, r0, 0 + c->sqc2(vf2, 16, v1); // sqc2 vf2, 16(v1) + c->daddiu(a1, a1, -1); // daddiu a1, a1, -1 + c->sqc2(vf3, 32, v1); // sqc2 vf3, 32(v1) + c->daddiu(v1, v1, 64); // daddiu v1, v1, 64 + bc = ((s64)c->sgpr64(a1)) > 0; // bgtz a1, L14 + c->sqc2(vf4, -16, v1); // sqc2 vf4, -16(v1) + if (bc) {goto block_1;} // branch non-likely + + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + //jr ra // jr ra + c->daddu(sp, sp, r0); // daddu sp, sp, r0 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + gLinkedFunctionTable.reg("(method 15 ocean)", execute, 128); +} + +} // namespace method_15_ocean +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak2/kscheme.h" +using ::jak2::intern_from_c; +namespace Mips2C::jak2 { +namespace method_16_ocean { +struct Cache { + void* level; // *level* + void* time_of_day_context; // *time-of-day-context* + void* ocean_vu0_block; // ocean-vu0-block + void* sewerb; // sewerb + void* upload_vu0_program; // upload-vu0-program + void* vu_lights_light_group; // vu-lights<-light-group! +} cache; + +void vcallms0(ExecutionContext* c) { + // nop | mulay.x ACC, vf12, vf02 0 + c->acc.vf.mula(Mask::x, c->vf_src(vf12).vf, c->vf_src(vf02).vf.y()); + // nop | mulax.z ACC, vf12, vf03 1 + c->acc.vf.mula(Mask::z, c->vf_src(vf12).vf, c->vf_src(vf03).vf.x()); + // nop | msubx.xz vf24, vf12, vf02 2 + // ASSERT(false); + c->acc.vf.msub(Mask::xz, c->vfs[vf24].vf, c->vf_src(vf12).vf, c->vf_src(vf02).vf.x()); + // nop | mulaz.x ACC, vf12, vf02 3 + c->acc.vf.mula(Mask::x, c->vf_src(vf12).vf, c->vf_src(vf02).vf.z()); + // nop | mulay.z ACC, vf12, vf03 4 + c->acc.vf.mula(Mask::z, c->vf_src(vf12).vf, c->vf_src(vf03).vf.y()); + // nop | msuby.xz vf25, vf12, vf02 5 + // ASSERT(false); + c->acc.vf.msub(Mask::xz, c->vfs[vf25].vf, c->vf_src(vf12).vf, c->vf_src(vf02).vf.y()); + // nop | mulaw.x ACC, vf12, vf02 6 + c->acc.vf.mula(Mask::x, c->vf_src(vf12).vf, c->vf_src(vf02).vf.w()); + // nop | mulaz.z ACC, vf12, vf03 7 + c->acc.vf.mula(Mask::z, c->vf_src(vf12).vf, c->vf_src(vf03).vf.z()); + // nop | msubz.xz vf26, vf12, vf02 8 + // ASSERT(false); + c->acc.vf.msub(Mask::xz, c->vfs[vf26].vf, c->vf_src(vf12).vf, c->vf_src(vf02).vf.z()); + // nop | mulax.x ACC, vf12, vf04 9 + c->acc.vf.mula(Mask::x, c->vf_src(vf12).vf, c->vf_src(vf04).vf.x()); + // nop | mulaw.z ACC, vf12, vf03 10 + c->acc.vf.mula(Mask::z, c->vf_src(vf12).vf, c->vf_src(vf03).vf.w()); + // nop | msubw.xz vf27, vf12, vf02 11 + // ASSERT(false); + c->acc.vf.msub(Mask::xz, c->vfs[vf27].vf, c->vf_src(vf12).vf, c->vf_src(vf02).vf.w()); + // nop | mul.xz vf28, vf24, vf24 12 + c->vfs[vf28].vf.mul(Mask::xz, c->vf_src(vf24).vf, c->vf_src(vf24).vf); + // nop | mul.xz vf29, vf25, vf25 13 + c->vfs[vf29].vf.mul(Mask::xz, c->vf_src(vf25).vf, c->vf_src(vf25).vf); + // nop | mul.xz vf30, vf26, vf26 14 + c->vfs[vf30].vf.mul(Mask::xz, c->vf_src(vf26).vf, c->vf_src(vf26).vf); + // nop | mul.xz vf31, vf27, vf27 15 + c->vfs[vf31].vf.mul(Mask::xz, c->vf_src(vf27).vf, c->vf_src(vf27).vf); + // nop | subx.y vf24, vf01, vf28 16 + c->vfs[vf24].vf.sub(Mask::y, c->vf_src(vf01).vf, c->vf_src(vf28).vf.x()); + // nop | subx.y vf25, vf01, vf29 17 + c->vfs[vf25].vf.sub(Mask::y, c->vf_src(vf01).vf, c->vf_src(vf29).vf.x()); + // nop | subx.y vf26, vf01, vf30 18 + c->vfs[vf26].vf.sub(Mask::y, c->vf_src(vf01).vf, c->vf_src(vf30).vf.x()); + // nop | subx.y vf27, vf01, vf31 19 + c->vfs[vf27].vf.sub(Mask::y, c->vf_src(vf01).vf, c->vf_src(vf31).vf.x()); + // nop | subz.y vf24, vf24, vf28 20 + c->vfs[vf24].vf.sub(Mask::y, c->vf_src(vf24).vf, c->vf_src(vf28).vf.z()); + // nop | subz.y vf25, vf25, vf29 21 + c->vfs[vf25].vf.sub(Mask::y, c->vf_src(vf25).vf, c->vf_src(vf29).vf.z()); + // nop | subz.y vf26, vf26, vf30 22 + c->vfs[vf26].vf.sub(Mask::y, c->vf_src(vf26).vf, c->vf_src(vf30).vf.z()); + // nop | subz.y vf27, vf27, vf31 23 + c->vfs[vf27].vf.sub(Mask::y, c->vf_src(vf27).vf, c->vf_src(vf31).vf.z()); + // nop | mulx.w vf24, vf01, vf02 24 + c->vfs[vf24].vf.mul(Mask::w, c->vf_src(vf01).vf, c->vf_src(vf02).vf.x()); + // nop | muly.w vf25, vf01, vf02 25 + c->vfs[vf25].vf.mul(Mask::w, c->vf_src(vf01).vf, c->vf_src(vf02).vf.y()); + // nop | mulz.w vf26, vf01, vf02 26 + c->vfs[vf26].vf.mul(Mask::w, c->vf_src(vf01).vf, c->vf_src(vf02).vf.z()); + // nop | mulw.w vf27, vf01, vf02 27 + c->vfs[vf27].vf.mul(Mask::w, c->vf_src(vf01).vf, c->vf_src(vf02).vf.w()); + // nop | mulax.xyzw ACC, vf05, vf24 28 + c->acc.vf.mula(Mask::xyzw, c->vf_src(vf05).vf, c->vf_src(vf24).vf.x()); + // nop | madday.xyzw ACC, vf06, vf24 29 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf06].vf, c->vfs[vf24].vf.y()); + // nop | maddz.xyz vf16, vf07, vf24 30 + c->acc.vf.madd(Mask::xyz, c->vfs[vf16].vf, c->vf_src(vf07).vf, c->vf_src(vf24).vf.z()); + // nop | mulax.xyzw ACC, vf05, vf25 31 + c->acc.vf.mula(Mask::xyzw, c->vf_src(vf05).vf, c->vf_src(vf25).vf.x()); + // nop | madday.xyzw ACC, vf06, vf25 32 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf06].vf, c->vfs[vf25].vf.y()); + // nop | maddz.xyz vf17, vf07, vf25 33 + c->acc.vf.madd(Mask::xyz, c->vfs[vf17].vf, c->vf_src(vf07).vf, c->vf_src(vf25).vf.z()); + // nop | mulax.xyzw ACC, vf05, vf26 34 + c->acc.vf.mula(Mask::xyzw, c->vf_src(vf05).vf, c->vf_src(vf26).vf.x()); + // nop | madday.xyzw ACC, vf06, vf26 35 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf06].vf, c->vfs[vf26].vf.y()); + // nop | maddz.xyz vf18, vf07, vf26 36 + c->acc.vf.madd(Mask::xyz, c->vfs[vf18].vf, c->vf_src(vf07).vf, c->vf_src(vf26).vf.z()); + // nop | mulax.xyzw ACC, vf05, vf27 37 + c->acc.vf.mula(Mask::xyzw, c->vf_src(vf05).vf, c->vf_src(vf27).vf.x()); + // nop | madday.xyzw ACC, vf06, vf27 38 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf06].vf, c->vfs[vf27].vf.y()); + // nop | maddz.xyz vf19, vf07, vf27 39 + c->acc.vf.madd(Mask::xyz, c->vfs[vf19].vf, c->vf_src(vf07).vf, c->vf_src(vf27).vf.z()); + // nop | maxx.xyz vf16, vf16, vf00 40 + c->vfs[vf16].vf.max(Mask::xyz, c->vf_src(vf16).vf, c->vf_src(vf00).vf.x()); + // nop | maxx.xyz vf17, vf17, vf00 41 + c->vfs[vf17].vf.max(Mask::xyz, c->vf_src(vf17).vf, c->vf_src(vf00).vf.x()); + // nop | maxx.xyz vf18, vf18, vf00 42 + c->vfs[vf18].vf.max(Mask::xyz, c->vf_src(vf18).vf, c->vf_src(vf00).vf.x()); + // nop | maxx.xyz vf19, vf19, vf00 43 + c->vfs[vf19].vf.max(Mask::xyz, c->vf_src(vf19).vf, c->vf_src(vf00).vf.x()); + // nop | mula.xyzw ACC, vf01, vf11 44 + // vu.acc.mula(Mask::xyzw, vu.vf01, vu.vf11); + c->acc.vf.mula(Mask::xyzw, c->vf_src(vf01).vf, c->vf_src(vf11).vf); + // nop | maddax.xyzw ACC, vf08, vf16 45 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf08].vf, c->vfs[vf16].vf.x()); + // nop | madday.xyzw ACC, vf09, vf16 46 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf09].vf, c->vfs[vf16].vf.y()); + // nop | maddz.xyzw vf20, vf10, vf16 47 + c->acc.vf.madd(Mask::xyzw, c->vfs[vf20].vf, c->vf_src(vf10).vf, c->vf_src(vf16).vf.z()); + // nop | mula.xyzw ACC, vf01, vf11 48 + // vu.acc.mula(Mask::xyzw, vu.vf01, vu.vf11); + c->acc.vf.mula(Mask::xyzw, c->vf_src(vf01).vf, c->vf_src(vf11).vf); + // nop | maddax.xyzw ACC, vf08, vf17 49 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf08].vf, c->vfs[vf17].vf.x()); + // nop | madday.xyzw ACC, vf09, vf17 50 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf09].vf, c->vfs[vf17].vf.y()); + // nop | maddz.xyzw vf21, vf10, vf17 51 + c->acc.vf.madd(Mask::xyzw, c->vfs[vf21].vf, c->vf_src(vf10).vf, c->vf_src(vf17).vf.z()); + // nop | mula.xyzw ACC, vf01, vf11 52 + // vu.acc.mula(Mask::xyzw, vu.vf01, vu.vf11); + c->acc.vf.mula(Mask::xyzw, c->vf_src(vf01).vf, c->vf_src(vf11).vf); + // nop | maddax.xyzw ACC, vf08, vf18 53 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf08].vf, c->vfs[vf18].vf.x()); + // nop | madday.xyzw ACC, vf09, vf18 54 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf09].vf, c->vfs[vf18].vf.y()); + // nop | maddz.xyzw vf22, vf10, vf18 55 + c->acc.vf.madd(Mask::xyzw, c->vfs[vf22].vf, c->vf_src(vf10).vf, c->vf_src(vf18).vf.z()); + // nop | mula.xyzw ACC, vf01, vf11 56 + // vu.acc.mula(Mask::xyzw, vu.vf01, vu.vf11); + c->acc.vf.mula(Mask::xyzw, c->vf_src(vf01).vf, c->vf_src(vf11).vf); + // nop | maddax.xyzw ACC, vf08, vf19 57 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf08].vf, c->vfs[vf19].vf.x()); + // nop | madday.xyzw ACC, vf09, vf19 58 + c->acc.vf.madda(Mask::xyzw, c->vfs[vf09].vf, c->vfs[vf19].vf.y()); + // nop | maddz.xyzw vf23, vf10, vf19 59 + c->acc.vf.madd(Mask::xyzw, c->vfs[vf23].vf, c->vf_src(vf10).vf, c->vf_src(vf19).vf.z()); + // nop | miniy.xyzw vf20, vf20, vf12 60 + c->vfs[vf20].vf.mini(Mask::xyzw, c->vf_src(vf20).vf, c->vf_src(vf12).vf.y()); + // nop | miniy.xyzw vf21, vf21, vf12 61 + c->vfs[vf21].vf.mini(Mask::xyzw, c->vf_src(vf21).vf, c->vf_src(vf12).vf.y()); + // nop | miniy.xyzw vf22, vf22, vf12 :e 62 + c->vfs[vf22].vf.mini(Mask::xyzw, c->vf_src(vf22).vf, c->vf_src(vf12).vf.y()); + // nop | miniy.xyzw vf23, vf23, vf12 63 + c->vfs[vf23].vf.mini(Mask::xyzw, c->vf_src(vf23).vf, c->vf_src(vf12).vf.y()); +} + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + bool cop1_bc = false; + c->daddiu(sp, sp, -80); // daddiu sp, sp, -80 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sd(fp, 8, sp); // sd fp, 8(sp) + c->mov64(fp, t9); // or fp, t9, r0 + c->sq(s4, 32, sp); // sq s4, 32(sp) + c->sq(s5, 48, sp); // sq s5, 48(sp) + c->sq(gp, 64, sp); // sq gp, 64(sp) + c->mov64(s4, a0); // or s4, a0, r0 + c->mov64(s5, a1); // or s5, a1, r0 + c->mov64(gp, a2); // or gp, a2, r0 + c->load_symbol2(t9, cache.upload_vu0_program); // lw t9, upload-vu0-program(s7) + c->load_symbol2(a0, cache.ocean_vu0_block); // lw a0, ocean-vu0-block(s7) + c->daddiu(a1, s4, 8296); // daddiu a1, s4, 8296 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->load_symbol2(a0, cache.level); // lw a0, *level*(s7) + c->lwu(v1, -4, a0); // lwu v1, -4(a0) + c->lwu(t9, 52, v1); // lwu t9, 52(v1) + c->load_symbol_addr(a1, cache.sewerb); // daddiu a1, s7, sewerb + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + bc = c->sgpr64(s7) == c->sgpr64(v1); // beq s7, v1, L2 + // nop // sll r0, r0, 0 + if (bc) {goto block_2;} // branch non-likely + + c->load_symbol2(t9, cache.vu_lights_light_group);// lw t9, vu-lights<-light-group!(s7) + c->daddiu(a0, s4, 8144); // daddiu a0, s4, 8144 + c->daddiu(a1, v1, 716); // daddiu a1, v1, 716 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + //beq r0, r0, L3 // beq r0, r0, L3 + // nop // sll r0, r0, 0 + goto block_3; // branch always + + +block_2: + c->load_symbol2(t9, cache.vu_lights_light_group);// lw t9, vu-lights<-light-group!(s7) + c->daddiu(a0, s4, 8144); // daddiu a0, s4, 8144 + c->load_symbol2(v1, cache.time_of_day_context); // lw v1, *time-of-day-context*(s7) + c->daddiu(a1, v1, 140); // daddiu a1, v1, 140 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + +block_3: + c->daddiu(v1, sp, 16); // daddiu v1, sp, 16 + c->mov64(a2, v1); // or a2, v1, r0 + c->daddiu(a0, s4, 8192); // daddiu a0, s4, 8192 + c->daddiu(a1, s4, 8208); // daddiu a1, s4, 8208 + c->vmove(DEST::w, vf6, vf0); // vmove.w vf6, vf0 + c->lqc2(vf4, 0, a0); // lqc2 vf4, 0(a0) + c->lqc2(vf5, 0, a1); // lqc2 vf5, 0(a1) + c->vadd(DEST::xyz, vf6, vf4, vf5); // vadd.xyz vf6, vf4, vf5 + c->sqc2(vf6, 0, a2); // sqc2 vf6, 0(a2) + c->mov64(a2, v1); // or a2, v1, r0 + c->mov64(a0, v1); // or a0, v1, r0 + c->daddiu(a1, s4, 8224); // daddiu a1, s4, 8224 + c->vmove(DEST::w, vf6, vf0); // vmove.w vf6, vf0 + c->lqc2(vf4, 0, a0); // lqc2 vf4, 0(a0) + c->lqc2(vf5, 0, a1); // lqc2 vf5, 0(a1) + c->vadd(DEST::xyz, vf6, vf4, vf5); // vadd.xyz vf6, vf4, vf5 + c->sqc2(vf6, 0, a2); // sqc2 vf6, 0(a2) + c->mov64(a2, v1); // or a2, v1, r0 + c->mov64(a0, v1); // or a0, v1, r0 + c->daddiu(a1, s4, 8240); // daddiu a1, s4, 8240 + c->vmove(DEST::w, vf6, vf0); // vmove.w vf6, vf0 + c->lqc2(vf4, 0, a0); // lqc2 vf4, 0(a0) + c->lqc2(vf5, 0, a1); // lqc2 vf5, 0(a1) + c->vadd(DEST::xyz, vf6, vf4, vf5); // vadd.xyz vf6, vf4, vf5 + c->sqc2(vf6, 0, a2); // sqc2 vf6, 0(a2) + c->lui(a0, 16288); // lui a0, 16288 + c->mtc1(f0, a0); // mtc1 f0, a0 + c->lwc1(f1, 0, v1); // lwc1 f1, 0(v1) + cop1_bc = c->fprs[f0] < c->fprs[f1]; // c.lt.s f0, f1 + bc = cop1_bc; // bc1t L4 + c->daddiu(a0, s7, 4); // daddiu a0, s7, 4 + if (bc) {goto block_5;} // branch non-likely + + c->mov64(a0, s7); // or a0, s7, r0 + +block_5: + if (((s64)c->sgpr64(s7)) != ((s64)c->sgpr64(a0))) {// bnel s7, a0, L6 + c->mov64(a0, a0); // or a0, a0, r0 + goto block_13; + } + +block_7: + c->lui(a0, 16288); // lui a0, 16288 + c->mtc1(f0, a0); // mtc1 f0, a0 + c->lwc1(f1, 4, v1); // lwc1 f1, 4(v1) + cop1_bc = c->fprs[f0] < c->fprs[f1]; // c.lt.s f0, f1 + bc = cop1_bc; // bc1t L5 + c->daddiu(a0, s7, 4); // daddiu a0, s7, 4 + if (bc) {goto block_9;} // branch non-likely + + c->mov64(a0, s7); // or a0, s7, r0 + +block_9: + if (((s64)c->sgpr64(s7)) != ((s64)c->sgpr64(a0))) {// bnel s7, a0, L6 + c->mov64(a0, a0); // or a0, a0, r0 + goto block_13; + } + +block_11: + c->lui(a0, 16288); // lui a0, 16288 + c->mtc1(f0, a0); // mtc1 f0, a0 + c->lwc1(f1, 8, v1); // lwc1 f1, 8(v1) + cop1_bc = c->fprs[f0] < c->fprs[f1]; // c.lt.s f0, f1 + bc = cop1_bc; // bc1t L6 + c->daddiu(a0, s7, 4); // daddiu a0, s7, 4 + if (bc) {goto block_13;} // branch non-likely + + c->mov64(a0, s7); // or a0, s7, r0 + +block_13: + bc = c->sgpr64(s7) == c->sgpr64(a0); // beq s7, a0, L10 + c->mov64(a0, s7); // or a0, s7, r0 + if (bc) {goto block_20;} // branch non-likely + + c->mtc1(f0, r0); // mtc1 f0, r0 + c->mtc1(f0, r0); // mtc1 f0, r0 + c->lwc1(f0, 4, v1); // lwc1 f0, 4(v1) + c->lwc1(f1, 0, v1); // lwc1 f1, 0(v1) + cop1_bc = c->fprs[f0] < c->fprs[f1]; // c.lt.s f0, f1 + bc = !cop1_bc; // bc1f L7 + // nop // sll r0, r0, 0 + if (bc) {goto block_16;} // branch non-likely + + c->lwc1(f0, 0, v1); // lwc1 f0, 0(v1) + c->lwc1(f1, 8240, s4); // lwc1 f1, 8240(s4) + c->mfc1(a0, f1); // mfc1 a0, f1 + //beq r0, r0, L8 // beq r0, r0, L8 + // nop // sll r0, r0, 0 + goto block_17; // branch always + + +block_16: + c->lwc1(f0, 4, v1); // lwc1 f0, 4(v1) + c->lwc1(f1, 8244, s4); // lwc1 f1, 8244(s4) + c->mfc1(a0, f1); // mfc1 a0, f1 + +block_17: + c->lwc1(f2, 8, v1); // lwc1 f2, 8(v1) + cop1_bc = c->fprs[f0] < c->fprs[f2]; // c.lt.s f0, f2 + bc = !cop1_bc; // bc1f L9 + c->mov64(a0, s7); // or a0, s7, r0 + if (bc) {goto block_19;} // branch non-likely + + c->lwc1(f0, 8, v1); // lwc1 f0, 8(v1) + c->lwc1(f1, 8248, s4); // lwc1 f1, 8248(s4) + c->mfc1(v1, f1); // mfc1 v1, f1 + +block_19: + c->lui(v1, 16288); // lui v1, 16288 + c->mtc1(f2, v1); // mtc1 f2, v1 + c->subs(f2, f2, f1); // sub.s f2, f2, f1 + c->subs(f0, f0, f1); // sub.s f0, f0, f1 + c->divs(f0, f2, f0); // div.s f0, f2, f0 + c->daddiu(v1, s4, 8192); // daddiu v1, s4, 8192 + c->daddiu(a0, s4, 8192); // daddiu a0, s4, 8192 + c->movs(f1, f0); // mov.s f1, f0 + c->lqc2(vf1, 0, a0); // lqc2 vf1, 0(a0) + c->mfc1(a0, f1); // mfc1 a0, f1 + c->mov128_vf_gpr(vf2, a0); // qmtc2.i vf2, a0 + c->vadd_bc(DEST::w, BC::x, vf1, vf0, vf0); // vaddx.w vf1, vf0, vf0 + c->vmul_bc(DEST::xyz, BC::x, vf1, vf1, vf2); // vmulx.xyz vf1, vf1, vf2 + c->sqc2(vf1, 0, v1); // sqc2 vf1, 0(v1) + c->daddiu(v1, s4, 8208); // daddiu v1, s4, 8208 + c->daddiu(a0, s4, 8208); // daddiu a0, s4, 8208 + c->movs(f1, f0); // mov.s f1, f0 + c->lqc2(vf1, 0, a0); // lqc2 vf1, 0(a0) + c->mfc1(a0, f1); // mfc1 a0, f1 + c->mov128_vf_gpr(vf2, a0); // qmtc2.i vf2, a0 + c->vadd_bc(DEST::w, BC::x, vf1, vf0, vf0); // vaddx.w vf1, vf0, vf0 + c->vmul_bc(DEST::xyz, BC::x, vf1, vf1, vf2); // vmulx.xyz vf1, vf1, vf2 + c->sqc2(vf1, 0, v1); // sqc2 vf1, 0(v1) + c->daddiu(a0, s4, 8224); // daddiu a0, s4, 8224 + c->daddiu(v1, s4, 8224); // daddiu v1, s4, 8224 + c->lqc2(vf1, 0, v1); // lqc2 vf1, 0(v1) + c->mfc1(v1, f0); // mfc1 v1, f0 + c->mov128_vf_gpr(vf2, v1); // qmtc2.i vf2, v1 + c->vadd_bc(DEST::w, BC::x, vf1, vf0, vf0); // vaddx.w vf1, vf0, vf0 + c->vmul_bc(DEST::xyz, BC::x, vf1, vf1, vf2); // vmulx.xyz vf1, vf1, vf2 + c->sqc2(vf1, 0, a0); // sqc2 vf1, 0(a0) + +block_20: + // daddiu v1, fp, L18 // daddiu v1, fp, L18 + c->daddiu(a2, s4, 8192); // daddiu a2, s4, 8192 + c->daddiu(a0, s4, 8192); // daddiu a0, s4, 8192 + c->mov64(a1, v1); // or a1, v1, r0 + c->lqc2(vf4, 0, a0); // lqc2 vf4, 0(a0) + c->lqc2(vf5, 0, a1); // lqc2 vf5, 0(a1) + c->vadd_bc(DEST::w, BC::x, vf6, vf0, vf0); // vaddx.w vf6, vf0, vf0 + c->vmul(DEST::xyz, vf6, vf4, vf5); // vmul.xyz vf6, vf4, vf5 + c->sqc2(vf6, 0, a2); // sqc2 vf6, 0(a2) + c->daddiu(a2, s4, 8208); // daddiu a2, s4, 8208 + c->daddiu(a0, s4, 8208); // daddiu a0, s4, 8208 + c->mov64(a1, v1); // or a1, v1, r0 + c->lqc2(vf4, 0, a0); // lqc2 vf4, 0(a0) + c->lqc2(vf5, 0, a1); // lqc2 vf5, 0(a1) + c->vadd_bc(DEST::w, BC::x, vf6, vf0, vf0); // vaddx.w vf6, vf0, vf0 + c->vmul(DEST::xyz, vf6, vf4, vf5); // vmul.xyz vf6, vf4, vf5 + c->sqc2(vf6, 0, a2); // sqc2 vf6, 0(a2) + c->daddiu(a2, s4, 8224); // daddiu a2, s4, 8224 + c->daddiu(a0, s4, 8224); // daddiu a0, s4, 8224 + c->mov64(a1, v1); // or a1, v1, r0 + c->lqc2(vf4, 0, a0); // lqc2 vf4, 0(a0) + c->lqc2(vf5, 0, a1); // lqc2 vf5, 0(a1) + c->vadd_bc(DEST::w, BC::x, vf6, vf0, vf0); // vaddx.w vf6, vf0, vf0 + c->vmul(DEST::xyz, vf6, vf4, vf5); // vmul.xyz vf6, vf4, vf5 + c->sqc2(vf6, 0, a2); // sqc2 vf6, 0(a2) + c->daddiu(a1, s4, 8240); // daddiu a1, s4, 8240 + c->daddiu(a0, s4, 8240); // daddiu a0, s4, 8240 + c->lqc2(vf4, 0, a0); // lqc2 vf4, 0(a0) + c->lqc2(vf5, 0, v1); // lqc2 vf5, 0(v1) + c->vadd_bc(DEST::w, BC::x, vf6, vf0, vf0); // vaddx.w vf6, vf0, vf0 + c->vmul(DEST::xyz, vf6, vf4, vf5); // vmul.xyz vf6, vf4, vf5 + c->sqc2(vf6, 0, a1); // sqc2 vf6, 0(a1) + c->lui(v1, 17152); // lui v1, 17152 + c->mtc1(f0, v1); // mtc1 f0, v1 + c->swc1(f0, 8204, s4); // swc1 f0, 8204(s4) + c->lui(v1, 17152); // lui v1, 17152 + c->mtc1(f0, v1); // mtc1 f0, v1 + c->swc1(f0, 8220, s4); // swc1 f0, 8220(s4) + c->lui(v1, 17152); // lui v1, 17152 + c->mtc1(f0, v1); // mtc1 f0, v1 + c->swc1(f0, 8236, s4); // swc1 f0, 8236(s4) + c->mtc1(f0, r0); // mtc1 f0, r0 + c->swc1(f0, 8252, s4); // swc1 f0, 8252(s4) + c->mfc1(v1, f0); // mfc1 v1, f0 + c->vmax_bc(DEST::xyzw, BC::w, vf1, vf0, vf0); // vmaxw.xyzw vf1, vf0, vf0 + c->lqc2(vf12, 8096, s4); // lqc2 vf12, 8096(s4) + c->lqc2(vf5, 8144, s4); // lqc2 vf5, 8144(s4) + c->lqc2(vf6, 8160, s4); // lqc2 vf6, 8160(s4) + c->lqc2(vf7, 8176, s4); // lqc2 vf7, 8176(s4) + c->lqc2(vf8, 8192, s4); // lqc2 vf8, 8192(s4) + c->lqc2(vf9, 8208, s4); // lqc2 vf9, 8208(s4) + c->lqc2(vf10, 8224, s4); // lqc2 vf10, 8224(s4) + c->lqc2(vf11, 8240, s4); // lqc2 vf11, 8240(s4) + c->addiu(v1, r0, 31); // addiu v1, r0, 31 + c->mov64(a0, gp); // or a0, gp, r0 + c->daddiu(a1, gp, 128); // daddiu a1, gp, 128 + // nop // sll r0, r0, 0 + +block_21: + c->lqc2(vf2, 0, gp); // lqc2 vf2, 0(gp) + c->addiu(t2, r0, 6); // addiu t2, r0, 6 + c->lqc2(vf3, 16, gp); // lqc2 vf3, 16(gp) + c->daddiu(t5, gp, 16); // daddiu t5, gp, 16 + c->lqc2(vf4, 0, a1); // lqc2 vf4, 0(a1) + c->daddiu(a1, a1, 16); // daddiu a1, a1, 16 + // Unknown instr: vcallms 0 + vcallms0(c); + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t1, vf20); // qmfc2.i t1, vf20 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t0, vf21); // qmfc2.i t0, vf21 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(a3, vf22); // qmfc2.i a3, vf22 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(a2, vf23); // qmfc2.i a2, vf23 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t6, vf24); // qmfc2.i t6, vf24 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t7, vf25); // qmfc2.i t7, vf25 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t3, vf26); // qmfc2.i t3, vf26 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t4, vf27); // qmfc2.i t4, vf27 + // nop // sll r0, r0, 0 + c->lqc2(vf2, 0, t5); // lqc2 vf2, 0(t5) + // nop // sll r0, r0, 0 + c->lqc2(vf3, 16, t5); // lqc2 vf3, 16(t5) + c->daddiu(gp, t5, 16); // daddiu gp, t5, 16 + c->lqc2(vf4, 0, a1); // lqc2 vf4, 0(a1) + c->daddiu(a1, a1, 16); // daddiu a1, a1, 16 + +block_22: + // Unknown instr: vcallms 0 + vcallms0(c); + // nop // sll r0, r0, 0 + c->pextlw(t5, t7, t6); // pextlw t5, t7, t6 + // nop // sll r0, r0, 0 + c->pextuw(t6, t7, t6); // pextuw t6, t7, t6 + // nop // sll r0, r0, 0 + c->pextlw(t7, t4, t3); // pextlw t7, t4, t3 + // nop // sll r0, r0, 0 + c->pextuw(t4, t4, t3); // pextuw t4, t4, t3 + // nop // sll r0, r0, 0 + c->pcpyld(t3, t7, t5); // pcpyld t3, t7, t5 + c->sq(t1, 0, s5); // sq t1, 0(s5) + c->pcpyud(t1, t5, t7); // pcpyud t1, t5, t7 + c->sq(t0, 32, s5); // sq t0, 32(s5) + c->pcpyld(t0, t4, t6); // pcpyld t0, t4, t6 + c->sq(a3, 64, s5); // sq a3, 64(s5) + c->pcpyud(a3, t6, t4); // pcpyud a3, t6, t4 + c->sq(a2, 96, s5); // sq a2, 96(s5) + c->sq(t3, 16, s5); // sq t3, 16(s5) + // nop // sll r0, r0, 0 + c->sq(t1, 48, s5); // sq t1, 48(s5) + // nop // sll r0, r0, 0 + c->sq(t0, 80, s5); // sq t0, 80(s5) + // nop // sll r0, r0, 0 + c->sq(a3, 112, s5); // sq a3, 112(s5) + c->daddiu(s5, s5, 128); // daddiu s5, s5, 128 + c->mov128_gpr_vf(t1, vf20); // qmfc2.i t1, vf20 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t0, vf21); // qmfc2.i t0, vf21 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(a3, vf22); // qmfc2.i a3, vf22 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(a2, vf23); // qmfc2.i a2, vf23 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t6, vf24); // qmfc2.i t6, vf24 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t7, vf25); // qmfc2.i t7, vf25 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t3, vf26); // qmfc2.i t3, vf26 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t4, vf27); // qmfc2.i t4, vf27 + c->daddiu(t2, t2, -1); // daddiu t2, t2, -1 + c->lqc2(vf2, 0, gp); // lqc2 vf2, 0(gp) + c->daddiu(a1, a1, 16); // daddiu a1, a1, 16 + c->lqc2(vf3, 16, gp); // lqc2 vf3, 16(gp) + c->daddiu(gp, gp, 16); // daddiu gp, gp, 16 + bc = ((s64)c->sgpr64(t2)) > 0; // bgtz t2, L12 + c->lqc2(vf4, -16, a1); // lqc2 vf4, -16(a1) + if (bc) {goto block_22;} // branch non-likely + + c->lqc2(vf3, -128, gp); // lqc2 vf3, -128(gp) + // nop // sll r0, r0, 0 + // Unknown instr: vcallms 0 + vcallms0(c); + // nop // sll r0, r0, 0 + c->pextlw(t2, t7, t6); // pextlw t2, t7, t6 + // nop // sll r0, r0, 0 + c->pextuw(t5, t7, t6); // pextuw t5, t7, t6 + // nop // sll r0, r0, 0 + c->pextlw(t6, t4, t3); // pextlw t6, t4, t3 + // nop // sll r0, r0, 0 + c->pextuw(t4, t4, t3); // pextuw t4, t4, t3 + // nop // sll r0, r0, 0 + c->pcpyld(t3, t6, t2); // pcpyld t3, t6, t2 + c->sq(t1, 0, s5); // sq t1, 0(s5) + c->pcpyud(t1, t2, t6); // pcpyud t1, t2, t6 + c->sq(t0, 32, s5); // sq t0, 32(s5) + c->pcpyld(t0, t4, t5); // pcpyld t0, t4, t5 + c->sq(a3, 64, s5); // sq a3, 64(s5) + c->pcpyud(a3, t5, t4); // pcpyud a3, t5, t4 + c->sq(a2, 96, s5); // sq a2, 96(s5) + c->sq(t3, 16, s5); // sq t3, 16(s5) + // nop // sll r0, r0, 0 + c->sq(t1, 48, s5); // sq t1, 48(s5) + // nop // sll r0, r0, 0 + c->sq(t0, 80, s5); // sq t0, 80(s5) + // nop // sll r0, r0, 0 + c->sq(a3, 112, s5); // sq a3, 112(s5) + c->daddiu(a2, s5, 128); // daddiu a2, s5, 128 + c->mov128_gpr_vf(t2, vf20); // qmfc2.i t2, vf20 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t1, vf21); // qmfc2.i t1, vf21 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t0, vf22); // qmfc2.i t0, vf22 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(a3, vf23); // qmfc2.i a3, vf23 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t4, vf24); // qmfc2.i t4, vf24 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t7, vf25); // qmfc2.i t7, vf25 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t5, vf26); // qmfc2.i t5, vf26 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t6, vf27); // qmfc2.i t6, vf27 + c->daddiu(v1, v1, -1); // daddiu v1, v1, -1 + c->pextlw(t3, t7, t4); // pextlw t3, t7, t4 + // nop // sll r0, r0, 0 + c->pextuw(t4, t7, t4); // pextuw t4, t7, t4 + // nop // sll r0, r0, 0 + c->pextlw(t7, t6, t5); // pextlw t7, t6, t5 + // nop // sll r0, r0, 0 + c->pextuw(t6, t6, t5); // pextuw t6, t6, t5 + // nop // sll r0, r0, 0 + c->pcpyld(t5, t7, t3); // pcpyld t5, t7, t3 + c->sq(t2, 0, a2); // sq t2, 0(a2) + c->pcpyud(t2, t3, t7); // pcpyud t2, t3, t7 + c->sq(t1, 32, a2); // sq t1, 32(a2) + c->pcpyld(t1, t6, t4); // pcpyld t1, t6, t4 + c->sq(t0, 64, a2); // sq t0, 64(a2) + c->pcpyud(t0, t4, t6); // pcpyud t0, t4, t6 + c->sq(a3, 96, a2); // sq a3, 96(a2) + c->sq(t5, 16, a2); // sq t5, 16(a2) + // nop // sll r0, r0, 0 + c->sq(t2, 48, a2); // sq t2, 48(a2) + // nop // sll r0, r0, 0 + c->sq(t1, 80, a2); // sq t1, 80(a2) + // nop // sll r0, r0, 0 + c->sq(t0, 112, a2); // sq t0, 112(a2) + c->daddiu(s5, a2, 128); // daddiu s5, a2, 128 + bc = ((s64)c->sgpr64(v1)) > 0; // bgtz v1, L11 + // nop // sll r0, r0, 0 + if (bc) {goto block_21;} // branch non-likely + + bc = c->sgpr64(v1) == 0; // beq v1, r0, L11 + c->mov64(a1, a0); // or a1, a0, r0 + if (bc) {goto block_21;} // branch non-likely + + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->ld(fp, 8, sp); // ld fp, 8(sp) + c->lq(gp, 64, sp); // lq gp, 64(sp) + c->lq(s5, 48, sp); // lq s5, 48(sp) + c->lq(s4, 32, sp); // lq s4, 32(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 80); // daddiu sp, sp, 80 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.level = intern_from_c("*level*").c(); + cache.time_of_day_context = intern_from_c("*time-of-day-context*").c(); + cache.ocean_vu0_block = intern_from_c("ocean-vu0-block").c(); + cache.sewerb = intern_from_c("sewerb").c(); + cache.upload_vu0_program = intern_from_c("upload-vu0-program").c(); + cache.vu_lights_light_group = intern_from_c("vu-lights<-light-group!").c(); + gLinkedFunctionTable.reg("(method 16 ocean)", execute, 128); +} + +} // namespace method_16_ocean +} // namespace Mips2C \ No newline at end of file diff --git a/game/mips2c/mips2c_table.cpp b/game/mips2c/mips2c_table.cpp index a5afab5545..8d89707cdd 100644 --- a/game/mips2c/mips2c_table.cpp +++ b/game/mips2c/mips2c_table.cpp @@ -160,6 +160,12 @@ namespace method_9_edge_grab_info { extern void link(); } namespace method_16_collide_edge_work { extern void link(); } namespace method_17_collide_edge_work { extern void link(); } namespace method_18_collide_edge_work { extern void link(); } +namespace init_ocean_far_regs { extern void link(); } +namespace draw_large_polygon_ocean { extern void link(); } +namespace render_ocean_quad { extern void link(); } +namespace method_16_ocean { extern void link(); } +namespace method_15_ocean { extern void link(); } +namespace method_14_ocean { extern void link(); } } // clang-format on @@ -264,7 +270,12 @@ PerGameVersion>> gMips2C {"collide-edge-grab", {jak2::method_10_collide_edge_hold_list::link, jak2::method_19_collide_edge_work::link, jak2::method_9_edge_grab_info::link, jak2::method_16_collide_edge_work::link, - jak2::method_17_collide_edge_work::link, jak2::method_18_collide_edge_work::link}}}, + jak2::method_17_collide_edge_work::link, jak2::method_18_collide_edge_work::link}}, + {"ocean-vu0", + {jak2::method_16_ocean::link, jak2::method_15_ocean::link, jak2::method_14_ocean::link}}, + {"ocean", + {jak2::init_ocean_far_regs::link, jak2::draw_large_polygon_ocean::link, + jak2::render_ocean_quad::link}}}, }; void LinkedFunctionTable::reg(const std::string& name, u64 (*exec)(void*), u32 stack_size) { diff --git a/goal_src/jak2/engine/common_objs/rigid-body-plat.gc b/goal_src/jak2/engine/common_objs/rigid-body-plat.gc index 8f57a5cf2e..3ce780f7f5 100644 --- a/goal_src/jak2/engine/common_objs/rigid-body-plat.gc +++ b/goal_src/jak2/engine/common_objs/rigid-body-plat.gc @@ -104,7 +104,7 @@ f0-1 ) (else - (ocean-method-11 *ocean* arg0 #t) + (get-height *ocean* arg0 #t) ) ) ) diff --git a/goal_src/jak2/engine/common_objs/water.gc b/goal_src/jak2/engine/common_objs/water.gc index 5507c106ea..e84c849028 100644 --- a/goal_src/jak2/engine/common_objs/water.gc +++ b/goal_src/jak2/engine/common_objs/water.gc @@ -1514,8 +1514,8 @@ ) (('ocean) (set! (-> arg0 flags) (water-flags active use-ocean)) - (set! (-> arg0 trans y) (ocean-method-11 *ocean* (-> arg0 trans) #f)) - (set! (-> arg0 base-height) (ocean-map-method-10 *ocean-map*)) + (set! (-> arg0 trans y) (get-height *ocean* (-> arg0 trans) #f)) + (set! (-> arg0 base-height) (get-base-height *ocean-map*)) (when (= (-> arg0 trans y) 4095996000.0) (set! (-> arg0 flags) (water-flags)) 0 diff --git a/goal_src/jak2/engine/game/settings.gc b/goal_src/jak2/engine/game/settings.gc index 8a03c44579..749c3c49a8 100644 --- a/goal_src/jak2/engine/game/settings.gc +++ b/goal_src/jak2/engine/game/settings.gc @@ -35,7 +35,7 @@ (let ((s1-0 (-> (the-as connection s3-1) param0))) (case s1-0 (('sfx-volume) - (if (or (zero? (logand (-> *kernel-context* prevent-from-run) (process-mask progress))) + (if (or (not (logtest? (-> *kernel-context* prevent-from-run) (process-mask progress))) (= ((method-of-type connection get-process) (the-as connection s3-1)) (ppointer->process *progress-process*)) ) (user-setting-data-method-10 @@ -502,7 +502,7 @@ (let ((s1-0 (-> (the-as connection s3-1) param0))) (case s1-0 (('sfx-volume) - (if (or (zero? (logand (-> *kernel-context* prevent-from-run) (process-mask progress))) + (if (or (not (logtest? (-> *kernel-context* prevent-from-run) (process-mask progress))) (= ((method-of-type connection get-process) (the-as connection s3-1)) (ppointer->process *progress-process*)) ) (cam-setting-data-method-10 @@ -1253,13 +1253,13 @@ (let ((v1-137 *ocean*)) (case (-> s5-0 ocean-off) ((#t) - (set! (-> v1-137 off) (the-as basic #t)) + (set! (-> v1-137 off) #t) ) (('mid) - (set! (-> v1-137 mid-off) (the-as basic #t)) + (set! (-> v1-137 mid-off) #t) ) (('near) - (set! (-> v1-137 near-off) (the-as basic #t)) + (set! (-> v1-137 near-off) #t) ) ) ) diff --git a/goal_src/jak2/engine/gfx/mood/weather-part.gc b/goal_src/jak2/engine/gfx/mood/weather-part.gc index 6248f9b3af..12eb1b25e1 100644 --- a/goal_src/jak2/engine/gfx/mood/weather-part.gc +++ b/goal_src/jak2/engine/gfx/mood/weather-part.gc @@ -600,7 +600,7 @@ ) ) ) - (let ((f0-21 (ocean-method-11 *ocean* (-> arg2 x-y-z-sx) #f))) + (let ((f0-21 (get-height *ocean* (-> arg2 x-y-z-sx) #f))) (when (!= f0-21 4095996000.0) (when (< (-> arg1 user-float) f0-21) (set! (-> arg1 user-float) f0-21) diff --git a/goal_src/jak2/engine/gfx/ocean/ocean-frames.gc b/goal_src/jak2/engine/gfx/ocean/ocean-frames.gc index e99e39e4f0..6a8a7dcc81 100644 --- a/goal_src/jak2/engine/gfx/ocean/ocean-frames.gc +++ b/goal_src/jak2/engine/gfx/ocean/ocean-frames.gc @@ -16394,7 +16394,3 @@ #xd7ee0411 ) ) - - - - diff --git a/goal_src/jak2/engine/gfx/ocean/ocean-h.gc b/goal_src/jak2/engine/gfx/ocean/ocean-h.gc index 6fab74f322..0d4ebf6d50 100644 --- a/goal_src/jak2/engine/gfx/ocean/ocean-h.gc +++ b/goal_src/jak2/engine/gfx/ocean/ocean-h.gc @@ -330,7 +330,7 @@ (drw2-frame qword :inline :offset-assert 464) (drw2-strip gs-gif-tag :inline :offset-assert 480) (drw3-adgif gs-gif-tag :inline :offset-assert 496) - (drw3-frame qword :inline :offset-assert 512) + (drw3-frame gs-adcmd :inline :offset-assert 512) (index-table vector4w 4 :inline :offset-assert 528) ) :method-count-assert 9 @@ -407,21 +407,21 @@ :flag-assert #xb00000038 (:methods (set-height! (_type_ float) none 9) - (ocean-map-method-10 (_type_) float 10) + (get-base-height (_type_) float 10) ) ) (deftype ocean (ocean-map) - ((off basic :offset-assert 56) - (near-off basic :offset-assert 60) - (mid-off basic :offset-assert 64) - (far-on basic :offset-assert 68) + ((off symbol :offset-assert 56) + (near-off symbol :offset-assert 60) + (mid-off symbol :offset-assert 64) + (far-on symbol :offset-assert 68) (ocean-facing uint32 :offset-assert 72) (heights ocean-height-array :offset-assert 76) (heights2 ocean-height-array :offset-assert 80) (verts ocean-vert-array :offset-assert 84) - (ocean-near-translucent? basic :offset-assert 88) + (ocean-near-translucent? symbol :offset-assert 88) (deltas vector :inline :offset-assert 96) (map-min vector :inline :offset-assert 112) (map-max vector :inline :offset-assert 128) @@ -432,7 +432,7 @@ (mid-mask-ptrs pointer 36 :offset-assert 2240) (mid-camera-masks uint64 36 :offset-assert 2384) (trans-mask-ptrs pointer 64 :offset-assert 2672) - (trans-camera-masks uint32 16 :offset-assert 2928) + (trans-camera-masks ocean-trans-mask 16 :offset-assert 2928) (trans-temp-masks uint32 16 :offset-assert 2992) (sprite-tmpl dma-gif-packet :inline :offset-assert 3056) (sprite-tmpl2 dma-gif-packet :inline :offset-assert 3088) @@ -488,8 +488,8 @@ (temp-maxx uint8 :offset-assert 8045) (temp-minz uint8 :offset-assert 8046) (temp-maxz uint8 :offset-assert 8047) - (tex1 uint64 :offset-assert 8048) - (tex1-near uint64 :offset-assert 8056) + (tex1 gs-tex1 :offset-assert 8048) + (tex1-near gs-tex1 :offset-assert 8056) (corner00 float :offset-assert 8064) (corner01 float :offset-assert 8068) (corner10 float :offset-assert 8072) @@ -512,87 +512,87 @@ :size-assert #x206c :flag-assert #x5c0000206c (:methods - (ocean-method-11 (_type_ vector symbol) float 11) + (get-height (_type_ vector symbol) float 11) (draw! (_type_) none 12) (update-map (_type_) none 13) - (ocean-method-14 () none 14) - (ocean-method-15 () none 15) - (ocean-method-16 () none 16) - (ocean-method-17 () none 17) - (ocean-method-18 (_type_ object object) none 18) - (ocean-method-19 () none 19) - (ocean-method-20 () none 20) - (ocean-method-21 (_type_ float float) float 21) - (ocean-method-22 () none 22) - (ocean-method-23 () none 23) - (ocean-method-24 () none 24) - (ocean-method-25 () none 25) - (ocean-method-26 () none 26) - (ocean-method-27 () none 27) - (ocean-method-28 () none 28) - (ocean-method-29 () none 29) - (ocean-method-30 () none 30) - (ocean-method-31 () none 31) - (ocean-method-32 () none 32) - (ocean-method-33 () none 33) - (ocean-method-34 () none 34) - (ocean-method-35 () none 35) - (ocean-method-36 () none 36) - (ocean-method-37 () none 37) - (ocean-method-38 () none 38) - (ocean-method-39 () none 39) - (ocean-method-40 () none 40) - (ocean-method-41 () none 41) - (ocean-method-42 () none 42) - (ocean-method-43 () none 43) - (ocean-method-44 () none 44) - (ocean-method-45 () none 45) - (ocean-method-46 () none 46) - (ocean-method-47 () none 47) - (ocean-method-48 () none 48) - (ocean-method-49 () none 49) - (ocean-method-50 () none 50) - (ocean-method-51 () none 51) - (ocean-method-52 () none 52) - (ocean-method-53 () none 53) - (ocean-method-54 () none 54) - (ocean-method-55 () none 55) - (ocean-method-56 () none 56) - (ocean-method-57 () none 57) - (ocean-method-58 () none 58) - (ocean-method-59 () none 59) - (ocean-method-60 () none 60) - (ocean-method-61 () none 61) - (ocean-method-62 () none 62) - (ocean-method-63 () none 63) - (ocean-method-64 () none 64) - (ocean-method-65 () none 65) - (ocean-method-66 () none 66) - (ocean-method-67 () none 67) - (ocean-method-68 () none 68) - (ocean-method-69 () none 69) - (ocean-method-70 () none 70) - (ocean-method-71 () none 71) - (ocean-method-72 () none 72) - (ocean-method-73 () none 73) - (ocean-method-74 () none 74) - (ocean-method-75 () none 75) - (ocean-method-76 () none 76) - (ocean-method-77 () none 77) - (ocean-method-78 () none 78) - (ocean-method-79 () none 79) - (ocean-method-80 () none 80) - (ocean-method-81 () none 81) - (ocean-method-82 () none 82) - (ocean-method-83 () none 83) - (ocean-method-84 () none 84) - (ocean-method-85 () none 85) - (ocean-method-86 () none 86) - (ocean-method-87 () none 87) - (ocean-method-88 () none 88) - (ocean-method-89 () none 89) - (ocean-method-90 () none 90) - (ocean-method-91 () none 91) + (interp-wave (_type_ ocean-wave-info uint float) none 14) + (ocean-method-15 (_type_ matrix matrix) none 15) + (generate-verts () none 16) + (add-colors! (_type_ vector ocean-vertex) none 17) + (ocean-method-18 (_type_ (pointer ocean-colors) (pointer ocean-colors)) none 18) + (init-buffer! (_type_ dma-buffer) pointer 19) + (end-buffer! (_type_ dma-buffer) none 20) + (set-corners! (_type_ float float) float 21) + (ocean-near-add-call (_type_ dma-buffer int) none 22) + (ocean-near-add-call-flush (_type_ dma-buffer int) none 23) + (ocean-near-setup-constants (_type_ ocean-near-constants) none 24) + (ocean-near-add-constants (_type_ dma-buffer) none 25) + (ocean-near-add-heights (_type_ dma-buffer) none 26) + (ocean-near-add-matrices (_type_ dma-buffer vector) none 27) + (ocean-near-add-upload (_type_ dma-buffer uint uint) none 28) + (draw-ocean-near (_type_ dma-buffer) none 29) + (ocean-trans-camera-masks-bit? (_type_ uint uint) symbol 30) + (ocean-trans-mask-ptrs-bit? (_type_ int int) symbol 31) + (ocean-trans-mask-ptrs-set! (_type_ uint uint) symbol 32) + (ocean-trans-add-upload-table (_type_ dma-buffer uint uint int int symbol) none 33) + (ocean-trans-add-upload-strip (_type_ dma-buffer uint uint int int int) none 34) + (ocean-transition-check (_type_ ocean-trans-mask int int vector) none 35) + (ocean-make-trans-camera-masks (_type_ uint uint uint uint) none 36) + (ocean-trans-add-upload (_type_ dma-buffer uint uint) none 37) + (draw-ocean-transition-seams (_type_ dma-buffer) none 38) + (ocean-trans-add-constants (_type_ dma-buffer) none 39) + (draw-ocean-transition (_type_ dma-buffer) none 40) + (ocean-mid-add-call (_type_ dma-buffer int) none 41) + (ocean-mid-add-call-flush (_type_ dma-buffer uint) none 42) + (ocean-matrix*! (_type_ matrix matrix matrix) matrix 43) + (ocean-vector-matrix*! (_type_ vector vector matrix) vector 44) + (ocean-mid-add-matrices (_type_ dma-buffer vector) none 45) + (ocean-mid-check (_type_ pointer int int vector) symbol 46) + (ocean-mid-setup-constants (_type_ ocean-mid-constants) none 47) + (ocean-mid-add-constants (_type_ dma-buffer) none 48) + (ocean-mid-camera-masks-bit? (_type_ uint uint) symbol 49) + (ocean-mid-mask-ptrs-bit? (_type_ uint uint) symbol 50) + (ocean-mid-camera-masks-set! (_type_ uint uint) symbol 51) + (ocean-mid-add-upload (_type_ dma-buffer int int int int float) none 52) + (ocean-mid-add-upload-table (_type_ dma-buffer uint uint (pointer float) int symbol) none 53) + (ocean-mid-add-upload-top (_type_ dma-buffer uint uint) none 54) + (ocean-mid-add-upload-middle (_type_ dma-buffer uint uint) none 55) + (ocean-mid-add-upload-bottom (_type_ dma-buffer uint uint) none 56) + (ocean-seams-add-constants (_type_ dma-buffer) none 57) + (draw-ocean-mid-seams (_type_ dma-buffer) none 58) + (draw-ocean-mid (_type_ dma-buffer) none 59) + (ocean-method-60 (_type_ dma-buffer) none 60) + (ocean-method-61 (_type_ dma-buffer) none 61) + (ocean-method-62 (_type_ dma-buffer) none 62) + (ocean-method-63 (_type_ dma-buffer) none 63) + (ocean-method-64 (_type_ dma-buffer) none 64) + (ocean-method-65 (_type_ dma-buffer) none 65) + (ocean-method-66 (_type_ dma-buffer) none 66) + (ocean-method-67 (_type_ dma-buffer) none 67) + (render-ocean-far (_type_ dma-buffer int) none 68) + (draw-ocean-far (_type_ dma-buffer) none 69) + (ocean-texture-setup-constants (_type_ ocean-texture-constants) none 70) + (ocean-texture-add-constants (_type_ dma-buffer) none 71) + (ocean-texture-add-envmap (_type_ dma-buffer) none 72) + (ocean-texture-add-verts (_type_ dma-buffer int) none 73) + (ocean-texture-add-verts-last (_type_ dma-buffer int int) none 74) + (ocean-texture-add-call-start (_type_ dma-buffer) none 75) + (ocean-texture-add-call-rest (_type_ dma-buffer) none 76) + (ocean-texture-add-call-done (_type_ dma-buffer) none 77) + (draw-ocean-texture (_type_ dma-buffer int) none 78) + (ocean-method-79 (_type_ dma-buffer) none 79) + (ocean-method-80 (_type_ (pointer rgba)) none 80) + (ocean-method-81 (_type_ dma-buffer) none 81) + (draw-envmap-debug (_type_ dma-buffer) none 82) + (ocean-method-83 (_type_ dma-buffer float) none 83) + (ocean-method-84 (_type_ dma-buffer sky-upload-data vector4w float) none 84) + (ocean-method-85 (_type_ dma-buffer) none 85) + (ocean-method-86 (_type_ vector vector vector vector) none 86) + (ocean-method-87 (_type_ vector vector vector) none 87) + (ocean-method-88 (_type_ dma-buffer) none 88) + (ocean-method-89 (_type_ dma-buffer) none 89) + (rgba-to-vector! (_type_ vector (pointer rgba)) none 90) + (do-tex-scroll! (_type_) none 91) ) ) @@ -931,8 +931,8 @@ #x80 #x80 ) - :tex1 #xeed00080178 - :tex1-near #xeed0008016c + :tex1 (new 'static 'gs-tex1 :mxl #x6 :mmag #x1 :mmin #x5 :l #x1 :k #xeed) + :tex1-near (new 'static 'gs-tex1 :mxl #x3 :mmag #x1 :mmin #x5 :l #x1 :k #xeed) :scales (new 'static 'vector :x -0.00012207031 :y 255.0 :z -0.00012207031 :w 128.0) :mask-hi (new 'static 'vector4w :x -65536 :y -65536 :z -65536 :w -65536) :mask-lo (new 'static 'vector4w :x #xffff :y #xffff :z #xffff :w #xffff) diff --git a/goal_src/jak2/engine/gfx/ocean/ocean-mid.gc b/goal_src/jak2/engine/gfx/ocean/ocean-mid.gc index 90580a8d74..134af5b334 100644 --- a/goal_src/jak2/engine/gfx/ocean/ocean-mid.gc +++ b/goal_src/jak2/engine/gfx/ocean/ocean-mid.gc @@ -7,3 +7,1191 @@ ;; DECOMP BEGINS +(define ocean-mid-block (new 'static 'vu-function :length #x490 :qlength #x248)) + +(defmethod ocean-mid-setup-constants ocean ((obj ocean) (arg0 ocean-mid-constants)) + (let ((v1-0 *math-camera*)) + (set! (-> arg0 hmge-scale quad) (-> v1-0 hmge-scale quad)) + (set! (-> arg0 inv-hmge-scale quad) (-> v1-0 inv-hmge-scale quad)) + (set! (-> arg0 hvdf-offset quad) (-> v1-0 hvdf-off quad)) + (set-vector! (-> arg0 fog) (-> v1-0 pfog0) (-> v1-0 fog-min) (-> v1-0 fog-max) 3072.0) + ) + (set-vector! (-> arg0 constants) -0.25 -0.5 0.0 393216.0) + (let ((t9-0 matrix-local->world) + (a0-8 #f) + ) + (let* ((s4-0 (-> (t9-0 a0-8) vector 2)) + (f0-12 (- 1.5 (* 0.000015258789 (atan (-> s4-0 x) (-> s4-0 z))))) + (f1-1 (+ 0.5 (* -0.5 (-> s4-0 y)))) + ) + (set-vector! (-> arg0 constants2) f0-12 f1-1 1.0 0.0) + ) + ) + (case *subdivide-ocean-draw-mode* + (((subdivide-setting textured)) + (set! (-> arg0 drw-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :fge #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 env-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 drw-strip-0 tag) + (new 'static 'gif-tag64 + :nloop #x12 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :fge #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 drw-strip-1 tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :fge #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 env-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + (((subdivide-setting outline)) + (set! (-> arg0 drw-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 env-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 drw-strip-0 tag) + (new 'static 'gif-tag64 + :nloop #x12 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 drw-strip-1 tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 env-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + (((subdivide-setting gouraud)) + (set! (-> arg0 drw-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :fge #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 env-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 drw-strip-0 tag) + (new 'static 'gif-tag64 + :nloop #x12 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :fge #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 drw-strip-1 tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :fge #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 env-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1) + :nreg #x3 + ) + ) + ) + (((subdivide-setting hack)) + (set! (-> arg0 drw-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :fge #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 env-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 drw-strip-0 tag) + (new 'static 'gif-tag64 + :nloop #x12 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 drw-strip-1 tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 env-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ) + (set! (-> arg0 drw-fan regs) + (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) + ) + (set! (-> arg0 env-fan regs) + (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) + ) + (set! (-> arg0 drw-strip-0 regs) + (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) + ) + (set! (-> arg0 drw-strip-1 regs) + (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) + ) + (set! (-> arg0 env-strip regs) + (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) + ) + (set! (-> arg0 drw-adgif tag) (new 'static 'gif-tag64 :nloop #x5 :nreg #x1)) + (set! (-> arg0 drw-adgif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d))) + (set! (-> arg0 drw-texture tex0) + (new 'static 'gs-tex0 :tbp0 #x2a0 :tbw #x2 :tcc #x1 :th (log2 128) :tw (log2 128)) + ) + (set! (-> arg0 drw-texture prims 1) (gs-reg64 tex0-1)) + (set! (-> arg0 drw-texture tex1) (-> obj tex1)) + (set! (-> arg0 drw-texture prims 3) (gs-reg64 tex1-1)) + (set! (-> arg0 drw-texture miptbp1) (new 'static 'gs-miptbp :tbp1 #x6a0 :tbw1 #x1 :tbp2 #x7a0 :tbp3 #x7e0)) + (set! (-> arg0 drw-texture prims 5) (gs-reg64 miptbp1-1)) + (set! (-> arg0 drw-texture clamp) (new 'static 'gs-clamp)) + (set! (-> arg0 drw-texture clamp-reg) (gs-reg64 clamp-1)) + (set! (-> arg0 drw-texture alpha) (the-as gs-alpha #x8400082000800)) + (set! (-> arg0 drw-texture prims 9) (gs-reg64 miptbp2-1)) + (set! (-> arg0 env-adgif tag) (new 'static 'gif-tag64 :nloop #x5 :nreg #x1)) + (set! (-> arg0 env-adgif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d))) + (cond + ((-> *time-of-day-context* sky) + (set! (-> arg0 env-texture tex0) (new 'static 'gs-tex0 + :tbw #x1 + :tcc #x1 + :th (log2 64) + :tw (log2 64) + :tbp0 (-> *ocean-envmap-texture-base* vram-block) + ) + ) + (set! (-> arg0 env-texture prims 1) (gs-reg64 tex0-1)) + (set! (-> arg0 env-texture tex1) (new 'static 'gs-tex1 :mmag #x1 :mmin #x5 :l #x1 :k #xeed)) + (set! (-> arg0 env-texture prims 3) (gs-reg64 tex1-1)) + (set! (-> arg0 env-texture miptbp1) (new 'static 'gs-miptbp)) + (set! (-> arg0 env-texture prims 5) (gs-reg64 miptbp1-1)) + (set! (-> arg0 env-texture clamp) (new 'static 'gs-clamp)) + (set! (-> arg0 env-texture clamp-reg) (gs-reg64 clamp-1)) + (set! (-> arg0 env-texture alpha) (new 'static 'gs-alpha :b #x2 :c #x1 :d #x1)) + (set! (-> arg0 env-texture prims 9) (gs-reg64 alpha-1)) + ) + (else + (let ((s4-3 (-> arg0 env-texture))) + (adgif-shader<-texture-simple! s4-3 (lookup-texture-by-id (new 'static 'texture-id :page #x1f))) + ) + (set! (-> arg0 env-texture clamp) (new 'static 'gs-clamp)) + (set! (-> arg0 env-texture alpha) (new 'static 'gs-alpha :b #x2 :c #x1 :d #x1)) + ) + ) + (let ((f0-16 (* 128.0 (-> *time-of-day-context* ocean-alpha)))) + (if (-> *time-of-day-context* sky) + (set-vector! (-> arg0 env-color) f0-16 f0-16 f0-16 f0-16) + (set-vector! (-> arg0 env-color) f0-16 f0-16 (* 0.5 f0-16) f0-16) + ) + ) + (set-vector! (-> arg0 index-table 0) 63 84 66 0) + (set-vector! (-> arg0 index-table 1) 54 72 57 0) + (set-vector! (-> arg0 index-table 2) 45 60 48 0) + (set-vector! (-> arg0 index-table 3) 36 48 39 0) + (set-vector! (-> arg0 index-table 4) 27 36 30 0) + (set-vector! (-> arg0 index-table 5) 18 24 21 0) + (set-vector! (-> arg0 index-table 6) 9 12 12 0) + (set-vector! (-> arg0 index-table 7) 0 0 3 0) + (set-vector! (-> arg0 pos0) 0.0 0.0 0.0 1.0) + (set-vector! (-> arg0 pos1) 393216.0 0.0 0.0 1.0) + (set-vector! (-> arg0 pos2) 0.0 0.0 393216.0 1.0) + (set-vector! (-> arg0 pos3) 393216.0 0.0 393216.0 1.0) + 0 + (none) + ) + +(defmethod ocean-mid-add-constants ocean ((obj ocean) (arg0 dma-buffer)) + (let* ((a2-0 36) + (v1-0 arg0) + (a1-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a1-1) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a2-0)) + (set! (-> (the-as dma-packet a1-1) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a1-1) vif1) + (new 'static 'vif-tag :imm #x2dd :cmd (vif-cmd unpack-v4-32) :num a2-0) + ) + (set! (-> v1-0 base) (&+ (the-as pointer a1-1) 16)) + ) + (ocean-mid-setup-constants obj (the-as ocean-mid-constants (-> arg0 base))) + (&+! (-> arg0 base) 576) + 0 + (none) + ) + +(defmethod ocean-matrix*! ocean ((obj ocean) (arg0 matrix) (arg1 matrix) (arg2 matrix)) + (rlet ((acc :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf12 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf) + ) + (.lvf vf1 (&-> arg1 vector 0 quad)) + (.lvf vf5 (&-> arg2 vector 0 quad)) + (.lvf vf6 (&-> arg2 vector 1 quad)) + (.lvf vf7 (&-> arg2 vector 2 quad)) + (.lvf vf8 (&-> arg2 trans quad)) + (.lvf vf2 (&-> arg1 vector 1 quad)) + (.lvf vf3 (&-> arg1 vector 2 quad)) + (.lvf vf4 (&-> arg1 trans quad)) + (.mul.x.vf acc vf5 vf1) + (.add.mul.y.vf acc vf6 vf1 acc) + (.add.mul.z.vf acc vf7 vf1 acc) + (.add.mul.w.vf vf9 vf8 vf1 acc) + (.mul.x.vf acc vf5 vf2) + (.add.mul.y.vf acc vf6 vf2 acc) + (.add.mul.z.vf acc vf7 vf2 acc) + (.add.mul.w.vf vf10 vf8 vf2 acc) + (.mul.x.vf acc vf5 vf3) + (.add.mul.y.vf acc vf6 vf3 acc) + (.add.mul.z.vf acc vf7 vf3 acc) + (.add.mul.w.vf vf11 vf8 vf3 acc) + (.mul.x.vf acc vf5 vf4) + (.add.mul.y.vf acc vf6 vf4 acc) + (.add.mul.z.vf acc vf7 vf4 acc) + (.add.mul.w.vf vf12 vf8 vf4 acc) + (.svf (&-> arg0 vector 0 quad) vf9) + (.svf (&-> arg0 vector 1 quad) vf10) + (.svf (&-> arg0 vector 2 quad) vf11) + (.svf (&-> arg0 trans quad) vf12) + arg0 + ) + ) + +(defmethod ocean-vector-matrix*! ocean ((obj ocean) (arg0 vector) (arg1 vector) (arg2 matrix)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg2 vector 0 quad)) + (.lvf vf2 (&-> arg2 vector 1 quad)) + (.lvf vf3 (&-> arg2 vector 2 quad)) + (.lvf vf4 (&-> arg2 trans quad)) + (.lvf vf5 (&-> arg1 quad)) + (.mul.x.vf acc vf1 vf5) + (.add.mul.y.vf acc vf2 vf5 acc) + (.add.mul.z.vf acc vf3 vf5 acc) + (.add.mul.w.vf vf5 vf4 vf0 acc) + (.svf (&-> arg0 quad) vf5) + arg0 + ) + ) + +(defmethod ocean-mid-add-matrices ocean ((obj ocean) (arg0 dma-buffer) (arg1 vector)) + (let ((s4-0 (new-stack-vector0)) + (v1-3 (if (-> *time-of-day-context* use-camera-other) + (-> *math-camera* camera-rot-other) + (-> *math-camera* camera-rot) + ) + ) + ) + (let* ((a3-0 8) + (a0-1 arg0) + (a1-1 (the-as object (-> a0-1 base))) + ) + (set! (-> (the-as dma-packet a1-1) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a3-0)) + (set! (-> (the-as dma-packet a1-1) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a1-1) vif1) + (new 'static 'vif-tag :imm #x8000 :cmd (vif-cmd unpack-v4-32) :num a3-0) + ) + (set! (-> a0-1 base) (&+ (the-as pointer a1-1) 16)) + ) + (let ((s3-0 (the-as object (-> arg0 base)))) + (let* ((t0-4 (the-as matrix s3-0)) + (t1-2 v1-3) + (a0-2 (-> t1-2 vector 0 quad)) + (a1-3 (-> t1-2 vector 1 quad)) + (a3-4 (-> t1-2 vector 2 quad)) + (t1-3 (-> t1-2 trans quad)) + ) + (set! (-> t0-4 vector 0 quad) a0-2) + (set! (-> t0-4 vector 1 quad) a1-3) + (set! (-> t0-4 vector 2 quad) a3-4) + (set! (-> t0-4 trans quad) t1-3) + ) + (let ((s2-0 (the-as object (&+ (the-as pointer s3-0) 48)))) + (vector-matrix*! s4-0 arg1 v1-3) + (set! (-> (the-as vector s2-0) x) (-> s4-0 x)) + (set! (-> (the-as vector s2-0) y) (-> s4-0 y)) + (set! (-> (the-as vector s2-0) z) (-> s4-0 z)) + ) + (let ((a1-5 (&+ (-> arg0 base) 64))) + (ocean-matrix*! obj (the-as matrix a1-5) (the-as matrix s3-0) (-> *math-camera* perspective)) + ) + ) + ) + (&+! (-> arg0 base) 128) + 0 + (none) + ) + +(defmethod ocean-mid-check ocean ((obj ocean) (arg0 pointer) (arg1 int) (arg2 int) (arg3 vector)) + (local-vars (v0-0 symbol) (v1-10 float) (t0-3 float) (t0-8 float) (t0-13 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (let ((v1-0 (new-stack-vector0)) + (a0-2 (-> *math-camera* trans)) + ) + 1.0 + (set! (-> v1-0 x) (+ (-> arg3 x) (* 393216.0 (the float arg1)))) + (set! (-> v1-0 y) (-> arg3 y)) + (set! (-> v1-0 z) (+ (-> arg3 z) (* 393216.0 (the float arg2)))) + (let ((t0-2 v1-0) + (t1-2 a0-2) + ) + (.lvf vf2 (&-> t0-2 quad)) + (.lvf vf3 (&-> t1-2 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov t0-3 vf1) + (when (< t0-3 309237600000.0) + (logior! (-> (the-as (pointer uint8) (+ arg2 (the-as int arg0)))) (ash 1 arg1)) + (return #f) + ) + (set! (-> v1-0 x) (+ 393216.0 (-> v1-0 x))) + (let ((t0-7 v1-0) + (t1-3 a0-2) + ) + (.lvf vf2 (&-> t0-7 quad)) + (.lvf vf3 (&-> t1-3 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov t0-8 vf1) + (when (< t0-8 309237600000.0) + (logior! (-> (the-as (pointer uint8) (+ arg2 (the-as int arg0)))) (ash 1 arg1)) + (return #f) + ) + (set! (-> v1-0 z) (+ 393216.0 (-> v1-0 z))) + (let ((t0-12 v1-0) + (t1-4 a0-2) + ) + (.lvf vf2 (&-> t0-12 quad)) + (.lvf vf3 (&-> t1-4 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov t0-13 vf1) + (when (< t0-13 309237600000.0) + (logior! (-> (the-as (pointer uint8) (+ arg2 (the-as int arg0)))) (ash 1 arg1)) + (return #f) + ) + (set! (-> v1-0 x) (+ -393216.0 (-> v1-0 x))) + (.lvf vf2 (&-> v1-0 quad)) + (.lvf vf3 (&-> a0-2 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov v1-10 vf1) + (when (< v1-10 309237600000.0) + (logior! (-> (the-as (pointer uint8) (+ arg2 (the-as int arg0)))) (ash 1 arg1)) + (return #f) + v0-0 + ) + ) + ) + +(defmethod ocean-mid-add-call ocean ((obj ocean) (arg0 dma-buffer) (arg1 int)) + (let* ((v1-0 arg0) + (a0-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a0-1) vif1) (new 'static 'vif-tag :cmd (vif-cmd mscalf) :msk #x1 :imm arg1)) + (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) + ) + 0 + (none) + ) + +(defmethod ocean-mid-add-call-flush ocean ((obj ocean) (arg0 dma-buffer) (arg1 uint)) + (let* ((v1-0 arg0) + (a0-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag :cmd (vif-cmd mscalf) :msk #x1 :imm arg1)) + (set! (-> (the-as dma-packet a0-1) vif1) (new 'static 'vif-tag :cmd (vif-cmd flusha) :msk #x1)) + (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod ocean-mid-add-upload ocean ((obj ocean) (arg0 dma-buffer) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 float)) + (local-vars (sv-32 int)) + (set! sv-32 arg1) + (let ((s0-0 arg2) + (s1-0 arg3) + (s4-0 arg4) + (s2-0 arg5) + (s5-0 (new-stack-vector0)) + ) + (let ((v1-0 (-> obj start-corner))) + (set! (-> s5-0 x) (+ (-> v1-0 x) (* 3145728.0 (the float s0-0)))) + (set! (-> s5-0 y) (-> v1-0 y)) + (set! (-> s5-0 z) (+ (-> v1-0 z) (* 3145728.0 (the float sv-32)))) + ) + (set! (-> s5-0 w) 1.0) + (ocean-mid-add-matrices obj arg0 s5-0) + (let ((v1-6 (+ (the-as uint (-> obj ocean-colors)) (* (+ (* 416 sv-32) (* s0-0 8)) 4)))) + (dotimes (a0-7 9) + (let* ((a1-4 arg0) + (a2-2 (the-as object (-> a1-4 base))) + ) + (set! (-> (the-as dma-packet a2-2) dma) (new 'static 'dma-tag :qwc #x3 :id (dma-tag-id ref) :addr v1-6)) + (set! (-> (the-as dma-packet a2-2) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a2-2) vif1) (new 'static 'vif-tag + :num #xc + :cmd (vif-cmd unpack-v4-8) + :imm (logior (shr (shl (+ (* 12 a0-7) 8) 54) 54) #xc000) + ) + ) + (set! (-> a1-4 base) (&+ (the-as pointer a2-2) 16)) + ) + (+! v1-6 208) + ) + ) + (let* ((a2-4 1) + (v1-9 arg0) + (a0-8 (the-as object (-> v1-9 base))) + ) + (set! (-> (the-as dma-packet a0-8) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a2-4)) + (set! (-> (the-as dma-packet a0-8) vif0) (new 'static 'vif-tag :imm #x204 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a0-8) vif1) + (new 'static 'vif-tag :imm #xc074 :num #x2 :cmd (vif-cmd unpack-v4-8)) + ) + (set! (-> v1-9 base) (&+ (the-as pointer a0-8) 16)) + ) + (let ((v1-10 (-> arg0 base))) + (let ((a0-12 (-> obj ocean-mid-masks data s1-0))) + (set! (-> obj mid-mask-ptrs s4-0) v1-10) + (set! (-> (the-as (pointer uint64) v1-10)) (-> a0-12 dword)) + ) + (set! (-> (the-as (pointer uint64) v1-10) 1) (the-as uint 0)) + ) + (&+! (-> arg0 base) 16) + (when (< s2-0 556091.4) + (let* ((v1-15 (-> *math-camera* trans)) + (s4-1 (&-> obj mid-camera-masks s4-0)) + (s3-1 (+ (the int (* 0.0000025431316 (- (-> v1-15 x) (-> s5-0 x)))) -1)) + (s2-1 (+ (the int (* 0.0000025431316 (- (-> v1-15 z) (-> s5-0 z)))) -1)) + ) + (dotimes (s1-1 3) + (dotimes (s0-1 3) + (let ((a2-7 (+ s0-1 s3-1)) + (a3-6 (+ s1-1 s2-1)) + ) + (if (and (>= a2-7 0) (>= a3-6 0) (< a2-7 8) (< a3-6 8)) + (ocean-mid-check obj s4-1 a2-7 a3-6 s5-0) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + +(defmethod ocean-mid-camera-masks-bit? ocean ((obj ocean) (arg0 uint) (arg1 uint)) + (cond + ((or (< (the-as int arg0) 0) (>= (the-as int arg0) 48) (< (the-as int arg1) 0) (>= (the-as int arg1) 48)) + #t + ) + (else + (let* ((t0-0 (/ (the-as int arg0) 8)) + (a3-3 (/ (the-as int arg1) 8)) + (a1-1 (logand arg0 7)) + (v1-1 (logand arg1 7)) + (a2-3 (+ (* 6 (the-as int t0-0)) a3-3)) + ) + (logtest? (-> (the-as (pointer uint8) (+ (+ a1-1 (* a2-3 8)) (the-as uint obj))) 2384) (ash 1 v1-1)) + ) + ) + ) + ) + +(defmethod ocean-mid-mask-ptrs-bit? ocean ((obj ocean) (arg0 uint) (arg1 uint)) + (cond + ((or (< (the-as int arg0) 0) (>= (the-as int arg0) 48) (< (the-as int arg1) 0) (>= (the-as int arg1) 48)) + #t + ) + (else + (let* ((t0-0 (/ (the-as int arg0) 8)) + (a3-3 (/ (the-as int arg1) 8)) + (a1-1 (logand arg0 7)) + (v1-1 (logand arg1 7)) + (a2-3 (+ (* 6 (the-as int t0-0)) a3-3)) + ) + (if (-> obj mid-mask-ptrs a2-3) + (logtest? (-> (the-as (pointer uint8) (+ a1-1 (the-as uint (-> obj mid-mask-ptrs a2-3))))) (ash 1 v1-1)) + #t + ) + ) + ) + ) + ) + +(defmethod ocean-mid-camera-masks-set! ocean ((obj ocean) (arg0 uint) (arg1 uint)) + (cond + ((or (< (the-as int arg0) 0) (>= (the-as int arg0) 48) (< (the-as int arg1) 0) (>= (the-as int arg1) 48)) + #f + ) + (else + (let* ((t0-0 (/ (the-as int arg0) 8)) + (a3-3 (/ (the-as int arg1) 8)) + (v1-1 (logand arg0 7)) + (a1-1 (logand arg1 7)) + (a3-4 (+ (* 6 (the-as int t0-0)) a3-3)) + (a2-5 (&-> obj mid-camera-masks a3-4)) + ) + (cond + (a2-5 + (cond + ((logtest? (-> (the-as (pointer uint8) (+ v1-1 (the-as uint (-> obj mid-mask-ptrs a3-4))))) (ash 1 a1-1)) + #f + ) + (else + (logior! (-> (the-as (pointer uint8) (+ v1-1 (the-as uint a2-5))) 0) (ash 1 a1-1)) + #t + ) + ) + ) + (else + #f + ) + ) + ) + ) + ) + ) + +(defmethod ocean-mid-add-upload-table ocean ((obj ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint) (arg3 (pointer float)) (arg4 int) (arg5 symbol)) + (local-vars + (v1-13 float) + (a0-20 uint128) + (a0-21 uint128) + (a0-22 uint128) + (a1-13 uint128) + (a1-14 uint128) + (a1-15 uint128) + (a2-16 uint128) + (a3-10 uint128) + ) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (when (ocean-mid-camera-masks-set! obj arg1 arg2) + (let ((a2-2 (new-stack-vector0))) + (let ((v1-3 (-> obj start-corner))) + (set! (-> a2-2 x) (+ (-> v1-3 x) (* 393216.0 (the float arg2)))) + (set! (-> a2-2 y) (-> v1-3 y)) + (set! (-> a2-2 z) (+ (-> v1-3 z) (* 393216.0 (the float arg1)))) + ) + (set! (-> a2-2 w) 1.0) + (ocean-mid-add-matrices obj arg0 a2-2) + ) + (let* ((a1-3 9) + (v1-8 arg0) + (a0-4 (the-as object (-> v1-8 base))) + ) + (set! (-> (the-as dma-packet a0-4) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a1-3)) + (set! (-> (the-as dma-packet a0-4) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a0-4) vif1) + (new 'static 'vif-tag :imm #x8008 :cmd (vif-cmd unpack-v4-32) :num a1-3) + ) + (set! (-> v1-8 base) (&+ (the-as pointer a0-4) 16)) + ) + (set-vector! (the-as vector4w (-> arg0 base)) arg4 0 0 0) + (&+! (-> arg0 base) 16) + (let ((v1-12 (the-as (inline-array vector4w) (-> arg0 base)))) + (set! (-> v1-12 0 quad) (-> *ocean-trans-st-table* 0 quad)) + (set! (-> v1-12 1 quad) (-> *ocean-trans-st-table* 1 quad)) + (set! (-> v1-12 2 quad) (-> *ocean-trans-st-table* 2 quad)) + (set! (-> v1-12 3 quad) (-> *ocean-trans-st-table* 3 quad)) + (let ((a0-19 (the-as uint128 (-> obj ocean-colors colors (+ (* 52 (the-as int arg1)) arg2)))) + (a1-12 (the-as uint128 (-> obj ocean-colors colors (+ arg2 1 (* 52 (the-as int arg1)))))) + (a2-15 (the-as uint128 (-> obj ocean-colors colors (+ (* 52 (the-as int (+ arg1 1))) arg2)))) + (a3-9 (the-as uint128 (-> obj ocean-colors colors (+ arg2 1 (* 52 (the-as int (+ arg1 1))))))) + ) + (.pextlb a0-20 0 a0-19) + (nop!) + (.pextlb a1-13 0 a1-12) + (nop!) + (.pextlb a2-16 0 a2-15) + (nop!) + (.pextlb a3-10 0 a3-9) + ) + (nop!) + (.pextlh a0-21 0 a0-20) + (nop!) + (.pextlh a1-14 0 a1-13) + (.mov vf1 a0-21) + (.pextlh a0-22 0 a2-16) + (.mov vf2 a1-14) + (.pextlh a1-15 0 a3-10) + (.mov vf3 a0-22) + (nop!) + (.mov vf4 a1-15) + (.itof.vf vf1 vf1) + (nop!) + (.itof.vf vf2 vf2) + (nop!) + (.itof.vf vf3 vf3) + (nop!) + (.itof.vf vf4 vf4) + (nop!) + (nop!) + (.svf (&-> v1-12 4 quad) vf1) + (nop!) + (.svf (&-> v1-12 5 quad) vf2) + (nop!) + (.svf (&-> v1-12 6 quad) vf3) + (nop!) + (.svf (&-> v1-12 7 quad) vf4) + ) + (.mov v1-13 vf4) + (&+! (-> arg0 base) 128) + (let* ((v1-16 arg0) + (a0-23 (the-as object (-> v1-16 base))) + ) + (set! (-> (the-as dma-packet a0-23) dma) + (new 'static 'dma-tag :id (dma-tag-id ref) :addr (the-as int arg3) :qwc arg4) + ) + (set! (-> (the-as dma-packet a0-23) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a0-23) vif1) + (new 'static 'vif-tag :imm #x8011 :cmd (vif-cmd unpack-v4-32) :num arg4) + ) + (set! (-> v1-16 base) (&+ (the-as pointer a0-23) 16)) + ) + (if arg5 + (ocean-mid-add-call obj arg0 275) + (ocean-mid-add-call obj arg0 107) + ) + ) + 0 + (none) + ) + ) + +(defmethod ocean-mid-add-upload-top ocean ((obj ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) + (let ((s0-0 (-> obj mid-minx)) + (s2-0 (-> obj mid-maxx)) + (s1-0 (ocean-mid-camera-masks-bit? obj arg1 arg2)) + ) + (cond + ((ocean-mid-mask-ptrs-bit? obj arg1 arg2) + ) + ((= arg2 s0-0) + (cond + (s1-0 + (ocean-mid-add-upload-table obj arg0 (+ arg1 -1) arg2 *ocean-down-table* 7 #t) + (ocean-mid-add-upload-table obj arg0 arg1 (+ arg2 -1) *ocean-right-table* 7 #t) + ) + (else + (let ((s2-1 (ocean-mid-mask-ptrs-bit? obj (+ arg1 1) arg2)) + (v1-12 (ocean-mid-mask-ptrs-bit? obj arg1 (+ arg2 1))) + ) + (cond + ((and s2-1 v1-12) + ) + (s2-1 + (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-right-table* 7 #t) + ) + (v1-12 + (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-down-table* 7 #t) + ) + (else + (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-down-right-table* 10 #f) + ) + ) + ) + ) + ) + ) + ((= arg2 s2-0) + (cond + (s1-0 + (ocean-mid-add-upload-table obj arg0 (+ arg1 -1) arg2 *ocean-down-table* 7 #t) + (ocean-mid-add-upload-table obj arg0 arg1 (+ arg2 1) *ocean-left-table* 7 #t) + ) + (else + (let ((s2-2 (ocean-mid-mask-ptrs-bit? obj (+ arg1 1) arg2)) + (v1-27 (ocean-mid-mask-ptrs-bit? obj arg1 (+ arg2 -1))) + ) + (cond + ((and s2-2 v1-27) + ) + (s2-2 + (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-left-table* 7 #t) + ) + (v1-27 + (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-down-table* 7 #t) + ) + (else + (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-down-left-table* 10 #t) + ) + ) + ) + ) + ) + ) + (s1-0 + (ocean-mid-add-upload-table obj arg0 (+ arg1 -1) arg2 *ocean-down-table* 7 #t) + ) + ) + ) + 0 + (none) + ) + +(defmethod ocean-mid-add-upload-middle ocean ((obj ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) + (let ((s0-0 (-> obj mid-minx)) + (s2-0 (-> obj mid-maxx)) + (s1-0 (ocean-mid-camera-masks-bit? obj arg1 arg2)) + ) + (cond + ((ocean-mid-mask-ptrs-bit? obj arg1 arg2) + ) + ((= arg2 s0-0) + (cond + (s1-0 + (ocean-mid-add-upload-table obj arg0 arg1 (+ arg2 -1) *ocean-right-table* 7 #t) + ) + ((ocean-mid-mask-ptrs-bit? obj arg1 (+ arg2 1)) + ) + (else + (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-right-table* 7 #t) + ) + ) + ) + ((= arg2 s2-0) + (cond + (s1-0 + (ocean-mid-add-upload-table obj arg0 arg1 (+ arg2 1) *ocean-left-table* 7 #t) + ) + ((ocean-mid-mask-ptrs-bit? obj arg1 (+ arg2 -1)) + ) + (else + (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-left-table* 7 #t) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod ocean-mid-add-upload-bottom ocean ((obj ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) + (let ((s0-0 (-> obj mid-minx)) + (s2-0 (-> obj mid-maxx)) + (s1-0 (ocean-mid-camera-masks-bit? obj arg1 arg2)) + ) + (cond + ((ocean-mid-mask-ptrs-bit? obj arg1 arg2) + ) + ((= arg2 s0-0) + (cond + (s1-0 + (ocean-mid-add-upload-table obj arg0 (+ arg1 1) arg2 *ocean-up-table* 7 #t) + (ocean-mid-add-upload-table obj arg0 arg1 (+ arg2 -1) *ocean-right-table* 7 #t) + ) + (else + (let ((s2-1 (ocean-mid-mask-ptrs-bit? obj (+ arg1 -1) arg2)) + (v1-12 (ocean-mid-mask-ptrs-bit? obj arg1 (+ arg2 1))) + ) + (cond + ((and s2-1 v1-12) + ) + (s2-1 + (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-right-table* 7 #t) + ) + (v1-12 + (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-up-table* 7 #t) + ) + (else + (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-up-right-table* 10 #t) + ) + ) + ) + ) + ) + ) + ((= arg2 s2-0) + (cond + (s1-0 + (ocean-mid-add-upload-table obj arg0 (+ arg1 1) arg2 *ocean-up-table* 7 #t) + (ocean-mid-add-upload-table obj arg0 arg1 (+ arg2 1) *ocean-left-table* 7 #t) + ) + (else + (let ((s2-2 (ocean-mid-mask-ptrs-bit? obj (+ arg1 -1) arg2)) + (v1-27 (ocean-mid-mask-ptrs-bit? obj arg1 (+ arg2 -1))) + ) + (cond + ((and s2-2 v1-27) + ) + (s2-2 + (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-left-table* 7 #t) + ) + (v1-27 + (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-up-table* 7 #t) + ) + (else + (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-up-left-table* 10 #f) + ) + ) + ) + ) + ) + ) + (s1-0 + (ocean-mid-add-upload-table obj arg0 (+ arg1 1) arg2 *ocean-up-table* 7 #t) + ) + ) + ) + 0 + (none) + ) + +(defmethod ocean-seams-add-constants ocean ((obj ocean) (arg0 dma-buffer)) + (let* ((a2-0 4) + (v1-0 arg0) + (a0-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a2-0)) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a0-1) vif1) + (new 'static 'vif-tag :imm #x2fd :cmd (vif-cmd unpack-v4-32) :num a2-0) + ) + (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) + ) + (let ((v1-1 (-> arg0 base))) + (set-vector! (the-as vector (&+ v1-1 0)) 0.0 0.0 0.0 1.0) + (set-vector! (the-as vector (&+ v1-1 16)) 393216.0 0.0 0.0 1.0) + (set-vector! (the-as vector (&+ v1-1 32)) 0.0 0.0 393216.0 1.0) + (set-vector! (the-as vector (&+ v1-1 48)) 393216.0 0.0 393216.0 1.0) + ) + (&+! (-> arg0 base) 64) + 0 + (none) + ) + +(defmethod draw-ocean-mid-seams ocean ((obj ocean) (arg0 dma-buffer)) + (local-vars (sv-32 uint) (sv-33 uint) (sv-34 uint) (sv-35 uint) (sv-36 sphere)) + (ocean-seams-add-constants obj arg0) + (set! sv-32 (-> obj mid-minx)) + (set! sv-33 (-> obj mid-maxx)) + (set! sv-34 (-> obj mid-minz)) + (set! sv-35 (-> obj mid-maxz)) + (set! sv-36 (new 'stack 'sphere)) + (set! (-> sv-36 y) (-> obj start-corner y)) + (set! (-> sv-36 r) 278045.7) + (let ((s4-0 sv-34) + (s3-0 sv-35) + ) + (while (>= s3-0 s4-0) + (let ((s2-0 sv-32) + (s1-0 sv-33) + ) + (while (>= s1-0 s2-0) + (set! (-> sv-36 x) (+ 196608.0 (* 393216.0 (the float s2-0)) (-> obj start-corner x))) + (set! (-> sv-36 z) (+ 196608.0 (* 393216.0 (the float s4-0)) (-> obj start-corner z))) + (when (sphere-cull sv-36) + (cond + ((= s4-0 sv-34) + (ocean-mid-add-upload-top obj arg0 s4-0 s2-0) + ) + ((= s4-0 sv-35) + (ocean-mid-add-upload-bottom obj arg0 s4-0 s2-0) + ) + (else + (ocean-mid-add-upload-middle obj arg0 s4-0 s2-0) + ) + ) + ) + (+! s2-0 1) + ) + ) + (+! s4-0 1) + ) + ) + (dotimes (v1-29 36) + (if (and (-> obj mid-mask-ptrs v1-29) (nonzero? (-> obj mid-camera-masks v1-29))) + (logior! (-> (the-as (pointer uint64) (-> obj mid-mask-ptrs v1-29))) (-> obj mid-camera-masks v1-29)) + ) + ) + 0 + (none) + ) + +(defmethod draw-ocean-mid ocean ((obj ocean) (arg0 dma-buffer)) + (local-vars (v1-8 float) (v1-9 float) (sv-32 int)) + (rlet ((vf16 :class vf) + (vf17 :class vf) + (vf18 :class vf) + (vf19 :class vf) + (vf20 :class vf) + (vf21 :class vf) + (vf22 :class vf) + (vf23 :class vf) + ) + (dotimes (v1-0 36) + (set! (-> obj mid-mask-ptrs v1-0) (the-as pointer #f)) + (set! (-> obj mid-camera-masks v1-0) (the-as uint 0)) + ) + (dma-buffer-add-vu-function arg0 ocean-mid-block 1) + (let* ((v1-3 arg0) + (a0-6 (the-as object (-> v1-3 base))) + ) + (set! (-> (the-as dma-packet a0-6) dma) (new 'static 'dma-tag :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-6) vif0) (new 'static 'vif-tag :cmd (vif-cmd base))) + (set! (-> (the-as dma-packet a0-6) vif1) (new 'static 'vif-tag :imm #x76 :cmd (vif-cmd offset))) + (set! (-> v1-3 base) (&+ (the-as pointer a0-6) 16)) + ) + (ocean-mid-add-constants obj arg0) + (ocean-mid-add-call obj arg0 0) + (let ((v1-7 *math-camera*)) + (cond + ((-> *time-of-day-context* use-camera-other) + (.lvf vf16 (&-> v1-7 plane-other 0 quad)) + (.lvf vf17 (&-> v1-7 plane-other 1 quad)) + (.lvf vf18 (&-> v1-7 plane-other 2 quad)) + (.lvf vf19 (&-> v1-7 plane-other 3 quad)) + (.lvf vf20 (&-> v1-7 guard-plane-other 0 quad)) + (.lvf vf21 (&-> v1-7 guard-plane-other 1 quad)) + (.lvf vf22 (&-> v1-7 guard-plane-other 2 quad)) + (.lvf vf23 (&-> v1-7 guard-plane-other 3 quad)) + (.mov v1-8 vf23) + ) + (else + (.lvf vf16 (&-> v1-7 plane 0 quad)) + (.lvf vf17 (&-> v1-7 plane 1 quad)) + (.lvf vf18 (&-> v1-7 plane 2 quad)) + (.lvf vf19 (&-> v1-7 plane 3 quad)) + (.lvf vf20 (&-> v1-7 guard-plane 0 quad)) + (.lvf vf21 (&-> v1-7 guard-plane 1 quad)) + (.lvf vf22 (&-> v1-7 guard-plane 2 quad)) + (.lvf vf23 (&-> v1-7 guard-plane 3 quad)) + (.mov v1-9 vf23) + ) + ) + ) + (set! (-> (new 'stack-no-clear 'vector) quad) (the-as uint128 0)) + (let ((s4-0 (-> *math-camera* trans))) + (dotimes (s3-0 6) + (dotimes (s2-0 6) + (let* ((s1-0 (+ (* 6 s3-0) s2-0)) + (s0-0 (-> obj ocean-spheres spheres s1-0)) + ) + (set! sv-32 (-> (the-as (pointer int16) (+ (* s1-0 2) (the-as int (-> obj ocean-mid-indices)))))) + (when (sphere-cull s0-0) + (cond + ((< sv-32 0) + ) + ((let ((f30-0 (- (vector-vector-distance s0-0 s4-0) (-> s0-0 r)))) + (let ((a0-16 obj) + (t9-5 (method-of-type ocean ocean-mid-add-upload)) + (a1-8 arg0) + (a2-2 s3-0) + (a3-0 s2-0) + (t2-0 f30-0) + ) + (t9-5 a0-16 a1-8 a2-2 a3-0 sv-32 s1-0 t2-0) + ) + (< f30-0 786432.0) + ) + (ocean-mid-add-call obj arg0 73) + (+! (-> *terrain-stats* ocean-mid fragments) 1) + (+! (-> *terrain-stats* ocean-mid tris) 256) + (+! (-> *terrain-stats* ocean-mid dverts) 288) + ) + (else + (ocean-mid-add-call obj arg0 46) + (+! (-> *terrain-stats* ocean-mid fragments) 1) + (+! (-> *terrain-stats* ocean-mid tris) 128) + (+! (-> *terrain-stats* ocean-mid dverts) 144) + ) + ) + ) + ) + ) + ) + ) + (when (not (or (-> obj near-off) (< 196608.0 (fabs (- (-> obj start-corner y) (-> *math-camera* trans y)))))) + (let ((a1-11 48) + (a2-5 0) + (v1-53 48) + (a0-25 0) + ) + (dotimes (a3-1 6) + (dotimes (t0-1 6) + (let ((t1-6 (&-> obj mid-camera-masks (+ (* 6 a3-1) t0-1)))) + (when (nonzero? (-> t1-6 0)) + (dotimes (t2-3 8) + (let ((t3-1 (-> (the-as (pointer uint8) (+ t2-3 (the-as int t1-6))) 0))) + (when (nonzero? t3-1) + (let ((t4-2 (+ (* a3-1 8) t2-3))) + (if (< t4-2 v1-53) + (set! v1-53 t4-2) + ) + (if (< a0-25 t4-2) + (set! a0-25 t4-2) + ) + ) + (dotimes (t4-3 8) + (when (logtest? t3-1 (ash 1 t4-3)) + (let ((t5-9 (+ (* t0-1 8) t4-3))) + (if (< t5-9 a1-11) + (set! a1-11 t5-9) + ) + (if (< a2-5 t5-9) + (set! a2-5 t5-9) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (set! (-> obj mid-minx) (the-as uint a1-11)) + (set! (-> obj mid-maxx) (the-as uint a2-5)) + (set! (-> obj mid-minz) (the-as uint v1-53)) + (set! (-> obj mid-maxz) (the-as uint a0-25)) + (when (and (< a1-11 a2-5) (< v1-53 a0-25)) + (ocean-mid-add-call-flush obj arg0 (the-as uint 41)) + (ocean-mid-add-call-flush obj arg0 (the-as uint 43)) + (draw-ocean-transition obj arg0) + (draw-ocean-mid-seams obj arg0) + ) + ) + ) + (ocean-mid-add-call-flush obj arg0 (the-as uint 41)) + 0 + (none) + ) + ) diff --git a/goal_src/jak2/engine/gfx/ocean/ocean-near.gc b/goal_src/jak2/engine/gfx/ocean/ocean-near.gc index 1ff6b58131..d0f85e69d9 100644 --- a/goal_src/jak2/engine/gfx/ocean/ocean-near.gc +++ b/goal_src/jak2/engine/gfx/ocean/ocean-near.gc @@ -7,3 +7,725 @@ ;; DECOMP BEGINS +(define ocean-near-block (new 'static 'vu-function :length #x3dd :qlength #x1ef)) + +(defmethod ocean-near-add-call ocean ((obj ocean) (arg0 dma-buffer) (arg1 int)) + (let* ((v1-0 arg0) + (a0-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag :cmd (vif-cmd mscalf) :msk #x1 :imm arg1)) + (set! (-> (the-as dma-packet a0-1) vif1) (new 'static 'vif-tag :cmd (vif-cmd stmod))) + (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) + ) + 0 + (none) + ) + +(defmethod ocean-near-add-call-flush ocean ((obj ocean) (arg0 dma-buffer) (arg1 int)) + (let* ((v1-0 arg0) + (a0-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag :cmd (vif-cmd mscalf) :msk #x1 :imm arg1)) + (set! (-> (the-as dma-packet a0-1) vif1) (new 'static 'vif-tag :cmd (vif-cmd flusha) :msk #x1)) + (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) + ) + 0 + (none) + ) + +(defmethod ocean-near-setup-constants ocean ((obj ocean) (arg0 ocean-near-constants)) + (let ((v1-0 *math-camera*)) + (set! (-> arg0 hmge-scale quad) (-> v1-0 hmge-scale quad)) + (set! (-> arg0 inv-hmge-scale quad) (-> v1-0 inv-hmge-scale quad)) + (set! (-> arg0 hvdf-offset quad) (-> v1-0 hvdf-off quad)) + (set-vector! (-> arg0 fog) (-> v1-0 pfog0) (-> v1-0 fog-min) (-> v1-0 fog-max) 3072.0) + ) + (set-vector! (-> arg0 constants) -0.25 -0.5 0.0 0.000010172526) + (let ((t9-0 matrix-local->world) + (a0-8 #f) + ) + (let* ((s4-0 (-> (t9-0 a0-8) vector 2)) + (f0-12 (- 1.5 (* 0.000015258789 (atan (-> s4-0 x) (-> s4-0 z))))) + (f1-1 (+ 0.5 (* -0.5 (-> s4-0 y)))) + ) + (set-vector! (-> arg0 constants2) f0-12 f1-1 1.0 128.0) + ) + ) + (set-vector! (-> arg0 constants3) 12288.0 0.125 2.0 0.03125) + (set-vector! (-> arg0 constants4) 2.0 255.0 3.0 0.0078125) + (set-vector! (-> arg0 constants5) 0.5 0.0 0.0 0.000010172526) + (case *subdivide-ocean-draw-mode* + (((subdivide-setting textured)) + (set! (-> arg0 drw-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 drw2-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 env-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 drw-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 env-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 drw2-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + (((subdivide-setting outline)) + (set! (-> arg0 drw-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 drw2-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 env-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 drw-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 env-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 drw2-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + (((subdivide-setting gouraud)) + (set! (-> arg0 drw-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 drw2-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 env-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 drw-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 env-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 drw2-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + (((subdivide-setting hack)) + (set! (-> arg0 drw-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 drw2-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 env-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 drw-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 env-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 drw2-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ) + (set! (-> arg0 drw-fan regs) + (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) + ) + (set! (-> arg0 drw2-fan regs) + (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) + ) + (set! (-> arg0 env-fan regs) + (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) + ) + (set! (-> arg0 drw-strip regs) + (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) + ) + (set! (-> arg0 env-strip regs) + (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) + ) + (set! (-> arg0 drw2-strip regs) + (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) + ) + (set! (-> arg0 drw-adgif tag) (new 'static 'gif-tag64 :nloop #x5 :nreg #x1)) + (set! (-> arg0 drw-adgif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d))) + (set! (-> arg0 drw-texture tex0) (new 'static 'gs-tex0 :tbp0 #x2a0 :tbw #x2 :th (log2 128) :tw (log2 128))) + (set! (-> arg0 drw-texture prims 1) (gs-reg64 tex0-1)) + (set! (-> arg0 drw-texture tex1) (-> obj tex1-near)) + (set! (-> arg0 drw-texture prims 3) (gs-reg64 tex1-1)) + (set! (-> arg0 drw-texture miptbp1) (new 'static 'gs-miptbp :tbp1 #x6a0 :tbw1 #x1 :tbp2 #x7a0 :tbp3 #x7e0)) + (set! (-> arg0 drw-texture prims 5) (gs-reg64 miptbp1-1)) + (set! (-> arg0 drw-texture clamp) (new 'static 'gs-clamp)) + (set! (-> arg0 drw-texture clamp-reg) (gs-reg64 clamp-1)) + (set! (-> arg0 drw-texture alpha) (new 'static 'gs-alpha :b #x1 :d #x1)) + (set! (-> arg0 drw-texture prims 9) (gs-reg64 alpha-1)) + (set! (-> arg0 env-adgif tag) (new 'static 'gif-tag64 :nloop #x5 :nreg #x1)) + (set! (-> arg0 env-adgif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d))) + (cond + ((-> *time-of-day-context* sky) + (set! (-> arg0 env-texture tex0) + (new 'static 'gs-tex0 + :tbw #x1 + :tcc #x1 + :th (log2 64) + :tw (log2 64) + :tbp0 (-> *ocean-envmap-texture-base* vram-block) + ) + ) + (set! (-> arg0 env-texture prims 1) (gs-reg64 tex0-1)) + (set! (-> arg0 env-texture tex1) (new 'static 'gs-tex1 :mmag #x1 :mmin #x5 :l #x1 :k #xeed)) + (set! (-> arg0 env-texture prims 3) (gs-reg64 tex1-1)) + (set! (-> arg0 env-texture miptbp1) (new 'static 'gs-miptbp)) + (set! (-> arg0 env-texture prims 5) (gs-reg64 miptbp1-1)) + (set! (-> arg0 env-texture clamp) (new 'static 'gs-clamp)) + (set! (-> arg0 env-texture clamp-reg) (gs-reg64 clamp-1)) + (set! (-> arg0 env-texture alpha) (new 'static 'gs-alpha :b #x2 :c #x1 :d #x1)) + (set! (-> arg0 env-texture prims 9) (gs-reg64 alpha-1)) + ) + (else + (let ((s4-2 (-> arg0 env-texture))) + (adgif-shader<-texture-simple! s4-2 (lookup-texture-by-id (new 'static 'texture-id :page #x1f))) + ) + (set! (-> arg0 env-texture clamp) (new 'static 'gs-clamp)) + (set! (-> arg0 env-texture alpha) (new 'static 'gs-alpha :b #x2 :c #x1 :d #x1)) + ) + ) + (let ((f0-28 (* 128.0 (-> *time-of-day-context* ocean-alpha)))) + (if (-> *time-of-day-context* sky) + (set-vector! (-> arg0 env-color) f0-28 f0-28 f0-28 f0-28) + (set-vector! (-> arg0 env-color) f0-28 f0-28 (* 0.5 f0-28) f0-28) + ) + ) + (set! (-> arg0 drw2-adgif tag) (new 'static 'gif-tag64 :nloop #x2 :eop #x1 :nreg #x1)) + (set! (-> arg0 drw2-adgif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d))) + (set! (-> arg0 drw2-tex0 dword 0) + (logior (logior (the-as uint #x4000082a0) (shr (shl (log2 128) 60) 34)) (shr (shl (log2 128) 60) 30)) + ) + (set! (-> arg0 drw2-tex0 dword 1) (the-as uint 6)) + (set! (-> arg0 drw2-frame dword 0) (the-as uint #xffffff00080198)) + (set! (-> arg0 drw2-frame dword 1) (the-as uint 76)) + (set! (-> arg0 drw3-adgif tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1)) + (set! (-> arg0 drw3-adgif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d))) + (set! (-> arg0 drw3-frame data) (the-as uint #x80198)) + (set! (-> arg0 drw3-frame cmds) (gs-reg64 frame-1)) + (set-vector! (-> arg0 index-table 0) 81 189 0 0) + (set-vector! (-> arg0 index-table 1) 54 162 0 0) + (set-vector! (-> arg0 index-table 2) 27 135 0 0) + (set-vector! (-> arg0 index-table 3) 0 108 0 0) + 0 + (none) + ) + +;; WARN: Return type mismatch pointer vs none. +(defmethod ocean-near-add-constants ocean ((obj ocean) (arg0 dma-buffer)) + (let* ((a2-0 37) + (v1-0 arg0) + (a1-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a1-1) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a2-0)) + (set! (-> (the-as dma-packet a1-1) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a1-1) vif1) + (new 'static 'vif-tag :imm #x3b7 :cmd (vif-cmd unpack-v4-32) :num a2-0) + ) + (set! (-> v1-0 base) (&+ (the-as pointer a1-1) 16)) + ) + (ocean-near-setup-constants obj (the-as ocean-near-constants (-> arg0 base))) + (&+! (-> arg0 base) 592) + (none) + ) + +(defmethod ocean-near-add-heights ocean ((obj ocean) (arg0 dma-buffer)) + (let ((v1-0 128) + (a0-1 (-> obj heights)) + ) + (let* ((a2-0 arg0) + (a3-0 (the-as object (-> a2-0 base))) + ) + (set! (-> (the-as dma-packet a3-0) dma) + (new 'static 'dma-tag :id (dma-tag-id ref) :addr (the-as int a0-1) :qwc v1-0) + ) + (set! (-> (the-as dma-packet a3-0) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a3-0) vif1) + (new 'static 'vif-tag :imm #x20 :cmd (vif-cmd unpack-v4-32) :num v1-0) + ) + (set! (-> a2-0 base) (&+ (the-as pointer a3-0) 16)) + ) + (let ((a2-1 (the-as object (-> arg0 base)))) + (set! (-> (the-as dma-packet a2-1) dma) + (new 'static 'dma-tag :id (dma-tag-id ref) :addr (the-as int (&-> a0-1 data 512)) :qwc v1-0) + ) + (set! (-> (the-as dma-packet a2-1) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a2-1) vif1) + (new 'static 'vif-tag :imm #xa0 :cmd (vif-cmd unpack-v4-32) :num v1-0) + ) + (set! (-> arg0 base) (&+ (the-as pointer a2-1) 16)) + ) + ) + 0 + (none) + ) + +(defmethod ocean-near-add-matrices ocean ((obj ocean) (arg0 dma-buffer) (arg1 vector)) + (let ((s4-0 (new-stack-vector0))) + (if (-> *time-of-day-context* use-camera-other) + (-> *math-camera* camera-rot-other) + (-> *math-camera* camera-rot) + ) + (let* ((a1-1 8) + (v1-6 arg0) + (a0-1 (the-as object (-> v1-6 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a1-1)) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a0-1) vif1) + (new 'static 'vif-tag :imm #x8000 :cmd (vif-cmd unpack-v4-32) :num a1-1) + ) + (set! (-> v1-6 base) (&+ (the-as pointer a0-1) 16)) + ) + (let ((s3-0 (the-as object (-> arg0 base)))) + (let* ((v1-7 (the-as matrix s3-0)) + (t0-2 (-> *math-camera* camera-rot)) + (a0-4 (-> t0-2 vector 0 quad)) + (a1-5 (-> t0-2 vector 1 quad)) + (a3-4 (-> t0-2 vector 2 quad)) + (t0-3 (-> t0-2 trans quad)) + ) + (set! (-> v1-7 vector 0 quad) a0-4) + (set! (-> v1-7 vector 1 quad) a1-5) + (set! (-> v1-7 vector 2 quad) a3-4) + (set! (-> v1-7 trans quad) t0-3) + ) + (let ((s2-0 (the-as object (&+ (the-as pointer s3-0) 48)))) + (vector-matrix*! s4-0 arg1 (-> *math-camera* camera-rot)) + (set! (-> (the-as vector s2-0) x) (-> s4-0 x)) + (set! (-> (the-as vector s2-0) y) (-> s4-0 y)) + (set! (-> (the-as vector s2-0) z) (-> s4-0 z)) + ) + (let ((a1-7 (&+ (-> arg0 base) 64))) + (ocean-matrix*! obj (the-as matrix a1-7) (the-as matrix s3-0) (-> *math-camera* perspective)) + ) + ) + ) + (&+! (-> arg0 base) 128) + 0 + (none) + ) + +(defmethod ocean-near-add-upload ocean ((obj ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) + (local-vars + (v1-17 uint128) + (v1-18 uint128) + (v1-19 float) + (a0-18 uint128) + (a0-19 uint128) + (a0-20 uint128) + (a2-23 float) + (a2-30 uint128) + (a2-31 uint128) + (a3-25 uint128) + ) + (rlet ((acc :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf12 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf) + ) + (let ((s1-0 (-> obj mid-minx)) + (s2-0 (-> obj mid-minz)) + ) + (let ((a2-1 (new-stack-vector0))) + (let ((v1-0 (-> obj start-corner))) + (set! (-> a2-1 x) (+ (-> v1-0 x) (* 98304.0 (the float arg2)))) + (set! (-> a2-1 y) (-> v1-0 y)) + (set! (-> a2-1 z) (+ (-> v1-0 z) (* 98304.0 (the float arg1)))) + ) + (set! (-> a2-1 w) 1.0) + (ocean-near-add-matrices obj arg0 a2-1) + ) + (let* ((a1-2 8) + (v1-5 arg0) + (a0-3 (the-as object (-> v1-5 base))) + ) + (set! (-> (the-as dma-packet a0-3) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a1-2)) + (set! (-> (the-as dma-packet a0-3) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a0-3) vif1) + (new 'static 'vif-tag :imm #x8008 :cmd (vif-cmd unpack-v4-32) :num a1-2) + ) + (set! (-> v1-5 base) (&+ (the-as pointer a0-3) 16)) + ) + (let* ((v1-6 (-> arg0 base)) + (a0-6 (- arg2 (* s1-0 4))) + (a1-7 (- arg1 (* s2-0 4))) + (a2-6 (shr a0-6 2)) + (a3-3 (shr a1-7 2)) + (a0-7 (logand a0-6 3)) + (a1-8 (logand a1-7 3)) + (a2-10 (-> (the-as (pointer int16) (+ (* (+ (* a3-3 4) a2-6) 2) (the-as uint obj))) 4002)) + (a3-7 (-> obj ocean-near-indices data a2-10)) + (a0-13 + (-> obj ocean-mid-masks data (-> (the-as (pointer int16) (+ (* (+ (* a1-8 4) a0-7) 2) (the-as uint a3-7))))) + ) + ) + (set-vector! + (the-as vector4w (&+ v1-6 0)) + (the-as int (-> a0-13 mask 0)) + (the-as int (-> a0-13 mask 1)) + (the-as int (-> a0-13 mask 2)) + (the-as int (-> a0-13 mask 3)) + ) + (set-vector! + (the-as vector4w (&+ v1-6 16)) + (the-as int (-> a0-13 mask 4)) + (the-as int (-> a0-13 mask 5)) + (the-as int (-> a0-13 mask 6)) + (the-as int (-> a0-13 mask 7)) + ) + ) + ) + (&+! (-> arg0 base) 32) + (let ((a0-15 (/ (the-as int arg2) 4)) + (v1-10 (/ (the-as int arg1) 4)) + (a2-18 (logand arg2 3)) + (a3-8 (logand arg1 3)) + ) + (let ((t0-0 (-> arg0 base)) + (a1-15 (logand (+ arg2 1) 3)) + (t1-1 (logand (+ arg1 1) 3)) + ) + (set-vector! + (the-as vector4w (&+ t0-0 0)) + (the-as int (+ (* a3-8 64) (* a2-18 2))) + (the-as int (+ (* a3-8 64) (* a1-15 2))) + (the-as int (+ (* t1-1 64) (* a2-18 2))) + (the-as int (+ (* t1-1 64) (* a1-15 2))) + ) + ) + (&+! (-> arg0 base) 16) + (let ((a1-21 (the-as (inline-array vector4w) (-> (the-as (inline-array vector4w) (-> arg0 base)) 0)))) + (set! (-> a1-21 0 x) (the-as int (* 0.25 (the float a2-18)))) + (set! (-> a1-21 0 y) (the-as int (* 0.25 (the float a3-8)))) + (set! (-> a1-21 0 z) (the-as int 1.0)) + (set! (-> a1-21 0 w) (the-as int 0.0)) + ) + (set! (-> arg0 base) + (the-as pointer (the-as (inline-array vector4w) (-> (the-as (inline-array vector4w) (-> arg0 base)) 1))) + ) + (let ((a1-24 (the-as (inline-array vector4w) (-> arg0 base)))) + (let ((a2-19 (+ (* 5 (the-as int a3-8)) a2-18))) + (.lvf vf5 (&-> (-> *ocean-trans-corner-table* 0 vector a2-19) quad)) + (.lvf vf6 (&-> (-> *ocean-trans-corner-table* 0 vector (+ a2-19 1)) quad)) + (.lvf vf7 (&-> (-> *ocean-trans-corner-table* 0 vector (+ a2-19 5)) quad)) + (.lvf vf8 (&-> (-> *ocean-trans-corner-table* 0 vector (+ a2-19 6)) quad)) + ) + (.mov a2-23 vf8) + (let ((a2-29 (the-as uint128 (-> obj ocean-colors colors (+ (* 52 (the-as int v1-10)) a0-15)))) + (a3-24 (the-as uint128 (-> obj ocean-colors colors (+ a0-15 1 (* 52 (the-as int v1-10)))))) + (t0-17 (the-as uint128 (-> obj ocean-colors colors (+ (* 52 (the-as int (+ v1-10 1))) a0-15)))) + (v1-16 (the-as uint128 (-> obj ocean-colors colors (+ a0-15 1 (* 52 (the-as int (+ v1-10 1))))))) + ) + (.pextlb a0-18 0 a2-29) + (nop!) + (.pextlb a2-30 0 a3-24) + (nop!) + (.pextlb a3-25 0 t0-17) + (nop!) + (.pextlb v1-17 0 v1-16) + ) + (nop!) + (.pextlh a0-19 0 a0-18) + (nop!) + (.pextlh a2-31 0 a2-30) + (.mov vf1 a0-19) + (.pextlh a0-20 0 a3-25) + (.mov vf2 a2-31) + (.pextlh v1-18 0 v1-17) + (.mov vf3 a0-20) + (nop!) + (.mov vf4 v1-18) + (.itof.vf vf1 vf1) + (nop!) + (.itof.vf vf2 vf2) + (nop!) + (.itof.vf vf3 vf3) + (nop!) + (.itof.vf vf4 vf4) + (nop!) + (.mul.x.vf acc vf1 vf5) + (nop!) + (.add.mul.y.vf acc vf2 vf5 acc) + (nop!) + (.add.mul.z.vf acc vf3 vf5 acc) + (nop!) + (.add.mul.w.vf vf9 vf4 vf5 acc) + (nop!) + (.mul.x.vf acc vf1 vf6) + (nop!) + (.add.mul.y.vf acc vf2 vf6 acc) + (nop!) + (.add.mul.z.vf acc vf3 vf6 acc) + (nop!) + (.add.mul.w.vf vf10 vf4 vf6 acc) + (.svf (&-> a1-24 0 quad) vf9) + (.mul.x.vf acc vf1 vf7) + (nop!) + (.add.mul.y.vf acc vf2 vf7 acc) + (nop!) + (.add.mul.z.vf acc vf3 vf7 acc) + (nop!) + (.add.mul.w.vf vf11 vf4 vf7 acc) + (.svf (&-> a1-24 1 quad) vf10) + (.mul.x.vf acc vf1 vf8) + (nop!) + (.add.mul.y.vf acc vf2 vf8 acc) + (nop!) + (.add.mul.z.vf acc vf3 vf8 acc) + (nop!) + (.add.mul.w.vf vf12 vf4 vf8 acc) + (.svf (&-> a1-24 2 quad) vf11) + (nop!) + (.svf (&-> a1-24 3 quad) vf12) + ) + ) + (.mov v1-19 vf12) + (&+! (-> arg0 base) 64) + 0 + (none) + ) + ) + +(defmethod draw-ocean-near ocean ((obj ocean) (arg0 dma-buffer)) + (local-vars (sv-16 uint)) + (let* ((v1-0 arg0) + (a0-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-1) vif1) (new 'static 'vif-tag :imm #x2 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) + ) + (let* ((v1-1 arg0) + (a0-3 (the-as object (-> v1-1 base))) + ) + (set! (-> (the-as gs-gif-tag a0-3) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1)) + (set! (-> (the-as gs-gif-tag a0-3) regs) GIF_REGS_ALL_AD) + (set! (-> v1-1 base) (&+ (the-as pointer a0-3) 16)) + ) + (let* ((v1-2 arg0) + (a0-5 (-> v1-2 base)) + ) + (set! (-> (the-as (pointer gs-test) a0-5) 0) + (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest greater-equal)) + ) + (set! (-> (the-as (pointer gs-reg64) a0-5) 1) (gs-reg64 test-1)) + (set! (-> v1-2 base) (&+ a0-5 16)) + ) + (dma-buffer-add-vu-function arg0 ocean-near-block 1) + (let* ((v1-3 arg0) + (a0-8 (the-as object (-> v1-3 base))) + ) + (set! (-> (the-as dma-packet a0-8) dma) (new 'static 'dma-tag :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-8) vif0) (new 'static 'vif-tag :cmd (vif-cmd base))) + (set! (-> (the-as dma-packet a0-8) vif1) (new 'static 'vif-tag :imm #x10 :cmd (vif-cmd offset))) + (set! (-> v1-3 base) (&+ (the-as pointer a0-8) 16)) + ) + (ocean-near-add-constants obj arg0) + (ocean-near-add-heights obj arg0) + (ocean-near-add-call obj arg0 0) + (let ((s4-0 (-> obj near-minx)) + (s3-0 (-> obj near-maxx)) + (s2-0 (-> obj near-minz)) + (s1-0 (-> obj near-maxz)) + ) + (when (and (< s4-0 s3-0) (< s2-0 s1-0)) + (while (>= s1-0 s2-0) + (let ((s0-0 s4-0)) + (set! sv-16 s3-0) + (while (>= sv-16 s0-0) + (when (ocean-trans-camera-masks-bit? obj s2-0 s0-0) + (let* ((a1-16 (- (shr s0-0 2) (-> obj mid-minx))) + (a2-3 (- (shr s2-0 2) (-> obj mid-minz))) + (v1-13 (logand s0-0 3)) + (a0-17 (logand s2-0 3)) + (a1-20 (-> (the-as (pointer int16) (+ (* (+ (* a2-3 4) a1-16) 2) (the-as uint obj))) 4002)) + ) + (when (>= a1-20 0) + (let ((a1-22 (-> obj ocean-near-indices data a1-20))) + (when (>= (-> (the-as (pointer int16) (+ (* (+ (* a0-17 4) v1-13) 2) (the-as uint a1-22)))) 0) + (ocean-near-add-upload obj arg0 s2-0 s0-0) + (ocean-near-add-call obj arg0 39) + ) + ) + ) + ) + ) + (+! s0-0 1) + ) + ) + (+! s2-0 1) + ) + ) + ) + 0 + (none) + ) diff --git a/goal_src/jak2/engine/gfx/ocean/ocean-texture.gc b/goal_src/jak2/engine/gfx/ocean/ocean-texture.gc index 1a4fc69561..19c8e0c1c5 100644 --- a/goal_src/jak2/engine/gfx/ocean/ocean-texture.gc +++ b/goal_src/jak2/engine/gfx/ocean/ocean-texture.gc @@ -7,3 +7,1688 @@ ;; DECOMP BEGINS +(define ocean-texture-vu1-block (new 'static 'vu-function :length #x7c :qlength 62)) + +(defmethod ocean-texture-setup-constants ocean ((obj ocean) (arg0 ocean-texture-constants)) + (set! (-> arg0 giftag tag) + (new 'static 'gif-tag64 + :nloop #x42 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 giftag regs) + (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyz2)) + ) + (set-vector! (-> arg0 buffers) 384 583 384 583) + (set-vector! (-> arg0 dests) 782 881 782 881) + (set-vector! (-> arg0 start) 0.0 0.0 1048575.94 0.0) + (set-vector! (-> arg0 offsets) 4.0 8.0 12.0 16.0) + (set-vector! (-> arg0 constants) 0.5 0.5 0.0 128.0) + (set! (-> arg0 cam-nrm x) 0.0) + (set! (-> arg0 cam-nrm y) 0.707) + (set! (-> arg0 cam-nrm z) 0.707) + (set! (-> arg0 cam-nrm w) 0.0) + 0 + (none) + ) + +(defmethod ocean-texture-add-constants ocean ((obj ocean) (arg0 dma-buffer)) + (let* ((a2-0 7) + (v1-0 arg0) + (a1-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a1-1) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a2-0)) + (set! (-> (the-as dma-packet a1-1) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a1-1) vif1) + (new 'static 'vif-tag :imm #x3d9 :cmd (vif-cmd unpack-v4-32) :num a2-0) + ) + (set! (-> v1-0 base) (&+ (the-as pointer a1-1) 16)) + ) + (ocean-texture-setup-constants obj (the-as ocean-texture-constants (-> arg0 base))) + (&+! (-> arg0 base) 112) + 0 + (none) + ) + +(defmethod ocean-texture-add-envmap ocean ((obj ocean) (arg0 dma-buffer)) + (let ((v1-0 (the-as object (-> arg0 base)))) + (set! (-> (the-as (inline-array vector4w) v1-0) 0 quad) (-> obj adgif-tmpl dma-vif quad)) + (set! (-> (the-as (inline-array vector4w) v1-0) 1 quad) (-> obj adgif-tmpl quad 1)) + (let ((s4-0 (&+ (the-as pointer v1-0) 32))) + (adgif-shader<-texture-simple! + (the-as adgif-shader s4-0) + (lookup-texture-by-id (new 'static 'texture-id :index #x3 :page #x475)) + ) + ) + ) + (&+! (-> arg0 base) 112) + 0 + (none) + ) + +(defmethod ocean-texture-add-verts ocean ((obj ocean) (arg0 dma-buffer) (arg1 int)) + (let* ((v1-0 arg0) + (a0-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :qwc #xc0 :id (dma-tag-id ref) :addr arg1)) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a0-1) vif1) + (new 'static 'vif-tag :imm #x8000 :num #xc0 :cmd (vif-cmd unpack-v4-32)) + ) + (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) + ) + 0 + (none) + ) + +(defmethod ocean-texture-add-verts-last ocean ((obj ocean) (arg0 dma-buffer) (arg1 int) (arg2 int)) + (let* ((v1-0 arg0) + (a0-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :qwc #x80 :id (dma-tag-id ref) :addr arg1)) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a0-1) vif1) + (new 'static 'vif-tag :imm #x8000 :num #x80 :cmd (vif-cmd unpack-v4-32)) + ) + (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) + ) + (let* ((v1-1 arg0) + (a0-3 (the-as object (-> v1-1 base))) + ) + (set! (-> (the-as dma-packet a0-3) dma) (new 'static 'dma-tag :qwc #x40 :id (dma-tag-id ref) :addr arg2)) + (set! (-> (the-as dma-packet a0-3) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a0-3) vif1) + (new 'static 'vif-tag :imm #x8080 :num #x40 :cmd (vif-cmd unpack-v4-32)) + ) + (set! (-> v1-1 base) (&+ (the-as pointer a0-3) 16)) + ) + 0 + (none) + ) + +(defmethod ocean-texture-add-call-start ocean ((obj ocean) (arg0 dma-buffer)) + (let* ((v1-0 arg0) + (a0-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag :cmd (vif-cmd mscalf) :msk #x1)) + (set! (-> (the-as dma-packet a0-1) vif1) (new 'static 'vif-tag :cmd (vif-cmd stmod))) + (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) + ) + 0 + (none) + ) + +(defmethod ocean-texture-add-call-rest ocean ((obj ocean) (arg0 dma-buffer)) + (let* ((v1-0 arg0) + (a0-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag :imm #x2 :cmd (vif-cmd mscalf) :msk #x1)) + (set! (-> (the-as dma-packet a0-1) vif1) (new 'static 'vif-tag :cmd (vif-cmd stmod))) + (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) + ) + 0 + (none) + ) + +(defmethod ocean-texture-add-call-done ocean ((obj ocean) (arg0 dma-buffer)) + (let* ((v1-0 arg0) + (a0-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag :imm #x4 :cmd (vif-cmd mscalf) :msk #x1)) + (set! (-> (the-as dma-packet a0-1) vif1) (new 'static 'vif-tag :cmd (vif-cmd stmod))) + (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) + ) + 0 + (none) + ) + +(defmethod draw-ocean-texture ocean ((obj ocean) (arg0 dma-buffer) (arg1 int)) + (set-display-gs-state arg0 21 128 128 0 0) + (ocean-texture-add-envmap obj arg0) + (let* ((v1-2 arg0) + (a0-3 (the-as object (-> v1-2 base))) + ) + (set! (-> (the-as dma-packet a0-3) dma) (new 'static 'dma-tag :qwc #x4 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-3) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-3) vif1) (new 'static 'vif-tag :imm #x4 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-2 base) (&+ (the-as pointer a0-3) 16)) + ) + (let* ((v1-3 arg0) + (a0-5 (the-as object (-> v1-3 base))) + ) + (set! (-> (the-as gs-gif-tag a0-5) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x3)) + (set! (-> (the-as gs-gif-tag a0-5) regs) GIF_REGS_ALL_AD) + (set! (-> v1-3 base) (&+ (the-as pointer a0-5) 16)) + ) + (let* ((v1-4 arg0) + (a0-7 (-> v1-4 base)) + ) + (set! (-> (the-as (pointer gs-test) a0-7) 0) + (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + ) + (set! (-> (the-as (pointer gs-reg64) a0-7) 1) (gs-reg64 test-1)) + (set! (-> (the-as (pointer gs-alpha) a0-7) 2) (new 'static 'gs-alpha :b #x2 :d #x1)) + (set! (-> (the-as (pointer gs-reg64) a0-7) 3) (gs-reg64 alpha-1)) + (set! (-> (the-as (pointer gs-tex1) a0-7) 4) (new 'static 'gs-tex1)) + (set! (-> (the-as (pointer gs-reg64) a0-7) 5) (gs-reg64 tex1-1)) + (set! (-> v1-4 base) (&+ a0-7 48)) + ) + (dma-buffer-add-vu-function arg0 ocean-texture-vu1-block 1) + (let* ((v1-5 arg0) + (a0-10 (the-as object (-> v1-5 base))) + ) + (set! (-> (the-as dma-packet a0-10) dma) (new 'static 'dma-tag :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-10) vif0) (new 'static 'vif-tag :cmd (vif-cmd base))) + (set! (-> (the-as dma-packet a0-10) vif1) (new 'static 'vif-tag :imm #xc0 :cmd (vif-cmd offset))) + (set! (-> v1-5 base) (&+ (the-as pointer a0-10) 16)) + ) + (ocean-texture-add-constants obj arg0) + (let ((s3-0 (+ arg1 0))) + (ocean-texture-add-verts obj arg0 s3-0) + (let ((s3-1 (+ s3-0 3072))) + (ocean-texture-add-call-start obj arg0) + (dotimes (s2-0 9) + (ocean-texture-add-verts obj arg0 s3-1) + (+! s3-1 3072) + (ocean-texture-add-call-rest obj arg0) + ) + (let ((a2-5 s3-1)) + (ocean-texture-add-verts-last obj arg0 a2-5 (+ arg1 0)) + (ocean-texture-add-call-rest obj arg0) + (ocean-texture-add-call-done obj arg0) + (ocean-method-81 obj arg0) + (reset-display-gs-state *display* arg0 a2-5) + ) + ) + ) + 0 + (none) + ) + +(defmethod ocean-method-79 ocean ((obj ocean) (arg0 dma-buffer)) + (set-display-gs-state arg0 53 64 64 0 0) + (let* ((v1-0 arg0) + (a0-2 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-2) dma) (new 'static 'dma-tag :qwc #x7 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-2) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-2) vif1) (new 'static 'vif-tag :imm #x7 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-0 base) (&+ (the-as pointer a0-2) 16)) + ) + (let* ((v1-1 arg0) + (a0-4 (the-as object (-> v1-1 base))) + ) + (set! (-> (the-as gs-gif-tag a0-4) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x6)) + (set! (-> (the-as gs-gif-tag a0-4) regs) GIF_REGS_ALL_AD) + (set! (-> v1-1 base) (&+ (the-as pointer a0-4) 16)) + ) + (let* ((s4-0 arg0) + (s3-0 (-> s4-0 base)) + ) + (set! (-> (the-as (pointer gs-test) s3-0) 0) + (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest always)) + ) + (set! (-> (the-as (pointer gs-reg64) s3-0) 1) (gs-reg64 test-1)) + (set! (-> (the-as (pointer gs-alpha) s3-0) 2) (new 'static 'gs-alpha :b #x1 :d #x1)) + (set! (-> (the-as (pointer gs-reg64) s3-0) 3) (gs-reg64 alpha-1)) + (set! (-> (the-as (pointer gs-tex0) s3-0) 4) + (new 'static 'gs-tex0 :tbp0 #x2a0 :tbw #x2 :tcc #x1 :th (log2 128) :tw (log2 128)) + ) + (set! (-> (the-as (pointer gs-reg64) s3-0) 5) (gs-reg64 tex0-1)) + (set! (-> (the-as (pointer gs-tex1) s3-0) 6) (new 'static 'gs-tex1 :mmag #x1 :mmin #x1)) + (set! (-> (the-as (pointer gs-reg64) s3-0) 7) (gs-reg64 tex1-1)) + (set! (-> (the-as (pointer gs-clamp) s3-0) 8) (new 'static 'gs-clamp)) + (set! (-> (the-as (pointer gs-reg64) s3-0) 9) (gs-reg64 clamp-1)) + (set! (-> (the-as (pointer uint64) s3-0) 10) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) s3-0) 11) (gs-reg64 texflush)) + (set! (-> s4-0 base) (&+ s3-0 96)) + ) + (let ((v1-17 (the-as (inline-array vector4w) (-> arg0 base)))) + (set! (-> v1-17 0 quad) (-> obj sprite-tmpl dma-vif quad)) + (set! (-> v1-17 1 quad) (-> obj sprite-tmpl quad 1)) + (set! (-> v1-17 2 quad) (-> obj color80808040 quad)) + (set! (-> v1-17 3 quad) (-> obj uv00 quad)) + (set! (-> v1-17 4 quad) (-> obj xy00 quad)) + (set! (-> v1-17 5 quad) (-> obj uv8080 quad)) + (set! (-> v1-17 6 quad) (-> obj xy4040 quad)) + ) + (&+! (-> arg0 base) 112) + (set-display-gs-state arg0 61 32 32 0 0) + (let* ((v1-20 arg0) + (a0-16 (the-as object (-> v1-20 base))) + ) + (set! (-> (the-as dma-packet a0-16) dma) (new 'static 'dma-tag :qwc #x3 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-16) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-16) vif1) (new 'static 'vif-tag :imm #x3 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-20 base) (&+ (the-as pointer a0-16) 16)) + ) + (let* ((v1-21 arg0) + (a0-18 (the-as object (-> v1-21 base))) + ) + (set! (-> (the-as gs-gif-tag a0-18) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x2)) + (set! (-> (the-as gs-gif-tag a0-18) regs) GIF_REGS_ALL_AD) + (set! (-> v1-21 base) (&+ (the-as pointer a0-18) 16)) + ) + (let* ((s4-1 arg0) + (s3-1 (-> s4-1 base)) + ) + (set! (-> (the-as (pointer gs-tex0) s3-1) 0) + (new 'static 'gs-tex0 :tbp0 #x6a0 :tbw #x1 :tcc #x1 :th (log2 64) :tw (log2 64)) + ) + (set! (-> (the-as (pointer gs-reg64) s3-1) 1) (gs-reg64 tex0-1)) + (set! (-> (the-as (pointer uint64) s3-1) 2) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) s3-1) 3) (gs-reg64 texflush)) + (set! (-> s4-1 base) (&+ s3-1 32)) + ) + (let ((v1-30 (the-as (inline-array vector4w) (-> arg0 base)))) + (set! (-> v1-30 0 quad) (-> obj sprite-tmpl dma-vif quad)) + (set! (-> v1-30 1 quad) (-> obj sprite-tmpl quad 1)) + (set! (-> v1-30 2 quad) (-> obj color80808000 quad)) + (set! (-> v1-30 3 quad) (-> obj uv00 quad)) + (set! (-> v1-30 4 quad) (-> obj xy00 quad)) + (set! (-> v1-30 5 quad) (-> obj uv4040 quad)) + (set! (-> v1-30 6 quad) (-> obj xy2020 quad)) + ) + (&+! (-> arg0 base) 112) + (set-display-gs-state arg0 63 16 16 0 0) + (let* ((v1-33 arg0) + (a0-30 (the-as object (-> v1-33 base))) + ) + (set! (-> (the-as dma-packet a0-30) dma) (new 'static 'dma-tag :qwc #x3 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-30) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-30) vif1) (new 'static 'vif-tag :imm #x3 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-33 base) (&+ (the-as pointer a0-30) 16)) + ) + (let* ((v1-34 arg0) + (a0-32 (the-as object (-> v1-34 base))) + ) + (set! (-> (the-as gs-gif-tag a0-32) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x2)) + (set! (-> (the-as gs-gif-tag a0-32) regs) GIF_REGS_ALL_AD) + (set! (-> v1-34 base) (&+ (the-as pointer a0-32) 16)) + ) + (let* ((s4-2 arg0) + (s3-2 (-> s4-2 base)) + ) + (set! (-> (the-as (pointer gs-tex0) s3-2) 0) + (new 'static 'gs-tex0 :tbp0 #x7a0 :tcc #x1 :th (log2 32) :tw (log2 32)) + ) + (set! (-> (the-as (pointer gs-reg64) s3-2) 1) (gs-reg64 tex0-1)) + (set! (-> (the-as (pointer uint64) s3-2) 2) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) s3-2) 3) (gs-reg64 texflush)) + (set! (-> s4-2 base) (&+ s3-2 32)) + ) + (let ((v1-43 (the-as (inline-array vector4w) (-> arg0 base)))) + (set! (-> v1-43 0 quad) (-> obj sprite-tmpl dma-vif quad)) + (set! (-> v1-43 1 quad) (-> obj sprite-tmpl quad 1)) + (set! (-> v1-43 2 quad) (-> obj color80808000 quad)) + (set! (-> v1-43 3 quad) (-> obj uv00 quad)) + (set! (-> v1-43 4 quad) (-> obj xy00 quad)) + (set! (-> v1-43 5 quad) (-> obj uv2020 quad)) + (set! (-> v1-43 6 quad) (-> obj xy1010 quad)) + ) + (&+! (-> arg0 base) 112) + (set-display-gs-state arg0 64 8 8 0 0) + (let* ((v1-46 arg0) + (a0-44 (the-as object (-> v1-46 base))) + ) + (set! (-> (the-as dma-packet a0-44) dma) (new 'static 'dma-tag :qwc #x3 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-44) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-44) vif1) (new 'static 'vif-tag :imm #x3 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-46 base) (&+ (the-as pointer a0-44) 16)) + ) + (let* ((v1-47 arg0) + (a0-46 (the-as object (-> v1-47 base))) + ) + (set! (-> (the-as gs-gif-tag a0-46) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x2)) + (set! (-> (the-as gs-gif-tag a0-46) regs) GIF_REGS_ALL_AD) + (set! (-> v1-47 base) (&+ (the-as pointer a0-46) 16)) + ) + (let* ((s4-3 arg0) + (s3-3 (-> s4-3 base)) + ) + (set! (-> (the-as (pointer gs-tex0) s3-3) 0) + (new 'static 'gs-tex0 :tbp0 #x7e0 :tcc #x1 :th (log2 16) :tw (log2 16)) + ) + (set! (-> (the-as (pointer gs-reg64) s3-3) 1) (gs-reg64 tex0-1)) + (set! (-> (the-as (pointer uint64) s3-3) 2) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) s3-3) 3) (gs-reg64 texflush)) + (set! (-> s4-3 base) (&+ s3-3 32)) + ) + (let ((v1-56 (the-as (inline-array vector4w) (-> arg0 base)))) + (set! (-> v1-56 0 quad) (-> obj sprite-tmpl dma-vif quad)) + (set! (-> v1-56 1 quad) (-> obj sprite-tmpl quad 1)) + (set! (-> v1-56 2 quad) (-> obj color80808000 quad)) + (set! (-> v1-56 3 quad) (-> obj uv00 quad)) + (set! (-> v1-56 4 quad) (-> obj xy00 quad)) + (set! (-> v1-56 5 quad) (-> obj uv1010 quad)) + (set! (-> v1-56 6 quad) (-> obj xy88 quad)) + ) + (&+! (-> arg0 base) 112) + (set-display-gs-state arg0 65 8 8 0 0) + (let* ((v1-59 arg0) + (a0-58 (the-as object (-> v1-59 base))) + ) + (set! (-> (the-as dma-packet a0-58) dma) (new 'static 'dma-tag :qwc #x3 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-58) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-58) vif1) (new 'static 'vif-tag :imm #x3 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-59 base) (&+ (the-as pointer a0-58) 16)) + ) + (let* ((v1-60 arg0) + (a0-60 (the-as object (-> v1-60 base))) + ) + (set! (-> (the-as gs-gif-tag a0-60) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x2)) + (set! (-> (the-as gs-gif-tag a0-60) regs) GIF_REGS_ALL_AD) + (set! (-> v1-60 base) (&+ (the-as pointer a0-60) 16)) + ) + (let* ((s4-4 arg0) + (s3-4 (-> s4-4 base)) + ) + (set! (-> (the-as (pointer gs-tex0) s3-4) 0) + (new 'static 'gs-tex0 :tbp0 #x800 :tcc #x1 :th (log2 8) :tw (log2 8)) + ) + (set! (-> (the-as (pointer gs-reg64) s3-4) 1) (gs-reg64 tex0-1)) + (set! (-> (the-as (pointer uint64) s3-4) 2) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) s3-4) 3) (gs-reg64 texflush)) + (set! (-> s4-4 base) (the-as pointer (the-as (inline-array vector4w) (&+ s3-4 32)))) + ) + (let ((v1-69 (the-as (inline-array vector4w) (-> arg0 base)))) + (set! (-> v1-69 0 quad) (-> obj sprite-tmpl dma-vif quad)) + (set! (-> v1-69 1 quad) (-> obj sprite-tmpl quad 1)) + (set! (-> v1-69 2 quad) (-> obj color80808000 quad)) + (set! (-> v1-69 3 quad) (-> obj uv00 quad)) + (set! (-> v1-69 4 quad) (-> obj xy00 quad)) + (set! (-> v1-69 5 quad) (-> obj uv1010 quad)) + (set! (-> v1-69 6 quad) (-> obj xy88 quad)) + ) + (&+! (-> arg0 base) 112) + (let ((t9-15 set-display-gs-state) + (a0-71 arg0) + (a1-31 66) + (a2-5 8) + ) + (t9-15 a0-71 a1-31 a2-5 8 0 0) + (let ((v1-72 (the-as (inline-array vector4w) (-> arg0 base)))) + (set! (-> v1-72 0 quad) (-> obj erase-tmpl dma-vif quad)) + (set! (-> v1-72 1 quad) (-> obj erase-tmpl quad 1)) + (set! (-> v1-72 2 quad) (-> obj color80808000 quad)) + (set! (-> v1-72 3 quad) (-> obj xy00 quad)) + (set! (-> v1-72 4 quad) (-> obj xy88 quad)) + ) + (set! (-> arg0 base) (the-as pointer (-> (the-as (inline-array vector4w) (-> arg0 base)) 5))) + (reset-display-gs-state *display* arg0 a2-5) + ) + 0 + (none) + ) + +(defmethod ocean-method-80 ocean ((obj ocean) (arg0 (pointer rgba))) + (dotimes (v1-0 256) + (let ((a0-3 (-> (the-as (pointer uint8) (&+ *clut-translate* v1-0))))) + (set! (-> arg0 a0-3 r) v1-0) + (set! (-> arg0 a0-3 g) v1-0) + (set! (-> arg0 a0-3 b) v1-0) + (set! (-> arg0 a0-3 a) v1-0) + ) + ) + 0 + (none) + ) + +(defmethod do-tex-scroll! ocean ((obj ocean)) + (with-pp + (when (not (paused?)) + (+! (-> obj st-scroll x) (* 8.0 (-> pp clock seconds-per-frame))) + (set! (-> obj st-scroll y) (- (-> obj st-scroll y) (* 8.0 (-> pp clock seconds-per-frame)))) + (if (< 128.0 (-> obj st-scroll x)) + (set! (-> obj st-scroll x) (+ -128.0 (-> obj st-scroll x))) + ) + (if (< (-> obj st-scroll y) 0.0) + (set! (-> obj st-scroll y) (+ 128.0 (-> obj st-scroll y))) + ) + ) + (set! (-> obj uv-scroll-0 x) (the int (* 16.0 (-> obj st-scroll x)))) + (set! (-> obj uv-scroll-0 y) (the int (* 16.0 (+ 256.0 (-> obj st-scroll y))))) + (set! (-> obj uv-scroll-1 x) (the int (* 16.0 (+ 256.0 (-> obj st-scroll x))))) + (set! (-> obj uv-scroll-1 y) (the int (* 16.0 (-> obj st-scroll y)))) + 0 + (none) + ) + ) + +(defmethod ocean-method-81 ocean ((obj ocean) (arg0 dma-buffer)) + (set-display-gs-state arg0 53 128 128 0 0) + (let* ((v1-0 arg0) + (a0-2 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-2) dma) (new 'static 'dma-tag :qwc #x7 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-2) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-2) vif1) (new 'static 'vif-tag :imm #x7 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-0 base) (&+ (the-as pointer a0-2) 16)) + ) + (let* ((v1-1 arg0) + (a0-4 (the-as object (-> v1-1 base))) + ) + (set! (-> (the-as gs-gif-tag a0-4) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x6)) + (set! (-> (the-as gs-gif-tag a0-4) regs) GIF_REGS_ALL_AD) + (set! (-> v1-1 base) (&+ (the-as pointer a0-4) 16)) + ) + (let* ((s4-0 arg0) + (s3-0 (-> s4-0 base)) + ) + (set! (-> (the-as (pointer gs-test) s3-0) 0) + (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest always)) + ) + (set! (-> (the-as (pointer gs-reg64) s3-0) 1) (gs-reg64 test-1)) + (set! (-> (the-as (pointer gs-alpha) s3-0) 2) (new 'static 'gs-alpha :b #x1 :d #x1)) + (set! (-> (the-as (pointer gs-reg64) s3-0) 3) (gs-reg64 alpha-1)) + (set! (-> (the-as (pointer gs-tex0) s3-0) 4) + (new 'static 'gs-tex0 :tbp0 #x2a0 :tbw #x2 :tcc #x1 :th (log2 128) :tw (log2 128)) + ) + (set! (-> (the-as (pointer gs-reg64) s3-0) 5) (gs-reg64 tex0-1)) + (set! (-> (the-as (pointer gs-tex1) s3-0) 6) (new 'static 'gs-tex1 :mmag #x1 :mmin #x1)) + (set! (-> (the-as (pointer gs-reg64) s3-0) 7) (gs-reg64 tex1-1)) + (set! (-> (the-as (pointer gs-clamp) s3-0) 8) (new 'static 'gs-clamp)) + (set! (-> (the-as (pointer gs-reg64) s3-0) 9) (gs-reg64 clamp-1)) + (set! (-> (the-as (pointer uint64) s3-0) 10) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) s3-0) 11) (gs-reg64 texflush)) + (set! (-> s4-0 base) (&+ s3-0 96)) + ) + (let ((v1-17 (the-as (inline-array vector4w) (-> arg0 base)))) + (set! (-> v1-17 0 quad) (-> obj sprite-tmpl dma-vif quad)) + (set! (-> v1-17 1 quad) (-> obj sprite-tmpl quad 1)) + (set! (-> v1-17 2 quad) (-> obj color80808080 quad)) + (set! (-> v1-17 3 quad) (-> obj uv00 quad)) + (set! (-> v1-17 4 quad) (-> obj xy00 quad)) + (set! (-> v1-17 5 quad) (-> obj uv8080 quad)) + (set! (-> v1-17 6 quad) (-> obj xy8080 quad)) + ) + (&+! (-> arg0 base) 112) + (let* ((v1-20 arg0) + (a0-15 (the-as object (-> v1-20 base))) + ) + (set! (-> (the-as dma-packet a0-15) dma) (new 'static 'dma-tag :qwc #x5 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-15) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-15) vif1) (new 'static 'vif-tag :imm #x5 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-20 base) (&+ (the-as pointer a0-15) 16)) + ) + (let* ((v1-21 arg0) + (a0-17 (the-as object (-> v1-21 base))) + ) + (set! (-> (the-as gs-gif-tag a0-17) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x4)) + (set! (-> (the-as gs-gif-tag a0-17) regs) GIF_REGS_ALL_AD) + (set! (-> v1-21 base) (&+ (the-as pointer a0-17) 16)) + ) + (let* ((v1-22 arg0) + (a0-19 (-> v1-22 base)) + ) + (set! (-> (the-as (pointer gs-bitbltbuf) a0-19) 0) (new 'static 'gs-bitbltbuf :dbp #x860)) + (set! (-> (the-as (pointer gs-reg64) a0-19) 1) (gs-reg64 bitbltbuf)) + (set! (-> (the-as (pointer gs-trxpos) a0-19) 2) (new 'static 'gs-trxpos)) + (set! (-> (the-as (pointer gs-reg64) a0-19) 3) (gs-reg64 trxpos)) + (set! (-> (the-as (pointer gs-trxreg) a0-19) 4) (new 'static 'gs-trxreg :rrw #x10 :rrh #x10)) + (set! (-> (the-as (pointer gs-reg64) a0-19) 5) (gs-reg64 trxreg)) + (set! (-> (the-as (pointer gs-trxdir) a0-19) 6) (new 'static 'gs-trxdir)) + (set! (-> (the-as (pointer gs-reg64) a0-19) 7) (gs-reg64 trxdir)) + (set! (-> v1-22 base) (&+ a0-19 64)) + ) + (let ((v1-23 (the-as object (-> arg0 base)))) + (set! (-> (the-as (inline-array vector4w) v1-23) 0 quad) (-> obj clut-tmpl dma-vif quad)) + (set! (-> (the-as (inline-array vector4w) v1-23) 1 quad) (-> obj clut-tmpl quad 1)) + (ocean-method-80 obj (the-as (pointer rgba) (&+ (the-as pointer v1-23) 32))) + ) + (&+! (-> arg0 base) 1056) + (set-display-gs-state arg0 85 128 128 0 0) + (let* ((v1-27 arg0) + (a0-25 (the-as object (-> v1-27 base))) + ) + (set! (-> (the-as dma-packet a0-25) dma) (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-25) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-25) vif1) (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-27 base) (&+ (the-as pointer a0-25) 16)) + ) + (let* ((v1-28 arg0) + (a0-27 (the-as object (-> v1-28 base))) + ) + (set! (-> (the-as gs-gif-tag a0-27) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x5)) + (set! (-> (the-as gs-gif-tag a0-27) regs) GIF_REGS_ALL_AD) + (set! (-> v1-28 base) (&+ (the-as pointer a0-27) 16)) + ) + (let* ((s4-1 arg0) + (s3-1 (-> s4-1 base)) + ) + (set! (-> (the-as (pointer gs-alpha) s3-1) 0) (new 'static 'gs-alpha)) + (set! (-> (the-as (pointer gs-reg64) s3-1) 1) (gs-reg64 alpha-1)) + (set! (-> (the-as (pointer gs-tex0) s3-1) 2) (new 'static 'gs-tex0 + :tbp0 #x2a0 + :tbw #x2 + :psm #x1b + :tcc #x1 + :cbp #x860 + :cld #x1 + :th (log2 128) + :tw (log2 128) + ) + ) + (set! (-> (the-as (pointer gs-reg64) s3-1) 3) (gs-reg64 tex0-1)) + (set! (-> (the-as (pointer gs-tex1) s3-1) 4) (new 'static 'gs-tex1)) + (set! (-> (the-as (pointer gs-reg64) s3-1) 5) (gs-reg64 tex1-1)) + (set! (-> (the-as (pointer gs-clamp) s3-1) 6) (new 'static 'gs-clamp)) + (set! (-> (the-as (pointer gs-reg64) s3-1) 7) (gs-reg64 clamp-1)) + (set! (-> (the-as (pointer uint64) s3-1) 8) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) s3-1) 9) (gs-reg64 texflush)) + (set! (-> s4-1 base) (&+ s3-1 80)) + ) + (let ((v1-40 (the-as (inline-array vector4w) (-> arg0 base)))) + (set! (-> v1-40 0 quad) (-> obj sprite-tmpl3 dma-vif quad)) + (set! (-> v1-40 1 quad) (-> obj sprite-tmpl3 quad 1)) + (set-vector! (-> v1-40 2) 96 96 96 128) + (set! (-> v1-40 3 quad) (-> obj uv00 quad)) + (set! (-> v1-40 4 quad) (-> obj xy00 quad)) + (set! (-> v1-40 5 quad) (-> obj uv8080 quad)) + (set! (-> v1-40 6 quad) (-> obj xy8080 quad)) + ) + (&+! (-> arg0 base) 112) + (let* ((v1-43 arg0) + (a0-38 (the-as object (-> v1-43 base))) + ) + (set! (-> (the-as dma-packet a0-38) dma) (new 'static 'dma-tag :qwc #x4 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-38) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-38) vif1) (new 'static 'vif-tag :imm #x4 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-43 base) (&+ (the-as pointer a0-38) 16)) + ) + (let* ((v1-44 arg0) + (a0-40 (the-as object (-> v1-44 base))) + ) + (set! (-> (the-as gs-gif-tag a0-40) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x3)) + (set! (-> (the-as gs-gif-tag a0-40) regs) GIF_REGS_ALL_AD) + (set! (-> v1-44 base) (&+ (the-as pointer a0-40) 16)) + ) + (let* ((v1-45 arg0) + (a0-42 (-> v1-45 base)) + ) + (set! (-> (the-as (pointer gs-alpha) a0-42) 0) (new 'static 'gs-alpha :b #x1 :d #x1)) + (set! (-> (the-as (pointer gs-reg64) a0-42) 1) (gs-reg64 alpha-1)) + (set! (-> (the-as (pointer gs-tex1) a0-42) 2) (new 'static 'gs-tex1 :mmag #x1 :mmin #x1)) + (set! (-> (the-as (pointer gs-reg64) a0-42) 3) (gs-reg64 tex1-1)) + (set! (-> (the-as (pointer uint64) a0-42) 4) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) a0-42) 5) (gs-reg64 texflush)) + (set! (-> v1-45 base) (&+ a0-42 48)) + ) + (let ((v1-46 (the-as (inline-array vector4w) (-> arg0 base)))) + (set! (-> v1-46 0 quad) (-> obj sprite-tmpl3 dma-vif quad)) + (set! (-> v1-46 1 quad) (-> obj sprite-tmpl3 quad 1)) + (set-vector! (-> v1-46 2) 64 64 64 64) + (set! (-> v1-46 3 quad) (-> obj uv-scroll-0 quad)) + (set! (-> v1-46 4 quad) (-> obj xy00 quad)) + (set! (-> v1-46 5 quad) (-> obj uv-scroll-1 quad)) + (set! (-> v1-46 6 quad) (-> obj xy8080 quad)) + ) + (&+! (-> arg0 base) 112) + (set-display-gs-state arg0 21 128 128 0 0) + (let* ((v1-49 arg0) + (a0-52 (the-as object (-> v1-49 base))) + ) + (set! (-> (the-as dma-packet a0-52) dma) (new 'static 'dma-tag :qwc #x5 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-52) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-52) vif1) (new 'static 'vif-tag :imm #x5 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-49 base) (&+ (the-as pointer a0-52) 16)) + ) + (let* ((v1-50 arg0) + (a0-54 (the-as object (-> v1-50 base))) + ) + (set! (-> (the-as gs-gif-tag a0-54) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x4)) + (set! (-> (the-as gs-gif-tag a0-54) regs) GIF_REGS_ALL_AD) + (set! (-> v1-50 base) (&+ (the-as pointer a0-54) 16)) + ) + (let* ((s4-2 arg0) + (s3-2 (-> s4-2 base)) + ) + (set! (-> (the-as (pointer gs-alpha) s3-2) 0) (new 'static 'gs-alpha :b #x1 :d #x1)) + (set! (-> (the-as (pointer gs-reg64) s3-2) 1) (gs-reg64 alpha-1)) + (set! (-> (the-as (pointer gs-tex0) s3-2) 2) + (new 'static 'gs-tex0 :tbp0 #x6a0 :tbw #x2 :th (log2 128) :tw (log2 128)) + ) + (set! (-> (the-as (pointer gs-reg64) s3-2) 3) (gs-reg64 tex0-1)) + (set! (-> (the-as (pointer gs-tex1) s3-2) 4) (new 'static 'gs-tex1 :mmag #x1 :mmin #x1)) + (set! (-> (the-as (pointer gs-reg64) s3-2) 5) (gs-reg64 tex1-1)) + (set! (-> (the-as (pointer uint64) s3-2) 6) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) s3-2) 7) (gs-reg64 texflush)) + (set! (-> s4-2 base) (&+ s3-2 64)) + ) + (let ((v1-63 (the-as (inline-array vector4w) (-> arg0 base)))) + (set! (-> v1-63 0 quad) (-> obj sprite-tmpl3 dma-vif quad)) + (set! (-> v1-63 1 quad) (-> obj sprite-tmpl3 quad 1)) + (set-vector! (-> v1-63 2) 128 128 128 64) + (set! (-> v1-63 3 quad) (-> obj uv-scroll-0 quad)) + (set! (-> v1-63 4 quad) (-> obj xy00 quad)) + (set! (-> v1-63 5 quad) (-> obj uv-scroll-1 quad)) + (set! (-> v1-63 6 quad) (-> obj xy8080 quad)) + ) + (&+! (-> arg0 base) 112) + (let ((s5-1 128) + (s4-3 128) + ) + (let ((s1-0 21) + (s2-5 2720) + (s3-3 (log2 (* s5-1 2))) + (v1-66 (log2 s4-3)) + (a0-69 (/ (+ (* s5-1 2) 63) 64)) + (a1-55 #x3fff) + ) + (let* ((a2-3 arg0) + (a3-3 (the-as object (-> a2-3 base))) + ) + (set! (-> (the-as dma-packet a3-3) dma) (new 'static 'dma-tag :qwc #xc :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a3-3) vif0) (new 'static 'vif-tag :cmd (vif-cmd flusha) :msk #x1)) + (set! (-> (the-as dma-packet a3-3) vif1) (new 'static 'vif-tag :imm #xc :cmd (vif-cmd direct) :msk #x1)) + (set! (-> a2-3 base) (&+ (the-as pointer a3-3) 16)) + ) + (let* ((a2-4 arg0) + (a3-5 (the-as object (-> a2-4 base))) + ) + (set! (-> (the-as gs-gif-tag a3-5) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #xb)) + (set! (-> (the-as gs-gif-tag a3-5) regs) GIF_REGS_ALL_AD) + (set! (-> a2-4 base) (&+ (the-as pointer a3-5) 16)) + ) + (let* ((a2-5 arg0) + (a3-7 (-> a2-5 base)) + ) + (set! (-> (the-as (pointer gs-xy-offset) a3-7) 0) (new 'static 'gs-xy-offset)) + (set! (-> (the-as (pointer gs-reg64) a3-7) 1) (gs-reg64 xyoffset-1)) + (set! (-> (the-as (pointer gs-frame) a3-7) 2) + (new 'static 'gs-frame :psm (gs-psm ct16) :fbmsk a1-55 :fbw a0-69 :fbp s1-0) + ) + (set! (-> (the-as (pointer gs-reg64) a3-7) 3) (gs-reg64 frame-1)) + (set! (-> (the-as (pointer gs-scissor) a3-7) 4) + (new 'static 'gs-scissor :scax1 (+ s5-1 -1) :scay1 (+ s4-3 -1)) + ) + (set! (-> (the-as (pointer gs-reg64) a3-7) 5) (gs-reg64 scissor-1)) + (set! (-> (the-as (pointer gs-test) a3-7) 6) + (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + ) + (set! (-> (the-as (pointer gs-reg64) a3-7) 7) (gs-reg64 test-1)) + (set! (-> (the-as (pointer gs-alpha) a3-7) 8) (new 'static 'gs-alpha :a #x2 :b #x2 :c #x2 :fix #x80)) + (set! (-> (the-as (pointer gs-reg64) a3-7) 9) (gs-reg64 alpha-1)) + (set! (-> (the-as (pointer gs-tex0) a3-7) 10) + (new 'static 'gs-tex0 :psm #x2 :tcc #x1 :tfx #x1 :th v1-66 :tw s3-3 :tbw a0-69 :tbp0 s2-5) + ) + (set! (-> (the-as (pointer gs-reg64) a3-7) 11) (gs-reg64 tex0-1)) + (set! (-> (the-as (pointer uint64) a3-7) 12) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) a3-7) 13) (gs-reg64 fba-1)) + (set! (-> (the-as (pointer gs-texa) a3-7) 14) (new 'static 'gs-texa :ta1 #x80)) + (set! (-> (the-as (pointer gs-reg64) a3-7) 15) (gs-reg64 texa)) + (set! (-> (the-as (pointer gs-tex1) a3-7) 16) (new 'static 'gs-tex1 :lcm #x1)) + (set! (-> (the-as (pointer gs-reg64) a3-7) 17) (gs-reg64 tex1-1)) + (set! (-> (the-as (pointer uint64) a3-7) 18) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) a3-7) 19) (gs-reg64 texflush)) + (set! (-> (the-as (pointer gs-prim) a3-7) 20) + (new 'static 'gs-prim :prim (gs-prim-type sprite) :tme #x1 :abe #x1 :fst #x1) + ) + (set! (-> (the-as (pointer gs-reg64) a3-7) 21) (gs-reg64 prim)) + (set! (-> a2-5 base) (&+ a3-7 176)) + ) + (let ((a2-6 s4-3)) + (dotimes (a3-9 (/ s5-1 16)) + (let* ((t0-38 arg0) + (t1-19 (the-as object (-> t0-38 base))) + ) + (set! (-> (the-as dma-packet t1-19) dma) (new 'static 'dma-tag :qwc #x5 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet t1-19) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet t1-19) vif1) (new 'static 'vif-tag :imm #x5 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> t0-38 base) (&+ (the-as pointer t1-19) 16)) + ) + (let* ((t0-39 arg0) + (t1-21 (the-as object (-> t0-39 base))) + ) + (set! (-> (the-as gs-gif-tag t1-21) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x4)) + (set! (-> (the-as gs-gif-tag t1-21) regs) GIF_REGS_ALL_AD) + (set! (-> t0-39 base) (&+ (the-as pointer t1-21) 16)) + ) + (let* ((t0-40 arg0) + (t1-23 (-> t0-40 base)) + ) + (set! (-> (the-as (pointer gs-xyz) t1-23) 0) (new 'static 'gs-xyz :y #x8 :x (+ (* a3-9 256) 8))) + (set! (-> (the-as (pointer gs-reg64) t1-23) 1) (gs-reg64 uv)) + (set! (-> (the-as (pointer gs-xyz) t1-23) 2) (new 'static 'gs-xyz :x (+ (* a3-9 256) 128))) + (set! (-> (the-as (pointer gs-reg64) t1-23) 3) (gs-reg64 xyz2)) + (set! (-> (the-as (pointer gs-xyz) t1-23) 4) + (new 'static 'gs-xyz :x (+ (* a3-9 256) 136) :y (+ (* a2-6 16) 8)) + ) + (set! (-> (the-as (pointer gs-reg64) t1-23) 5) (gs-reg64 uv)) + (set! (-> (the-as (pointer gs-xyz) t1-23) 6) (new 'static 'gs-xyz :y (* a2-6 16) :x (+ (* a3-9 256) 256))) + (set! (-> (the-as (pointer gs-reg64) t1-23) 7) (gs-reg64 xyz2)) + (set! (-> t0-40 base) (&+ t1-23 64)) + ) + ) + ) + (let ((t0-42 (/ s5-1 64))) + (let* ((a2-9 arg0) + (a3-10 (the-as object (-> a2-9 base))) + ) + (set! (-> (the-as dma-packet a3-10) dma) (new 'static 'dma-tag :qwc #x4 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a3-10) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a3-10) vif1) (new 'static 'vif-tag :imm #x4 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> a2-9 base) (&+ (the-as pointer a3-10) 16)) + ) + (let* ((a2-10 arg0) + (a3-12 (the-as object (-> a2-10 base))) + ) + (set! (-> (the-as gs-gif-tag a3-12) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x3)) + (set! (-> (the-as gs-gif-tag a3-12) regs) GIF_REGS_ALL_AD) + (set! (-> a2-10 base) (&+ (the-as pointer a3-12) 16)) + ) + (let* ((a2-11 arg0) + (a3-14 (-> a2-11 base)) + ) + (set! (-> (the-as (pointer gs-frame) a3-14) 0) + (new 'static 'gs-frame :psm (gs-psm ct16) :fbmsk a1-55 :fbw a0-69 :fbp (+ s1-0 t0-42)) + ) + (set! (-> (the-as (pointer gs-reg64) a3-14) 1) (gs-reg64 frame-1)) + (set! (-> (the-as (pointer gs-tex0) a3-14) 2) + (new 'static 'gs-tex0 :psm #x2 :tcc #x1 :tfx #x1 :th v1-66 :tw s3-3 :tbw a0-69 :tbp0 (+ s2-5 (* t0-42 32))) + ) + (set! (-> (the-as (pointer gs-reg64) a3-14) 3) (gs-reg64 tex0-1)) + (set! (-> (the-as (pointer gs-prim) a3-14) 4) + (new 'static 'gs-prim :prim (gs-prim-type sprite) :tme #x1 :abe #x1 :fst #x1) + ) + (set! (-> (the-as (pointer gs-reg64) a3-14) 5) (gs-reg64 prim)) + (set! (-> a2-11 base) (&+ a3-14 48)) + ) + ) + ) + (dotimes (v1-73 (/ s5-1 16)) + (let* ((a0-74 arg0) + (a1-63 (the-as object (-> a0-74 base))) + ) + (set! (-> (the-as dma-packet a1-63) dma) (new 'static 'dma-tag :qwc #x5 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a1-63) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a1-63) vif1) (new 'static 'vif-tag :imm #x5 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> a0-74 base) (&+ (the-as pointer a1-63) 16)) + ) + (let* ((a0-75 arg0) + (a1-65 (the-as object (-> a0-75 base))) + ) + (set! (-> (the-as gs-gif-tag a1-65) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x4)) + (set! (-> (the-as gs-gif-tag a1-65) regs) GIF_REGS_ALL_AD) + (set! (-> a0-75 base) (&+ (the-as pointer a1-65) 16)) + ) + (let* ((a0-76 arg0) + (a1-67 (-> a0-76 base)) + ) + (set! (-> (the-as (pointer gs-xyz) a1-67) 0) (new 'static 'gs-xyz :y #x8 :x (+ (* v1-73 256) 8))) + (set! (-> (the-as (pointer gs-reg64) a1-67) 1) (gs-reg64 uv)) + (set! (-> (the-as (pointer gs-xyz) a1-67) 2) (new 'static 'gs-xyz :x (+ (* v1-73 256) 128))) + (set! (-> (the-as (pointer gs-reg64) a1-67) 3) (gs-reg64 xyz2)) + (set! (-> (the-as (pointer gs-xyz) a1-67) 4) + (new 'static 'gs-xyz :x (+ (* v1-73 256) 136) :y (+ (* s4-3 16) 8)) + ) + (set! (-> (the-as (pointer gs-reg64) a1-67) 5) (gs-reg64 uv)) + (set! (-> (the-as (pointer gs-xyz) a1-67) 6) (new 'static 'gs-xyz :y (* s4-3 16) :x (+ (* v1-73 256) 256))) + (set! (-> (the-as (pointer gs-reg64) a1-67) 7) (gs-reg64 xyz2)) + (set! (-> a0-76 base) (&+ a1-67 64)) + ) + ) + ) + 0 + (none) + ) + +(defmethod draw-envmap-debug ocean ((obj ocean) (arg0 dma-buffer)) + (format *stdcon* "draw-envmap-debug~%") + (-> arg0 base) + (let* ((v1-1 arg0) + (a0-2 (the-as object (-> v1-1 base))) + ) + (set! (-> (the-as dma-packet a0-2) dma) (new 'static 'dma-tag :qwc #x7 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-2) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-2) vif1) (new 'static 'vif-tag :imm #x7 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-1 base) (&+ (the-as pointer a0-2) 16)) + ) + (let* ((v1-2 arg0) + (a0-4 (the-as object (-> v1-2 base))) + ) + (set! (-> (the-as gs-gif-tag a0-4) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x6)) + (set! (-> (the-as gs-gif-tag a0-4) regs) GIF_REGS_ALL_AD) + (set! (-> v1-2 base) (&+ (the-as pointer a0-4) 16)) + ) + (let* ((s4-0 arg0) + (s3-0 (-> s4-0 base)) + ) + (set! (-> (the-as (pointer gs-test) s3-0) 0) + (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest always)) + ) + (set! (-> (the-as (pointer gs-reg64) s3-0) 1) (gs-reg64 test-1)) + (set! (-> (the-as (pointer gs-alpha) s3-0) 2) (new 'static 'gs-alpha :b #x1 :d #x1)) + (set! (-> (the-as (pointer gs-reg64) s3-0) 3) (gs-reg64 alpha-1)) + (set! (-> (the-as (pointer gs-tex0) s3-0) 4) + (new 'static 'gs-tex0 + :tbw #x1 + :tcc #x1 + :th (log2 64) + :tw (log2 64) + :tbp0 (+ (-> *ocean-texture-base* vram-block) 256) + ) + ) + (set! (-> (the-as (pointer gs-reg64) s3-0) 5) (gs-reg64 tex0-1)) + (set! (-> (the-as (pointer gs-tex1) s3-0) 6) (new 'static 'gs-tex1 :mmag #x1 :mmin #x1)) + (set! (-> (the-as (pointer gs-reg64) s3-0) 7) (gs-reg64 tex1-1)) + (set! (-> (the-as (pointer gs-clamp) s3-0) 8) + (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp)) + ) + (set! (-> (the-as (pointer gs-reg64) s3-0) 9) (gs-reg64 clamp-1)) + (set! (-> (the-as (pointer uint64) s3-0) 10) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) s3-0) 11) (gs-reg64 texflush)) + (set! (-> s4-0 base) (&+ s3-0 96)) + ) + (let ((v1-20 (the-as (inline-array vector4w) (-> arg0 base)))) + (set! (-> v1-20 0 quad) (-> obj sprite-tmpl dma-vif quad)) + (set! (-> v1-20 1 quad) (-> obj sprite-tmpl quad 1)) + (set! (-> v1-20 2 quad) (-> obj color80808080 quad)) + (set! (-> v1-20 3 quad) (-> obj uv00 quad)) + (set-vector! (-> v1-20 4) #x7b50 #x8000 #xffffff 0) + (set! (-> v1-20 5 quad) (-> obj uv4040 quad)) + (set-vector! (-> v1-20 6) #x7f60 #x8400 #xffffff 0) + ) + (&+! (-> arg0 base) 112) + (let* ((v1-24 arg0) + (a0-22 (the-as object (-> v1-24 base))) + ) + (set! (-> (the-as dma-packet a0-22) dma) (new 'static 'dma-tag :qwc #x7 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-22) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-22) vif1) (new 'static 'vif-tag :imm #x7 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-24 base) (&+ (the-as pointer a0-22) 16)) + ) + (let* ((v1-25 arg0) + (a0-24 (the-as object (-> v1-25 base))) + ) + (set! (-> (the-as gs-gif-tag a0-24) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x6)) + (set! (-> (the-as gs-gif-tag a0-24) regs) GIF_REGS_ALL_AD) + (set! (-> v1-25 base) (&+ (the-as pointer a0-24) 16)) + ) + (let* ((s4-1 arg0) + (s3-1 (-> s4-1 base)) + ) + (set! (-> (the-as (pointer gs-test) s3-1) 0) + (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest always)) + ) + (set! (-> (the-as (pointer gs-reg64) s3-1) 1) (gs-reg64 test-1)) + (set! (-> (the-as (pointer gs-alpha) s3-1) 2) (new 'static 'gs-alpha)) + (set! (-> (the-as (pointer gs-reg64) s3-1) 3) (gs-reg64 alpha-1)) + (set! (-> (the-as (pointer gs-tex0) s3-1) 4) + (new 'static 'gs-tex0 :tbw #x1 :th (log2 64) :tw (log2 64) :tbp0 (-> *ocean-envmap-texture-base* vram-block)) + ) + (set! (-> (the-as (pointer gs-reg64) s3-1) 5) (gs-reg64 tex0-1)) + (set! (-> (the-as (pointer gs-tex1) s3-1) 6) (new 'static 'gs-tex1)) + (set! (-> (the-as (pointer gs-reg64) s3-1) 7) (gs-reg64 tex1-1)) + (set! (-> (the-as (pointer gs-clamp) s3-1) 8) + (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp)) + ) + (set! (-> (the-as (pointer gs-reg64) s3-1) 9) (gs-reg64 clamp-1)) + (set! (-> (the-as (pointer uint64) s3-1) 10) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) s3-1) 11) (gs-reg64 texflush)) + (set! (-> s4-1 base) (&+ s3-1 96)) + ) + (let ((v1-44 (the-as (inline-array vector4w) (-> arg0 base)))) + (set! (-> v1-44 0 quad) (-> obj sprite-tmpl dma-vif quad)) + (set! (-> v1-44 1 quad) (-> obj sprite-tmpl quad 1)) + (set! (-> v1-44 2 quad) (-> obj color80808080 quad)) + (set! (-> v1-44 3 quad) (-> obj uv00 quad)) + (set-vector! (-> v1-44 4) #x8000 #x8000 #xffffff 0) + (set! (-> v1-44 5 quad) (-> obj uv4040 quad)) + (set-vector! (-> v1-44 6) #x8820 #x8400 #xffffff 0) + ) + (&+! (-> arg0 base) 112) + 0 + (none) + ) + +(defmethod ocean-method-83 ocean ((obj ocean) (arg0 dma-buffer) (arg1 float)) + (let* ((s4-0 64) + (s3-0 0) + (f30-0 (/ -65536.0 (the float s4-0))) + (f28-0 arg1) + ) + (let* ((v1-1 arg0) + (a0-1 (the-as object (-> v1-1 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :qwc #x5 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-1) vif1) (new 'static 'vif-tag :imm #x5 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-1 base) (&+ (the-as pointer a0-1) 16)) + ) + (let* ((v1-2 arg0) + (a0-3 (the-as object (-> v1-2 base))) + ) + (set! (-> (the-as gs-gif-tag a0-3) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x4)) + (set! (-> (the-as gs-gif-tag a0-3) regs) GIF_REGS_ALL_AD) + (set! (-> v1-2 base) (&+ (the-as pointer a0-3) 16)) + ) + (let* ((s2-0 arg0) + (s1-0 (-> s2-0 base)) + ) + (set! (-> (the-as (pointer gs-alpha) s1-0) 0) (new 'static 'gs-alpha :b #x1 :d #x1)) + (set! (-> (the-as (pointer gs-reg64) s1-0) 1) (gs-reg64 alpha-1)) + (set! (-> (the-as (pointer gs-tex0) s1-0) 2) + (new 'static 'gs-tex0 + :tbw #x1 + :tcc #x1 + :th (log2 64) + :tw (log2 64) + :tbp0 (+ (-> *ocean-texture-base* vram-block) 256) + ) + ) + (set! (-> (the-as (pointer gs-reg64) s1-0) 3) (gs-reg64 tex0-1)) + (set! (-> (the-as (pointer gs-clamp) s1-0) 4) + (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp)) + ) + (set! (-> (the-as (pointer gs-reg64) s1-0) 5) (gs-reg64 clamp-1)) + (set! (-> (the-as (pointer uint64) s1-0) 6) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) s1-0) 7) (gs-reg64 texflush)) + (set! (-> s2-0 base) (&+ s1-0 64)) + ) + (let ((v1-16 (-> arg0 base))) + (set! (-> (the-as (pointer uint128) v1-16)) (-> obj line-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) v1-16) 1) (-> obj line-tmpl quad 1)) + ) + (&+! (-> arg0 base) 32) + (dotimes (s2-1 s4-0) + (let ((s1-1 (the-as object (-> arg0 base)))) + (let ((f26-1 (+ 0.5 (* 0.5 (sin f28-0)))) + (f0-5 (+ 0.5 (* 0.5 (cos f28-0)))) + ) + (set! (-> (the-as (inline-array vector4w) s1-1) 0 quad) (-> obj color80808000 quad)) + (set! (-> (the-as (inline-array vector4w) s1-1) 1 quad) (-> obj st0505 quad)) + (set-vector! (-> (the-as (inline-array vector4w) s1-1) 2) s3-0 0 #xffffff 0) + (set-vector! + (-> (the-as (inline-array vector4w) s1-1) 3) + (the-as int f26-1) + (the-as int f0-5) + (the-as int 1.0) + (the-as int 0.0) + ) + ) + (set-vector! (-> (the-as (inline-array vector4w) s1-1) 4) s3-0 512 #xffffff 0) + ) + (+! s3-0 16) + (+! f28-0 f30-0) + (&+! (-> arg0 base) 80) + ) + ) + 0 + (none) + ) + +(defmethod ocean-method-84 ocean ((obj ocean) (arg0 dma-buffer) (arg1 sky-upload-data) (arg2 vector4w) (arg3 float)) + (when (>= (-> arg1 sun 0 pos y) -150.0) + (let* ((f2-0 (* 0.00010050251 (-> arg1 sun 0 pos x))) + (f1-3 (* 0.00010050251 (-> arg1 sun 0 pos z))) + (f0-6 (if (< 0.0 (-> arg1 sun 0 pos y)) + 1.0 + (* 0.006666667 (+ 150.0 (-> arg1 sun 0 pos y))) + ) + ) + (f3-6 (if (< 4000.0 (-> arg1 sun 0 pos y)) + 1.0 + (+ 1.0 (* 0.001 (- 4000.0 (-> arg1 sun 0 pos y)))) + ) + ) + (t0-1 (* arg3 f3-6)) + (v1-14 (the int (+ 1024.0 (* 512.0 f2-0)))) + (a2-3 (the int (+ 1024.0 (* 512.0 f1-3)))) + (t0-2 (the int t0-1)) + (t1-0 (the-as (inline-array vector4w) (-> arg0 base))) + ) + (set! (-> t1-0 0 quad) (-> obj sun-tmpl dma-vif quad)) + (set! (-> t1-0 1 quad) (-> obj sun-tmpl quad 1)) + (set! (-> t1-0 2 quad) (-> arg2 quad)) + (set! (-> t1-0 2 w) (the int (* 128.0 f0-6))) + (set! (-> t1-0 3 quad) (-> obj st0000 quad)) + (set-vector! (-> t1-0 4) (- v1-14 t0-2) (- a2-3 t0-2) #xffffff 0) + (set! (-> t1-0 5 quad) (-> obj st1010 quad)) + (set-vector! (-> t1-0 6) (+ v1-14 t0-2) (+ a2-3 t0-2) #xffffff 0) + ) + (&+! (-> arg0 base) 112) + ) + 0 + (none) + ) + +(defmethod ocean-method-85 ocean ((obj ocean) (arg0 dma-buffer)) + (local-vars (sv-48 vector4w) (sv-64 vector4w)) + (let* ((v1-0 arg0) + (a0-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-1) vif1) (new 'static 'vif-tag :imm #x2 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) + ) + (let* ((v1-1 arg0) + (a0-3 (the-as object (-> v1-1 base))) + ) + (set! (-> (the-as gs-gif-tag a0-3) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1)) + (set! (-> (the-as gs-gif-tag a0-3) regs) GIF_REGS_ALL_AD) + (set! (-> v1-1 base) (&+ (the-as pointer a0-3) 16)) + ) + (let* ((v1-2 arg0) + (a0-5 (-> v1-2 base)) + ) + (set! (-> (the-as (pointer gs-alpha) a0-5) 0) (new 'static 'gs-alpha :b #x2 :d #x1)) + (set! (-> (the-as (pointer gs-reg64) a0-5) 1) (gs-reg64 alpha-1)) + (set! (-> v1-2 base) (&+ a0-5 16)) + ) + (let ((v1-3 (-> arg0 base))) + (set! (-> (the-as (pointer uint128) v1-3)) (-> obj haze-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) v1-3) 1) (-> obj haze-tmpl quad 1)) + ) + (&+! (-> arg0 base) 32) + (let ((f30-0 0.0) + (f28-0 4096.0) + (s3-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'ocean-vertex)) + (s4-0 (-> arg0 base)) + ) + (dotimes (s1-0 16) + (let ((s0-0 (the-as object (-> arg0 base)))) + (set! sv-48 (-> obj haze-verts (* s1-0 2))) + (set! sv-64 (-> obj haze-verts (+ (* s1-0 2) 1))) + (let ((f0-1 (+ -1024.0 (the float (-> sv-48 x)))) + (f1-3 (+ -1024.0 (the float (-> sv-48 y)))) + (v1-22 s2-0) + ) + (set! (-> v1-22 pos x) f0-1) + (set! (-> v1-22 pos y) 0.0) + (set! (-> v1-22 pos z) f1-3) + (set! (-> v1-22 pos w) 1.0) + ) + (add-colors! obj s3-0 s2-0) + (vector-float*! s3-0 s3-0 0.25) + (set-vector! + (-> (the-as (inline-array vector4w) s0-0) 0) + (the int (-> s3-0 x)) + (the int (-> s3-0 y)) + (the int (-> s3-0 z)) + 0 + ) + (set! (-> (the-as (inline-array vector4w) s0-0) 1 quad) (-> sv-48 quad)) + (set-vector! + (-> (the-as (inline-array vector4w) s0-0) 2) + (the int (-> s3-0 x)) + (the int (-> s3-0 y)) + (the int (-> s3-0 z)) + 128 + ) + (set! (-> (the-as (inline-array vector4w) s0-0) 3 quad) (-> sv-64 quad)) + ) + (&+! (-> arg0 base) 64) + (+! f30-0 f28-0) + ) + (let ((v1-37 (the-as (pointer uint128) (-> arg0 base)))) + (set! (-> v1-37 0) (-> (the-as (pointer uint128) s4-0) 0)) + (set! (-> v1-37 1) (-> (the-as (pointer uint128) s4-0) 1)) + (set! (-> v1-37 2) (-> (the-as (pointer uint128) s4-0) 2)) + (set! (-> v1-37 3) (-> (the-as (pointer uint128) s4-0) 3)) + ) + ) + (&+! (-> arg0 base) 64) + 0 + (none) + ) + +(defmethod ocean-method-86 ocean ((obj ocean) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) + (local-vars (v1-1 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf12 :class vf) + (vf13 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf) + ) + (init-vf0-vector) + (let ((v1-0 (new 'static 'vector :y 128.0 :z 255.0))) + (.max.w.vf vf1 vf0 vf0) + (.lvf vf2 (&-> v1-0 quad)) + ) + (.lvf vf7 (&-> arg1 quad)) + (.lvf vf4 (&-> obj cloud-lights sun0-normal quad)) + (.lvf vf5 (&-> obj cloud-lights sun1-normal quad)) + (.lvf vf6 (&-> obj cloud-lights moon-normal quad)) + (.mul.vf vf8 vf4 vf7) + (.mul.vf vf9 vf5 vf7) + (.mul.vf vf10 vf6 vf7) + (.lvf vf3 (&-> arg3 quad)) + (.mul.w.vf acc vf8 vf0) + (.add.mul.y.vf acc vf1 vf8 acc) + (.add.mul.z.vf vf8 vf1 vf8 acc) + (.mul.w.vf acc vf9 vf0) + (.add.mul.y.vf acc vf1 vf9 acc) + (.add.mul.z.vf vf9 vf1 vf9 acc) + (.mul.w.vf acc vf10 vf0) + (.add.mul.y.vf acc vf1 vf10 acc) + (.add.mul.z.vf vf10 vf1 vf10 acc) + (.lvf vf11 (&-> arg2 quad)) + (.max.vf vf8 vf8 vf0) + (.max.vf vf9 vf9 vf0) + (.max.vf vf10 vf10 vf0) + (.lvf vf12 (&-> obj cloud-lights sun1-color quad)) + (.lvf vf13 (&-> obj cloud-lights moon-color quad)) + (.mul.w.vf acc vf3 vf0) + (.add.mul.x.vf acc vf11 vf8 acc) + (.add.mul.x.vf acc vf12 vf9 acc) + (.add.mul.x.vf vf3 vf13 vf10 acc) + (.mul.y.vf vf3 vf3 vf2) + (.max.x.vf vf3 vf3 vf0) + (.min.z.vf vf3 vf3 vf2) + (.ftoi.vf vf3 vf3) + (.svf (&-> arg0 quad) vf3) + (.mov v1-1 vf3) + 0 + (none) + ) + ) + +(defmethod ocean-method-87 ocean ((obj ocean) (arg0 vector) (arg1 vector) (arg2 vector)) + (let ((s5-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + (f28-0 0.00390625) + (f30-0 0.015625) + ) + (let ((s3-0 (-> obj cloud-lights))) + (set! (-> arg0 quad) (-> arg1 quad)) + (vector--float*! s5-0 arg2 (-> s3-0 sun0-normal) 9.0) + (vector--float*! s2-0 arg2 (-> s3-0 sun1-normal) 9.0) + (vector--float*! s4-0 arg2 (-> s3-0 moon-normal) 9.0) + (vector-float*! s5-0 s5-0 (* (-> s3-0 sun0-scale) f28-0)) + (vector+float*! s5-0 s5-0 s2-0 (* 0.25 f28-0 (-> s3-0 sun1-scale))) + (vector+float*! s5-0 s5-0 s4-0 (* (-> s3-0 moon-scale) f28-0)) + ) + (+! (-> arg0 x) (fmax (fmin (-> s5-0 x) f30-0) (- f30-0))) + (+! (-> arg0 y) (fmax (fmin (-> s5-0 z) f30-0) (- f30-0))) + ) + 0 + (none) + ) + +(defmethod ocean-method-88 ocean ((obj ocean) (arg0 dma-buffer)) + (local-vars (sv-48 vector) (sv-64 uint) (sv-80 vector) (sv-96 vector) (sv-112 vector)) + (let* ((v1-0 arg0) + (a0-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :qwc #x7 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-1) vif1) (new 'static 'vif-tag :imm #x7 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) + ) + (let* ((v1-1 arg0) + (a0-3 (the-as object (-> v1-1 base))) + ) + (set! (-> (the-as gs-gif-tag a0-3) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x6)) + (set! (-> (the-as gs-gif-tag a0-3) regs) GIF_REGS_ALL_AD) + (set! (-> v1-1 base) (&+ (the-as pointer a0-3) 16)) + ) + (let* ((s4-0 arg0) + (s3-0 (-> s4-0 base)) + ) + (set! (-> (the-as (pointer gs-test) s3-0) 0) (new 'static 'gs-test + :ate #x1 + :atst (gs-atest greater-equal) + :aref #x50 + :afail #x1 + :zte #x1 + :ztst (gs-ztest greater-equal) + ) + ) + (set! (-> (the-as (pointer gs-reg64) s3-0) 1) (gs-reg64 test-1)) + (set! (-> (the-as (pointer gs-tex0) s3-0) 2) (new 'static 'gs-tex0 + :tbp0 #x100 + :tbw #x2 + :psm #x1b + :tcc #x1 + :cbp #x300 + :cld #x1 + :th (log2 128) + :tw (log2 128) + ) + ) + (set! (-> (the-as (pointer gs-reg64) s3-0) 3) (gs-reg64 tex0-1)) + (set! (-> (the-as (pointer gs-tex1) s3-0) 4) (new 'static 'gs-tex1 :mmag #x1 :mmin #x1)) + (set! (-> (the-as (pointer gs-reg64) s3-0) 5) (gs-reg64 tex1-1)) + (set! (-> (the-as (pointer gs-clamp) s3-0) 6) (new 'static 'gs-clamp)) + (set! (-> (the-as (pointer gs-reg64) s3-0) 7) (gs-reg64 clamp-1)) + (set! (-> (the-as (pointer gs-alpha) s3-0) 8) (new 'static 'gs-alpha :b #x1 :d #x1)) + (set! (-> (the-as (pointer gs-reg64) s3-0) 9) (gs-reg64 alpha-1)) + (set! (-> (the-as (pointer uint64) s3-0) 10) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) s3-0) 11) (gs-reg64 texflush)) + (set! (-> s4-0 base) (&+ s3-0 96)) + ) + (let* ((v1-17 *sky-work*) + (f0-1 (* 0.000015258789 (the float (-> v1-17 off-s)))) + (f1-3 (* 0.000015258789 (the float (-> v1-17 off-t)))) + ) + (dotimes (v1-19 6) + (dotimes (a0-10 6) + (set-vector! + (-> obj cloud-st0 (+ (* 6 v1-19) a0-10)) + (+ (* 0.5 (the float a0-10)) f0-1) + (+ (* 0.5 (the float v1-19)) f1-3) + 1.0 + 0.0 + ) + ) + ) + ) + (let ((s4-1 (new 'stack-no-clear 'vector)) + (s3-1 (new 'stack-no-clear 'vector)) + (s2-2 (-> obj cloud-lights)) + ) + (vector-float*! (-> s2-2 sun0-color) (-> s2-2 sun0-color) 0.25) + (vector-float*! (-> s2-2 sun0-color-lower) (-> s2-2 sun0-color-lower) 0.25) + (vector-float*! (-> s2-2 sun1-color) (-> s2-2 sun1-color) 0.25) + (vector-float*! (-> s2-2 moon-color) (-> s2-2 moon-color) 0.25) + (vector-float*! (-> s2-2 ambi-color) (-> s2-2 ambi-color) 0.25) + (vector-float*! (-> s2-2 ambi-color-lower) (-> s2-2 ambi-color-lower) 0.25) + (dotimes (s1-0 36) + (let ((v1-36 (-> obj cloud-verts s1-0))) + (set! sv-80 (-> obj cloud-nrms s1-0)) + (let ((s0-0 (-> obj cloud-col0 s1-0))) + (set! sv-48 (-> obj cloud-col1 s1-0)) + (set! sv-112 (-> obj cloud-st0 s1-0)) + (set! sv-96 (-> obj cloud-st1 s1-0)) + (set! sv-64 (-> obj cloud-alpha s1-0)) + (set! (-> s4-1 x) (* 0.140625 (+ -1024.0 (the float (-> v1-36 x))))) + (set! (-> s4-1 z) (* 0.140625 (+ -1024.0 (the float (-> v1-36 z))))) + (vector-negate! s3-1 sv-80) + (let ((a0-41 obj) + (t9-3 (method-of-type ocean ocean-method-86)) + (a1-19 s0-0) + (a3-0 (-> s2-2 sun0-color)) + (t0-0 (-> s2-2 ambi-color)) + ) + (t9-3 a0-41 a1-19 sv-80 a3-0 t0-0) + ) + (ocean-method-86 obj sv-48 s3-1 (-> s2-2 sun0-color-lower) (-> s2-2 ambi-color-lower)) + (set! (-> s0-0 w) (the-as float sv-64)) + ) + ) + (set! (-> sv-48 w) (the-as float sv-64)) + (let ((a0-44 obj) + (t9-5 (method-of-type ocean ocean-method-87)) + (a3-2 s4-1) + ) + (t9-5 a0-44 sv-96 sv-112 a3-2) + ) + ) + ) + (dotimes (v1-46 5) + (let ((a0-45 (the-as (inline-array vector4w) (-> arg0 base)))) + (set! (-> a0-45 0 quad) (-> obj cloud-tmpl dma-vif quad)) + (set! (-> a0-45 1 quad) (-> obj cloud-tmpl quad 1)) + ) + (&+! (-> arg0 base) 32) + (dotimes (a0-48 6) + (let ((a3-3 (+ (* 6 v1-46) a0-48)) + (a2-7 (+ (* 6 (+ v1-46 1)) a0-48)) + (a1-28 (the-as (inline-array vector4w) (-> arg0 base))) + ) + (set! (-> a1-28 0 quad) (-> obj cloud-col0 a3-3 quad)) + (set! (-> a1-28 1 quad) (-> obj cloud-st0 a3-3 quad)) + (set! (-> a1-28 2 quad) (-> obj cloud-verts a3-3 quad)) + (set! (-> a1-28 3 quad) (-> obj cloud-col0 a2-7 quad)) + (set! (-> a1-28 4 quad) (-> obj cloud-st0 a2-7 quad)) + (set! (-> a1-28 5 quad) (-> obj cloud-verts a2-7 quad)) + ) + (&+! (-> arg0 base) 96) + ) + ) + (dotimes (v1-49 5) + (let ((a0-51 (the-as (inline-array vector4w) (-> arg0 base)))) + (set! (-> a0-51 0 quad) (-> obj cloud-tmpl dma-vif quad)) + (set! (-> a0-51 1 quad) (-> obj cloud-tmpl quad 1)) + ) + (&+! (-> arg0 base) 32) + (dotimes (a0-54 6) + (let ((a3-13 (+ (* 6 v1-49) a0-54)) + (a2-12 (+ (* 6 (+ v1-49 1)) a0-54)) + (a1-37 (the-as (inline-array vector4w) (-> arg0 base))) + ) + (set! (-> a1-37 0 quad) (-> obj cloud-col1 a3-13 quad)) + (set! (-> a1-37 1 quad) (-> obj cloud-st1 a3-13 quad)) + (set! (-> a1-37 2 quad) (-> obj cloud-verts a3-13 quad)) + (set! (-> a1-37 3 quad) (-> obj cloud-col1 a2-12 quad)) + (set! (-> a1-37 4 quad) (-> obj cloud-st1 a2-12 quad)) + (set! (-> a1-37 5 quad) (-> obj cloud-verts a2-12 quad)) + ) + (&+! (-> arg0 base) 96) + ) + ) + 0 + (none) + ) + +(defmethod ocean-method-89 ocean ((obj ocean) (arg0 dma-buffer)) + (set-display-gs-state arg0 (the-as int (+ (-> *ocean-texture-base* vram-page) 8)) 64 64 0 0) + (vector-float*! (-> obj sky-color) (-> *time-of-day-context* current-sky-color) 0.25) + (+! (-> obj sky-color x) (* 0.5 (- (-> obj sky-color z) (-> obj sky-color x)))) + (+! (-> obj sky-color y) (* 0.5 (- (-> obj sky-color z) (-> obj sky-color y)))) + (let* ((v1-6 arg0) + (a0-4 (the-as object (-> v1-6 base))) + ) + (set! (-> (the-as dma-packet a0-4) dma) (new 'static 'dma-tag :qwc #x4 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-4) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-4) vif1) (new 'static 'vif-tag :imm #x4 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-6 base) (&+ (the-as pointer a0-4) 16)) + ) + (let* ((v1-7 arg0) + (a0-6 (the-as object (-> v1-7 base))) + ) + (set! (-> (the-as gs-gif-tag a0-6) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x3)) + (set! (-> (the-as gs-gif-tag a0-6) regs) GIF_REGS_ALL_AD) + (set! (-> v1-7 base) (&+ (the-as pointer a0-6) 16)) + ) + (let* ((v1-8 arg0) + (a0-8 (-> v1-8 base)) + ) + (set! (-> (the-as (pointer gs-test) a0-8) 0) + (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest always)) + ) + (set! (-> (the-as (pointer gs-reg64) a0-8) 1) (gs-reg64 test-1)) + (set! (-> (the-as (pointer gs-alpha) a0-8) 2) (new 'static 'gs-alpha :b #x1 :d #x1)) + (set! (-> (the-as (pointer gs-reg64) a0-8) 3) (gs-reg64 alpha-1)) + (set! (-> (the-as (pointer uint64) a0-8) 4) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) a0-8) 5) (gs-reg64 texflush)) + (set! (-> v1-8 base) (&+ a0-8 48)) + ) + (let ((v1-9 (the-as object (-> arg0 base)))) + (let ((a1-13 (-> obj sky-color))) + (set! (-> (the-as (inline-array vector4w) v1-9) 0 quad) (-> obj sprite-tmpl2 dma-vif quad)) + (set! (-> (the-as (inline-array vector4w) v1-9) 1 quad) (-> obj sprite-tmpl2 quad 1)) + (set-vector! + (-> (the-as (inline-array vector4w) v1-9) 2) + (the int (-> a1-13 x)) + (the int (-> a1-13 y)) + (the int (-> a1-13 z)) + 128 + ) + ) + (let ((a0-13 (the-as (inline-array vector4w) (&+ (the-as pointer v1-9) 48)))) + (set! (-> a0-13 0 x) 0) + (set! (-> a0-13 0 y) 0) + (set! (-> a0-13 0 z) #xffffff) + (set! (-> a0-13 0 w) 0) + ) + (let ((v1-10 (the-as (inline-array vector4w) (-> (the-as (inline-array vector4w) v1-9) 4)))) + (set! (-> v1-10 0 x) 1024) + (set! (-> v1-10 0 y) 1024) + (set! (-> v1-10 0 z) #xffffff) + (set! (-> v1-10 0 w) 0) + ) + ) + (&+! (-> arg0 base) 80) + (let* ((v1-13 arg0) + (a0-17 (the-as object (-> v1-13 base))) + ) + (set! (-> (the-as dma-packet a0-17) dma) (new 'static 'dma-tag :qwc #x4 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-17) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-17) vif1) (new 'static 'vif-tag :imm #x4 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-13 base) (&+ (the-as pointer a0-17) 16)) + ) + (let* ((v1-14 arg0) + (a0-19 (the-as object (-> v1-14 base))) + ) + (set! (-> (the-as gs-gif-tag a0-19) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x3)) + (set! (-> (the-as gs-gif-tag a0-19) regs) GIF_REGS_ALL_AD) + (set! (-> v1-14 base) (&+ (the-as pointer a0-19) 16)) + ) + (let* ((v1-15 arg0) + (a0-21 (-> v1-15 base)) + ) + (set! (-> (the-as (pointer gs-xy-offset) a0-21) 0) (new 'static 'gs-xy-offset :ofx #x200 :ofy #x200)) + (set! (-> (the-as (pointer gs-reg64) a0-21) 1) (gs-reg64 xyoffset-1)) + (set! (-> (the-as (pointer gs-texa) a0-21) 2) (new 'static 'gs-texa :ta1 #x80)) + (set! (-> (the-as (pointer gs-reg64) a0-21) 3) (gs-reg64 texa)) + (set! (-> (the-as (pointer uint64) a0-21) 4) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) a0-21) 5) (gs-reg64 texflush)) + (set! (-> v1-15 base) (&+ a0-21 48)) + ) + (let ((v1-16 (the-as adgif-shader (-> arg0 base)))) + (set! (-> v1-16 quad 0 quad) (-> obj adgif-tmpl dma-vif quad)) + (set! (-> v1-16 quad 1 quad) (-> obj adgif-tmpl quad 1)) + (let ((s4-0 (&-> v1-16 miptbp1))) + (adgif-shader<-texture-simple! + (the-as adgif-shader s4-0) + (lookup-texture-by-id-fast (new 'static 'texture-id :index #x4 :page #x475)) + ) + (set! (-> s4-0 8) (new 'static 'gs-miptbp :tbp1 #x48)) + ) + ) + (&+! (-> arg0 base) 112) + (let ((s4-1 (-> *sky-work* upload-data)) + (a3-1 (new 'stack 'vector4w)) + ) + (let ((a0-28 (-> obj cloud-lights sun0-color))) + (set-vector! + a3-1 + (the int (* 128.0 (-> a0-28 x))) + (the int (* 80.0 (-> a0-28 y))) + (the int (* 32.0 (-> a0-28 z))) + 1 + ) + ) + (ocean-method-84 obj arg0 s4-1 a3-1 80.0) + ) + (let ((s4-2 (-> *sky-work* upload-data sun 1)) + (a3-2 (new 'stack 'vector4w)) + ) + (let ((a0-32 (-> obj cloud-lights sun1-color))) + (set-vector! + a3-2 + (the int (* 255.0 (-> a0-32 x))) + (the int (* 255.0 (-> a0-32 y))) + (the int (* 255.0 (-> a0-32 z))) + 1 + ) + ) + (ocean-method-84 obj arg0 (the-as sky-upload-data s4-2) a3-2 64.0) + ) + (let ((v1-30 (the-as adgif-shader (-> arg0 base)))) + (set! (-> v1-30 quad 0 quad) (-> obj adgif-tmpl dma-vif quad)) + (set! (-> v1-30 quad 1 quad) (-> obj adgif-tmpl quad 1)) + (let ((s4-3 (&-> v1-30 miptbp1))) + (adgif-shader<-texture-simple! + (the-as adgif-shader s4-3) + (lookup-texture-by-id-fast (new 'static 'texture-id :index #x1 :page #x475)) + ) + (set! (-> s4-3 8) (new 'static 'gs-miptbp :tbp1 #x44)) + ) + ) + (&+! (-> arg0 base) 112) + (let ((a2-3 (-> *sky-work* upload-data moon)) + (a3-3 (new 'static 'vector4w :x 80 :y 80 :z 80)) + ) + (ocean-method-84 obj arg0 (the-as sky-upload-data a2-3) a3-3 48.0) + ) + (ocean-method-85 obj arg0) + (ocean-method-88 obj arg0) + (set-display-gs-state arg0 (the-as int (-> *ocean-envmap-texture-base* vram-page)) 64 64 0 0) + (let ((a0-43 obj) + (t9-13 (method-of-type ocean ocean-method-83)) + (a1-43 arg0) + (a2-5 32768.0) + ) + (t9-13 a0-43 a1-43 a2-5) + (let* ((v1-44 arg0) + (a0-44 (the-as object (-> v1-44 base))) + ) + (set! (-> (the-as dma-packet a0-44) dma) (new 'static 'dma-tag :qwc #x7 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-44) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-44) vif1) (new 'static 'vif-tag :imm #x7 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-44 base) (&+ (the-as pointer a0-44) 16)) + ) + (let* ((v1-45 arg0) + (a0-46 (the-as object (-> v1-45 base))) + ) + (set! (-> (the-as gs-gif-tag a0-46) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x6)) + (set! (-> (the-as gs-gif-tag a0-46) regs) GIF_REGS_ALL_AD) + (set! (-> v1-45 base) (&+ (the-as pointer a0-46) 16)) + ) + (let* ((s4-4 arg0) + (s3-2 (-> s4-4 base)) + ) + (set! (-> (the-as (pointer gs-alpha) s3-2) 0) (new 'static 'gs-alpha :b #x1 :d #x1)) + (set! (-> (the-as (pointer gs-reg64) s3-2) 1) (gs-reg64 alpha-1)) + (set! (-> (the-as (pointer gs-tex0) s3-2) 2) + (new 'static 'gs-tex0 + :tbw #x1 + :tcc #x1 + :th (log2 32) + :tw (log2 64) + :tbp0 (-> *ocean-envmap-texture-base* vram-block) + ) + ) + (set! (-> (the-as (pointer gs-reg64) s3-2) 3) (gs-reg64 tex0-1)) + (set! (-> (the-as (pointer gs-tex1) s3-2) 4) (new 'static 'gs-tex1 :mmag #x1 :mmin #x1)) + (set! (-> (the-as (pointer gs-reg64) s3-2) 5) (gs-reg64 tex1-1)) + (set! (-> (the-as (pointer gs-clamp) s3-2) 6) + (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp)) + ) + (set! (-> (the-as (pointer gs-reg64) s3-2) 7) (gs-reg64 clamp-1)) + (set! (-> (the-as (pointer gs-rgbaq) s3-2) 8) (new 'static 'gs-rgbaq :r #x80 :g #x80 :b #x80 :a #x80 :q 1.0)) + (set! (-> (the-as (pointer gs-reg64) s3-2) 9) (gs-reg64 rgbaq)) + (set! (-> (the-as (pointer uint64) s3-2) 10) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) s3-2) 11) (gs-reg64 texflush)) + (set! (-> s4-4 base) (&+ s3-2 96)) + ) + (let* ((v1-63 arg0) + (a0-54 (the-as object (-> v1-63 base))) + ) + (set! (-> (the-as dma-packet a0-54) dma) (new 'static 'dma-tag :qwc #x3 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-54) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-54) vif1) (new 'static 'vif-tag :imm #x3 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-63 base) (&+ (the-as pointer a0-54) 16)) + ) + (let* ((v1-64 arg0) + (a0-56 (the-as object (-> v1-64 base))) + ) + (set! (-> (the-as gs-gif-tag a0-56) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x2)) + (set! (-> (the-as gs-gif-tag a0-56) regs) GIF_REGS_ALL_AD) + (set! (-> v1-64 base) (&+ (the-as pointer a0-56) 16)) + ) + (let* ((v1-65 arg0) + (a0-58 (-> v1-65 base)) + ) + (set! (-> (the-as (pointer gs-tex1) a0-58) 0) (new 'static 'gs-tex1)) + (set! (-> (the-as (pointer gs-reg64) a0-58) 1) (gs-reg64 tex1-1)) + (set! (-> (the-as (pointer uint64) a0-58) 2) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) a0-58) 3) (gs-reg64 texflush)) + (set! (-> v1-65 base) (&+ a0-58 32)) + ) + (let ((v1-66 (the-as (inline-array vector4w) (-> arg0 base)))) + (set! (-> v1-66 0 quad) (-> obj sprite-tmpl dma-vif quad)) + (set! (-> v1-66 1 quad) (-> obj sprite-tmpl quad 1)) + (set-vector! (-> v1-66 2) 128 128 128 128) + (set-vector! (-> v1-66 3) 8 520 0 0) + (set-vector! (-> v1-66 4) 0 512 #xffffff 0) + (set-vector! (-> v1-66 5) 1032 8 0 0) + (let ((v1-67 (the-as object (-> v1-66 6)))) + (set! (-> (the-as (inline-array vector4w) v1-67) 0 x) 1024) + (set! (-> (the-as vector4w v1-67) y) 1024) + (set! (-> (the-as vector4w v1-67) z) #xffffff) + (set! (-> (the-as vector4w v1-67) w) 0) + ) + ) + (&+! (-> arg0 base) 112) + (reset-display-gs-state *display* arg0 (the-as int a2-5)) + ) + 0 + (none) + ) + +(defun-debug generate-cloud-verts ((arg0 int) (arg1 float)) + (let ((f30-0 8192.0) + (f28-0 (/ 65536.0 (the float arg0))) + ) + (dotimes (s4-0 arg0) + (let* ((f26-0 (sin f30-0)) + (f0-1 (cos f30-0)) + (a2-0 (* (the int (+ 64.0 (* f26-0 arg1))) 16)) + (a3-0 (* (the int (+ 64.0 (* f0-1 arg1))) 16)) + ) + (format + 0 + "(new 'static 'vector4w :x #x~x :y #x~x :z #xffffff :w 0) ; ~f degrees~%" + a2-0 + a3-0 + (* 0.005493164 f30-0) + ) + ) + (+! f30-0 f28-0) + ) + ) + #f + ) + +(defun-debug generate-cloud-nrms ((arg0 int) (arg1 float)) + (let ((f30-0 8192.0) + (f28-0 (/ 65536.0 (the float arg0))) + ) + (dotimes (s4-0 arg0) + (let ((f26-0 (sin f30-0)) + (f0-1 (cos f30-0)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (set-vector! s3-0 f26-0 arg1 f0-1 1.0) + (vector-normalize! s3-0 1.0) + (format + 0 + "(new 'static 'vector :x ~f :y ~f :z ~f :w 0) ; ~f degrees~%" + (-> s3-0 x) + (-> s3-0 y) + (-> s3-0 z) + (* 0.005493164 f30-0) + ) + ) + (+! f30-0 f28-0) + ) + ) + #f + ) + +;; WARN: Return type mismatch gs-tex1 vs none. +(defun-debug set-ocean-lk ((arg0 int) (arg1 int)) + (let ((v1-0 *ocean*)) + (set! (-> v1-0 tex1 l) arg0) + (set! (-> v1-0 tex1 k) arg1) + (set! (-> v1-0 tex1-near l) arg0) + (set! (-> v1-0 tex1-near k) arg1) + ) + (none) + ) + +(defun-debug set-ocean-normal-scale ((arg0 float)) + (let* ((v1-0 *ocean*) + (f0-1 (/ -1.0 (* 4096.0 arg0))) + (v0-0 (-> v1-0 scales)) + ) + (set! (-> v0-0 x) f0-1) + (set! (-> v0-0 y) 255.0) + (set! (-> v0-0 z) f0-1) + (set! (-> v0-0 w) 128.0) + v0-0 + ) + ) diff --git a/goal_src/jak2/engine/gfx/ocean/ocean-transition.gc b/goal_src/jak2/engine/gfx/ocean/ocean-transition.gc index 6decd6106f..b2f0e183d7 100644 --- a/goal_src/jak2/engine/gfx/ocean/ocean-transition.gc +++ b/goal_src/jak2/engine/gfx/ocean/ocean-transition.gc @@ -7,3 +7,846 @@ ;; DECOMP BEGINS +(defmethod ocean-trans-camera-masks-bit? ocean ((obj ocean) (arg0 uint) (arg1 uint)) + (let ((v1-2 (- arg0 (* (-> obj mid-minz) 4))) + (a1-3 (- arg1 (* (-> obj mid-minx) 4))) + ) + (cond + ((or (< v1-2 0) (>= v1-2 (the-as uint 16)) (< a1-3 0) (>= a1-3 (the-as uint 16))) + #f + ) + (else + (let* ((t0-0 (shr v1-2 2)) + (a3-3 (shr a1-3 2)) + (a2-2 (logand v1-2 3)) + (v1-3 (logand a1-3 3)) + (a1-5 (+ (* t0-0 4) a3-3)) + ) + (logtest? (-> (the-as (pointer uint8) (+ (+ a2-2 (* a1-5 4)) (the-as uint obj))) 2928) (ash 1 v1-3)) + ) + ) + ) + ) + ) + +(defmethod ocean-trans-mask-ptrs-bit? ocean ((obj ocean) (arg0 int) (arg1 int)) + (let ((v1-2 (- arg0 (the-as int (* (-> obj mid-minz) 4)))) + (a1-3 (- arg1 (the-as int (* (-> obj mid-minx) 4)))) + ) + (cond + ((or (< (the-as uint v1-2) 0) + (>= (the-as uint v1-2) (the-as uint 16)) + (< (the-as uint a1-3) 0) + (>= (the-as uint a1-3) (the-as uint 16)) + ) + #f + ) + (else + (let* ((t0-0 (shr v1-2 2)) + (a3-3 (shr a1-3 2)) + (a2-2 (logand v1-2 3)) + (v1-3 (logand a1-3 3)) + (a0-2 (-> obj trans-mask-ptrs (+ (* (+ (* t0-0 4) a3-3) 4) a2-2))) + ) + (if a0-2 + (logtest? (-> (the-as (pointer int32) a0-2) 1) (ash 1 v1-3)) + #f + ) + ) + ) + ) + ) + ) + +(defmethod ocean-trans-mask-ptrs-set! ocean ((obj ocean) (arg0 uint) (arg1 uint)) + (let ((v1-2 (- arg0 (* (-> obj mid-minz) 4))) + (a1-3 (- arg1 (* (-> obj mid-minx) 4))) + ) + (cond + ((or (< v1-2 0) (>= v1-2 (the-as uint 16)) (< a1-3 0) (>= a1-3 (the-as uint 16))) + #f + ) + (else + (let* ((a3-3 (shr v1-2 2)) + (a2-2 (shr a1-3 2)) + (v1-3 (logand v1-2 3)) + (a1-4 (logand a1-3 3)) + (t0-6 (-> obj trans-mask-ptrs (+ (* (+ (* a3-3 4) a2-2) 4) v1-3))) + ) + (cond + (t0-6 + (cond + ((logtest? (-> (the-as (pointer int32) t0-6) 1) (ash 1 a1-4)) + #f + ) + (else + (let ((a0-1 (&-> obj trans-temp-masks (+ (* a3-3 4) a2-2)))) + (set! (-> (the-as (pointer int8) (+ v1-3 (the-as uint a0-1))) 0) + (the-as int (logior (-> (the-as (pointer uint8) (+ v1-3 (the-as uint a0-1))) 0) (ash 1 a1-4))) + ) + ) + #t + ) + ) + ) + (else + #f + ) + ) + ) + ) + ) + ) + ) + +(defmethod ocean-trans-add-upload-table ocean ((obj ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint) (arg3 int) (arg4 int) (arg5 symbol)) + (local-vars + (v1-16 (inline-array vector4w)) + (v1-18 float) + (a0-24 uint128) + (a0-25 uint128) + (a1-14 uint128) + (a1-15 uint128) + (a1-16 uint128) + (a2-17 uint128) + (a2-18 uint128) + (a3-9 uint128) + ) + (rlet ((acc :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf12 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf) + ) + (when (ocean-trans-mask-ptrs-set! obj arg1 arg2) + (let ((a2-2 (new-stack-vector0))) + (let ((v1-2 (-> obj start-corner))) + (set! (-> a2-2 x) (+ (-> v1-2 x) (* 98304.0 (the float arg2)))) + (set! (-> a2-2 y) (-> v1-2 y)) + (set! (-> a2-2 z) (+ (-> v1-2 z) (* 98304.0 (the float arg1)))) + ) + (set! (-> a2-2 w) 1.0) + (ocean-mid-add-matrices obj arg0 a2-2) + ) + (let* ((a1-3 9) + (v1-7 arg0) + (a0-4 (the-as object (-> v1-7 base))) + ) + (set! (-> (the-as dma-packet a0-4) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a1-3)) + (set! (-> (the-as dma-packet a0-4) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a0-4) vif1) + (new 'static 'vif-tag :imm #x8008 :cmd (vif-cmd unpack-v4-32) :num a1-3) + ) + (set! (-> v1-7 base) (&+ (the-as pointer a0-4) 16)) + ) + (set-vector! (the-as vector4w (-> arg0 base)) arg4 0 0 0) + (&+! (-> arg0 base) 16) + (let* ((a0-6 (logand arg1 3)) + (v1-11 (logand arg2 3)) + (v1-12 (+ (* 5 (the-as int a0-6)) v1-11)) + ) + (.lvf vf5 (&-> (-> *ocean-trans-corner-table* 0 vector v1-12) quad)) + (.lvf vf6 (&-> (-> *ocean-trans-corner-table* 0 vector (+ v1-12 1)) quad)) + (.lvf vf7 (&-> (-> *ocean-trans-corner-table* 0 vector (+ v1-12 5)) quad)) + (.lvf vf8 (&-> (the-as (inline-array vector4w) (-> *ocean-trans-corner-table* 0 vector (+ v1-12 6))) 0 quad)) + ) + (.mov v1-16 vf8) + (let ((v1-17 (the-as (inline-array vector4w) (-> arg0 base)))) + (let ((a0-17 (/ (the-as int arg1) 4)) + (a1-11 (/ (the-as int arg2) 4)) + ) + (.lvf vf1 (&-> *ocean-trans-st-table* 0 quad)) + (.lvf vf2 (&-> *ocean-trans-st-table* 1 quad)) + (.lvf vf3 (&-> *ocean-trans-st-table* 2 quad)) + (.lvf vf4 (&-> *ocean-trans-st-table* 3 quad)) + (.mul.x.vf acc vf1 vf5) + (nop!) + (.add.mul.y.vf acc vf2 vf5 acc) + (nop!) + (.add.mul.z.vf acc vf3 vf5 acc) + (nop!) + (.add.mul.w.vf vf9 vf4 vf5 acc) + (nop!) + (.mul.x.vf acc vf1 vf6) + (nop!) + (.add.mul.y.vf acc vf2 vf6 acc) + (nop!) + (.add.mul.z.vf acc vf3 vf6 acc) + (nop!) + (.add.mul.w.vf vf10 vf4 vf6 acc) + (.svf (&-> v1-17 0 quad) vf9) + (.mul.x.vf acc vf1 vf7) + (nop!) + (.add.mul.y.vf acc vf2 vf7 acc) + (nop!) + (.add.mul.z.vf acc vf3 vf7 acc) + (nop!) + (.add.mul.w.vf vf11 vf4 vf7 acc) + (.svf (&-> v1-17 1 quad) vf10) + (.mul.x.vf acc vf1 vf8) + (nop!) + (.add.mul.y.vf acc vf2 vf8 acc) + (nop!) + (.add.mul.z.vf acc vf3 vf8 acc) + (nop!) + (.add.mul.w.vf vf12 vf4 vf8 acc) + (.svf (&-> v1-17 2 quad) vf11) + (nop!) + (.svf (&-> v1-17 3 quad) vf12) + (let ((a2-16 (the-as uint128 (-> obj ocean-colors colors (+ (* 52 (the-as int a0-17)) a1-11)))) + (a3-8 (the-as uint128 (-> obj ocean-colors colors (+ a1-11 1 (* 52 (the-as int a0-17)))))) + (t0-9 (the-as uint128 (-> obj ocean-colors colors (+ (* 52 (the-as int (+ a0-17 1))) a1-11)))) + (a0-23 (the-as uint128 (-> obj ocean-colors colors (+ a1-11 1 (* 52 (the-as int (+ a0-17 1))))))) + ) + (.pextlb a1-14 0 a2-16) + (nop!) + (.pextlb a2-17 0 a3-8) + (nop!) + (.pextlb a3-9 0 t0-9) + (nop!) + (.pextlb a0-24 0 a0-23) + ) + ) + (nop!) + (.pextlh a1-15 0 a1-14) + (nop!) + (.pextlh a2-18 0 a2-17) + (.mov vf1 a1-15) + (.pextlh a1-16 0 a3-9) + (.mov vf2 a2-18) + (.pextlh a0-25 0 a0-24) + (.mov vf3 a1-16) + (nop!) + (.mov vf4 a0-25) + (.itof.vf vf1 vf1) + (nop!) + (.itof.vf vf2 vf2) + (nop!) + (.itof.vf vf3 vf3) + (nop!) + (.itof.vf vf4 vf4) + (nop!) + (.mul.x.vf acc vf1 vf5) + (nop!) + (.add.mul.y.vf acc vf2 vf5 acc) + (nop!) + (.add.mul.z.vf acc vf3 vf5 acc) + (nop!) + (.add.mul.w.vf vf9 vf4 vf5 acc) + (nop!) + (.mul.x.vf acc vf1 vf6) + (nop!) + (.add.mul.y.vf acc vf2 vf6 acc) + (nop!) + (.add.mul.z.vf acc vf3 vf6 acc) + (nop!) + (.add.mul.w.vf vf10 vf4 vf6 acc) + (.svf (&-> v1-17 4 quad) vf9) + (.mul.x.vf acc vf1 vf7) + (nop!) + (.add.mul.y.vf acc vf2 vf7 acc) + (nop!) + (.add.mul.z.vf acc vf3 vf7 acc) + (nop!) + (.add.mul.w.vf vf11 vf4 vf7 acc) + (.svf (&-> v1-17 5 quad) vf10) + (.mul.x.vf acc vf1 vf8) + (nop!) + (.add.mul.y.vf acc vf2 vf8 acc) + (nop!) + (.add.mul.z.vf acc vf3 vf8 acc) + (nop!) + (.add.mul.w.vf vf12 vf4 vf8 acc) + (.svf (&-> v1-17 6 quad) vf11) + (nop!) + (.svf (&-> v1-17 7 quad) vf12) + ) + (.mov v1-18 vf12) + (&+! (-> arg0 base) 128) + (let* ((v1-21 arg0) + (a0-26 (the-as object (-> v1-21 base))) + ) + (set! (-> (the-as dma-packet a0-26) dma) (new 'static 'dma-tag :id (dma-tag-id ref) :addr arg3 :qwc arg4)) + (set! (-> (the-as dma-packet a0-26) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a0-26) vif1) + (new 'static 'vif-tag :imm #x8011 :cmd (vif-cmd unpack-v4-32) :num arg4) + ) + (set! (-> v1-21 base) (&+ (the-as pointer a0-26) 16)) + ) + (if arg5 + (ocean-mid-add-call obj arg0 275) + (ocean-mid-add-call obj arg0 107) + ) + ) + (none) + ) + ) + +(defmethod ocean-trans-add-upload-strip ocean ((obj ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint) (arg3 int) (arg4 int) (arg5 int)) + (local-vars + (v1-10 float) + (a0-24 uint128) + (a0-25 uint128) + (a0-26 uint128) + (a1-12 uint128) + (a1-13 uint128) + (a1-14 uint128) + (a2-15 uint128) + (a3-10 uint128) + ) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (let ((a2-1 (new-stack-vector0))) + (let ((v1-0 (-> obj start-corner))) + (set! (-> a2-1 x) (+ (-> v1-0 x) (* 393216.0 (the float arg2)))) + (set! (-> a2-1 y) (-> v1-0 y)) + (set! (-> a2-1 z) (+ (-> v1-0 z) (* 393216.0 (the float arg1)))) + ) + (set! (-> a2-1 w) 1.0) + (ocean-mid-add-matrices obj arg0 a2-1) + ) + (let* ((a1-2 9) + (v1-5 arg0) + (a0-3 (the-as object (-> v1-5 base))) + ) + (set! (-> (the-as dma-packet a0-3) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a1-2)) + (set! (-> (the-as dma-packet a0-3) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a0-3) vif1) + (new 'static 'vif-tag :imm #x8008 :cmd (vif-cmd unpack-v4-32) :num a1-2) + ) + (set! (-> v1-5 base) (&+ (the-as pointer a0-3) 16)) + ) + (let ((v1-6 (the-as object (-> arg0 base)))) + (set! (-> obj trans-mask-ptrs (+ (* arg4 4) arg5)) (the-as pointer v1-6)) + (set! (-> (the-as vector4w v1-6) x) 10) + (set! (-> (the-as vector4w v1-6) y) arg3) + (set! (-> (the-as vector4w v1-6) z) 0) + (set! (-> (the-as vector4w v1-6) w) 0) + ) + (&+! (-> arg0 base) 16) + (let ((v1-9 (the-as (inline-array vector4w) (-> arg0 base)))) + (set! (-> v1-9 0 quad) (-> *ocean-trans-st-table* 0 quad)) + (set! (-> v1-9 1 quad) (-> *ocean-trans-st-table* 1 quad)) + (set! (-> v1-9 2 quad) (-> *ocean-trans-st-table* 2 quad)) + (set! (-> v1-9 3 quad) (-> *ocean-trans-st-table* 3 quad)) + (let ((a0-23 (the-as uint128 (-> obj ocean-colors colors (+ (* 52 (the-as int arg1)) arg2)))) + (a1-11 (the-as uint128 (-> obj ocean-colors colors (+ arg2 1 (* 52 (the-as int arg1)))))) + (a2-14 (the-as uint128 (-> obj ocean-colors colors (+ (* 52 (the-as int (+ arg1 1))) arg2)))) + (a3-9 (the-as uint128 (-> obj ocean-colors colors (+ arg2 1 (* 52 (the-as int (+ arg1 1))))))) + ) + (.pextlb a0-24 0 a0-23) + (nop!) + (.pextlb a1-12 0 a1-11) + (nop!) + (.pextlb a2-15 0 a2-14) + (nop!) + (.pextlb a3-10 0 a3-9) + ) + (nop!) + (.pextlh a0-25 0 a0-24) + (nop!) + (.pextlh a1-13 0 a1-12) + (.mov vf1 a0-25) + (.pextlh a0-26 0 a2-15) + (.mov vf2 a1-13) + (.pextlh a1-14 0 a3-10) + (.mov vf3 a0-26) + (nop!) + (.mov vf4 a1-14) + (.itof.vf vf1 vf1) + (nop!) + (.itof.vf vf2 vf2) + (nop!) + (.itof.vf vf3 vf3) + (nop!) + (.itof.vf vf4 vf4) + (nop!) + (nop!) + (.svf (&-> v1-9 4 quad) vf1) + (nop!) + (.svf (&-> v1-9 5 quad) vf2) + (nop!) + (.svf (&-> v1-9 6 quad) vf3) + (nop!) + (.svf (&-> v1-9 7 quad) vf4) + ) + (.mov v1-10 vf4) + (&+! (-> arg0 base) 128) + (let* ((a1-15 10) + (v1-13 arg0) + (a0-27 (the-as object (-> v1-13 base))) + ) + (set! (-> (the-as dma-packet a0-27) dma) + (new 'static 'dma-tag + :id (dma-tag-id ref) + :addr (the-as int (+ (+ (* 160 arg5) 0) (the-as int *ocean-trans-strip-array*))) + :qwc a1-15 + ) + ) + (set! (-> (the-as dma-packet a0-27) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a0-27) vif1) + (new 'static 'vif-tag :imm #x8011 :cmd (vif-cmd unpack-v4-32) :num a1-15) + ) + (set! (-> v1-13 base) (&+ (the-as pointer a0-27) 16)) + ) + (ocean-mid-add-call obj arg0 107) + 0 + (none) + ) + ) + +(defmethod ocean-transition-check ocean ((obj ocean) (arg0 ocean-trans-mask) (arg1 int) (arg2 int) (arg3 vector)) + (local-vars (v1-13 float) (t0-3 float) (t0-8 float) (t0-13 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (let ((v1-0 (new-stack-vector0)) + (a0-2 (-> *math-camera* trans)) + ) + 1.0 + (set! (-> v1-0 x) (+ (-> arg3 x) (* 98304.0 (the float arg1)))) + (set! (-> v1-0 y) (-> arg3 y)) + (set! (-> v1-0 z) (+ (-> arg3 z) (* 98304.0 (the float arg2)))) + (let ((t0-2 v1-0) + (t1-2 a0-2) + ) + (.lvf vf2 (&-> t0-2 quad)) + (.lvf vf3 (&-> t1-2 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov t0-3 vf1) + (when (< t0-3 19327350000.0) + (logior! (-> arg0 mask arg2) (ash 1 arg1)) + (goto cfg-24) + ) + (set! (-> v1-0 x) (+ 98304.0 (-> v1-0 x))) + (let ((t0-7 v1-0) + (t1-3 a0-2) + ) + (.lvf vf2 (&-> t0-7 quad)) + (.lvf vf3 (&-> t1-3 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov t0-8 vf1) + (when (< t0-8 19327350000.0) + (logior! (-> arg0 mask arg2) (ash 1 arg1)) + (goto cfg-24) + ) + (set! (-> v1-0 z) (+ 98304.0 (-> v1-0 z))) + (let ((t0-12 v1-0) + (t1-4 a0-2) + ) + (.lvf vf2 (&-> t0-12 quad)) + (.lvf vf3 (&-> t1-4 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov t0-13 vf1) + (when (< t0-13 19327350000.0) + (logior! (-> arg0 mask arg2) (ash 1 arg1)) + (goto cfg-24) + ) + (set! (-> v1-0 x) (+ -98304.0 (-> v1-0 x))) + (.lvf vf2 (&-> v1-0 quad)) + (.lvf vf3 (&-> a0-2 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov v1-13 vf1) + (when (< v1-13 19327350000.0) + (logior! (-> arg0 mask arg2) (ash 1 arg1)) + (goto cfg-24) + ) + (label cfg-24) + 0 + (none) + ) + ) + +(defmethod ocean-make-trans-camera-masks ocean ((obj ocean) (arg0 uint) (arg1 uint) (arg2 uint) (arg3 uint)) + (local-vars (sv-48 ocean-trans-mask) (sv-52 vector) (sv-56 vector) (sv-60 vector)) + (set! sv-48 (the-as ocean-trans-mask (&-> obj trans-camera-masks (+ (* arg2 4) arg3)))) + (set! sv-52 (-> *math-camera* trans)) + (set! sv-56 (new-stack-vector0)) + (set! sv-60 (new-stack-vector0)) + (set! (-> sv-56 x) (+ (-> obj start-corner x) (* 393216.0 (the float arg1)))) + (set! (-> sv-56 y) (-> obj start-corner y)) + (set! (-> sv-56 z) (+ (-> obj start-corner z) (* 393216.0 (the float arg0)))) + (set! (-> sv-56 w) 1.0) + (dotimes (s5-0 4) + (dotimes (s4-0 4) + (set! (-> sv-60 x) (- (+ (-> sv-56 x) (* 98304.0 (the float s4-0))) (-> sv-52 x))) + (set! (-> sv-60 y) (- (-> sv-56 y) (-> sv-52 y))) + (set! (-> sv-60 z) (- (+ (-> sv-56 z) (* 98304.0 (the float s5-0))) (-> sv-52 z))) + (ocean-transition-check obj sv-48 s4-0 s5-0 sv-56) + ) + ) + 0 + (none) + ) + +(defmethod ocean-trans-add-upload ocean ((obj ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) + (when (not (ocean-trans-mask-ptrs-bit? obj (the-as int arg1) (the-as int arg2))) + (let ((s0-0 (ocean-trans-camera-masks-bit? obj (+ arg1 -1) arg2)) + (s1-0 (ocean-trans-camera-masks-bit? obj (+ arg1 1) arg2)) + (s2-0 (ocean-trans-camera-masks-bit? obj arg1 (+ arg2 -1))) + (a0-6 (ocean-trans-camera-masks-bit? obj arg1 (+ arg2 1))) + (v1-7 0) + ) + (if s0-0 + (+! v1-7 1) + ) + (if s1-0 + (+! v1-7 2) + ) + (if s2-0 + (+! v1-7 4) + ) + (if a0-6 + (+! v1-7 8) + ) + (cond + ((= v1-7 1) + (if (not (ocean-trans-mask-ptrs-bit? obj (the-as int (+ arg1 -1)) (the-as int arg2))) + (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-up-table*) 11 #t) + ) + ) + ((= v1-7 2) + (if (not (ocean-trans-mask-ptrs-bit? obj (the-as int (+ arg1 1)) (the-as int arg2))) + (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-down-table*) 11 #t) + ) + ) + ((= v1-7 4) + (if (not (ocean-trans-mask-ptrs-bit? obj (the-as int arg1) (the-as int (+ arg2 -1)))) + (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-left-table*) 11 #t) + ) + ) + ((= v1-7 5) + (let ((s2-1 (ocean-trans-mask-ptrs-bit? obj (the-as int (+ arg1 -1)) (the-as int arg2))) + (v1-25 (ocean-trans-mask-ptrs-bit? obj (the-as int arg1) (the-as int (+ arg2 -1)))) + ) + (cond + ((and s2-1 v1-25) + ) + (s2-1 + (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-left-table*) 11 #t) + ) + (v1-25 + (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-up-table*) 11 #t) + ) + (else + (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-up-left-table*) 18 #f) + ) + ) + ) + ) + ((= v1-7 6) + (let ((s2-2 (ocean-trans-mask-ptrs-bit? obj (the-as int (+ arg1 1)) (the-as int arg2))) + (v1-35 (ocean-trans-mask-ptrs-bit? obj (the-as int arg1) (the-as int (+ arg2 -1)))) + ) + (cond + ((and s2-2 v1-35) + ) + (s2-2 + (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-left-table*) 11 #t) + ) + (v1-35 + (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-down-table*) 11 #t) + ) + (else + (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-down-left-table*) 18 #t) + ) + ) + ) + ) + ((= v1-7 8) + (if (not (ocean-trans-mask-ptrs-bit? obj (the-as int arg1) (the-as int (+ arg2 1)))) + (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-right-table*) 11 #t) + ) + ) + ((= v1-7 9) + (let ((s2-3 (ocean-trans-mask-ptrs-bit? obj (the-as int (+ arg1 -1)) (the-as int arg2))) + (v1-50 (ocean-trans-mask-ptrs-bit? obj (the-as int arg1) (the-as int (+ arg2 1)))) + ) + (cond + ((and s2-3 v1-50) + ) + (s2-3 + (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-right-table*) 11 #t) + ) + (v1-50 + (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-up-table*) 11 #t) + ) + (else + (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-up-right-table*) 18 #t) + ) + ) + ) + ) + ((= v1-7 10) + (let ((s2-4 (ocean-trans-mask-ptrs-bit? obj (the-as int (+ arg1 1)) (the-as int arg2))) + (v1-61 (ocean-trans-mask-ptrs-bit? obj (the-as int arg1) (the-as int (+ arg2 1)))) + ) + (cond + ((and s2-4 v1-61) + ) + (s2-4 + (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-right-table*) 11 #t) + ) + (v1-61 + (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-down-table*) 11 #t) + ) + (else + (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-down-right-table*) 18 #f) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod draw-ocean-transition-seams ocean ((obj ocean) (arg0 dma-buffer)) + (local-vars (sv-32 uint) (sv-33 uint) (sv-34 uint) (sv-35 uint) (sv-36 sphere)) + (set! sv-32 (-> obj near-minx)) + (set! sv-33 (-> obj near-maxx)) + (set! sv-34 (-> obj near-minz)) + (set! sv-35 (-> obj near-maxz)) + (set! sv-36 (new 'stack 'sphere)) + (set! (-> sv-36 y) (-> obj start-corner y)) + (set! (-> sv-36 r) 69511.42) + (when (and (< sv-32 sv-33) (< sv-34 sv-35)) + (let ((s4-0 sv-34) + (s3-0 sv-35) + ) + (while (>= s3-0 s4-0) + (let ((s2-0 sv-32) + (s1-0 sv-33) + ) + (while (>= s1-0 s2-0) + (set! (-> sv-36 x) (+ 49152.0 (* 98304.0 (the float s2-0)) (-> obj start-corner x))) + (set! (-> sv-36 z) (+ 49152.0 (* 98304.0 (the float s4-0)) (-> obj start-corner z))) + (when (sphere-cull sv-36) + (if (not (ocean-trans-camera-masks-bit? obj s4-0 s2-0)) + (ocean-trans-add-upload obj arg0 s4-0 s2-0) + ) + ) + (+! s2-0 1) + ) + ) + (+! s4-0 1) + ) + ) + ) + (dotimes (v1-28 16) + (when (nonzero? (-> obj trans-camera-masks v1-28)) + (dotimes (a0-12 4) + (let ((a1-8 (-> obj trans-mask-ptrs (+ (* v1-28 4) a0-12)))) + (if a1-8 + (logior! + (-> (the-as (pointer int32) a1-8) 1) + (-> (the-as (pointer uint8) (+ (+ a0-12 (* v1-28 4)) (the-as int obj))) 2992) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod ocean-trans-add-constants ocean ((obj ocean) (arg0 dma-buffer)) + (let* ((a2-0 4) + (v1-0 arg0) + (a0-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a2-0)) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a0-1) vif1) + (new 'static 'vif-tag :imm #x2fd :cmd (vif-cmd unpack-v4-32) :num a2-0) + ) + (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) + ) + (let ((v1-1 (the-as matrix (-> arg0 base)))) + (set-vector! (-> v1-1 vector 0) 0.0 0.0 0.0 1.0) + (set-vector! (-> v1-1 vector 1) 98304.0 0.0 0.0 1.0) + (set-vector! (-> v1-1 vector 2) 0.0 0.0 98304.0 1.0) + (set-vector! (-> v1-1 trans) 98304.0 0.0 98304.0 1.0) + ) + (&+! (-> arg0 base) 64) + 0 + (none) + ) + +(defmethod draw-ocean-transition ocean ((obj ocean) (arg0 dma-buffer)) + (local-vars + (sv-32 uint) + (sv-33 uint) + (sv-34 uint) + (sv-35 uint) + (sv-36 sphere) + (sv-40 ocean-trans-mask) + (sv-44 uint) + (sv-48 int) + ) + (dotimes (v1-0 16) + (set! (-> obj trans-camera-masks v1-0) (the-as ocean-trans-mask 0)) + (set! (-> obj near-mask-indices v1-0) (the-as uint -1)) + ) + (dotimes (v1-3 64) + (set! (-> obj trans-mask-ptrs v1-3) (the-as pointer #f)) + ) + (set! sv-32 (-> obj mid-minx)) + (set! sv-33 (-> obj mid-maxx)) + (set! sv-34 (-> obj mid-minz)) + (set! sv-35 (-> obj mid-maxz)) + (set! sv-36 (new 'stack 'sphere)) + (set! (-> sv-36 y) (-> obj start-corner y)) + (set! (-> sv-36 r) 278045.7) + (let ((s4-0 sv-34) + (s3-0 sv-35) + ) + (while (>= s3-0 s4-0) + (let ((s2-0 sv-32) + (s1-0 sv-33) + ) + (while (>= s1-0 s2-0) + (when (not (ocean-mid-mask-ptrs-bit? obj s4-0 s2-0)) + (when (ocean-mid-camera-masks-bit? obj s4-0 s2-0) + (set! (-> sv-36 x) (+ 196608.0 (* 393216.0 (the float s2-0)) (-> obj start-corner x))) + (set! (-> sv-36 z) (+ 196608.0 (* 393216.0 (the float s4-0)) (-> obj start-corner z))) + (if (sphere-cull sv-36) + (ocean-make-trans-camera-masks obj s4-0 s2-0 (- s4-0 sv-34) (- s2-0 sv-32)) + ) + ) + ) + (+! s2-0 1) + ) + ) + (+! s4-0 1) + ) + ) + (let ((a2-3 192) + (a1-7 0) + (a0-11 192) + (v1-33 0) + ) + (let ((a3-1 sv-34) + (t0-1 sv-35) + ) + (while (>= t0-1 a3-1) + (let ((t1-0 sv-32) + (t2-0 sv-33) + ) + (while (>= t2-0 t1-0) + (set! sv-40 (the-as ocean-trans-mask (&-> obj trans-camera-masks (+ (* (- a3-1 sv-34) 4) (- t1-0 sv-32))))) + (when (nonzero? (-> sv-40 word)) + (dotimes (t3-10 4) + (let ((t4-4 (-> sv-40 mask t3-10))) + (when (nonzero? t4-4) + (let ((t5-2 (+ (* a3-1 4) t3-10))) + (if (< t5-2 (the-as uint a0-11)) + (set! a0-11 (the-as int t5-2)) + ) + (if (< (the-as uint v1-33) t5-2) + (set! v1-33 (the-as int t5-2)) + ) + ) + (dotimes (t5-3 4) + (when (logtest? t4-4 (ash 1 t5-3)) + (let ((t6-9 (+ (* t1-0 4) t5-3))) + (if (< t6-9 (the-as uint a2-3)) + (set! a2-3 (the-as int t6-9)) + ) + (if (< (the-as uint a1-7) t6-9) + (set! a1-7 (the-as int t6-9)) + ) + ) + ) + ) + ) + ) + ) + ) + (+! t1-0 1) + ) + ) + (+! a3-1 1) + ) + ) + (set! (-> obj near-minx) (the-as uint (+ a2-3 -1))) + (set! (-> obj near-maxx) (the-as uint (+ a1-7 1))) + (set! (-> obj near-minz) (the-as uint (+ a0-11 -1))) + (set! (-> obj near-maxz) (the-as uint (+ v1-33 1))) + ) + (dotimes (v1-35 16) + (set! (-> obj trans-temp-masks v1-35) (the-as uint (-> obj trans-camera-masks v1-35))) + ) + (let ((s4-1 sv-34) + (s3-1 sv-35) + ) + (while (>= s3-1 s4-1) + (let ((s2-1 sv-32) + (s1-1 sv-33) + ) + (while (>= s1-1 s2-1) + (when (not (ocean-mid-mask-ptrs-bit? obj s4-1 s2-1)) + (when (ocean-mid-camera-masks-bit? obj s4-1 s2-1) + (let ((v1-46 (-> obj ocean-trans-indices data (+ (* (the-as uint 48) s4-1) s2-1)))) + (when (>= (-> v1-46 parent) 0) + (set! sv-44 (+ (* (- s4-1 sv-34) 4) (- s2-1 sv-32))) + (set! (-> obj near-mask-indices sv-44) (the-as uint (-> v1-46 child))) + (let ((s0-0 (-> obj ocean-mid-masks data (-> v1-46 parent)))) + (set! sv-48 0) + (while (< sv-48 4) + (let ((t0-2 (-> s0-0 mask sv-48))) + (if (!= t0-2 255) + (ocean-trans-add-upload-strip obj arg0 s4-1 s2-1 (the-as int t0-2) (the-as int sv-44) sv-48) + ) + ) + (set! sv-48 (+ sv-48 1)) + ) + ) + ) + ) + ) + ) + (+! s2-1 1) + ) + ) + (+! s4-1 1) + ) + ) + (ocean-mid-add-call-flush obj arg0 (the-as uint 41)) + (ocean-trans-add-constants obj arg0) + (draw-ocean-transition-seams obj arg0) + (ocean-mid-add-call-flush obj arg0 (the-as uint 41)) + 0 + (none) + ) diff --git a/goal_src/jak2/engine/gfx/ocean/ocean-vu0.gc b/goal_src/jak2/engine/gfx/ocean/ocean-vu0.gc index 4a680072b7..ef78ec370e 100644 --- a/goal_src/jak2/engine/gfx/ocean/ocean-vu0.gc +++ b/goal_src/jak2/engine/gfx/ocean/ocean-vu0.gc @@ -7,3 +7,8 @@ ;; DECOMP BEGINS +(define ocean-vu0-block (new 'static 'vu-function :length 0 :qlength 0)) + +(defmethod-mips2c "(method 16 ocean)" 16 ocean) ;; ocean-generate-verts +(defmethod-mips2c "(method 15 ocean)" 15 ocean) +(defmethod-mips2c "(method 14 ocean)" 14 ocean) ;; ocean-interp-waves \ No newline at end of file diff --git a/goal_src/jak2/engine/gfx/ocean/ocean.gc b/goal_src/jak2/engine/gfx/ocean/ocean.gc index f4f5c0a8fa..9b6fde1b47 100644 --- a/goal_src/jak2/engine/gfx/ocean/ocean.gc +++ b/goal_src/jak2/engine/gfx/ocean/ocean.gc @@ -5,5 +5,1333 @@ ;; name in dgo: ocean ;; dgos: ENGINE, GAME +(def-mips2c init-ocean-far-regs (function none)) +(def-mips2c draw-large-polygon-ocean (function none)) +(def-mips2c render-ocean-quad (function (inline-array ocean-vertex) dma-buffer symbol)) + ;; DECOMP BEGINS +(defmethod set-corners! ocean ((obj ocean) (corner-x float) (corner-z float)) + (let* ((f2-0 (* 0.00008138021 corner-x)) + (f3-0 (* 0.00008138021 corner-z)) + (f0-2 f2-0) + (f0-4 (- f0-2 (the float (the int f0-2)))) + (f1-6 f3-0) + (f1-8 (- f1-6 (the float (the int f1-6)))) + (a1-1 (logand (the int f2-0) 31)) + (a3-0 (logand (the int f3-0) 31)) + (v1-9 (logand (+ a1-1 1) 31)) + (a2-2 (logand (+ a3-0 1) 31)) + (f2-3 (-> obj heights data (+ (* a3-0 32) a1-1))) + (f3-1 (-> obj heights data (+ (* a3-0 32) v1-9))) + (f4-4 (-> obj heights data (+ (* a2-2 32) a1-1))) + (f5-0 (-> obj heights data (+ (* a2-2 32) v1-9))) + (f6-1 (+ (* f3-1 f0-4) (* f2-3 (- 1.0 f0-4)))) + (f0-9 (+ (* (+ (* f5-0 f0-4) (* f4-4 (- 1.0 f0-4))) f1-8) (* f6-1 (- 1.0 f1-8)))) + ) + (set! (-> obj corner00) f2-3) + (set! (-> obj corner01) f3-1) + (set! (-> obj corner10) f4-4) + (set! (-> obj corner11) f5-0) + f0-9 + ) + ) + +(defmethod get-height ocean ((obj ocean) (arg0 vector) (arg1 symbol)) + (local-vars (v1-12 int)) + (cond + ((and (-> obj heights) *ocean-map*) + (let* ((f30-0 (- (-> arg0 x) (-> obj start-corner x))) + (f28-0 (- (-> arg0 z) (-> obj start-corner z))) + (v1-3 (the int (* 0.0000025431316 f30-0))) + (a0-2 (the int (* 0.0000025431316 f28-0))) + (v1-7 (-> obj ocean-trans-indices data (+ (* 48 a0-2) v1-3))) + ) + (cond + ((= (-> v1-7 parent) -1) + (if arg1 + (-> obj start-corner y) + 4095996000.0 + ) + ) + ((begin + (let ((a0-8 (logand (the int (* 0.000010172526 f30-0)) 3)) + (a3-4 (logand (the int (* 0.000010172526 f28-0)) 3)) + (v1-10 (-> obj ocean-near-indices data (-> v1-7 child))) + ) + (set! v1-12 (-> (the-as (pointer int16) (+ (* (+ (* a3-4 4) a0-8) 2) (the-as int v1-10))))) + ) + (= v1-12 -1) + ) + (if arg1 + (-> obj start-corner y) + 4095996000.0 + ) + ) + (else + (let ((a0-14 (logand (the int (* 0.00008138021 f30-0)) 7))) + (cond + ((not (logtest? (-> obj ocean-mid-masks data v1-12 mask (logand (the int (* 0.00008138021 f28-0)) 7)) (ash 1 a0-14)) + ) + (let* ((f1-2 (vector-vector-distance arg0 (math-camera-pos))) + (f26-0 (- 1.0 (fmin 1.0 (* 0.000010172526 f1-2)))) + ) + (if (-> obj ocean-near-translucent?) + (+ (* f26-0 (set-corners! obj f30-0 f28-0)) (-> obj start-corner y)) + (-> obj start-corner y) + ) + ) + ) + (arg1 + (-> obj start-corner y) + ) + (else + 4095996000.0 + ) + ) + ) + ) + ) + ) + ) + (arg1 + 0.0 + ) + (else + 4095996000.0 + ) + ) + ) + +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; ERROR: function was not converted to expressions. Cannot decompile. + +(defmethod add-colors! ocean ((obj ocean) (arg0 vector) (arg1 ocean-vertex)) + (let ((s3-0 (new 'stack-no-clear 'vector)) + (s4-0 (-> obj haze-lights)) + ) + (set! (-> s3-0 quad) (-> arg1 pos quad)) + (set! (-> s3-0 y) 0.0) + (vector-normalize! s3-0 1.0) + (set! (-> s3-0 y) (+ 0.1 (-> s3-0 y))) + (vector-normalize! s3-0 1.0) + (let ((s5-0 (new 'stack-no-clear 'vector4))) + (let* ((f0-4 (vector-dot (-> s4-0 sun0-normal) s3-0)) + (f1-2 (vector-dot (-> s4-0 sun1-normal) s3-0)) + (f2-1 (vector-dot (-> s4-0 moon-normal) s3-0)) + (f0-5 (fmax 0.0 f0-4)) + (f30-0 (fmax 0.0 f1-2)) + (f28-0 (fmax 0.0 f2-1)) + ) + (set! (-> s5-0 quad) (-> s4-0 ambi-color quad)) + (vector4-madd! s5-0 s5-0 (the-as vector4 (-> s4-0 sun0-color)) f0-5) + (vector4-madd! s5-0 s5-0 (the-as vector4 (-> s4-0 sun1-color)) f30-0) + (vector4-madd! s5-0 s5-0 (the-as vector4 (-> s4-0 moon-color)) f28-0) + ) + (vector4-scale! s5-0 s5-0 128.0) + (set! (-> arg0 x) (fmax 0.0 (fmin 255.0 (-> s5-0 x)))) + (set! (-> arg0 y) (fmax 0.0 (fmin 255.0 (-> s5-0 y)))) + (set! (-> arg0 z) (fmax 0.0 (fmin 255.0 (-> s5-0 z)))) + ) + ) + 0 + (none) + ) + +(defmethod ocean-method-60 ocean ((obj ocean) (arg0 dma-buffer)) + (local-vars (sv-48 float) (sv-52 vector) (sv-56 vector)) + (let ((vertices (scratchpad-object (inline-array ocean-vertex)))) + (let ((f0-0 (-> obj start-corner z))) + (let ((f1-1 (+ -5898240.0 f0-0))) + (set! (-> vertices 0 pos z) f1-1) + (set! (-> vertices 1 pos z) f1-1) + ) + (set! (-> vertices 2 pos z) f0-0) + (set! (-> vertices 3 pos z) f0-0) + ) + (set! (-> vertices 0 pos w) 0.5) + (set! (-> vertices 1 pos w) 0.5) + (set! (-> vertices 2 pos w) 1.0) + (set! (-> vertices 3 pos w) 1.0) + (set! sv-48 (-> obj start-corner x)) + (set! sv-52 (new 'stack-no-clear 'vector)) + (set! sv-56 (new 'stack-no-clear 'vector)) + (let ((s3-0 (-> obj ocean-colors))) + (let ((s2-0 #f)) + (rgba-to-vector! obj sv-52 (-> s3-0 colors)) + (dotimes (s1-0 48) + (let ((f0-8 (+ (* 393216.0 (the float s1-0)) sv-48))) + (let ((f1-6 (+ 393216.0 f0-8))) + (set! (-> vertices 0 pos x) f0-8) + (set! (-> vertices 1 pos x) f1-6) + (set! (-> vertices 2 pos x) f1-6) + ) + (set! (-> vertices 3 pos x) f0-8) + ) + (rgba-to-vector! obj sv-56 (&+ (-> s3-0 colors) (* (+ s1-0 1) 4))) + (set! (-> vertices 0 col quad) (-> sv-52 quad)) + (set! (-> vertices 1 col quad) (-> sv-56 quad)) + (set! (-> vertices 2 col quad) (-> sv-56 quad)) + (set! (-> vertices 3 col quad) (-> sv-52 quad)) + (set! (-> sv-52 quad) (-> sv-56 quad)) + (cond + ((render-ocean-quad vertices arg0) + (set! s2-0 #t) + ) + (else + (if s2-0 + (goto cfg-9) + ) + ) + ) + ) + ) + ) + (label cfg-9) + (let ((f0-10 (+ -5898240.0 (-> obj start-corner z)))) + (let ((f1-9 (+ -5898240.0 f0-10))) + (set! (-> vertices 0 pos z) f1-9) + (set! (-> vertices 1 pos z) f1-9) + ) + (set! (-> vertices 2 pos z) f0-10) + (set! (-> vertices 3 pos z) f0-10) + ) + (set! (-> vertices 0 pos w) 0.0) + (set! (-> vertices 1 pos w) 0.0) + (set! (-> vertices 2 pos w) 0.5) + (set! (-> vertices 3 pos w) 0.5) + (let ((s3-1 (-> obj ocean-colors))) + (let ((s2-1 #f)) + (rgba-to-vector! obj sv-52 (-> s3-1 colors)) + (dotimes (s1-1 48) + (let ((f0-17 (+ (* 393216.0 (the float s1-1)) sv-48))) + (let ((f1-14 (+ 393216.0 f0-17))) + (set! (-> vertices 0 pos x) f0-17) + (set! (-> vertices 1 pos x) f1-14) + (set! (-> vertices 2 pos x) f1-14) + ) + (set! (-> vertices 3 pos x) f0-17) + ) + (rgba-to-vector! obj sv-56 (&+ (-> s3-1 colors) (* (+ s1-1 1) 4))) + (add-colors! obj (-> vertices 0 col) (-> vertices 0)) + (add-colors! obj (-> vertices 1 col) (-> vertices 1)) + (set! (-> vertices 2 col quad) (-> sv-56 quad)) + (set! (-> vertices 3 col quad) (-> sv-52 quad)) + (set! (-> sv-52 quad) (-> sv-56 quad)) + (cond + ((render-ocean-quad vertices arg0) + (set! s2-1 #t) + ) + (else + (if s2-1 + (goto cfg-18) + ) + ) + ) + ) + ) + ) + ) + (label cfg-18) + 0 + (none) + ) + +(defmethod ocean-method-61 ocean ((obj ocean) (arg0 dma-buffer)) + (local-vars (sv-48 float) (sv-52 vector) (sv-56 vector)) + (let ((vertices (scratchpad-object (inline-array ocean-vertex)))) + (let* ((f0-1 (+ 18874368.0 (-> obj start-corner z))) + (f1-2 (+ 5898240.0 f0-1)) + ) + (set! (-> vertices 0 pos z) f0-1) + (set! (-> vertices 1 pos z) f0-1) + (set! (-> vertices 2 pos z) f1-2) + (set! (-> vertices 3 pos z) f1-2) + ) + (set! (-> vertices 0 pos w) 1.0) + (set! (-> vertices 1 pos w) 1.0) + (set! (-> vertices 2 pos w) 0.5) + (set! (-> vertices 3 pos w) 0.5) + (set! sv-48 (-> obj start-corner x)) + (set! sv-52 (new 'stack-no-clear 'vector)) + (set! sv-56 (new 'stack-no-clear 'vector)) + (let ((s3-0 (-> obj ocean-colors))) + (let ((s2-0 #f)) + (rgba-to-vector! obj sv-52 (&-> s3-0 colors 2444)) + (dotimes (s1-0 48) + (let ((f0-9 (+ (* 393216.0 (the float s1-0)) sv-48))) + (let ((f1-7 (+ 393216.0 f0-9))) + (set! (-> vertices 0 pos x) f0-9) + (set! (-> vertices 1 pos x) f1-7) + (set! (-> vertices 2 pos x) f1-7) + ) + (set! (-> vertices 3 pos x) f0-9) + ) + (rgba-to-vector! obj sv-56 (&+ (-> s3-0 colors) (* (+ s1-0 2445) 4))) + (set! (-> vertices 0 col quad) (-> sv-52 quad)) + (set! (-> vertices 1 col quad) (-> sv-56 quad)) + (set! (-> vertices 2 col quad) (-> sv-56 quad)) + (set! (-> vertices 3 col quad) (-> sv-52 quad)) + (set! (-> sv-52 quad) (-> sv-56 quad)) + (cond + ((render-ocean-quad vertices arg0) + (set! s2-0 #t) + ) + (else + (if s2-0 + (goto cfg-9) + ) + ) + ) + ) + ) + ) + (label cfg-9) + (let* ((f0-11 (+ 24772608.0 (-> obj start-corner z))) + (f1-10 (+ 5898240.0 f0-11)) + ) + (set! (-> vertices 0 pos z) f0-11) + (set! (-> vertices 1 pos z) f0-11) + (set! (-> vertices 2 pos z) f1-10) + (set! (-> vertices 3 pos z) f1-10) + ) + (set! (-> vertices 0 pos w) 0.5) + (set! (-> vertices 1 pos w) 0.5) + (set! (-> vertices 2 pos w) 0.0) + (set! (-> vertices 3 pos w) 0.0) + (let ((s3-1 (-> obj ocean-colors))) + (let ((s2-1 #f)) + (rgba-to-vector! obj sv-52 (&-> s3-1 colors 2444)) + (dotimes (s1-1 48) + (let ((f0-18 (+ (* 393216.0 (the float s1-1)) sv-48))) + (let ((f1-15 (+ 393216.0 f0-18))) + (set! (-> vertices 0 pos x) f0-18) + (set! (-> vertices 1 pos x) f1-15) + (set! (-> vertices 2 pos x) f1-15) + ) + (set! (-> vertices 3 pos x) f0-18) + ) + (rgba-to-vector! obj sv-56 (&+ (-> s3-1 colors) (* (+ s1-1 2445) 4))) + (set! (-> vertices 0 col quad) (-> sv-52 quad)) + (set! (-> vertices 1 col quad) (-> sv-56 quad)) + (add-colors! obj (-> vertices 2 col) (-> vertices 2)) + (add-colors! obj (-> vertices 3 col) (-> vertices 3)) + (set! (-> sv-52 quad) (-> sv-56 quad)) + (cond + ((render-ocean-quad vertices arg0) + (set! s2-1 #t) + ) + (else + (if s2-1 + (goto cfg-18) + ) + ) + ) + ) + ) + ) + ) + (label cfg-18) + 0 + (none) + ) + +(defmethod ocean-method-62 ocean ((obj ocean) (arg0 dma-buffer)) + (local-vars (sv-48 float) (sv-52 vector) (sv-56 vector)) + (let ((vertices (scratchpad-object (inline-array ocean-vertex)))) + (let* ((f0-0 (-> obj start-corner x)) + (f1-1 (+ -5898240.0 f0-0)) + ) + (set! (-> vertices 0 pos x) f1-1) + (set! (-> vertices 1 pos x) f0-0) + (set! (-> vertices 2 pos x) f0-0) + (set! (-> vertices 3 pos x) f1-1) + ) + (set! (-> vertices 0 pos w) 0.5) + (set! (-> vertices 1 pos w) 1.0) + (set! (-> vertices 2 pos w) 1.0) + (set! (-> vertices 3 pos w) 0.5) + (set! sv-48 (-> obj start-corner z)) + (set! sv-52 (new 'stack-no-clear 'vector)) + (set! sv-56 (new 'stack-no-clear 'vector)) + (let ((s3-0 (-> obj ocean-colors))) + (let ((s2-0 #f)) + (rgba-to-vector! obj sv-52 (-> s3-0 colors)) + (dotimes (s1-0 48) + (let* ((f0-8 (+ (* 393216.0 (the float s1-0)) sv-48)) + (f1-6 (+ 393216.0 f0-8)) + ) + (set! (-> vertices 0 pos z) f0-8) + (set! (-> vertices 1 pos z) f0-8) + (set! (-> vertices 2 pos z) f1-6) + (set! (-> vertices 3 pos z) f1-6) + ) + (rgba-to-vector! obj sv-56 (&+ (-> s3-0 colors) (* 208 (+ s1-0 1)))) + (set! (-> vertices 0 col quad) (-> sv-52 quad)) + (set! (-> vertices 1 col quad) (-> sv-52 quad)) + (set! (-> vertices 2 col quad) (-> sv-56 quad)) + (set! (-> vertices 3 col quad) (-> sv-56 quad)) + (set! (-> sv-52 quad) (-> sv-56 quad)) + (cond + ((render-ocean-quad vertices arg0) + (set! s2-0 #t) + ) + (else + (if s2-0 + (goto cfg-9) + ) + ) + ) + ) + ) + ) + (label cfg-9) + (let* ((f0-10 (+ -5898240.0 (-> obj start-corner x))) + (f1-9 (+ -5898240.0 f0-10)) + ) + (set! (-> vertices 0 pos x) f1-9) + (set! (-> vertices 1 pos x) f0-10) + (set! (-> vertices 2 pos x) f0-10) + (set! (-> vertices 3 pos x) f1-9) + ) + (set! (-> vertices 0 pos w) 0.0) + (set! (-> vertices 1 pos w) 0.5) + (set! (-> vertices 2 pos w) 0.5) + (set! (-> vertices 3 pos w) 0.0) + (let ((s3-1 (-> obj ocean-colors))) + (let ((s2-1 #f)) + (rgba-to-vector! obj sv-52 (-> s3-1 colors)) + (dotimes (s1-1 48) + (let* ((f0-17 (+ (* 393216.0 (the float s1-1)) sv-48)) + (f1-14 (+ 393216.0 f0-17)) + ) + (set! (-> vertices 0 pos z) f0-17) + (set! (-> vertices 1 pos z) f0-17) + (set! (-> vertices 2 pos z) f1-14) + (set! (-> vertices 3 pos z) f1-14) + ) + (rgba-to-vector! obj sv-56 (&+ (-> s3-1 colors) (* 208 (+ s1-1 1)))) + (add-colors! obj (-> vertices 0 col) (-> vertices 0)) + (set! (-> vertices 1 col quad) (-> sv-52 quad)) + (set! (-> vertices 2 col quad) (-> sv-56 quad)) + (add-colors! obj (-> vertices 3 col) (-> vertices 3)) + (set! (-> sv-52 quad) (-> sv-56 quad)) + (cond + ((render-ocean-quad vertices arg0) + (set! s2-1 #t) + ) + (else + (if s2-1 + (goto cfg-18) + ) + ) + ) + ) + ) + ) + ) + (label cfg-18) + 0 + (none) + ) + +(defmethod ocean-method-63 ocean ((obj ocean) (arg0 dma-buffer)) + (local-vars (sv-48 float) (sv-52 vector) (sv-56 vector)) + (let ((vertices (scratchpad-object (inline-array ocean-vertex)))) + (let ((f0-1 (+ 18874368.0 (-> obj start-corner x)))) + (let ((f1-2 (+ 5898240.0 f0-1))) + (set! (-> vertices 0 pos x) f0-1) + (set! (-> vertices 1 pos x) f1-2) + (set! (-> vertices 2 pos x) f1-2) + ) + (set! (-> vertices 3 pos x) f0-1) + ) + (set! (-> vertices 0 pos w) 1.0) + (set! (-> vertices 1 pos w) 0.5) + (set! (-> vertices 2 pos w) 0.5) + (set! (-> vertices 3 pos w) 1.0) + (set! sv-48 (-> obj start-corner z)) + (set! sv-52 (new 'stack-no-clear 'vector)) + (set! sv-56 (new 'stack-no-clear 'vector)) + (let ((s3-0 (-> obj ocean-colors))) + (let ((s2-0 #f)) + (rgba-to-vector! obj sv-52 (&-> s3-0 colors 47)) + (dotimes (s1-0 48) + (let* ((f0-9 (+ (* 393216.0 (the float s1-0)) sv-48)) + (f1-7 (+ 393216.0 f0-9)) + ) + (set! (-> vertices 0 pos z) f0-9) + (set! (-> vertices 1 pos z) f0-9) + (set! (-> vertices 2 pos z) f1-7) + (set! (-> vertices 3 pos z) f1-7) + ) + (rgba-to-vector! obj sv-56 (&+ (-> s3-0 colors) (* (+ (* 52 (+ s1-0 1)) 47) 4))) + (set! (-> vertices 0 col quad) (-> sv-52 quad)) + (set! (-> vertices 1 col quad) (-> sv-52 quad)) + (set! (-> vertices 2 col quad) (-> sv-56 quad)) + (set! (-> vertices 3 col quad) (-> sv-56 quad)) + (set! (-> sv-52 quad) (-> sv-56 quad)) + (cond + ((render-ocean-quad vertices arg0) + (set! s2-0 #t) + ) + (else + (if s2-0 + (goto cfg-9) + ) + ) + ) + ) + ) + ) + (label cfg-9) + (let ((f0-11 (+ 24772608.0 (-> obj start-corner x)))) + (let ((f1-10 (+ 5898240.0 f0-11))) + (set! (-> vertices 0 pos x) f0-11) + (set! (-> vertices 1 pos x) f1-10) + (set! (-> vertices 2 pos x) f1-10) + ) + (set! (-> vertices 3 pos x) f0-11) + ) + (set! (-> vertices 0 pos w) 0.5) + (set! (-> vertices 1 pos w) 0.0) + (set! (-> vertices 2 pos w) 0.0) + (set! (-> vertices 3 pos w) 0.5) + (let ((s3-1 (-> obj ocean-colors))) + (let ((s2-1 #f)) + (rgba-to-vector! obj sv-52 (&-> s3-1 colors 47)) + (dotimes (s1-1 48) + (let* ((f0-18 (+ (* 393216.0 (the float s1-1)) sv-48)) + (f1-15 (+ 393216.0 f0-18)) + ) + (set! (-> vertices 0 pos z) f0-18) + (set! (-> vertices 1 pos z) f0-18) + (set! (-> vertices 2 pos z) f1-15) + (set! (-> vertices 3 pos z) f1-15) + ) + (rgba-to-vector! obj sv-56 (&+ (-> s3-1 colors) (* (+ (* 52 (+ s1-1 1)) 47) 4))) + (set! (-> vertices 0 col quad) (-> sv-52 quad)) + (add-colors! obj (-> vertices 1 col) (-> vertices 1)) + (add-colors! obj (-> vertices 2 col) (-> vertices 2)) + (set! (-> vertices 3 col quad) (-> sv-56 quad)) + (set! (-> sv-52 quad) (-> sv-56 quad)) + (cond + ((render-ocean-quad vertices arg0) + (set! s2-1 #t) + ) + (else + (if s2-1 + (goto cfg-18) + ) + ) + ) + ) + ) + ) + ) + (label cfg-18) + 0 + (none) + ) + +(defmethod ocean-method-64 ocean ((obj ocean) (arg0 dma-buffer)) + (let ((vertices (scratchpad-object (inline-array ocean-vertex)))) + (let* ((v1-1 (-> obj ocean-colors)) + (f30-0 (-> obj start-corner x)) + (f28-0 (-> obj start-corner z)) + (f26-0 (+ -5898240.0 f30-0)) + (f24-0 (+ -5898240.0 f28-0)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (rgba-to-vector! obj s3-0 (-> v1-1 colors)) + (set! (-> vertices 0 pos x) f26-0) + (set! (-> vertices 1 pos x) f30-0) + (set! (-> vertices 2 pos x) f30-0) + (set! (-> vertices 3 pos x) f26-0) + (set! (-> vertices 0 pos z) f24-0) + (set! (-> vertices 1 pos z) f24-0) + (set! (-> vertices 2 pos z) f28-0) + (set! (-> vertices 3 pos z) f28-0) + (set! (-> vertices 0 pos w) 0.5) + (set! (-> vertices 1 pos w) 0.5) + (set! (-> vertices 2 pos w) 1.0) + (set! (-> vertices 3 pos w) 0.5) + (set! (-> vertices 0 col quad) (-> s3-0 quad)) + (set! (-> vertices 1 col quad) (-> s3-0 quad)) + (set! (-> vertices 2 col quad) (-> s3-0 quad)) + (set! (-> vertices 3 col quad) (-> s3-0 quad)) + (render-ocean-quad vertices arg0) + (let ((f0-7 (+ -5898240.0 (-> obj start-corner x))) + (f1-1 (-> obj start-corner z)) + ) + (let ((f2-1 (+ -5898240.0 f0-7)) + (f3-1 (+ -5898240.0 f1-1)) + ) + (set! (-> vertices 0 pos x) f2-1) + (set! (-> vertices 1 pos x) f0-7) + (set! (-> vertices 2 pos x) f0-7) + (set! (-> vertices 3 pos x) f2-1) + (set! (-> vertices 0 pos z) f3-1) + (set! (-> vertices 1 pos z) f3-1) + ) + (set! (-> vertices 2 pos z) f1-1) + (set! (-> vertices 3 pos z) f1-1) + ) + (set! (-> vertices 0 pos w) 0.0) + (set! (-> vertices 1 pos w) 0.5) + (set! (-> vertices 2 pos w) 0.5) + (set! (-> vertices 3 pos w) 0.0) + (add-colors! obj (-> vertices 0 col) (-> vertices 0)) + (set! (-> vertices 1 col quad) (-> s3-0 quad)) + (set! (-> vertices 2 col quad) (-> s3-0 quad)) + (add-colors! obj (-> vertices 3 col) (-> vertices 3)) + (render-ocean-quad vertices arg0) + (let ((f0-13 (+ -5898240.0 (-> obj start-corner x))) + (f1-4 (+ -5898240.0 (-> obj start-corner z))) + ) + (let ((f2-4 (+ -5898240.0 f0-13)) + (f3-3 (+ -5898240.0 f1-4)) + ) + (set! (-> vertices 0 pos x) f2-4) + (set! (-> vertices 1 pos x) f0-13) + (set! (-> vertices 2 pos x) f0-13) + (set! (-> vertices 3 pos x) f2-4) + (set! (-> vertices 0 pos z) f3-3) + (set! (-> vertices 1 pos z) f3-3) + ) + (set! (-> vertices 2 pos z) f1-4) + (set! (-> vertices 3 pos z) f1-4) + ) + (set! (-> vertices 0 pos w) 0.0) + (set! (-> vertices 1 pos w) 0.0) + (set! (-> vertices 2 pos w) 0.5) + (set! (-> vertices 3 pos w) 0.0) + (add-colors! obj (-> vertices 0 col) (-> vertices 0)) + (add-colors! obj (-> vertices 1 col) (-> vertices 1)) + (set! (-> vertices 2 col quad) (-> s3-0 quad)) + (add-colors! obj (-> vertices 3 col) (-> vertices 3)) + (render-ocean-quad vertices arg0) + (let ((f0-18 (-> obj start-corner x)) + (f1-6 (+ -5898240.0 (-> obj start-corner z))) + ) + (let ((f2-7 (+ -5898240.0 f0-18)) + (f3-5 (+ -5898240.0 f1-6)) + ) + (set! (-> vertices 0 pos x) f2-7) + (set! (-> vertices 1 pos x) f0-18) + (set! (-> vertices 2 pos x) f0-18) + (set! (-> vertices 3 pos x) f2-7) + (set! (-> vertices 0 pos z) f3-5) + (set! (-> vertices 1 pos z) f3-5) + ) + (set! (-> vertices 2 pos z) f1-6) + (set! (-> vertices 3 pos z) f1-6) + ) + (set! (-> vertices 0 pos w) 0.0) + (set! (-> vertices 1 pos w) 0.0) + (set! (-> vertices 2 pos w) 0.5) + (set! (-> vertices 3 pos w) 0.5) + (add-colors! obj (-> vertices 0 col) (-> vertices 0)) + (add-colors! obj (-> vertices 1 col) (-> vertices 2)) + (set! (-> vertices 2 col quad) (-> s3-0 quad)) + (set! (-> vertices 3 col quad) (-> s3-0 quad)) + ) + (render-ocean-quad vertices arg0) + ) + 0 + (none) + ) + +(defmethod ocean-method-65 ocean ((obj ocean) (arg0 dma-buffer)) + (let ((vertices (scratchpad-object (inline-array ocean-vertex)))) + (let* ((v1-1 (-> obj ocean-colors)) + (f30-0 (+ 18874368.0 (-> obj start-corner x))) + (f28-0 (-> obj start-corner z)) + (f26-0 (+ 5898240.0 f30-0)) + (f24-0 (+ -5898240.0 f28-0)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (rgba-to-vector! obj s3-0 (&-> v1-1 colors 47)) + (set! (-> vertices 0 pos x) f30-0) + (set! (-> vertices 1 pos x) f26-0) + (set! (-> vertices 2 pos x) f26-0) + (set! (-> vertices 3 pos x) f30-0) + (set! (-> vertices 0 pos z) f24-0) + (set! (-> vertices 1 pos z) f24-0) + (set! (-> vertices 2 pos z) f28-0) + (set! (-> vertices 3 pos z) f28-0) + (set! (-> vertices 0 pos w) 0.5) + (set! (-> vertices 1 pos w) 0.5) + (set! (-> vertices 2 pos w) 0.5) + (set! (-> vertices 3 pos w) 1.0) + (set! (-> vertices 0 col quad) (-> s3-0 quad)) + (set! (-> vertices 1 col quad) (-> s3-0 quad)) + (set! (-> vertices 2 col quad) (-> s3-0 quad)) + (set! (-> vertices 3 col quad) (-> s3-0 quad)) + (render-ocean-quad vertices arg0) + (let ((f0-8 (+ 24772608.0 (-> obj start-corner x))) + (f1-2 (-> obj start-corner z)) + ) + (let ((f2-1 (+ 5898240.0 f0-8)) + (f3-1 (+ -5898240.0 f1-2)) + ) + (set! (-> vertices 0 pos x) f0-8) + (set! (-> vertices 1 pos x) f2-1) + (set! (-> vertices 2 pos x) f2-1) + (set! (-> vertices 3 pos x) f0-8) + (set! (-> vertices 0 pos z) f3-1) + (set! (-> vertices 1 pos z) f3-1) + ) + (set! (-> vertices 2 pos z) f1-2) + (set! (-> vertices 3 pos z) f1-2) + ) + (set! (-> vertices 0 pos w) 0.5) + (set! (-> vertices 1 pos w) 0.0) + (set! (-> vertices 2 pos w) 0.0) + (set! (-> vertices 3 pos w) 0.5) + (set! (-> vertices 0 col quad) (-> s3-0 quad)) + (add-colors! obj (-> vertices 1 col) (-> vertices 1)) + (add-colors! obj (-> vertices 2 col) (-> vertices 2)) + (set! (-> vertices 3 col quad) (-> s3-0 quad)) + (render-ocean-quad vertices arg0) + (let ((f0-14 (+ 18874368.0 (-> obj start-corner x))) + (f1-5 (+ -5898240.0 (-> obj start-corner z))) + ) + (let ((f2-4 (+ 5898240.0 f0-14)) + (f3-3 (+ -5898240.0 f1-5)) + ) + (set! (-> vertices 0 pos x) f0-14) + (set! (-> vertices 1 pos x) f2-4) + (set! (-> vertices 2 pos x) f2-4) + (set! (-> vertices 3 pos x) f0-14) + (set! (-> vertices 0 pos z) f3-3) + (set! (-> vertices 1 pos z) f3-3) + ) + (set! (-> vertices 2 pos z) f1-5) + (set! (-> vertices 3 pos z) f1-5) + ) + (set! (-> vertices 0 pos w) 0.0) + (set! (-> vertices 1 pos w) 0.0) + (set! (-> vertices 2 pos w) 0.5) + (set! (-> vertices 3 pos w) 0.5) + (add-colors! obj (-> vertices 0 col) (-> vertices 0)) + (add-colors! obj (-> vertices 1 col) (-> vertices 1)) + (set! (-> vertices 2 col quad) (-> s3-0 quad)) + (set! (-> vertices 3 col quad) (-> s3-0 quad)) + (render-ocean-quad vertices arg0) + (let ((f0-20 (+ 24772608.0 (-> obj start-corner x))) + (f1-8 (+ -5898240.0 (-> obj start-corner z))) + ) + (let ((f2-7 (+ 5898240.0 f0-20)) + (f3-5 (+ -5898240.0 f1-8)) + ) + (set! (-> vertices 0 pos x) f0-20) + (set! (-> vertices 1 pos x) f2-7) + (set! (-> vertices 2 pos x) f2-7) + (set! (-> vertices 3 pos x) f0-20) + (set! (-> vertices 0 pos z) f3-5) + (set! (-> vertices 1 pos z) f3-5) + ) + (set! (-> vertices 2 pos z) f1-8) + (set! (-> vertices 3 pos z) f1-8) + ) + (set! (-> vertices 0 pos w) 0.0) + (set! (-> vertices 1 pos w) 0.0) + (set! (-> vertices 2 pos w) 0.0) + (set! (-> vertices 3 pos w) 0.5) + (add-colors! obj (-> vertices 0 col) (-> vertices 0)) + (add-colors! obj (-> vertices 1 col) (-> vertices 1)) + (add-colors! obj (-> vertices 2 col) (-> vertices 2)) + (set! (-> vertices 3 col quad) (-> s3-0 quad)) + ) + (render-ocean-quad vertices arg0) + ) + 0 + (none) + ) + +(defmethod ocean-method-66 ocean ((obj ocean) (arg0 dma-buffer)) + (let ((vertices (scratchpad-object (inline-array ocean-vertex)))) + (let* ((v1-1 (-> obj ocean-colors)) + (f30-0 (-> obj start-corner x)) + (f28-0 (+ 18874368.0 (-> obj start-corner z))) + (f26-0 (+ -5898240.0 f30-0)) + (f24-0 (+ 5898240.0 f28-0)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (rgba-to-vector! obj s3-0 (&-> v1-1 colors 2444)) + (set! (-> vertices 0 pos x) f26-0) + (set! (-> vertices 1 pos x) f30-0) + (set! (-> vertices 2 pos x) f30-0) + (set! (-> vertices 3 pos x) f26-0) + (set! (-> vertices 0 pos z) f28-0) + (set! (-> vertices 1 pos z) f28-0) + (set! (-> vertices 2 pos z) f24-0) + (set! (-> vertices 3 pos z) f24-0) + (set! (-> vertices 0 pos w) 0.5) + (set! (-> vertices 1 pos w) 1.0) + (set! (-> vertices 2 pos w) 0.5) + (set! (-> vertices 3 pos w) 0.5) + (set! (-> vertices 0 col quad) (-> s3-0 quad)) + (set! (-> vertices 1 col quad) (-> s3-0 quad)) + (set! (-> vertices 2 col quad) (-> s3-0 quad)) + (set! (-> vertices 3 col quad) (-> s3-0 quad)) + (render-ocean-quad vertices arg0) + (let* ((f0-8 (+ -5898240.0 (-> obj start-corner x))) + (f1-3 (+ 18874368.0 (-> obj start-corner z))) + (f2-2 (+ -5898240.0 f0-8)) + (f3-1 (+ 5898240.0 f1-3)) + ) + (set! (-> vertices 0 pos x) f2-2) + (set! (-> vertices 1 pos x) f0-8) + (set! (-> vertices 2 pos x) f0-8) + (set! (-> vertices 3 pos x) f2-2) + (set! (-> vertices 0 pos z) f1-3) + (set! (-> vertices 1 pos z) f1-3) + (set! (-> vertices 2 pos z) f3-1) + (set! (-> vertices 3 pos z) f3-1) + ) + (set! (-> vertices 0 pos w) 0.0) + (set! (-> vertices 1 pos w) 0.5) + (set! (-> vertices 2 pos w) 0.5) + (set! (-> vertices 3 pos w) 0.0) + (add-colors! obj (-> vertices 0 col) (-> vertices 0)) + (set! (-> vertices 1 col quad) (-> s3-0 quad)) + (set! (-> vertices 2 col quad) (-> s3-0 quad)) + (add-colors! obj (-> vertices 3 col) (-> vertices 3)) + (render-ocean-quad vertices arg0) + (let* ((f0-14 (+ -5898240.0 (-> obj start-corner x))) + (f1-6 (+ 24772608.0 (-> obj start-corner z))) + (f2-5 (+ -5898240.0 f0-14)) + (f3-3 (+ 5898240.0 f1-6)) + ) + (set! (-> vertices 0 pos x) f2-5) + (set! (-> vertices 1 pos x) f0-14) + (set! (-> vertices 2 pos x) f0-14) + (set! (-> vertices 3 pos x) f2-5) + (set! (-> vertices 0 pos z) f1-6) + (set! (-> vertices 1 pos z) f1-6) + (set! (-> vertices 2 pos z) f3-3) + (set! (-> vertices 3 pos z) f3-3) + ) + (set! (-> vertices 0 pos w) 0.0) + (set! (-> vertices 1 pos w) 0.5) + (set! (-> vertices 2 pos w) 0.0) + (set! (-> vertices 3 pos w) 0.0) + (add-colors! obj (-> vertices 0 col) (-> vertices 0)) + (set! (-> vertices 1 col quad) (-> s3-0 quad)) + (add-colors! obj (-> vertices 2 col) (-> vertices 2)) + (add-colors! obj (-> vertices 3 col) (-> vertices 3)) + (render-ocean-quad vertices arg0) + (let* ((f0-19 (-> obj start-corner x)) + (f1-8 (+ 24772608.0 (-> obj start-corner z))) + (f2-8 (+ -5898240.0 f0-19)) + (f3-5 (+ 5898240.0 f1-8)) + ) + (set! (-> vertices 0 pos x) f2-8) + (set! (-> vertices 1 pos x) f0-19) + (set! (-> vertices 2 pos x) f0-19) + (set! (-> vertices 3 pos x) f2-8) + (set! (-> vertices 0 pos z) f1-8) + (set! (-> vertices 1 pos z) f1-8) + (set! (-> vertices 2 pos z) f3-5) + (set! (-> vertices 3 pos z) f3-5) + ) + (set! (-> vertices 0 pos w) 0.5) + (set! (-> vertices 1 pos w) 0.5) + (set! (-> vertices 2 pos w) 0.0) + (set! (-> vertices 3 pos w) 0.0) + (set! (-> vertices 0 col quad) (-> s3-0 quad)) + (set! (-> vertices 1 col quad) (-> s3-0 quad)) + ) + (add-colors! obj (-> vertices 2 col) (-> vertices 2)) + (add-colors! obj (-> vertices 3 col) (-> vertices 3)) + (render-ocean-quad vertices arg0) + ) + 0 + (none) + ) + +(defmethod ocean-method-67 ocean ((obj ocean) (arg0 dma-buffer)) + (let ((vertices (scratchpad-object (inline-array ocean-vertex)))) + (let* ((v1-1 (-> obj ocean-colors)) + (f30-0 (+ 18874368.0 (-> obj start-corner x))) + (f28-0 (+ 18874368.0 (-> obj start-corner z))) + (f26-0 (+ 5898240.0 f30-0)) + (f24-0 (+ 5898240.0 f28-0)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (rgba-to-vector! obj s3-0 (&-> v1-1 colors 2491)) + (set! (-> vertices 0 pos x) f30-0) + (set! (-> vertices 1 pos x) f26-0) + (set! (-> vertices 2 pos x) f26-0) + (set! (-> vertices 3 pos x) f30-0) + (set! (-> vertices 0 pos z) f28-0) + (set! (-> vertices 1 pos z) f28-0) + (set! (-> vertices 2 pos z) f24-0) + (set! (-> vertices 3 pos z) f24-0) + (set! (-> vertices 0 pos w) 1.0) + (set! (-> vertices 1 pos w) 0.5) + (set! (-> vertices 2 pos w) 0.5) + (set! (-> vertices 3 pos w) 0.5) + (set! (-> vertices 0 col quad) (-> s3-0 quad)) + (set! (-> vertices 1 col quad) (-> s3-0 quad)) + (set! (-> vertices 2 col quad) (-> s3-0 quad)) + (set! (-> vertices 3 col quad) (-> s3-0 quad)) + (render-ocean-quad vertices arg0) + (let* ((f0-9 (+ 24772608.0 (-> obj start-corner x))) + (f1-4 (+ 18874368.0 (-> obj start-corner z))) + (f2-2 (+ 5898240.0 f0-9)) + (f3-1 (+ 5898240.0 f1-4)) + ) + (set! (-> vertices 0 pos x) f0-9) + (set! (-> vertices 1 pos x) f2-2) + (set! (-> vertices 2 pos x) f2-2) + (set! (-> vertices 3 pos x) f0-9) + (set! (-> vertices 0 pos z) f1-4) + (set! (-> vertices 1 pos z) f1-4) + (set! (-> vertices 2 pos z) f3-1) + (set! (-> vertices 3 pos z) f3-1) + ) + (set! (-> vertices 0 pos w) 0.5) + (set! (-> vertices 1 pos w) 0.0) + (set! (-> vertices 2 pos w) 0.0) + (set! (-> vertices 3 pos w) 0.5) + (set! (-> vertices 0 col quad) (-> s3-0 quad)) + (add-colors! obj (-> vertices 1 col) (-> vertices 1)) + (add-colors! obj (-> vertices 2 col) (-> vertices 2)) + (set! (-> vertices 3 col quad) (-> s3-0 quad)) + (render-ocean-quad vertices arg0) + (let* ((f0-15 (+ 18874368.0 (-> obj start-corner x))) + (f1-7 (+ 24772608.0 (-> obj start-corner z))) + (f2-5 (+ 5898240.0 f0-15)) + (f3-3 (+ 5898240.0 f1-7)) + ) + (set! (-> vertices 0 pos x) f0-15) + (set! (-> vertices 1 pos x) f2-5) + (set! (-> vertices 2 pos x) f2-5) + (set! (-> vertices 3 pos x) f0-15) + (set! (-> vertices 0 pos z) f1-7) + (set! (-> vertices 1 pos z) f1-7) + (set! (-> vertices 2 pos z) f3-3) + (set! (-> vertices 3 pos z) f3-3) + ) + (set! (-> vertices 0 pos w) 0.5) + (set! (-> vertices 1 pos w) 0.5) + (set! (-> vertices 2 pos w) 0.0) + (set! (-> vertices 3 pos w) 0.0) + (set! (-> vertices 0 col quad) (-> s3-0 quad)) + (set! (-> vertices 1 col quad) (-> s3-0 quad)) + (add-colors! obj (-> vertices 2 col) (-> vertices 2)) + (add-colors! obj (-> vertices 3 col) (-> vertices 3)) + (render-ocean-quad vertices arg0) + (let* ((f0-21 (+ 24772608.0 (-> obj start-corner x))) + (f1-10 (+ 24772608.0 (-> obj start-corner z))) + (f2-8 (+ 5898240.0 f0-21)) + (f3-5 (+ 5898240.0 f1-10)) + ) + (set! (-> vertices 0 pos x) f0-21) + (set! (-> vertices 1 pos x) f2-8) + (set! (-> vertices 2 pos x) f2-8) + (set! (-> vertices 3 pos x) f0-21) + (set! (-> vertices 0 pos z) f1-10) + (set! (-> vertices 1 pos z) f1-10) + (set! (-> vertices 2 pos z) f3-5) + (set! (-> vertices 3 pos z) f3-5) + ) + (set! (-> vertices 0 pos w) 0.5) + (set! (-> vertices 1 pos w) 0.0) + (set! (-> vertices 2 pos w) 0.0) + (set! (-> vertices 3 pos w) 0.0) + (set! (-> vertices 0 col quad) (-> s3-0 quad)) + ) + (add-colors! obj (-> vertices 1 col) (-> vertices 1)) + (add-colors! obj (-> vertices 2 col) (-> vertices 2)) + (add-colors! obj (-> vertices 3 col) (-> vertices 3)) + (render-ocean-quad vertices arg0) + ) + 0 + (none) + ) + +(defmethod render-ocean-far ocean ((obj ocean) (arg1 dma-buffer) (facing int)) + (let ((vertices (scratchpad-object (inline-array ocean-vertex)))) + (let ((f0-0 (-> obj start-corner y))) + (set! (-> vertices 0 pos y) f0-0) + (set! (-> vertices 1 pos y) f0-0) + (set! (-> vertices 2 pos y) f0-0) + (set! (-> vertices 3 pos y) f0-0) + ) + (set-vector! (-> vertices 0 stq) 0.0 0.0 1.0 1.0) + (set-vector! (-> vertices 1 stq) 1.0 0.0 1.0 1.0) + (set-vector! (-> vertices 2 stq) 1.0 15.0 1.0 1.0) + (set-vector! (-> vertices 3 stq) 0.0 15.0 1.0 1.0) + (if (not (logtest? facing 2)) + (ocean-method-60 obj arg1) + ) + (if (not (logtest? facing 4)) + (ocean-method-61 obj arg1) + ) + (set-vector! (-> vertices 0 stq) 0.0 0.0 1.0 1.0) + (set-vector! (-> vertices 1 stq) 15.0 0.0 1.0 1.0) + (set-vector! (-> vertices 2 stq) 15.0 1.0 1.0 1.0) + (set-vector! (-> vertices 3 stq) 0.0 1.0 1.0 1.0) + (if (not (logtest? facing 16)) + (ocean-method-62 obj arg1) + ) + (if (not (logtest? facing 8)) + (ocean-method-63 obj arg1) + ) + (set-vector! (-> vertices 0 stq) 0.0 0.0 1.0 1.0) + (set-vector! (-> vertices 1 stq) 15.0 0.0 1.0 1.0) + (set-vector! (-> vertices 2 stq) 15.0 15.0 1.0 1.0) + (set-vector! (-> vertices 3 stq) 0.0 15.0 1.0 1.0) + ) + (if (not (or (logtest? facing 2) (logtest? facing 16))) + (ocean-method-64 obj arg1) + ) + (if (not (or (logtest? facing 2) (logtest? facing 8))) + (ocean-method-65 obj arg1) + ) + (if (not (or (logtest? facing 4) (logtest? facing 16))) + (ocean-method-66 obj arg1) + ) + (if (not (or (logtest? facing 4) (logtest? facing 8))) + (ocean-method-67 obj arg1) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch uint vs none. +(defmethod draw-ocean-far ocean ((obj ocean) (arg0 dma-buffer)) + (init-ocean-far-regs) + (let ((gp-0 (the-as object (-> arg0 base)))) + (&+! (-> arg0 base) 16) + (let ((v1-2 (-> obj ocean-facing))) + (cond + ((zero? v1-2) + (render-ocean-far obj arg0 4) + ) + ((= v1-2 1) + (render-ocean-far obj arg0 2) + ) + ((= v1-2 3) + (render-ocean-far obj arg0 8) + ) + ((= v1-2 2) + (render-ocean-far obj arg0 16) + ) + ) + ) + (close-sky-buffer arg0) + (let ((v1-15 (/ (the-as int (+ (- -16 (the-as int gp-0)) (the-as int (-> arg0 base)))) 16))) + (set! (-> (the-as dma-packet gp-0) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc v1-15)) + (set! (-> (the-as dma-packet gp-0) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet gp-0) vif1) (new 'static 'vif-tag :cmd (vif-cmd direct) :msk #x1 :imm v1-15)) + ) + ) + (none) + ) + +(defmethod init-buffer! ocean ((obj ocean) (arg0 dma-buffer)) + "Initialize [[ocean]] DMA buffer. + @returns Pointer to the next DMA buffer" + (let* ((v1-0 arg0) + (a0-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :qwc #xa :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-1) vif1) (new 'static 'vif-tag :imm #xa :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) + ) + (let* ((v1-1 arg0) + (a0-3 (the-as object (-> v1-1 base))) + ) + (set! (-> (the-as gs-gif-tag a0-3) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x9)) + (set! (-> (the-as gs-gif-tag a0-3) regs) GIF_REGS_ALL_AD) + (set! (-> v1-1 base) (&+ (the-as pointer a0-3) 16)) + ) + (let* ((s5-0 arg0) + (s4-0 (-> s5-0 base)) + ) + (set! (-> (the-as (pointer gs-test) s4-0) 0) + (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest always)) + ) + (set! (-> (the-as (pointer gs-reg64) s4-0) 1) (gs-reg64 test-1)) + (set! (-> (the-as (pointer gs-alpha) s4-0) 2) (new 'static 'gs-alpha :b #x1 :d #x1)) + (set! (-> (the-as (pointer gs-reg64) s4-0) 3) (gs-reg64 alpha-1)) + (set! (-> (the-as (pointer gs-tex0) s4-0) 4) + (new 'static 'gs-tex0 :tbp0 #x2a0 :tbw #x2 :th (log2 128) :tw (log2 128)) + ) + (set! (-> (the-as (pointer gs-reg64) s4-0) 5) (gs-reg64 tex0-1)) + (set! (-> (the-as (pointer gs-tex1) s4-0) 6) (-> obj tex1)) + (set! (-> (the-as (pointer gs-reg64) s4-0) 7) (gs-reg64 tex1-1)) + (set! (-> (the-as (pointer gs-texa) s4-0) 8) (new 'static 'gs-texa :ta0 #x80 :ta1 #x80)) + (set! (-> (the-as (pointer gs-reg64) s4-0) 9) (gs-reg64 texa)) + (set! (-> (the-as (pointer gs-miptbp) s4-0) 10) + (new 'static 'gs-miptbp :tbp1 #x6a0 :tbw1 #x1 :tbp2 #x7a0 :tbp3 #x7e0) + ) + (set! (-> (the-as (pointer gs-reg64) s4-0) 11) (gs-reg64 miptbp1-1)) + (set! (-> (the-as (pointer gs-miptbp) s4-0) 12) (new 'static 'gs-miptbp :tbp1 #x800 :tbp2 #x820 :tbp3 #x840)) + (set! (-> (the-as (pointer gs-reg64) s4-0) 13) (gs-reg64 miptbp2-1)) + (set! (-> (the-as (pointer gs-clamp) s4-0) 14) (new 'static 'gs-clamp)) + (set! (-> (the-as (pointer gs-reg64) s4-0) 15) (gs-reg64 clamp-1)) + (set! (-> (the-as (pointer gs-fogcol) s4-0) 16) (the-as gs-fogcol *fog-color*)) + (set! (-> (the-as (pointer gs-reg64) s4-0) 17) (gs-reg64 fogcol)) + (let ((v0-2 (&+ s4-0 144))) + (set! (-> s5-0 base) v0-2) + v0-2 + ) + ) + ) + +(defmethod end-buffer! ocean ((obj ocean) (arg0 dma-buffer)) + (let* ((v1-0 arg0) + (a0-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-1) vif1) (new 'static 'vif-tag :imm #x2 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) + ) + (let* ((v1-1 arg0) + (a0-3 (the-as object (-> v1-1 base))) + ) + (set! (-> (the-as gs-gif-tag a0-3) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1)) + (set! (-> (the-as gs-gif-tag a0-3) regs) GIF_REGS_ALL_AD) + (set! (-> v1-1 base) (&+ (the-as pointer a0-3) 16)) + ) + (let* ((v1-2 arg0) + (a0-5 (-> v1-2 base)) + ) + (set! (-> (the-as (pointer gs-texa) a0-5) 0) (new 'static 'gs-texa :ta1 #x80)) + (set! (-> (the-as (pointer gs-reg64) a0-5) 1) (gs-reg64 texa)) + (set! (-> v1-2 base) (&+ a0-5 16)) + ) + 0 + (none) + ) + +(defmethod set-height! ocean-map ((obj ocean-map) (arg0 float)) + (if obj + (set! (-> obj start-corner y) arg0) + ) + 0 + (none) + ) + +(defmethod get-base-height ocean-map ((obj ocean-map)) + (if obj + (-> obj start-corner y) + 0.0 + ) + ) + +(defmethod rgba-to-vector! ocean ((obj ocean) (arg0 vector) (arg1 (pointer rgba))) + "Pack an [[rgba]]'s bytes into a vector." + (local-vars (v1-1 uint128) (v1-2 uint128)) + (rlet ((vf1 :class vf)) + (let ((v1-0 (the-as uint128 (-> (the-as (pointer int32) arg1) 0)))) + (.pextlb v1-1 0 v1-0) + ) + (.pextlh v1-2 0 v1-1) + (.mov vf1 v1-2) + (.itof.vf vf1 vf1) + (.svf (&-> arg0 quad) vf1) + 0 + (none) + ) + ) + +(defmethod update-map ocean ((obj ocean)) + (with-pp + (set! (-> obj heights) #f) + (set! (-> obj verts) #f) + (let ((s5-0 *mood-control*)) + (set! (-> obj constant w) (if (and (-> s5-0 overide-weather-flag) (not (movie?))) + (-> s5-0 overide cloud) + (-> s5-0 current-interp cloud) + ) + ) + ) + (set! (-> obj constant w) (fmin 1.0 (* 2.0 (-> obj constant w)))) + (let ((f0-5 1.0) + (f30-0 1.0) + ) + (when (= (-> *bigmap* bigmap-index) 13) + (set! f0-5 0.333) + (set! f30-0 0.75) + ) + (set! (-> obj frame-speed) (* (+ 4.0 (-> *setting-control* user-current rain)) f0-5)) + (set! (-> obj frame-speed2) (* (+ 5.0 (-> *setting-control* user-current rain)) f0-5)) + (when (not (paused?)) + (let ((f0-8 (+ (-> obj frame-num) (* (-> obj frame-speed) (-> pp clock seconds-per-frame))))) + (set! (-> obj frame-num) (- f0-8 (* (the float (the int (/ f0-8 64.0))) 64.0))) + ) + (let ((f0-11 (+ (-> obj frame-num2) (* (-> obj frame-speed2) (-> pp clock seconds-per-frame))))) + (set! (-> obj frame-num2) (- f0-11 (* (the float (the int (/ f0-11 64.0))) 64.0))) + ) + ) + (let ((s5-1 (-> *display* frames (-> *display* on-screen) global-buf))) + (set! (-> obj heights) (the-as ocean-height-array (-> s5-1 base))) + (interp-wave obj (the-as ocean-wave-info (-> obj heights)) (the-as uint (-> obj frame-num)) (* 0.08325 f30-0)) + (&+! (-> s5-1 base) 4096) + (set! (-> obj heights2) (the-as ocean-height-array (-> s5-1 base))) + (interp-wave + obj + (the-as ocean-wave-info (-> obj heights2)) + (the-as uint (-> obj frame-num2)) + (* 0.01665 f30-0) + ) + (&+! (-> s5-1 base) 4096) + (ocean-method-15 obj (the-as matrix (-> obj heights)) (the-as matrix (-> obj heights2))) + (set! (-> obj verts) (the-as ocean-vert-array (-> s5-1 base))) + (&+! (-> s5-1 base) #x8000) + ) + ) + (when (not (or (-> obj off) (-> *blit-displays-work* menu-mode))) + (when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask ocean)) + (mem-copy! (the-as pointer (-> obj cloud-lights)) (the-as pointer (-> *sky-work* cloud-lights)) 156) + (mem-copy! (the-as pointer (-> obj haze-lights)) (the-as pointer (-> *sky-work* haze-lights)) 124) + (vector4-scale! + (the-as vector4 (-> obj sky-color)) + (the-as vector4 (-> *time-of-day-context* current-sky-color)) + 0.0078125 + ) + (let ((t9-8 (method-of-type ocean generate-verts))) + (-> obj verts) + (-> obj heights) + (t9-8) + ) + (let* ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (s5-2 (-> s4-0 base)) + ) + (if (-> *time-of-day-context* sky) + (ocean-method-89 obj s4-0) + ) + (draw-ocean-texture obj s4-0 (the-as int (-> obj verts))) + (ocean-method-79 obj s4-0) + (init-buffer! obj s4-0) + (if (-> obj far-on) + (draw-ocean-far obj s4-0) + ) + (if (not (-> obj mid-off)) + (draw-ocean-mid obj s4-0) + ) + (end-buffer! obj s4-0) + (set-dirty-mask! (-> *level* default-level) 9 #xc0000 #x2a000) + (let ((a3-3 (-> s4-0 base))) + (let ((v1-87 (the-as object (-> s4-0 base)))) + (set! (-> (the-as dma-packet v1-87) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-87) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-87) vif1) (new 'static 'vif-tag)) + (set! (-> s4-0 base) (&+ (the-as pointer v1-87) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id bucket-6) + s5-2 + (the-as (pointer dma-tag) a3-3) + ) + ) + ) + (when (not (or (-> obj near-off) + (or (-> obj mid-off) (< 196608.0 (fabs (- (-> obj start-corner y) (-> *math-camera* trans y))))) + ) + ) + (let* ((s4-1 (-> *display* frames (-> *display* on-screen) global-buf)) + (s5-3 (-> s4-1 base)) + ) + (draw-ocean-texture obj s4-1 (the-as int (-> obj verts))) + (draw-ocean-near obj s4-1) + (end-buffer! obj s4-1) + (set-dirty-mask! (-> *level* default-level) 7 #xc0000 #x2a000) + (let ((a3-5 (-> s4-1 base))) + (let ((v1-113 (the-as object (-> s4-1 base)))) + (set! (-> (the-as dma-packet v1-113) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-113) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-113) vif1) (new 'static 'vif-tag)) + (set! (-> s4-1 base) (&+ (the-as pointer v1-113) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id bucket-310) + s5-3 + (the-as (pointer dma-tag) a3-5) + ) + ) + ) + ) + ) + ) + (when (not (paused?)) + (set! (-> obj off) #f) + (set! (-> obj mid-off) #f) + (set! (-> obj near-off) (if obj + (not (-> obj ocean-near-translucent?)) + #f + ) + ) + ) + 0 + (none) + ) + ) + +(defmethod draw! ocean ((obj ocean)) + (do-tex-scroll! obj) + (set! *ocean-map* #f) + (set! (-> obj far-on) #f) + (dotimes (v1-2 (-> *level* length)) + (let ((a0-5 (-> *level* level v1-2))) + (when (= (-> a0-5 status) 'active) + (if (-> a0-5 info ocean-far?) + (set! (-> obj far-on) #t) + ) + (let ((a1-7 (-> a0-5 info ocean))) + (cond + ((= a1-7 'none) + (when (-> a0-5 meta-inside?) + (set! *ocean-map* #f) + (goto cfg-17) + ) + ) + ((and a1-7 (nonzero? (-> a1-7 value))) + (set! *ocean-map* (the-as ocean-map (-> a1-7 value))) + (set! (-> obj ocean-near-translucent?) (-> a0-5 info ocean-near-translucent?)) + ) + ) + ) + ) + ) + ) + (label cfg-17) + (if *ocean-map* + (mem-copy! (the-as pointer obj) (the-as pointer *ocean-map*) 56) + ) + (let ((v1-9 (new 'stack-no-clear 'vector))) + (if (-> *time-of-day-context* use-camera-other) + (set! (-> v1-9 quad) (-> *math-camera* inv-camera-rot-other vector 2 quad)) + (set! (-> v1-9 quad) (-> *math-camera* inv-camera-rot vector 2 quad)) + ) + (cond + ((< (fabs (-> v1-9 z)) (fabs (-> v1-9 x))) + (if (< (-> v1-9 x) 0.0) + (set! (-> obj ocean-facing) (the-as uint 3)) + (set! (-> obj ocean-facing) (the-as uint 2)) + ) + ) + ((< (-> v1-9 z) 0.0) + (set! (-> obj ocean-facing) (the-as uint 0)) + 0 + ) + (else + (set! (-> obj ocean-facing) (the-as uint 1)) + ) + ) + ) + 0 + (none) + ) diff --git a/goal_src/jak2/engine/gfx/sprite/particles/sparticle-launcher.gc b/goal_src/jak2/engine/gfx/sprite/particles/sparticle-launcher.gc index 14bc15016a..bf4534dcaa 100644 --- a/goal_src/jak2/engine/gfx/sprite/particles/sparticle-launcher.gc +++ b/goal_src/jak2/engine/gfx/sprite/particles/sparticle-launcher.gc @@ -1828,9 +1828,7 @@ ) (defun birth-func-ocean-height ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) - (set! (-> arg2 vector 0 y) - (+ (ocean-method-11 *ocean* (the-as vector (-> arg2 vector)) #t) (-> arg1 user-float)) - ) + (set! (-> arg2 vector 0 y) (+ (get-height *ocean* (the-as vector (-> arg2 vector)) #t) (-> arg1 user-float))) 0 (none) ) diff --git a/test/decompiler/reference/jak2/engine/common_objs/rigid-body-plat_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/rigid-body-plat_REF.gc index 4c2373854d..e0e6bb89ae 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/rigid-body-plat_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/rigid-body-plat_REF.gc @@ -1,5 +1,7 @@ +;;-*-Lisp-*- (in-package goal) +;; definition of type rigid-body-platform-constants (deftype rigid-body-platform-constants (rigid-body-object-constants) ((drag-factor float :offset-assert 208) (buoyancy-factor float :offset-assert 212) @@ -20,6 +22,7 @@ :flag-assert #x900000108 ) +;; definition for method 3 of type rigid-body-platform-constants (defmethod inspect rigid-body-platform-constants ((obj rigid-body-platform-constants)) (when (not obj) (set! obj obj) @@ -62,6 +65,7 @@ obj ) +;; definition of type rigid-body-control-point (deftype rigid-body-control-point (structure) ((local-pos vector :inline :offset-assert 0) (world-pos vector :inline :offset-assert 16) @@ -72,6 +76,7 @@ :flag-assert #x900000030 ) +;; definition for method 3 of type rigid-body-control-point (defmethod inspect rigid-body-control-point ((obj rigid-body-control-point)) (when (not obj) (set! obj obj) @@ -85,6 +90,7 @@ obj ) +;; definition of type rigid-body-control-point-inline-array (deftype rigid-body-control-point-inline-array (inline-array-class) ((data rigid-body-control-point :inline :dynamic :offset-assert 16) ) @@ -93,6 +99,7 @@ :flag-assert #x900000010 ) +;; definition for method 3 of type rigid-body-control-point-inline-array (defmethod inspect rigid-body-control-point-inline-array ((obj rigid-body-control-point-inline-array)) (when (not obj) (set! obj obj) @@ -106,8 +113,10 @@ obj ) +;; failed to figure out what this is: (set! (-> rigid-body-control-point-inline-array heap-base) (the-as uint 48)) +;; definition of type rigid-body-platform (deftype rigid-body-platform (rigid-body-object) ((info-override rigid-body-platform-constants :offset 204) (control-point-array rigid-body-control-point-inline-array :offset-assert 272) @@ -130,6 +139,7 @@ ) ) +;; definition for method 3 of type rigid-body-platform (defmethod inspect rigid-body-platform ((obj rigid-body-platform)) (when (not obj) (set! obj obj) @@ -150,6 +160,8 @@ obj ) +;; definition for method 7 of type rigid-body-platform +;; WARN: Return type mismatch rigid-body-object vs rigid-body-platform. (defmethod relocate rigid-body-platform ((obj rigid-body-platform) (new-addr int)) (if (nonzero? (-> obj control-point-array)) (&+! (-> obj control-point-array) new-addr) @@ -163,6 +175,7 @@ ) ) +;; definition for method 53 of type rigid-body-platform (defmethod rigid-body-platform-method-53 rigid-body-platform ((obj rigid-body-platform) (arg0 vector)) (local-vars (f0-1 object)) (let ((v1-0 (-> obj water-anim))) @@ -180,7 +193,7 @@ f0-1 ) (else - (ocean-method-11 *ocean* arg0 #t) + (get-height *ocean* arg0 #t) ) ) ) @@ -188,6 +201,8 @@ (the-as float f0-1) ) +;; definition for method 54 of type rigid-body-platform +;; WARN: Return type mismatch int vs none. (defmethod rigid-body-platform-method-54 rigid-body-platform ((obj rigid-body-platform) (ctrl-point rigid-body-control-point)) (set! (-> ctrl-point world-pos w) (+ (rigid-body-platform-method-53 obj (-> ctrl-point world-pos)) (-> obj float-height-offset)) @@ -225,6 +240,8 @@ (none) ) +;; definition for method 50 of type rigid-body-platform +;; WARN: Return type mismatch int vs none. (defmethod rigid-body-object-method-50 rigid-body-platform ((obj rigid-body-platform) (arg0 float)) (when (logtest? (-> obj flags) (rigid-body-object-flag player-impulse-force player-contact-force)) (if (logtest? (-> obj flags) (rigid-body-object-flag player-impulse-force)) @@ -242,6 +259,8 @@ (none) ) +;; definition for method 55 of type rigid-body-platform +;; WARN: Return type mismatch int vs none. (defmethod rigid-body-platform-method-55 rigid-body-platform ((obj rigid-body-platform)) (let ((a1-0 (new 'stack-no-clear 'vector))) (vector-float*! a1-0 *y-vector* (* -1.0 (-> obj info-override gravity) (-> obj rbody state info mass))) @@ -251,6 +270,8 @@ (none) ) +;; definition for method 56 of type rigid-body-platform +;; WARN: Return type mismatch int vs none. (defmethod rigid-body-platform-method-56 rigid-body-platform ((obj rigid-body-platform) (arg0 vector)) (let ((v1-0 (new 'stack-no-clear 'vector))) (vector-! v1-0 arg0 (-> obj rbody state position)) @@ -268,6 +289,8 @@ (none) ) +;; definition for method 29 of type rigid-body-platform +;; WARN: Return type mismatch int vs none. (defmethod rigid-body-object-method-29 rigid-body-platform ((obj rigid-body-platform) (arg0 float)) (let ((s4-0 (-> obj rbody state matrix))) (dotimes (s3-0 (-> obj info-override control-point-count)) @@ -289,6 +312,9 @@ (none) ) +;; definition for method 30 of type rigid-body-platform +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. (defmethod rigid-body-object-method-30 rigid-body-platform ((obj rigid-body-platform)) (if (-> obj info-override platform) ((method-of-object (-> obj root-override-2) collide-shape-method-35)) @@ -306,11 +332,14 @@ (none) ) +;; definition for method 47 of type rigid-body-platform (defmethod rigid-body-object-method-47 rigid-body-platform ((obj rigid-body-platform) (arg0 process-drawable) (arg1 attack-info) (arg2 object) (arg3 penetrate)) ((method-of-type rigid-body-object rigid-body-object-method-47) obj arg0 arg1 arg2 arg3) #f ) +;; definition for method 46 of type rigid-body-platform +;; INFO: Used lq/sq (defmethod rigid-body-object-method-46 rigid-body-platform ((obj rigid-body-platform) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('edge-grabbed) @@ -394,6 +423,7 @@ (none) ) +;; definition for method 37 of type rigid-body-platform (defmethod rigid-body-object-method-37 rigid-body-platform ((obj rigid-body-platform)) (if (logtest? (-> obj flags) (rigid-body-object-flag player-impulse-force)) (sound-play-by-name @@ -417,6 +447,9 @@ (none) ) +;; definition for method 31 of type rigid-body-platform +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. (defmethod rigid-body-object-method-31 rigid-body-platform ((obj rigid-body-platform) (arg0 rigid-body-object-constants)) (with-pp (set! (-> obj info-override) (the-as rigid-body-platform-constants arg0)) @@ -445,6 +478,8 @@ ) ) +;; definition for method 32 of type rigid-body-platform +;; WARN: Return type mismatch int vs none. (defmethod rigid-body-object-method-32 rigid-body-platform ((obj rigid-body-platform)) (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) @@ -471,6 +506,7 @@ (none) ) +;; definition for symbol *rigid-body-platform-constants*, type rigid-body-platform-constants (define *rigid-body-platform-constants* (new 'static 'rigid-body-platform-constants :mass 2.0 :inv-mass 0.5 @@ -503,6 +539,8 @@ ) ) +;; definition for method 33 of type rigid-body-platform +;; WARN: Return type mismatch int vs none. (defmethod rigid-body-object-method-33 rigid-body-platform ((obj rigid-body-platform)) (set! (-> obj float-height-offset) 0.0) (rigid-body-object-method-31 obj *rigid-body-platform-constants*) @@ -522,6 +560,8 @@ (none) ) +;; definition for method 11 of type rigid-body-platform +;; WARN: Return type mismatch int vs none. (defmethod init-from-entity! rigid-body-platform ((obj rigid-body-platform) (arg0 entity-actor)) (set! (-> obj mask) (logior (process-mask platform) (-> obj mask))) (rigid-body-object-method-32 obj) diff --git a/test/decompiler/reference/jak2/engine/common_objs/water_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/water_REF.gc index 142cd755fa..c6dd12977d 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/water_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/water_REF.gc @@ -1505,8 +1505,8 @@ ) (('ocean) (set! (-> arg0 flags) (water-flags active use-ocean)) - (set! (-> arg0 trans y) (ocean-method-11 *ocean* (-> arg0 trans) #f)) - (set! (-> arg0 base-height) (ocean-map-method-10 *ocean-map*)) + (set! (-> arg0 trans y) (get-height *ocean* (-> arg0 trans) #f)) + (set! (-> arg0 base-height) (get-base-height *ocean-map*)) (when (= (-> arg0 trans y) 4095996000.0) (set! (-> arg0 flags) (water-flags)) 0 diff --git a/test/decompiler/reference/jak2/engine/game/settings_REF.gc b/test/decompiler/reference/jak2/engine/game/settings_REF.gc index 97d49e373a..4e029c5539 100644 --- a/test/decompiler/reference/jak2/engine/game/settings_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/settings_REF.gc @@ -1,13 +1,10 @@ -;;-*-Lisp-*- (in-package goal) -;; definition for function get-current-language (defun get-current-language () "Returns the current [[language-enum]]" (-> *setting-control* user-current language) ) -;; definition for method 9 of type user-setting-data (defmethod user-setting-data-method-9 user-setting-data ((obj user-setting-data) (arg0 engine) (arg1 engine-pers) (arg2 engine)) (let ((s3-0 (-> arg1 alive-list))) (while s3-0 @@ -73,7 +70,6 @@ obj ) -;; definition for method 10 of type user-setting-data (defmethod user-setting-data-method-10 user-setting-data ((obj user-setting-data) (arg0 object) (arg1 symbol) (arg2 float) (arg3 uint)) "set-defaults! perhaps?" (case arg0 @@ -476,7 +472,6 @@ obj ) -;; definition for method 9 of type cam-setting-data (defmethod cam-setting-data-method-9 cam-setting-data ((obj cam-setting-data) (arg0 engine) (arg1 engine-pers) (arg2 engine)) (let ((s3-0 (-> arg1 alive-list))) (while s3-0 @@ -542,9 +537,6 @@ obj ) -;; definition for method 10 of type cam-setting-data -;; INFO: Used lq/sq -;; WARN: Return type mismatch cam-setting-data vs none. (defmethod cam-setting-data-method-10 cam-setting-data ((obj cam-setting-data) (arg0 object) (arg1 (pointer process)) (arg2 float) (arg3 int)) (case arg0 (('fov) @@ -803,8 +795,6 @@ (none) ) -;; definition for method 9 of type setting-control -;; WARN: Return type mismatch int vs none. (defmethod add-setting setting-control ((obj setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object)) "Originally called `setting-set` see (anon-function 48 script)" (add-connection (-> obj engine) arg0 arg1 arg2 arg3 arg4) @@ -812,8 +802,6 @@ (none) ) -;; definition for method 11 of type setting-control -;; WARN: Return type mismatch int vs none. (defmethod set-setting setting-control ((obj setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object)) (remove-setting obj arg0 arg1) (add-connection (-> obj engine) arg0 arg1 arg2 arg3 arg4) @@ -821,8 +809,6 @@ (none) ) -;; definition for method 10 of type setting-control -;; WARN: Return type mismatch int vs none. (defmethod persist-with-delay setting-control ((obj setting-control) (arg0 symbol) (arg1 time-frame) (arg2 symbol) (arg3 symbol) (arg4 float) (arg5 int)) "Originally called `setting-pers` see (anon-function 46 script)" (let ((v1-1 (schedule-callback (-> obj engine-pers) arg0 arg1))) @@ -837,8 +823,6 @@ (none) ) -;; definition for method 12 of type setting-control -;; WARN: Return type mismatch int vs none. (defmethod remove-setting setting-control ((obj setting-control) (arg0 process) (arg1 symbol)) (when arg0 (let ((s5-0 (-> obj engine)) @@ -858,8 +842,6 @@ (none) ) -;; definition for method 13 of type setting-control -;; WARN: Return type mismatch int vs none. (defmethod kill-persister setting-control ((obj setting-control) (arg0 engine-pers) (arg1 object)) "Calls [[engine-pers::kill-matching]]" (kill-matching @@ -874,7 +856,6 @@ (none) ) -;; definition for method 14 of type setting-control (defmethod setting-control-method-14 setting-control ((obj setting-control) (arg0 object)) (let ((v1-1 (-> obj engine-hi alive-list next0))) (-> obj engine-hi) @@ -892,8 +873,6 @@ (the-as connectable #f) ) -;; definition for method 15 of type setting-control -;; WARN: Return type mismatch int vs none. (defmethod remove-setting-by-arg0 setting-control ((obj setting-control) (arg0 object)) "Calls [[engine::remove-by-param0]] on `engine-hi`" (remove-by-param0 (-> obj engine-hi) arg0) @@ -901,14 +880,12 @@ (none) ) -;; definition for method 16 of type setting-control (defmethod set-setting-by-param setting-control ((obj setting-control) (arg0 symbol) (arg1 object) (arg2 object) (arg3 object)) "Same as [[setting-control::set-setting]] but will [[engine::remove-by-param0]] using the symbol provided" (remove-by-param0 (-> obj engine-hi) arg0) (add-connection (-> obj engine-hi) *dproc* arg0 arg1 arg2 arg3) ) -;; definition for method 17 of type setting-control (defmethod apply-settings setting-control ((obj setting-control)) (speech-control-method-11 *speech-control*) (let ((s5-0 (-> obj user-current))) @@ -1067,8 +1044,6 @@ (-> obj user-current) ) -;; definition for method 18 of type setting-control -;; INFO: Used lq/sq (defmethod update setting-control ((obj setting-control)) (local-vars (v1-41 symbol)) (with-pp @@ -1266,13 +1241,13 @@ (let ((v1-137 *ocean*)) (case (-> s5-0 ocean-off) ((#t) - (set! (-> v1-137 off) (the-as basic #t)) + (set! (-> v1-137 off) #t) ) (('mid) - (set! (-> v1-137 mid-off) (the-as basic #t)) + (set! (-> v1-137 mid-off) #t) ) (('near) - (set! (-> v1-137 near-off) (the-as basic #t)) + (set! (-> v1-137 near-off) #t) ) ) ) @@ -1396,7 +1371,6 @@ ) ) -;; failed to figure out what this is: (when (zero? *setting-control*) (kmemopen global "settings") (set! *setting-control* (new 'global 'setting-control 64)) diff --git a/test/decompiler/reference/jak2/engine/gfx/mood/weather-part_REF.gc b/test/decompiler/reference/jak2/engine/gfx/mood/weather-part_REF.gc index 25086bd459..5002bca229 100644 --- a/test/decompiler/reference/jak2/engine/gfx/mood/weather-part_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/mood/weather-part_REF.gc @@ -593,7 +593,7 @@ ) ) ) - (let ((f0-21 (ocean-method-11 *ocean* (-> arg2 x-y-z-sx) #f))) + (let ((f0-21 (get-height *ocean* (-> arg2 x-y-z-sx) #f))) (when (!= f0-21 4095996000.0) (when (< (-> arg1 user-float) f0-21) (set! (-> arg1 user-float) f0-21) diff --git a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-h_REF.gc index 519e55e7a1..3f9d3e482f 100644 --- a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-h_REF.gc @@ -1,5 +1,7 @@ +;;-*-Lisp-*- (in-package goal) +;; definition of type ocean-corner (deftype ocean-corner (structure) ((bsphere sphere :inline :offset-assert 0) (start-corner vector :inline :offset-assert 16) @@ -12,6 +14,7 @@ :flag-assert #x900000050 ) +;; definition for method 3 of type ocean-corner (defmethod inspect ocean-corner ((obj ocean-corner)) (when (not obj) (set! obj obj) @@ -27,6 +30,7 @@ obj ) +;; definition of type ocean-wave-info (deftype ocean-wave-info (structure) ((frequency float :offset-assert 0) (amplitude float :offset-assert 4) @@ -42,6 +46,7 @@ :flag-assert #x900000020 ) +;; definition for method 3 of type ocean-wave-info (defmethod inspect ocean-wave-info ((obj ocean-wave-info)) (when (not obj) (set! obj obj) @@ -60,6 +65,7 @@ obj ) +;; definition of type ocean-vertex (deftype ocean-vertex (structure) ((pos vector :inline :offset-assert 0) (stq vector :inline :offset-assert 16) @@ -70,6 +76,7 @@ :flag-assert #x900000030 ) +;; definition for method 3 of type ocean-vertex (defmethod inspect ocean-vertex ((obj ocean-vertex)) (when (not obj) (set! obj obj) @@ -83,6 +90,7 @@ obj ) +;; definition of type ocean-spheres (deftype ocean-spheres (structure) ((spheres sphere 36 :inline :offset-assert 0) ) @@ -91,6 +99,7 @@ :flag-assert #x900000240 ) +;; definition for method 3 of type ocean-spheres (defmethod inspect ocean-spheres ((obj ocean-spheres)) (when (not obj) (set! obj obj) @@ -102,6 +111,7 @@ obj ) +;; definition of type ocean-colors (deftype ocean-colors (structure) ((colors rgba 2548 :offset-assert 0) ) @@ -110,6 +120,7 @@ :flag-assert #x9000027d0 ) +;; definition for method 3 of type ocean-colors (defmethod inspect ocean-colors ((obj ocean-colors)) (when (not obj) (set! obj obj) @@ -121,6 +132,7 @@ obj ) +;; definition of type ocean-colors-float (deftype ocean-colors-float (structure) ((colors vector 2548 :inline :offset-assert 0) ) @@ -129,6 +141,7 @@ :flag-assert #x900009f40 ) +;; definition for method 3 of type ocean-colors-float (defmethod inspect ocean-colors-float ((obj ocean-colors-float)) (when (not obj) (set! obj obj) @@ -140,6 +153,7 @@ obj ) +;; definition of type ocean-mid-mask (deftype ocean-mid-mask (structure) ((mask uint8 8 :offset-assert 0) (dword uint64 :offset 0) @@ -150,6 +164,7 @@ :flag-assert #x900000008 ) +;; definition for method 3 of type ocean-mid-mask (defmethod inspect ocean-mid-mask ((obj ocean-mid-mask)) (when (not obj) (set! obj obj) @@ -162,6 +177,7 @@ obj ) +;; definition of type ocean-mid-indices (deftype ocean-mid-indices (basic) ((data uint16 36 :offset-assert 4) ) @@ -170,6 +186,7 @@ :flag-assert #x90000004c ) +;; definition for method 3 of type ocean-mid-indices (defmethod inspect ocean-mid-indices ((obj ocean-mid-indices)) (when (not obj) (set! obj obj) @@ -181,6 +198,7 @@ obj ) +;; definition of type ocean-mid-masks (deftype ocean-mid-masks (basic) ((data (inline-array ocean-mid-mask) :offset-assert 4) ) @@ -189,6 +207,7 @@ :flag-assert #x900000008 ) +;; definition for method 3 of type ocean-mid-masks (defmethod inspect ocean-mid-masks ((obj ocean-mid-masks)) (when (not obj) (set! obj obj) @@ -200,6 +219,7 @@ obj ) +;; definition of type ocean-trans-mask (deftype ocean-trans-mask (structure) ((mask uint8 4 :offset-assert 0) (word int32 :offset 0) @@ -209,6 +229,7 @@ :flag-assert #x900000004 ) +;; definition for method 3 of type ocean-trans-mask (defmethod inspect ocean-trans-mask ((obj ocean-trans-mask)) (when (not obj) (set! obj obj) @@ -221,6 +242,7 @@ obj ) +;; definition of type ocean-trans-index (deftype ocean-trans-index (structure) ((parent int16 :offset-assert 0) (child int16 :offset-assert 2) @@ -231,6 +253,7 @@ :flag-assert #x900000004 ) +;; definition for method 3 of type ocean-trans-index (defmethod inspect ocean-trans-index ((obj ocean-trans-index)) (when (not obj) (set! obj obj) @@ -243,6 +266,7 @@ obj ) +;; definition of type ocean-trans-indices (deftype ocean-trans-indices (basic) ((data ocean-trans-index 2304 :inline :offset-assert 4) ) @@ -251,6 +275,7 @@ :flag-assert #x900002404 ) +;; definition for method 3 of type ocean-trans-indices (defmethod inspect ocean-trans-indices ((obj ocean-trans-indices)) (when (not obj) (set! obj obj) @@ -262,6 +287,7 @@ obj ) +;; definition of type ocean-near-index (deftype ocean-near-index (structure) ((data uint16 16 :offset-assert 0) ) @@ -270,6 +296,7 @@ :flag-assert #x900000020 ) +;; definition for method 3 of type ocean-near-index (defmethod inspect ocean-near-index ((obj ocean-near-index)) (when (not obj) (set! obj obj) @@ -281,6 +308,7 @@ obj ) +;; definition of type ocean-near-indices (deftype ocean-near-indices (basic) ((data (inline-array ocean-near-index) :offset-assert 4) ) @@ -289,6 +317,7 @@ :flag-assert #x900000008 ) +;; definition for method 3 of type ocean-near-indices (defmethod inspect ocean-near-indices ((obj ocean-near-indices)) (when (not obj) (set! obj obj) @@ -300,6 +329,7 @@ obj ) +;; definition of type ocean-near-colors (deftype ocean-near-colors (structure) ((color0 vector :inline :offset-assert 0) (color1 vector :inline :offset-assert 16) @@ -311,6 +341,7 @@ :flag-assert #x900000040 ) +;; definition for method 3 of type ocean-near-colors (defmethod inspect ocean-near-colors ((obj ocean-near-colors)) (when (not obj) (set! obj obj) @@ -325,6 +356,7 @@ obj ) +;; definition of type ocean-trans-strip (deftype ocean-trans-strip (structure) ((verts uint128 10 :offset-assert 0) ) @@ -333,6 +365,7 @@ :flag-assert #x9000000a0 ) +;; definition for method 3 of type ocean-trans-strip (defmethod inspect ocean-trans-strip ((obj ocean-trans-strip)) (when (not obj) (set! obj obj) @@ -344,6 +377,7 @@ obj ) +;; definition of type ocean-trans-strip-array (deftype ocean-trans-strip-array (structure) ((data ocean-trans-strip 4 :inline :offset-assert 0) ) @@ -352,6 +386,7 @@ :flag-assert #x900000280 ) +;; definition for method 3 of type ocean-trans-strip-array (defmethod inspect ocean-trans-strip-array ((obj ocean-trans-strip-array)) (when (not obj) (set! obj obj) @@ -363,6 +398,7 @@ obj ) +;; definition of type ocean-wave-data (deftype ocean-wave-data (structure) ((data uint8 1024 :offset-assert 0) ) @@ -371,6 +407,7 @@ :flag-assert #x900000400 ) +;; definition for method 3 of type ocean-wave-data (defmethod inspect ocean-wave-data ((obj ocean-wave-data)) (when (not obj) (set! obj obj) @@ -382,6 +419,7 @@ obj ) +;; definition of type ocean-wave-frames (deftype ocean-wave-frames (structure) ((frame ocean-wave-data 64 :inline :offset-assert 0) ) @@ -390,6 +428,7 @@ :flag-assert #x900000000 ) +;; definition for method 3 of type ocean-wave-frames (defmethod inspect ocean-wave-frames ((obj ocean-wave-frames)) (when (not obj) (set! obj obj) @@ -401,6 +440,7 @@ obj ) +;; definition of type ocean-texture-constants (deftype ocean-texture-constants (structure) ((giftag gs-gif-tag :inline :offset-assert 0) (buffers vector4w :inline :offset-assert 16) @@ -415,6 +455,7 @@ :flag-assert #x900000070 ) +;; definition for method 3 of type ocean-texture-constants (defmethod inspect ocean-texture-constants ((obj ocean-texture-constants)) (when (not obj) (set! obj obj) @@ -432,6 +473,7 @@ obj ) +;; definition of type ocean-mid-vertex (deftype ocean-mid-vertex (structure) ((stq vector :inline :offset-assert 0) (col vector :inline :offset-assert 16) @@ -442,6 +484,7 @@ :flag-assert #x900000030 ) +;; definition for method 3 of type ocean-mid-vertex (defmethod inspect ocean-mid-vertex ((obj ocean-mid-vertex)) (when (not obj) (set! obj obj) @@ -455,6 +498,7 @@ obj ) +;; definition of type ocean-mid-constants (deftype ocean-mid-constants (structure) ((hmge-scale vector :inline :offset-assert 0) (inv-hmge-scale vector :inline :offset-assert 16) @@ -483,6 +527,7 @@ :flag-assert #x900000240 ) +;; definition for method 3 of type ocean-mid-constants (defmethod inspect ocean-mid-constants ((obj ocean-mid-constants)) (when (not obj) (set! obj obj) @@ -514,6 +559,7 @@ obj ) +;; definition of type ocean-mid-upload (deftype ocean-mid-upload (structure) ((rot matrix :inline :offset-assert 0) (matrix matrix :inline :offset-assert 64) @@ -525,6 +571,7 @@ :flag-assert #x900000760 ) +;; definition for method 3 of type ocean-mid-upload (defmethod inspect ocean-mid-upload ((obj ocean-mid-upload)) (when (not obj) (set! obj obj) @@ -539,6 +586,7 @@ obj ) +;; definition of type ocean-mid-upload2 (deftype ocean-mid-upload2 (structure) ((rot matrix :inline :offset-assert 0) (matrix matrix :inline :offset-assert 64) @@ -558,6 +606,7 @@ :flag-assert #x900000230 ) +;; definition for method 3 of type ocean-mid-upload2 (defmethod inspect ocean-mid-upload2 ((obj ocean-mid-upload2)) (when (not obj) (set! obj obj) @@ -580,6 +629,7 @@ obj ) +;; definition of type ocean-mid-work (deftype ocean-mid-work (structure) ((env0 vector :inline :offset-assert 0) (env1 vector :inline :offset-assert 16) @@ -594,6 +644,7 @@ :flag-assert #x900000160 ) +;; definition for method 3 of type ocean-mid-work (defmethod inspect ocean-mid-work ((obj ocean-mid-work)) (when (not obj) (set! obj obj) @@ -611,6 +662,7 @@ obj ) +;; definition of type ocean-near-constants (deftype ocean-near-constants (structure) ((hmge-scale vector :inline :offset-assert 0) (inv-hmge-scale vector :inline :offset-assert 16) @@ -636,7 +688,7 @@ (drw2-frame qword :inline :offset-assert 464) (drw2-strip gs-gif-tag :inline :offset-assert 480) (drw3-adgif gs-gif-tag :inline :offset-assert 496) - (drw3-frame qword :inline :offset-assert 512) + (drw3-frame gs-adcmd :inline :offset-assert 512) (index-table vector4w 4 :inline :offset-assert 528) ) :method-count-assert 9 @@ -644,6 +696,7 @@ :flag-assert #x900000250 ) +;; definition for method 3 of type ocean-near-constants (defmethod inspect ocean-near-constants ((obj ocean-near-constants)) (when (not obj) (set! obj obj) @@ -680,6 +733,7 @@ obj ) +;; definition of type ocean-near-upload (deftype ocean-near-upload (structure) ((rot matrix :inline :offset-assert 0) (matrix matrix :inline :offset-assert 64) @@ -693,6 +747,7 @@ :flag-assert #x900000100 ) +;; definition for method 3 of type ocean-near-upload (defmethod inspect ocean-near-upload ((obj ocean-near-upload)) (when (not obj) (set! obj obj) @@ -709,6 +764,7 @@ obj ) +;; definition of type ocean-near-vertex (deftype ocean-near-vertex (structure) ((stq vector :inline :offset-assert 0) (clr vector :inline :offset-assert 16) @@ -719,6 +775,7 @@ :flag-assert #x900000030 ) +;; definition for method 3 of type ocean-near-vertex (defmethod inspect ocean-near-vertex ((obj ocean-near-vertex)) (when (not obj) (set! obj obj) @@ -732,6 +789,7 @@ obj ) +;; definition of type ocean-near-work (deftype ocean-near-work (structure) ((verts-ptr vector :inline :offset-assert 0) (indices uint128 16 :offset-assert 16) @@ -741,6 +799,7 @@ :flag-assert #x900000110 ) +;; definition for method 3 of type ocean-near-work (defmethod inspect ocean-near-work ((obj ocean-near-work)) (when (not obj) (set! obj obj) @@ -753,6 +812,7 @@ obj ) +;; definition of type ocean-height-array (deftype ocean-height-array (structure) ((data float 1024 :offset-assert 0) ) @@ -761,6 +821,7 @@ :flag-assert #x900001000 ) +;; definition for method 3 of type ocean-height-array (defmethod inspect ocean-height-array ((obj ocean-height-array)) (when (not obj) (set! obj obj) @@ -772,6 +833,7 @@ obj ) +;; definition of type ocean-vert-array (deftype ocean-vert-array (structure) ((data vector 2048 :inline :offset-assert 0) ) @@ -780,6 +842,7 @@ :flag-assert #x900008000 ) +;; definition for method 3 of type ocean-vert-array (defmethod inspect ocean-vert-array ((obj ocean-vert-array)) (when (not obj) (set! obj obj) @@ -791,6 +854,7 @@ obj ) +;; definition of type ocean-map (deftype ocean-map (structure) ((start-corner vector :inline :offset-assert 0) (far-color vector :inline :offset-assert 16) @@ -806,10 +870,11 @@ :flag-assert #xb00000038 (:methods (set-height! (_type_ float) none 9) - (ocean-map-method-10 (_type_) float 10) + (get-base-height (_type_) float 10) ) ) +;; definition for method 3 of type ocean-map (defmethod inspect ocean-map ((obj ocean-map)) (when (not obj) (set! obj obj) @@ -828,16 +893,17 @@ obj ) +;; definition of type ocean (deftype ocean (ocean-map) - ((off basic :offset-assert 56) - (near-off basic :offset-assert 60) - (mid-off basic :offset-assert 64) - (far-on basic :offset-assert 68) + ((off symbol :offset-assert 56) + (near-off symbol :offset-assert 60) + (mid-off symbol :offset-assert 64) + (far-on symbol :offset-assert 68) (ocean-facing uint32 :offset-assert 72) (heights ocean-height-array :offset-assert 76) (heights2 ocean-height-array :offset-assert 80) (verts ocean-vert-array :offset-assert 84) - (ocean-near-translucent? basic :offset-assert 88) + (ocean-near-translucent? symbol :offset-assert 88) (deltas vector :inline :offset-assert 96) (map-min vector :inline :offset-assert 112) (map-max vector :inline :offset-assert 128) @@ -848,7 +914,7 @@ (mid-mask-ptrs pointer 36 :offset-assert 2240) (mid-camera-masks uint64 36 :offset-assert 2384) (trans-mask-ptrs pointer 64 :offset-assert 2672) - (trans-camera-masks uint32 16 :offset-assert 2928) + (trans-camera-masks ocean-trans-mask 16 :offset-assert 2928) (trans-temp-masks uint32 16 :offset-assert 2992) (sprite-tmpl dma-gif-packet :inline :offset-assert 3056) (sprite-tmpl2 dma-gif-packet :inline :offset-assert 3088) @@ -904,8 +970,8 @@ (temp-maxx uint8 :offset-assert 8045) (temp-minz uint8 :offset-assert 8046) (temp-maxz uint8 :offset-assert 8047) - (tex1 uint64 :offset-assert 8048) - (tex1-near uint64 :offset-assert 8056) + (tex1 gs-tex1 :offset-assert 8048) + (tex1-near gs-tex1 :offset-assert 8056) (corner00 float :offset-assert 8064) (corner01 float :offset-assert 8068) (corner10 float :offset-assert 8072) @@ -928,90 +994,91 @@ :size-assert #x206c :flag-assert #x5c0000206c (:methods - (ocean-method-11 (_type_ vector symbol) float 11) + (get-height (_type_ vector symbol) float 11) (draw! (_type_) none 12) (update-map (_type_) none 13) - (ocean-method-14 () none 14) - (ocean-method-15 () none 15) - (ocean-method-16 () none 16) - (ocean-method-17 () none 17) - (ocean-method-18 (_type_ object object) none 18) - (ocean-method-19 () none 19) - (ocean-method-20 () none 20) - (ocean-method-21 (_type_ float float) float 21) - (ocean-method-22 () none 22) - (ocean-method-23 () none 23) - (ocean-method-24 () none 24) - (ocean-method-25 () none 25) - (ocean-method-26 () none 26) - (ocean-method-27 () none 27) - (ocean-method-28 () none 28) - (ocean-method-29 () none 29) - (ocean-method-30 () none 30) - (ocean-method-31 () none 31) - (ocean-method-32 () none 32) - (ocean-method-33 () none 33) - (ocean-method-34 () none 34) - (ocean-method-35 () none 35) - (ocean-method-36 () none 36) - (ocean-method-37 () none 37) - (ocean-method-38 () none 38) - (ocean-method-39 () none 39) - (ocean-method-40 () none 40) - (ocean-method-41 () none 41) - (ocean-method-42 () none 42) - (ocean-method-43 () none 43) - (ocean-method-44 () none 44) - (ocean-method-45 () none 45) - (ocean-method-46 () none 46) - (ocean-method-47 () none 47) - (ocean-method-48 () none 48) - (ocean-method-49 () none 49) - (ocean-method-50 () none 50) - (ocean-method-51 () none 51) - (ocean-method-52 () none 52) - (ocean-method-53 () none 53) - (ocean-method-54 () none 54) - (ocean-method-55 () none 55) - (ocean-method-56 () none 56) - (ocean-method-57 () none 57) - (ocean-method-58 () none 58) - (ocean-method-59 () none 59) - (ocean-method-60 () none 60) - (ocean-method-61 () none 61) - (ocean-method-62 () none 62) - (ocean-method-63 () none 63) - (ocean-method-64 () none 64) - (ocean-method-65 () none 65) - (ocean-method-66 () none 66) - (ocean-method-67 () none 67) - (ocean-method-68 () none 68) - (ocean-method-69 () none 69) - (ocean-method-70 () none 70) - (ocean-method-71 () none 71) - (ocean-method-72 () none 72) - (ocean-method-73 () none 73) - (ocean-method-74 () none 74) - (ocean-method-75 () none 75) - (ocean-method-76 () none 76) - (ocean-method-77 () none 77) - (ocean-method-78 () none 78) - (ocean-method-79 () none 79) - (ocean-method-80 () none 80) - (ocean-method-81 () none 81) - (ocean-method-82 () none 82) - (ocean-method-83 () none 83) - (ocean-method-84 () none 84) - (ocean-method-85 () none 85) - (ocean-method-86 () none 86) - (ocean-method-87 () none 87) - (ocean-method-88 () none 88) - (ocean-method-89 () none 89) - (ocean-method-90 () none 90) - (ocean-method-91 () none 91) + (interp-wave (_type_ ocean-wave-info uint float) none 14) + (ocean-method-15 (_type_ matrix matrix) none 15) + (generate-verts () none 16) + (add-colors! (_type_ vector ocean-vertex) none 17) + (ocean-method-18 (_type_ (pointer ocean-colors) (pointer ocean-colors)) none 18) + (init-buffer! (_type_ dma-buffer) pointer 19) + (end-buffer! (_type_ dma-buffer) none 20) + (set-corners! (_type_ float float) float 21) + (ocean-near-add-call (_type_ dma-buffer int) none 22) + (ocean-near-add-call-flush (_type_ dma-buffer int) none 23) + (ocean-near-setup-constants (_type_ ocean-near-constants) none 24) + (ocean-near-add-constants (_type_ dma-buffer) none 25) + (ocean-near-add-heights (_type_ dma-buffer) none 26) + (ocean-near-add-matrices (_type_ dma-buffer vector) none 27) + (ocean-near-add-upload (_type_ dma-buffer uint uint) none 28) + (draw-ocean-near (_type_ dma-buffer) none 29) + (ocean-trans-camera-masks-bit? (_type_ uint uint) symbol 30) + (ocean-trans-mask-ptrs-bit? (_type_ int int) symbol 31) + (ocean-trans-mask-ptrs-set! (_type_ uint uint) symbol 32) + (ocean-trans-add-upload-table (_type_ dma-buffer uint uint int int symbol) none 33) + (ocean-trans-add-upload-strip (_type_ dma-buffer uint uint int int int) none 34) + (ocean-transition-check (_type_ ocean-trans-mask int int vector) none 35) + (ocean-make-trans-camera-masks (_type_ uint uint uint uint) none 36) + (ocean-trans-add-upload (_type_ dma-buffer uint uint) none 37) + (draw-ocean-transition-seams (_type_ dma-buffer) none 38) + (ocean-trans-add-constants (_type_ dma-buffer) none 39) + (draw-ocean-transition (_type_ dma-buffer) none 40) + (ocean-mid-add-call (_type_ dma-buffer int) none 41) + (ocean-mid-add-call-flush (_type_ dma-buffer uint) none 42) + (ocean-matrix*! (_type_ matrix matrix matrix) matrix 43) + (ocean-vector-matrix*! (_type_ vector vector matrix) vector 44) + (ocean-mid-add-matrices (_type_ dma-buffer vector) none 45) + (ocean-mid-check (_type_ pointer int int vector) symbol 46) + (ocean-mid-setup-constants (_type_ ocean-mid-constants) none 47) + (ocean-mid-add-constants (_type_ dma-buffer) none 48) + (ocean-mid-camera-masks-bit? (_type_ uint uint) symbol 49) + (ocean-mid-mask-ptrs-bit? (_type_ uint uint) symbol 50) + (ocean-mid-camera-masks-set! (_type_ uint uint) symbol 51) + (ocean-mid-add-upload (_type_ dma-buffer int int int int float) none 52) + (ocean-mid-add-upload-table (_type_ dma-buffer uint uint (pointer float) int symbol) none 53) + (ocean-mid-add-upload-top (_type_ dma-buffer uint uint) none 54) + (ocean-mid-add-upload-middle (_type_ dma-buffer uint uint) none 55) + (ocean-mid-add-upload-bottom (_type_ dma-buffer uint uint) none 56) + (ocean-seams-add-constants (_type_ dma-buffer) none 57) + (draw-ocean-mid-seams (_type_ dma-buffer) none 58) + (draw-ocean-mid (_type_ dma-buffer) none 59) + (ocean-method-60 (_type_ dma-buffer) none 60) + (ocean-method-61 (_type_ dma-buffer) none 61) + (ocean-method-62 (_type_ dma-buffer) none 62) + (ocean-method-63 (_type_ dma-buffer) none 63) + (ocean-method-64 (_type_ dma-buffer) none 64) + (ocean-method-65 (_type_ dma-buffer) none 65) + (ocean-method-66 (_type_ dma-buffer) none 66) + (ocean-method-67 (_type_ dma-buffer) none 67) + (render-ocean-far (_type_ dma-buffer int) none 68) + (draw-ocean-far (_type_ dma-buffer) none 69) + (ocean-texture-setup-constants (_type_ ocean-texture-constants) none 70) + (ocean-texture-add-constants (_type_ dma-buffer) none 71) + (ocean-texture-add-envmap (_type_ dma-buffer) none 72) + (ocean-texture-add-verts (_type_ dma-buffer int) none 73) + (ocean-texture-add-verts-last (_type_ dma-buffer int int) none 74) + (ocean-texture-add-call-start (_type_ dma-buffer) none 75) + (ocean-texture-add-call-rest (_type_ dma-buffer) none 76) + (ocean-texture-add-call-done (_type_ dma-buffer) none 77) + (draw-ocean-texture (_type_ dma-buffer int) none 78) + (ocean-method-79 (_type_ dma-buffer) none 79) + (ocean-method-80 (_type_ (pointer rgba)) none 80) + (ocean-method-81 (_type_ dma-buffer) none 81) + (draw-envmap-debug (_type_ dma-buffer) none 82) + (ocean-method-83 (_type_ dma-buffer float) none 83) + (ocean-method-84 (_type_ dma-buffer sky-upload-data vector4w float) none 84) + (ocean-method-85 (_type_ dma-buffer) none 85) + (ocean-method-86 (_type_ vector vector vector vector) none 86) + (ocean-method-87 (_type_ vector vector vector) none 87) + (ocean-method-88 (_type_ dma-buffer) none 88) + (ocean-method-89 (_type_ dma-buffer) none 89) + (rgba-to-vector! (_type_ vector (pointer rgba)) none 90) + (do-tex-scroll! (_type_) none 91) ) ) +;; definition for method 3 of type ocean (defmethod inspect ocean ((obj ocean)) (when (not obj) (set! obj obj) @@ -1124,8 +1191,10 @@ obj ) +;; definition for symbol *ocean-map*, type ocean-map (define *ocean-map* (the-as ocean-map #f)) +;; definition for symbol *ocean*, type ocean (define *ocean* (new 'static 'ocean :sprite-tmpl (new 'static 'dma-gif-packet @@ -1458,12 +1527,13 @@ #x80 #x80 ) - :tex1 #xeed00080178 - :tex1-near #xeed0008016c + :tex1 (new 'static 'gs-tex1 :mxl #x6 :mmag #x1 :mmin #x5 :l #x1 :k #xeed) + :tex1-near (new 'static 'gs-tex1 :mxl #x3 :mmag #x1 :mmin #x5 :l #x1 :k #xeed) :scales (new 'static 'vector :x -0.00012207031 :y 255.0 :z -0.00012207031 :w 128.0) :mask-hi (new 'static 'vector4w :x -65536 :y -65536 :z -65536 :w -65536) :mask-lo (new 'static 'vector4w :x #xffff :y #xffff :z #xffff :w #xffff) ) ) +;; failed to figure out what this is: 0 diff --git a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-mid_REF.gc b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-mid_REF.gc new file mode 100644 index 0000000000..8bdc1805e6 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-mid_REF.gc @@ -0,0 +1,1189 @@ +(in-package goal) + +(define ocean-mid-block (new 'static 'vu-function :length #x490 :qlength #x248)) + +(defmethod ocean-mid-setup-constants ocean ((obj ocean) (arg0 ocean-mid-constants)) + (let ((v1-0 *math-camera*)) + (set! (-> arg0 hmge-scale quad) (-> v1-0 hmge-scale quad)) + (set! (-> arg0 inv-hmge-scale quad) (-> v1-0 inv-hmge-scale quad)) + (set! (-> arg0 hvdf-offset quad) (-> v1-0 hvdf-off quad)) + (set-vector! (-> arg0 fog) (-> v1-0 pfog0) (-> v1-0 fog-min) (-> v1-0 fog-max) 3072.0) + ) + (set-vector! (-> arg0 constants) -0.25 -0.5 0.0 393216.0) + (let ((t9-0 matrix-local->world) + (a0-8 #f) + ) + (let* ((s4-0 (-> (t9-0 a0-8) vector 2)) + (f0-12 (- 1.5 (* 0.000015258789 (atan (-> s4-0 x) (-> s4-0 z))))) + (f1-1 (+ 0.5 (* -0.5 (-> s4-0 y)))) + ) + (set-vector! (-> arg0 constants2) f0-12 f1-1 1.0 0.0) + ) + ) + (case *subdivide-ocean-draw-mode* + (((subdivide-setting textured)) + (set! (-> arg0 drw-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :fge #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 env-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 drw-strip-0 tag) + (new 'static 'gif-tag64 + :nloop #x12 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :fge #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 drw-strip-1 tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :fge #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 env-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + (((subdivide-setting outline)) + (set! (-> arg0 drw-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 env-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 drw-strip-0 tag) + (new 'static 'gif-tag64 + :nloop #x12 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 drw-strip-1 tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 env-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + (((subdivide-setting gouraud)) + (set! (-> arg0 drw-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :fge #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 env-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 drw-strip-0 tag) + (new 'static 'gif-tag64 + :nloop #x12 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :fge #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 drw-strip-1 tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :fge #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 env-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1) + :nreg #x3 + ) + ) + ) + (((subdivide-setting hack)) + (set! (-> arg0 drw-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :fge #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 env-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 drw-strip-0 tag) + (new 'static 'gif-tag64 + :nloop #x12 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 drw-strip-1 tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 env-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ) + (set! (-> arg0 drw-fan regs) + (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) + ) + (set! (-> arg0 env-fan regs) + (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) + ) + (set! (-> arg0 drw-strip-0 regs) + (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) + ) + (set! (-> arg0 drw-strip-1 regs) + (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) + ) + (set! (-> arg0 env-strip regs) + (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) + ) + (set! (-> arg0 drw-adgif tag) (new 'static 'gif-tag64 :nloop #x5 :nreg #x1)) + (set! (-> arg0 drw-adgif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d))) + (set! (-> arg0 drw-texture tex0) + (new 'static 'gs-tex0 :tbp0 #x2a0 :tbw #x2 :tcc #x1 :th (log2 128) :tw (log2 128)) + ) + (set! (-> arg0 drw-texture prims 1) (gs-reg64 tex0-1)) + (set! (-> arg0 drw-texture tex1) (-> obj tex1)) + (set! (-> arg0 drw-texture prims 3) (gs-reg64 tex1-1)) + (set! (-> arg0 drw-texture miptbp1) (new 'static 'gs-miptbp :tbp1 #x6a0 :tbw1 #x1 :tbp2 #x7a0 :tbp3 #x7e0)) + (set! (-> arg0 drw-texture prims 5) (gs-reg64 miptbp1-1)) + (set! (-> arg0 drw-texture clamp) (new 'static 'gs-clamp)) + (set! (-> arg0 drw-texture clamp-reg) (gs-reg64 clamp-1)) + (set! (-> arg0 drw-texture alpha) (the-as gs-alpha #x8400082000800)) + (set! (-> arg0 drw-texture prims 9) (gs-reg64 miptbp2-1)) + (set! (-> arg0 env-adgif tag) (new 'static 'gif-tag64 :nloop #x5 :nreg #x1)) + (set! (-> arg0 env-adgif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d))) + (cond + ((-> *time-of-day-context* sky) + (set! (-> arg0 env-texture tex0) (new 'static 'gs-tex0 + :tbw #x1 + :tcc #x1 + :th (log2 64) + :tw (log2 64) + :tbp0 (-> *ocean-envmap-texture-base* vram-block) + ) + ) + (set! (-> arg0 env-texture prims 1) (gs-reg64 tex0-1)) + (set! (-> arg0 env-texture tex1) (new 'static 'gs-tex1 :mmag #x1 :mmin #x5 :l #x1 :k #xeed)) + (set! (-> arg0 env-texture prims 3) (gs-reg64 tex1-1)) + (set! (-> arg0 env-texture miptbp1) (new 'static 'gs-miptbp)) + (set! (-> arg0 env-texture prims 5) (gs-reg64 miptbp1-1)) + (set! (-> arg0 env-texture clamp) (new 'static 'gs-clamp)) + (set! (-> arg0 env-texture clamp-reg) (gs-reg64 clamp-1)) + (set! (-> arg0 env-texture alpha) (new 'static 'gs-alpha :b #x2 :c #x1 :d #x1)) + (set! (-> arg0 env-texture prims 9) (gs-reg64 alpha-1)) + ) + (else + (let ((s4-3 (-> arg0 env-texture))) + (adgif-shader<-texture-simple! s4-3 (lookup-texture-by-id (new 'static 'texture-id :page #x1f))) + ) + (set! (-> arg0 env-texture clamp) (new 'static 'gs-clamp)) + (set! (-> arg0 env-texture alpha) (new 'static 'gs-alpha :b #x2 :c #x1 :d #x1)) + ) + ) + (let ((f0-16 (* 128.0 (-> *time-of-day-context* ocean-alpha)))) + (if (-> *time-of-day-context* sky) + (set-vector! (-> arg0 env-color) f0-16 f0-16 f0-16 f0-16) + (set-vector! (-> arg0 env-color) f0-16 f0-16 (* 0.5 f0-16) f0-16) + ) + ) + (set-vector! (-> arg0 index-table 0) 63 84 66 0) + (set-vector! (-> arg0 index-table 1) 54 72 57 0) + (set-vector! (-> arg0 index-table 2) 45 60 48 0) + (set-vector! (-> arg0 index-table 3) 36 48 39 0) + (set-vector! (-> arg0 index-table 4) 27 36 30 0) + (set-vector! (-> arg0 index-table 5) 18 24 21 0) + (set-vector! (-> arg0 index-table 6) 9 12 12 0) + (set-vector! (-> arg0 index-table 7) 0 0 3 0) + (set-vector! (-> arg0 pos0) 0.0 0.0 0.0 1.0) + (set-vector! (-> arg0 pos1) 393216.0 0.0 0.0 1.0) + (set-vector! (-> arg0 pos2) 0.0 0.0 393216.0 1.0) + (set-vector! (-> arg0 pos3) 393216.0 0.0 393216.0 1.0) + 0 + (none) + ) + +(defmethod ocean-mid-add-constants ocean ((obj ocean) (arg0 dma-buffer)) + (let* ((a2-0 36) + (v1-0 arg0) + (a1-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a1-1) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a2-0)) + (set! (-> (the-as dma-packet a1-1) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a1-1) vif1) + (new 'static 'vif-tag :imm #x2dd :cmd (vif-cmd unpack-v4-32) :num a2-0) + ) + (set! (-> v1-0 base) (&+ (the-as pointer a1-1) 16)) + ) + (ocean-mid-setup-constants obj (the-as ocean-mid-constants (-> arg0 base))) + (&+! (-> arg0 base) 576) + 0 + (none) + ) + +(defmethod ocean-matrix*! ocean ((obj ocean) (arg0 matrix) (arg1 matrix) (arg2 matrix)) + (rlet ((acc :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf12 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf) + ) + (.lvf vf1 (&-> arg1 vector 0 quad)) + (.lvf vf5 (&-> arg2 vector 0 quad)) + (.lvf vf6 (&-> arg2 vector 1 quad)) + (.lvf vf7 (&-> arg2 vector 2 quad)) + (.lvf vf8 (&-> arg2 trans quad)) + (.lvf vf2 (&-> arg1 vector 1 quad)) + (.lvf vf3 (&-> arg1 vector 2 quad)) + (.lvf vf4 (&-> arg1 trans quad)) + (.mul.x.vf acc vf5 vf1) + (.add.mul.y.vf acc vf6 vf1 acc) + (.add.mul.z.vf acc vf7 vf1 acc) + (.add.mul.w.vf vf9 vf8 vf1 acc) + (.mul.x.vf acc vf5 vf2) + (.add.mul.y.vf acc vf6 vf2 acc) + (.add.mul.z.vf acc vf7 vf2 acc) + (.add.mul.w.vf vf10 vf8 vf2 acc) + (.mul.x.vf acc vf5 vf3) + (.add.mul.y.vf acc vf6 vf3 acc) + (.add.mul.z.vf acc vf7 vf3 acc) + (.add.mul.w.vf vf11 vf8 vf3 acc) + (.mul.x.vf acc vf5 vf4) + (.add.mul.y.vf acc vf6 vf4 acc) + (.add.mul.z.vf acc vf7 vf4 acc) + (.add.mul.w.vf vf12 vf8 vf4 acc) + (.svf (&-> arg0 vector 0 quad) vf9) + (.svf (&-> arg0 vector 1 quad) vf10) + (.svf (&-> arg0 vector 2 quad) vf11) + (.svf (&-> arg0 trans quad) vf12) + arg0 + ) + ) + +(defmethod ocean-vector-matrix*! ocean ((obj ocean) (arg0 vector) (arg1 vector) (arg2 matrix)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg2 vector 0 quad)) + (.lvf vf2 (&-> arg2 vector 1 quad)) + (.lvf vf3 (&-> arg2 vector 2 quad)) + (.lvf vf4 (&-> arg2 trans quad)) + (.lvf vf5 (&-> arg1 quad)) + (.mul.x.vf acc vf1 vf5) + (.add.mul.y.vf acc vf2 vf5 acc) + (.add.mul.z.vf acc vf3 vf5 acc) + (.add.mul.w.vf vf5 vf4 vf0 acc) + (.svf (&-> arg0 quad) vf5) + arg0 + ) + ) + +(defmethod ocean-mid-add-matrices ocean ((obj ocean) (arg0 dma-buffer) (arg1 vector)) + (let ((s4-0 (new-stack-vector0)) + (v1-3 (if (-> *time-of-day-context* use-camera-other) + (-> *math-camera* camera-rot-other) + (-> *math-camera* camera-rot) + ) + ) + ) + (let* ((a3-0 8) + (a0-1 arg0) + (a1-1 (the-as object (-> a0-1 base))) + ) + (set! (-> (the-as dma-packet a1-1) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a3-0)) + (set! (-> (the-as dma-packet a1-1) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a1-1) vif1) + (new 'static 'vif-tag :imm #x8000 :cmd (vif-cmd unpack-v4-32) :num a3-0) + ) + (set! (-> a0-1 base) (&+ (the-as pointer a1-1) 16)) + ) + (let ((s3-0 (the-as object (-> arg0 base)))) + (let* ((t0-4 (the-as matrix s3-0)) + (t1-2 v1-3) + (a0-2 (-> t1-2 vector 0 quad)) + (a1-3 (-> t1-2 vector 1 quad)) + (a3-4 (-> t1-2 vector 2 quad)) + (t1-3 (-> t1-2 trans quad)) + ) + (set! (-> t0-4 vector 0 quad) a0-2) + (set! (-> t0-4 vector 1 quad) a1-3) + (set! (-> t0-4 vector 2 quad) a3-4) + (set! (-> t0-4 trans quad) t1-3) + ) + (let ((s2-0 (the-as object (&+ (the-as pointer s3-0) 48)))) + (vector-matrix*! s4-0 arg1 v1-3) + (set! (-> (the-as vector s2-0) x) (-> s4-0 x)) + (set! (-> (the-as vector s2-0) y) (-> s4-0 y)) + (set! (-> (the-as vector s2-0) z) (-> s4-0 z)) + ) + (let ((a1-5 (&+ (-> arg0 base) 64))) + (ocean-matrix*! obj (the-as matrix a1-5) (the-as matrix s3-0) (-> *math-camera* perspective)) + ) + ) + ) + (&+! (-> arg0 base) 128) + 0 + (none) + ) + +(defmethod ocean-mid-check ocean ((obj ocean) (arg0 pointer) (arg1 int) (arg2 int) (arg3 vector)) + (local-vars (v0-0 symbol) (v1-10 float) (t0-3 float) (t0-8 float) (t0-13 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (let ((v1-0 (new-stack-vector0)) + (a0-2 (-> *math-camera* trans)) + ) + 1.0 + (set! (-> v1-0 x) (+ (-> arg3 x) (* 393216.0 (the float arg1)))) + (set! (-> v1-0 y) (-> arg3 y)) + (set! (-> v1-0 z) (+ (-> arg3 z) (* 393216.0 (the float arg2)))) + (let ((t0-2 v1-0) + (t1-2 a0-2) + ) + (.lvf vf2 (&-> t0-2 quad)) + (.lvf vf3 (&-> t1-2 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov t0-3 vf1) + (when (< t0-3 309237600000.0) + (logior! (-> (the-as (pointer uint8) (+ arg2 (the-as int arg0)))) (ash 1 arg1)) + (return #f) + ) + (set! (-> v1-0 x) (+ 393216.0 (-> v1-0 x))) + (let ((t0-7 v1-0) + (t1-3 a0-2) + ) + (.lvf vf2 (&-> t0-7 quad)) + (.lvf vf3 (&-> t1-3 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov t0-8 vf1) + (when (< t0-8 309237600000.0) + (logior! (-> (the-as (pointer uint8) (+ arg2 (the-as int arg0)))) (ash 1 arg1)) + (return #f) + ) + (set! (-> v1-0 z) (+ 393216.0 (-> v1-0 z))) + (let ((t0-12 v1-0) + (t1-4 a0-2) + ) + (.lvf vf2 (&-> t0-12 quad)) + (.lvf vf3 (&-> t1-4 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov t0-13 vf1) + (when (< t0-13 309237600000.0) + (logior! (-> (the-as (pointer uint8) (+ arg2 (the-as int arg0)))) (ash 1 arg1)) + (return #f) + ) + (set! (-> v1-0 x) (+ -393216.0 (-> v1-0 x))) + (.lvf vf2 (&-> v1-0 quad)) + (.lvf vf3 (&-> a0-2 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov v1-10 vf1) + (when (< v1-10 309237600000.0) + (logior! (-> (the-as (pointer uint8) (+ arg2 (the-as int arg0)))) (ash 1 arg1)) + (return #f) + v0-0 + ) + ) + ) + +(defmethod ocean-mid-add-call ocean ((obj ocean) (arg0 dma-buffer) (arg1 int)) + (let* ((v1-0 arg0) + (a0-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a0-1) vif1) (new 'static 'vif-tag :cmd (vif-cmd mscalf) :msk #x1 :imm arg1)) + (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) + ) + 0 + (none) + ) + +(defmethod ocean-mid-add-call-flush ocean ((obj ocean) (arg0 dma-buffer) (arg1 uint)) + (let* ((v1-0 arg0) + (a0-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag :cmd (vif-cmd mscalf) :msk #x1 :imm arg1)) + (set! (-> (the-as dma-packet a0-1) vif1) (new 'static 'vif-tag :cmd (vif-cmd flusha) :msk #x1)) + (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) + ) + 0 + (none) + ) + +(defmethod ocean-mid-add-upload ocean ((obj ocean) (arg0 dma-buffer) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 float)) + (local-vars (sv-32 int)) + (set! sv-32 arg1) + (let ((s0-0 arg2) + (s1-0 arg3) + (s4-0 arg4) + (s2-0 arg5) + (s5-0 (new-stack-vector0)) + ) + (let ((v1-0 (-> obj start-corner))) + (set! (-> s5-0 x) (+ (-> v1-0 x) (* 3145728.0 (the float s0-0)))) + (set! (-> s5-0 y) (-> v1-0 y)) + (set! (-> s5-0 z) (+ (-> v1-0 z) (* 3145728.0 (the float sv-32)))) + ) + (set! (-> s5-0 w) 1.0) + (ocean-mid-add-matrices obj arg0 s5-0) + (let ((v1-6 (+ (the-as uint (-> obj ocean-colors)) (* (+ (* 416 sv-32) (* s0-0 8)) 4)))) + (dotimes (a0-7 9) + (let* ((a1-4 arg0) + (a2-2 (the-as object (-> a1-4 base))) + ) + (set! (-> (the-as dma-packet a2-2) dma) (new 'static 'dma-tag :qwc #x3 :id (dma-tag-id ref) :addr v1-6)) + (set! (-> (the-as dma-packet a2-2) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a2-2) vif1) (new 'static 'vif-tag + :num #xc + :cmd (vif-cmd unpack-v4-8) + :imm (logior (shr (shl (+ (* 12 a0-7) 8) 54) 54) #xc000) + ) + ) + (set! (-> a1-4 base) (&+ (the-as pointer a2-2) 16)) + ) + (+! v1-6 208) + ) + ) + (let* ((a2-4 1) + (v1-9 arg0) + (a0-8 (the-as object (-> v1-9 base))) + ) + (set! (-> (the-as dma-packet a0-8) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a2-4)) + (set! (-> (the-as dma-packet a0-8) vif0) (new 'static 'vif-tag :imm #x204 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a0-8) vif1) + (new 'static 'vif-tag :imm #xc074 :num #x2 :cmd (vif-cmd unpack-v4-8)) + ) + (set! (-> v1-9 base) (&+ (the-as pointer a0-8) 16)) + ) + (let ((v1-10 (-> arg0 base))) + (let ((a0-12 (-> obj ocean-mid-masks data s1-0))) + (set! (-> obj mid-mask-ptrs s4-0) v1-10) + (set! (-> (the-as (pointer uint64) v1-10)) (-> a0-12 dword)) + ) + (set! (-> (the-as (pointer uint64) v1-10) 1) (the-as uint 0)) + ) + (&+! (-> arg0 base) 16) + (when (< s2-0 556091.4) + (let* ((v1-15 (-> *math-camera* trans)) + (s4-1 (&-> obj mid-camera-masks s4-0)) + (s3-1 (+ (the int (* 0.0000025431316 (- (-> v1-15 x) (-> s5-0 x)))) -1)) + (s2-1 (+ (the int (* 0.0000025431316 (- (-> v1-15 z) (-> s5-0 z)))) -1)) + ) + (dotimes (s1-1 3) + (dotimes (s0-1 3) + (let ((a2-7 (+ s0-1 s3-1)) + (a3-6 (+ s1-1 s2-1)) + ) + (if (and (>= a2-7 0) (>= a3-6 0) (< a2-7 8) (< a3-6 8)) + (ocean-mid-check obj s4-1 a2-7 a3-6 s5-0) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + +(defmethod ocean-mid-camera-masks-bit? ocean ((obj ocean) (arg0 uint) (arg1 uint)) + (cond + ((or (< (the-as int arg0) 0) (>= (the-as int arg0) 48) (< (the-as int arg1) 0) (>= (the-as int arg1) 48)) + #t + ) + (else + (let* ((t0-0 (/ (the-as int arg0) 8)) + (a3-3 (/ (the-as int arg1) 8)) + (a1-1 (logand arg0 7)) + (v1-1 (logand arg1 7)) + (a2-3 (+ (* 6 (the-as int t0-0)) a3-3)) + ) + (logtest? (-> (the-as (pointer uint8) (+ (+ a1-1 (* a2-3 8)) (the-as uint obj))) 2384) (ash 1 v1-1)) + ) + ) + ) + ) + +(defmethod ocean-mid-mask-ptrs-bit? ocean ((obj ocean) (arg0 uint) (arg1 uint)) + (cond + ((or (< (the-as int arg0) 0) (>= (the-as int arg0) 48) (< (the-as int arg1) 0) (>= (the-as int arg1) 48)) + #t + ) + (else + (let* ((t0-0 (/ (the-as int arg0) 8)) + (a3-3 (/ (the-as int arg1) 8)) + (a1-1 (logand arg0 7)) + (v1-1 (logand arg1 7)) + (a2-3 (+ (* 6 (the-as int t0-0)) a3-3)) + ) + (if (-> obj mid-mask-ptrs a2-3) + (logtest? (-> (the-as (pointer uint8) (+ a1-1 (the-as uint (-> obj mid-mask-ptrs a2-3))))) (ash 1 v1-1)) + #t + ) + ) + ) + ) + ) + +(defmethod ocean-mid-camera-masks-set! ocean ((obj ocean) (arg0 uint) (arg1 uint)) + (cond + ((or (< (the-as int arg0) 0) (>= (the-as int arg0) 48) (< (the-as int arg1) 0) (>= (the-as int arg1) 48)) + #f + ) + (else + (let* ((t0-0 (/ (the-as int arg0) 8)) + (a3-3 (/ (the-as int arg1) 8)) + (v1-1 (logand arg0 7)) + (a1-1 (logand arg1 7)) + (a3-4 (+ (* 6 (the-as int t0-0)) a3-3)) + (a2-5 (&-> obj mid-camera-masks a3-4)) + ) + (cond + (a2-5 + (cond + ((logtest? (-> (the-as (pointer uint8) (+ v1-1 (the-as uint (-> obj mid-mask-ptrs a3-4))))) (ash 1 a1-1)) + #f + ) + (else + (logior! (-> (the-as (pointer uint8) (+ v1-1 (the-as uint a2-5))) 0) (ash 1 a1-1)) + #t + ) + ) + ) + (else + #f + ) + ) + ) + ) + ) + ) + +(defmethod ocean-mid-add-upload-table ocean ((obj ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint) (arg3 (pointer float)) (arg4 int) (arg5 symbol)) + (local-vars + (v1-13 float) + (a0-20 uint128) + (a0-21 uint128) + (a0-22 uint128) + (a1-13 uint128) + (a1-14 uint128) + (a1-15 uint128) + (a2-16 uint128) + (a3-10 uint128) + ) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (when (ocean-mid-camera-masks-set! obj arg1 arg2) + (let ((a2-2 (new-stack-vector0))) + (let ((v1-3 (-> obj start-corner))) + (set! (-> a2-2 x) (+ (-> v1-3 x) (* 393216.0 (the float arg2)))) + (set! (-> a2-2 y) (-> v1-3 y)) + (set! (-> a2-2 z) (+ (-> v1-3 z) (* 393216.0 (the float arg1)))) + ) + (set! (-> a2-2 w) 1.0) + (ocean-mid-add-matrices obj arg0 a2-2) + ) + (let* ((a1-3 9) + (v1-8 arg0) + (a0-4 (the-as object (-> v1-8 base))) + ) + (set! (-> (the-as dma-packet a0-4) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a1-3)) + (set! (-> (the-as dma-packet a0-4) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a0-4) vif1) + (new 'static 'vif-tag :imm #x8008 :cmd (vif-cmd unpack-v4-32) :num a1-3) + ) + (set! (-> v1-8 base) (&+ (the-as pointer a0-4) 16)) + ) + (set-vector! (the-as vector4w (-> arg0 base)) arg4 0 0 0) + (&+! (-> arg0 base) 16) + (let ((v1-12 (the-as (inline-array vector4w) (-> arg0 base)))) + (set! (-> v1-12 0 quad) (-> *ocean-trans-st-table* 0 quad)) + (set! (-> v1-12 1 quad) (-> *ocean-trans-st-table* 1 quad)) + (set! (-> v1-12 2 quad) (-> *ocean-trans-st-table* 2 quad)) + (set! (-> v1-12 3 quad) (-> *ocean-trans-st-table* 3 quad)) + (let ((a0-19 (the-as uint128 (-> obj ocean-colors colors (+ (* 52 (the-as int arg1)) arg2)))) + (a1-12 (the-as uint128 (-> obj ocean-colors colors (+ arg2 1 (* 52 (the-as int arg1)))))) + (a2-15 (the-as uint128 (-> obj ocean-colors colors (+ (* 52 (the-as int (+ arg1 1))) arg2)))) + (a3-9 (the-as uint128 (-> obj ocean-colors colors (+ arg2 1 (* 52 (the-as int (+ arg1 1))))))) + ) + (.pextlb a0-20 0 a0-19) + (nop!) + (.pextlb a1-13 0 a1-12) + (nop!) + (.pextlb a2-16 0 a2-15) + (nop!) + (.pextlb a3-10 0 a3-9) + ) + (nop!) + (.pextlh a0-21 0 a0-20) + (nop!) + (.pextlh a1-14 0 a1-13) + (.mov vf1 a0-21) + (.pextlh a0-22 0 a2-16) + (.mov vf2 a1-14) + (.pextlh a1-15 0 a3-10) + (.mov vf3 a0-22) + (nop!) + (.mov vf4 a1-15) + (.itof.vf vf1 vf1) + (nop!) + (.itof.vf vf2 vf2) + (nop!) + (.itof.vf vf3 vf3) + (nop!) + (.itof.vf vf4 vf4) + (nop!) + (nop!) + (.svf (&-> v1-12 4 quad) vf1) + (nop!) + (.svf (&-> v1-12 5 quad) vf2) + (nop!) + (.svf (&-> v1-12 6 quad) vf3) + (nop!) + (.svf (&-> v1-12 7 quad) vf4) + ) + (.mov v1-13 vf4) + (&+! (-> arg0 base) 128) + (let* ((v1-16 arg0) + (a0-23 (the-as object (-> v1-16 base))) + ) + (set! (-> (the-as dma-packet a0-23) dma) + (new 'static 'dma-tag :id (dma-tag-id ref) :addr (the-as int arg3) :qwc arg4) + ) + (set! (-> (the-as dma-packet a0-23) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a0-23) vif1) + (new 'static 'vif-tag :imm #x8011 :cmd (vif-cmd unpack-v4-32) :num arg4) + ) + (set! (-> v1-16 base) (&+ (the-as pointer a0-23) 16)) + ) + (if arg5 + (ocean-mid-add-call obj arg0 275) + (ocean-mid-add-call obj arg0 107) + ) + ) + 0 + (none) + ) + ) + +(defmethod ocean-mid-add-upload-top ocean ((obj ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) + (let ((s0-0 (-> obj mid-minx)) + (s2-0 (-> obj mid-maxx)) + (s1-0 (ocean-mid-camera-masks-bit? obj arg1 arg2)) + ) + (cond + ((ocean-mid-mask-ptrs-bit? obj arg1 arg2) + ) + ((= arg2 s0-0) + (cond + (s1-0 + (ocean-mid-add-upload-table obj arg0 (+ arg1 -1) arg2 *ocean-down-table* 7 #t) + (ocean-mid-add-upload-table obj arg0 arg1 (+ arg2 -1) *ocean-right-table* 7 #t) + ) + (else + (let ((s2-1 (ocean-mid-mask-ptrs-bit? obj (+ arg1 1) arg2)) + (v1-12 (ocean-mid-mask-ptrs-bit? obj arg1 (+ arg2 1))) + ) + (cond + ((and s2-1 v1-12) + ) + (s2-1 + (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-right-table* 7 #t) + ) + (v1-12 + (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-down-table* 7 #t) + ) + (else + (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-down-right-table* 10 #f) + ) + ) + ) + ) + ) + ) + ((= arg2 s2-0) + (cond + (s1-0 + (ocean-mid-add-upload-table obj arg0 (+ arg1 -1) arg2 *ocean-down-table* 7 #t) + (ocean-mid-add-upload-table obj arg0 arg1 (+ arg2 1) *ocean-left-table* 7 #t) + ) + (else + (let ((s2-2 (ocean-mid-mask-ptrs-bit? obj (+ arg1 1) arg2)) + (v1-27 (ocean-mid-mask-ptrs-bit? obj arg1 (+ arg2 -1))) + ) + (cond + ((and s2-2 v1-27) + ) + (s2-2 + (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-left-table* 7 #t) + ) + (v1-27 + (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-down-table* 7 #t) + ) + (else + (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-down-left-table* 10 #t) + ) + ) + ) + ) + ) + ) + (s1-0 + (ocean-mid-add-upload-table obj arg0 (+ arg1 -1) arg2 *ocean-down-table* 7 #t) + ) + ) + ) + 0 + (none) + ) + +(defmethod ocean-mid-add-upload-middle ocean ((obj ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) + (let ((s0-0 (-> obj mid-minx)) + (s2-0 (-> obj mid-maxx)) + (s1-0 (ocean-mid-camera-masks-bit? obj arg1 arg2)) + ) + (cond + ((ocean-mid-mask-ptrs-bit? obj arg1 arg2) + ) + ((= arg2 s0-0) + (cond + (s1-0 + (ocean-mid-add-upload-table obj arg0 arg1 (+ arg2 -1) *ocean-right-table* 7 #t) + ) + ((ocean-mid-mask-ptrs-bit? obj arg1 (+ arg2 1)) + ) + (else + (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-right-table* 7 #t) + ) + ) + ) + ((= arg2 s2-0) + (cond + (s1-0 + (ocean-mid-add-upload-table obj arg0 arg1 (+ arg2 1) *ocean-left-table* 7 #t) + ) + ((ocean-mid-mask-ptrs-bit? obj arg1 (+ arg2 -1)) + ) + (else + (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-left-table* 7 #t) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod ocean-mid-add-upload-bottom ocean ((obj ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) + (let ((s0-0 (-> obj mid-minx)) + (s2-0 (-> obj mid-maxx)) + (s1-0 (ocean-mid-camera-masks-bit? obj arg1 arg2)) + ) + (cond + ((ocean-mid-mask-ptrs-bit? obj arg1 arg2) + ) + ((= arg2 s0-0) + (cond + (s1-0 + (ocean-mid-add-upload-table obj arg0 (+ arg1 1) arg2 *ocean-up-table* 7 #t) + (ocean-mid-add-upload-table obj arg0 arg1 (+ arg2 -1) *ocean-right-table* 7 #t) + ) + (else + (let ((s2-1 (ocean-mid-mask-ptrs-bit? obj (+ arg1 -1) arg2)) + (v1-12 (ocean-mid-mask-ptrs-bit? obj arg1 (+ arg2 1))) + ) + (cond + ((and s2-1 v1-12) + ) + (s2-1 + (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-right-table* 7 #t) + ) + (v1-12 + (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-up-table* 7 #t) + ) + (else + (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-up-right-table* 10 #t) + ) + ) + ) + ) + ) + ) + ((= arg2 s2-0) + (cond + (s1-0 + (ocean-mid-add-upload-table obj arg0 (+ arg1 1) arg2 *ocean-up-table* 7 #t) + (ocean-mid-add-upload-table obj arg0 arg1 (+ arg2 1) *ocean-left-table* 7 #t) + ) + (else + (let ((s2-2 (ocean-mid-mask-ptrs-bit? obj (+ arg1 -1) arg2)) + (v1-27 (ocean-mid-mask-ptrs-bit? obj arg1 (+ arg2 -1))) + ) + (cond + ((and s2-2 v1-27) + ) + (s2-2 + (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-left-table* 7 #t) + ) + (v1-27 + (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-up-table* 7 #t) + ) + (else + (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-up-left-table* 10 #f) + ) + ) + ) + ) + ) + ) + (s1-0 + (ocean-mid-add-upload-table obj arg0 (+ arg1 1) arg2 *ocean-up-table* 7 #t) + ) + ) + ) + 0 + (none) + ) + +(defmethod ocean-seams-add-constants ocean ((obj ocean) (arg0 dma-buffer)) + (let* ((a2-0 4) + (v1-0 arg0) + (a0-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a2-0)) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a0-1) vif1) + (new 'static 'vif-tag :imm #x2fd :cmd (vif-cmd unpack-v4-32) :num a2-0) + ) + (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) + ) + (let ((v1-1 (-> arg0 base))) + (set-vector! (the-as vector (&+ v1-1 0)) 0.0 0.0 0.0 1.0) + (set-vector! (the-as vector (&+ v1-1 16)) 393216.0 0.0 0.0 1.0) + (set-vector! (the-as vector (&+ v1-1 32)) 0.0 0.0 393216.0 1.0) + (set-vector! (the-as vector (&+ v1-1 48)) 393216.0 0.0 393216.0 1.0) + ) + (&+! (-> arg0 base) 64) + 0 + (none) + ) + +(defmethod draw-ocean-mid-seams ocean ((obj ocean) (arg0 dma-buffer)) + (local-vars (sv-32 uint) (sv-33 uint) (sv-34 uint) (sv-35 uint) (sv-36 sphere)) + (ocean-seams-add-constants obj arg0) + (set! sv-32 (-> obj mid-minx)) + (set! sv-33 (-> obj mid-maxx)) + (set! sv-34 (-> obj mid-minz)) + (set! sv-35 (-> obj mid-maxz)) + (set! sv-36 (new 'stack 'sphere)) + (set! (-> sv-36 y) (-> obj start-corner y)) + (set! (-> sv-36 r) 278045.7) + (let ((s4-0 sv-34) + (s3-0 sv-35) + ) + (while (>= s3-0 s4-0) + (let ((s2-0 sv-32) + (s1-0 sv-33) + ) + (while (>= s1-0 s2-0) + (set! (-> sv-36 x) (+ 196608.0 (* 393216.0 (the float s2-0)) (-> obj start-corner x))) + (set! (-> sv-36 z) (+ 196608.0 (* 393216.0 (the float s4-0)) (-> obj start-corner z))) + (when (sphere-cull sv-36) + (cond + ((= s4-0 sv-34) + (ocean-mid-add-upload-top obj arg0 s4-0 s2-0) + ) + ((= s4-0 sv-35) + (ocean-mid-add-upload-bottom obj arg0 s4-0 s2-0) + ) + (else + (ocean-mid-add-upload-middle obj arg0 s4-0 s2-0) + ) + ) + ) + (+! s2-0 1) + ) + ) + (+! s4-0 1) + ) + ) + (dotimes (v1-29 36) + (if (and (-> obj mid-mask-ptrs v1-29) (nonzero? (-> obj mid-camera-masks v1-29))) + (logior! (-> (the-as (pointer uint64) (-> obj mid-mask-ptrs v1-29))) (-> obj mid-camera-masks v1-29)) + ) + ) + 0 + (none) + ) + +(defmethod draw-ocean-mid ocean ((obj ocean) (arg0 dma-buffer)) + (local-vars (v1-8 float) (v1-9 float) (sv-32 int)) + (rlet ((vf16 :class vf) + (vf17 :class vf) + (vf18 :class vf) + (vf19 :class vf) + (vf20 :class vf) + (vf21 :class vf) + (vf22 :class vf) + (vf23 :class vf) + ) + (dotimes (v1-0 36) + (set! (-> obj mid-mask-ptrs v1-0) (the-as pointer #f)) + (set! (-> obj mid-camera-masks v1-0) (the-as uint 0)) + ) + (dma-buffer-add-vu-function arg0 ocean-mid-block 1) + (let* ((v1-3 arg0) + (a0-6 (the-as object (-> v1-3 base))) + ) + (set! (-> (the-as dma-packet a0-6) dma) (new 'static 'dma-tag :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-6) vif0) (new 'static 'vif-tag :cmd (vif-cmd base))) + (set! (-> (the-as dma-packet a0-6) vif1) (new 'static 'vif-tag :imm #x76 :cmd (vif-cmd offset))) + (set! (-> v1-3 base) (&+ (the-as pointer a0-6) 16)) + ) + (ocean-mid-add-constants obj arg0) + (ocean-mid-add-call obj arg0 0) + (let ((v1-7 *math-camera*)) + (cond + ((-> *time-of-day-context* use-camera-other) + (.lvf vf16 (&-> v1-7 plane-other 0 quad)) + (.lvf vf17 (&-> v1-7 plane-other 1 quad)) + (.lvf vf18 (&-> v1-7 plane-other 2 quad)) + (.lvf vf19 (&-> v1-7 plane-other 3 quad)) + (.lvf vf20 (&-> v1-7 guard-plane-other 0 quad)) + (.lvf vf21 (&-> v1-7 guard-plane-other 1 quad)) + (.lvf vf22 (&-> v1-7 guard-plane-other 2 quad)) + (.lvf vf23 (&-> v1-7 guard-plane-other 3 quad)) + (.mov v1-8 vf23) + ) + (else + (.lvf vf16 (&-> v1-7 plane 0 quad)) + (.lvf vf17 (&-> v1-7 plane 1 quad)) + (.lvf vf18 (&-> v1-7 plane 2 quad)) + (.lvf vf19 (&-> v1-7 plane 3 quad)) + (.lvf vf20 (&-> v1-7 guard-plane 0 quad)) + (.lvf vf21 (&-> v1-7 guard-plane 1 quad)) + (.lvf vf22 (&-> v1-7 guard-plane 2 quad)) + (.lvf vf23 (&-> v1-7 guard-plane 3 quad)) + (.mov v1-9 vf23) + ) + ) + ) + (set! (-> (new 'stack-no-clear 'vector) quad) (the-as uint128 0)) + (let ((s4-0 (-> *math-camera* trans))) + (dotimes (s3-0 6) + (dotimes (s2-0 6) + (let* ((s1-0 (+ (* 6 s3-0) s2-0)) + (s0-0 (-> obj ocean-spheres spheres s1-0)) + ) + (set! sv-32 (-> (the-as (pointer int16) (+ (* s1-0 2) (the-as int (-> obj ocean-mid-indices)))))) + (when (sphere-cull s0-0) + (cond + ((< sv-32 0) + ) + ((let ((f30-0 (- (vector-vector-distance s0-0 s4-0) (-> s0-0 r)))) + (let ((a0-16 obj) + (t9-5 (method-of-type ocean ocean-mid-add-upload)) + (a1-8 arg0) + (a2-2 s3-0) + (a3-0 s2-0) + (t2-0 f30-0) + ) + (t9-5 a0-16 a1-8 a2-2 a3-0 sv-32 s1-0 t2-0) + ) + (< f30-0 786432.0) + ) + (ocean-mid-add-call obj arg0 73) + (+! (-> *terrain-stats* ocean-mid fragments) 1) + (+! (-> *terrain-stats* ocean-mid tris) 256) + (+! (-> *terrain-stats* ocean-mid dverts) 288) + ) + (else + (ocean-mid-add-call obj arg0 46) + (+! (-> *terrain-stats* ocean-mid fragments) 1) + (+! (-> *terrain-stats* ocean-mid tris) 128) + (+! (-> *terrain-stats* ocean-mid dverts) 144) + ) + ) + ) + ) + ) + ) + ) + (when (not (or (-> obj near-off) (< 196608.0 (fabs (- (-> obj start-corner y) (-> *math-camera* trans y)))))) + (let ((a1-11 48) + (a2-5 0) + (v1-53 48) + (a0-25 0) + ) + (dotimes (a3-1 6) + (dotimes (t0-1 6) + (let ((t1-6 (&-> obj mid-camera-masks (+ (* 6 a3-1) t0-1)))) + (when (nonzero? (-> t1-6 0)) + (dotimes (t2-3 8) + (let ((t3-1 (-> (the-as (pointer uint8) (+ t2-3 (the-as int t1-6))) 0))) + (when (nonzero? t3-1) + (let ((t4-2 (+ (* a3-1 8) t2-3))) + (if (< t4-2 v1-53) + (set! v1-53 t4-2) + ) + (if (< a0-25 t4-2) + (set! a0-25 t4-2) + ) + ) + (dotimes (t4-3 8) + (when (logtest? t3-1 (ash 1 t4-3)) + (let ((t5-9 (+ (* t0-1 8) t4-3))) + (if (< t5-9 a1-11) + (set! a1-11 t5-9) + ) + (if (< a2-5 t5-9) + (set! a2-5 t5-9) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (set! (-> obj mid-minx) (the-as uint a1-11)) + (set! (-> obj mid-maxx) (the-as uint a2-5)) + (set! (-> obj mid-minz) (the-as uint v1-53)) + (set! (-> obj mid-maxz) (the-as uint a0-25)) + (when (and (< a1-11 a2-5) (< v1-53 a0-25)) + (ocean-mid-add-call-flush obj arg0 (the-as uint 41)) + (ocean-mid-add-call-flush obj arg0 (the-as uint 43)) + (draw-ocean-transition obj arg0) + (draw-ocean-mid-seams obj arg0) + ) + ) + ) + (ocean-mid-add-call-flush obj arg0 (the-as uint 41)) + 0 + (none) + ) + ) diff --git a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-near_REF.gc b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-near_REF.gc new file mode 100644 index 0000000000..543dfdb35b --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-near_REF.gc @@ -0,0 +1,745 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol ocean-near-block, type vu-function +(define ocean-near-block (new 'static 'vu-function :length #x3dd :qlength #x1ef)) + +;; definition for method 22 of type ocean +;; WARN: Return type mismatch int vs none. +(defmethod ocean-near-add-call ocean ((obj ocean) (arg0 dma-buffer) (arg1 int)) + (let* ((v1-0 arg0) + (a0-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag :cmd (vif-cmd mscalf) :msk #x1 :imm arg1)) + (set! (-> (the-as dma-packet a0-1) vif1) (new 'static 'vif-tag :cmd (vif-cmd stmod))) + (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) + ) + 0 + (none) + ) + +;; definition for method 23 of type ocean +;; WARN: Return type mismatch int vs none. +(defmethod ocean-near-add-call-flush ocean ((obj ocean) (arg0 dma-buffer) (arg1 int)) + (let* ((v1-0 arg0) + (a0-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag :cmd (vif-cmd mscalf) :msk #x1 :imm arg1)) + (set! (-> (the-as dma-packet a0-1) vif1) (new 'static 'vif-tag :cmd (vif-cmd flusha) :msk #x1)) + (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) + ) + 0 + (none) + ) + +;; definition for method 24 of type ocean +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod ocean-near-setup-constants ocean ((obj ocean) (arg0 ocean-near-constants)) + (let ((v1-0 *math-camera*)) + (set! (-> arg0 hmge-scale quad) (-> v1-0 hmge-scale quad)) + (set! (-> arg0 inv-hmge-scale quad) (-> v1-0 inv-hmge-scale quad)) + (set! (-> arg0 hvdf-offset quad) (-> v1-0 hvdf-off quad)) + (set-vector! (-> arg0 fog) (-> v1-0 pfog0) (-> v1-0 fog-min) (-> v1-0 fog-max) 3072.0) + ) + (set-vector! (-> arg0 constants) -0.25 -0.5 0.0 0.000010172526) + (let ((t9-0 matrix-local->world) + (a0-8 #f) + ) + (let* ((s4-0 (-> (t9-0 a0-8) vector 2)) + (f0-12 (- 1.5 (* 0.000015258789 (atan (-> s4-0 x) (-> s4-0 z))))) + (f1-1 (+ 0.5 (* -0.5 (-> s4-0 y)))) + ) + (set-vector! (-> arg0 constants2) f0-12 f1-1 1.0 128.0) + ) + ) + (set-vector! (-> arg0 constants3) 12288.0 0.125 2.0 0.03125) + (set-vector! (-> arg0 constants4) 2.0 255.0 3.0 0.0078125) + (set-vector! (-> arg0 constants5) 0.5 0.0 0.0 0.000010172526) + (case *subdivide-ocean-draw-mode* + (((subdivide-setting textured)) + (set! (-> arg0 drw-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 drw2-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 env-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 drw-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 env-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 drw2-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + (((subdivide-setting outline)) + (set! (-> arg0 drw-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 drw2-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 env-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 drw-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 env-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 drw2-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + (((subdivide-setting gouraud)) + (set! (-> arg0 drw-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 drw2-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 env-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 drw-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 env-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 drw2-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + (((subdivide-setting hack)) + (set! (-> arg0 drw-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 drw2-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 env-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 drw-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 env-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 drw2-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ) + (set! (-> arg0 drw-fan regs) + (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) + ) + (set! (-> arg0 drw2-fan regs) + (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) + ) + (set! (-> arg0 env-fan regs) + (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) + ) + (set! (-> arg0 drw-strip regs) + (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) + ) + (set! (-> arg0 env-strip regs) + (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) + ) + (set! (-> arg0 drw2-strip regs) + (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) + ) + (set! (-> arg0 drw-adgif tag) (new 'static 'gif-tag64 :nloop #x5 :nreg #x1)) + (set! (-> arg0 drw-adgif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d))) + (set! (-> arg0 drw-texture tex0) (new 'static 'gs-tex0 :tbp0 #x2a0 :tbw #x2 :th (log2 128) :tw (log2 128))) + (set! (-> arg0 drw-texture prims 1) (gs-reg64 tex0-1)) + (set! (-> arg0 drw-texture tex1) (-> obj tex1-near)) + (set! (-> arg0 drw-texture prims 3) (gs-reg64 tex1-1)) + (set! (-> arg0 drw-texture miptbp1) (new 'static 'gs-miptbp :tbp1 #x6a0 :tbw1 #x1 :tbp2 #x7a0 :tbp3 #x7e0)) + (set! (-> arg0 drw-texture prims 5) (gs-reg64 miptbp1-1)) + (set! (-> arg0 drw-texture clamp) (new 'static 'gs-clamp)) + (set! (-> arg0 drw-texture clamp-reg) (gs-reg64 clamp-1)) + (set! (-> arg0 drw-texture alpha) (new 'static 'gs-alpha :b #x1 :d #x1)) + (set! (-> arg0 drw-texture prims 9) (gs-reg64 alpha-1)) + (set! (-> arg0 env-adgif tag) (new 'static 'gif-tag64 :nloop #x5 :nreg #x1)) + (set! (-> arg0 env-adgif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d))) + (cond + ((-> *time-of-day-context* sky) + (set! (-> arg0 env-texture tex0) + (new 'static 'gs-tex0 + :tbw #x1 + :tcc #x1 + :th (log2 64) + :tw (log2 64) + :tbp0 (-> *ocean-envmap-texture-base* vram-block) + ) + ) + (set! (-> arg0 env-texture prims 1) (gs-reg64 tex0-1)) + (set! (-> arg0 env-texture tex1) (new 'static 'gs-tex1 :mmag #x1 :mmin #x5 :l #x1 :k #xeed)) + (set! (-> arg0 env-texture prims 3) (gs-reg64 tex1-1)) + (set! (-> arg0 env-texture miptbp1) (new 'static 'gs-miptbp)) + (set! (-> arg0 env-texture prims 5) (gs-reg64 miptbp1-1)) + (set! (-> arg0 env-texture clamp) (new 'static 'gs-clamp)) + (set! (-> arg0 env-texture clamp-reg) (gs-reg64 clamp-1)) + (set! (-> arg0 env-texture alpha) (new 'static 'gs-alpha :b #x2 :c #x1 :d #x1)) + (set! (-> arg0 env-texture prims 9) (gs-reg64 alpha-1)) + ) + (else + (let ((s4-2 (-> arg0 env-texture))) + (adgif-shader<-texture-simple! s4-2 (lookup-texture-by-id (new 'static 'texture-id :page #x1f))) + ) + (set! (-> arg0 env-texture clamp) (new 'static 'gs-clamp)) + (set! (-> arg0 env-texture alpha) (new 'static 'gs-alpha :b #x2 :c #x1 :d #x1)) + ) + ) + (let ((f0-28 (* 128.0 (-> *time-of-day-context* ocean-alpha)))) + (if (-> *time-of-day-context* sky) + (set-vector! (-> arg0 env-color) f0-28 f0-28 f0-28 f0-28) + (set-vector! (-> arg0 env-color) f0-28 f0-28 (* 0.5 f0-28) f0-28) + ) + ) + (set! (-> arg0 drw2-adgif tag) (new 'static 'gif-tag64 :nloop #x2 :eop #x1 :nreg #x1)) + (set! (-> arg0 drw2-adgif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d))) + (set! (-> arg0 drw2-tex0 dword 0) + (logior (logior (the-as uint #x4000082a0) (shr (shl (log2 128) 60) 34)) (shr (shl (log2 128) 60) 30)) + ) + (set! (-> arg0 drw2-tex0 dword 1) (the-as uint 6)) + (set! (-> arg0 drw2-frame dword 0) (the-as uint #xffffff00080198)) + (set! (-> arg0 drw2-frame dword 1) (the-as uint 76)) + (set! (-> arg0 drw3-adgif tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1)) + (set! (-> arg0 drw3-adgif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d))) + (set! (-> arg0 drw3-frame data) (the-as uint #x80198)) + (set! (-> arg0 drw3-frame cmds) (gs-reg64 frame-1)) + (set-vector! (-> arg0 index-table 0) 81 189 0 0) + (set-vector! (-> arg0 index-table 1) 54 162 0 0) + (set-vector! (-> arg0 index-table 2) 27 135 0 0) + (set-vector! (-> arg0 index-table 3) 0 108 0 0) + 0 + (none) + ) + +;; definition for method 25 of type ocean +;; WARN: Return type mismatch pointer vs none. +(defmethod ocean-near-add-constants ocean ((obj ocean) (arg0 dma-buffer)) + (let* ((a2-0 37) + (v1-0 arg0) + (a1-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a1-1) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a2-0)) + (set! (-> (the-as dma-packet a1-1) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a1-1) vif1) + (new 'static 'vif-tag :imm #x3b7 :cmd (vif-cmd unpack-v4-32) :num a2-0) + ) + (set! (-> v1-0 base) (&+ (the-as pointer a1-1) 16)) + ) + (ocean-near-setup-constants obj (the-as ocean-near-constants (-> arg0 base))) + (&+! (-> arg0 base) 592) + (none) + ) + +;; definition for method 26 of type ocean +;; WARN: Return type mismatch int vs none. +(defmethod ocean-near-add-heights ocean ((obj ocean) (arg0 dma-buffer)) + (let ((v1-0 128) + (a0-1 (-> obj heights)) + ) + (let* ((a2-0 arg0) + (a3-0 (the-as object (-> a2-0 base))) + ) + (set! (-> (the-as dma-packet a3-0) dma) + (new 'static 'dma-tag :id (dma-tag-id ref) :addr (the-as int a0-1) :qwc v1-0) + ) + (set! (-> (the-as dma-packet a3-0) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a3-0) vif1) + (new 'static 'vif-tag :imm #x20 :cmd (vif-cmd unpack-v4-32) :num v1-0) + ) + (set! (-> a2-0 base) (&+ (the-as pointer a3-0) 16)) + ) + (let ((a2-1 (the-as object (-> arg0 base)))) + (set! (-> (the-as dma-packet a2-1) dma) + (new 'static 'dma-tag :id (dma-tag-id ref) :addr (the-as int (&-> a0-1 data 512)) :qwc v1-0) + ) + (set! (-> (the-as dma-packet a2-1) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a2-1) vif1) + (new 'static 'vif-tag :imm #xa0 :cmd (vif-cmd unpack-v4-32) :num v1-0) + ) + (set! (-> arg0 base) (&+ (the-as pointer a2-1) 16)) + ) + ) + 0 + (none) + ) + +;; definition for method 27 of type ocean +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod ocean-near-add-matrices ocean ((obj ocean) (arg0 dma-buffer) (arg1 vector)) + (let ((s4-0 (new-stack-vector0))) + (if (-> *time-of-day-context* use-camera-other) + (-> *math-camera* camera-rot-other) + (-> *math-camera* camera-rot) + ) + (let* ((a1-1 8) + (v1-6 arg0) + (a0-1 (the-as object (-> v1-6 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a1-1)) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a0-1) vif1) + (new 'static 'vif-tag :imm #x8000 :cmd (vif-cmd unpack-v4-32) :num a1-1) + ) + (set! (-> v1-6 base) (&+ (the-as pointer a0-1) 16)) + ) + (let ((s3-0 (the-as object (-> arg0 base)))) + (let* ((v1-7 (the-as matrix s3-0)) + (t0-2 (-> *math-camera* camera-rot)) + (a0-4 (-> t0-2 vector 0 quad)) + (a1-5 (-> t0-2 vector 1 quad)) + (a3-4 (-> t0-2 vector 2 quad)) + (t0-3 (-> t0-2 trans quad)) + ) + (set! (-> v1-7 vector 0 quad) a0-4) + (set! (-> v1-7 vector 1 quad) a1-5) + (set! (-> v1-7 vector 2 quad) a3-4) + (set! (-> v1-7 trans quad) t0-3) + ) + (let ((s2-0 (the-as object (&+ (the-as pointer s3-0) 48)))) + (vector-matrix*! s4-0 arg1 (-> *math-camera* camera-rot)) + (set! (-> (the-as vector s2-0) x) (-> s4-0 x)) + (set! (-> (the-as vector s2-0) y) (-> s4-0 y)) + (set! (-> (the-as vector s2-0) z) (-> s4-0 z)) + ) + (let ((a1-7 (&+ (-> arg0 base) 64))) + (ocean-matrix*! obj (the-as matrix a1-7) (the-as matrix s3-0) (-> *math-camera* perspective)) + ) + ) + ) + (&+! (-> arg0 base) 128) + 0 + (none) + ) + +;; definition for method 28 of type ocean +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod ocean-near-add-upload ocean ((obj ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) + (local-vars + (v1-17 uint128) + (v1-18 uint128) + (v1-19 float) + (a0-18 uint128) + (a0-19 uint128) + (a0-20 uint128) + (a2-23 float) + (a2-30 uint128) + (a2-31 uint128) + (a3-25 uint128) + ) + (rlet ((acc :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf12 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf) + ) + (let ((s1-0 (-> obj mid-minx)) + (s2-0 (-> obj mid-minz)) + ) + (let ((a2-1 (new-stack-vector0))) + (let ((v1-0 (-> obj start-corner))) + (set! (-> a2-1 x) (+ (-> v1-0 x) (* 98304.0 (the float arg2)))) + (set! (-> a2-1 y) (-> v1-0 y)) + (set! (-> a2-1 z) (+ (-> v1-0 z) (* 98304.0 (the float arg1)))) + ) + (set! (-> a2-1 w) 1.0) + (ocean-near-add-matrices obj arg0 a2-1) + ) + (let* ((a1-2 8) + (v1-5 arg0) + (a0-3 (the-as object (-> v1-5 base))) + ) + (set! (-> (the-as dma-packet a0-3) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a1-2)) + (set! (-> (the-as dma-packet a0-3) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a0-3) vif1) + (new 'static 'vif-tag :imm #x8008 :cmd (vif-cmd unpack-v4-32) :num a1-2) + ) + (set! (-> v1-5 base) (&+ (the-as pointer a0-3) 16)) + ) + (let* ((v1-6 (-> arg0 base)) + (a0-6 (- arg2 (* s1-0 4))) + (a1-7 (- arg1 (* s2-0 4))) + (a2-6 (shr a0-6 2)) + (a3-3 (shr a1-7 2)) + (a0-7 (logand a0-6 3)) + (a1-8 (logand a1-7 3)) + (a2-10 (-> (the-as (pointer int16) (+ (* (+ (* a3-3 4) a2-6) 2) (the-as uint obj))) 4002)) + (a3-7 (-> obj ocean-near-indices data a2-10)) + (a0-13 + (-> obj ocean-mid-masks data (-> (the-as (pointer int16) (+ (* (+ (* a1-8 4) a0-7) 2) (the-as uint a3-7))))) + ) + ) + (set-vector! + (the-as vector4w (&+ v1-6 0)) + (the-as int (-> a0-13 mask 0)) + (the-as int (-> a0-13 mask 1)) + (the-as int (-> a0-13 mask 2)) + (the-as int (-> a0-13 mask 3)) + ) + (set-vector! + (the-as vector4w (&+ v1-6 16)) + (the-as int (-> a0-13 mask 4)) + (the-as int (-> a0-13 mask 5)) + (the-as int (-> a0-13 mask 6)) + (the-as int (-> a0-13 mask 7)) + ) + ) + ) + (&+! (-> arg0 base) 32) + (let ((a0-15 (/ (the-as int arg2) 4)) + (v1-10 (/ (the-as int arg1) 4)) + (a2-18 (logand arg2 3)) + (a3-8 (logand arg1 3)) + ) + (let ((t0-0 (-> arg0 base)) + (a1-15 (logand (+ arg2 1) 3)) + (t1-1 (logand (+ arg1 1) 3)) + ) + (set-vector! + (the-as vector4w (&+ t0-0 0)) + (the-as int (+ (* a3-8 64) (* a2-18 2))) + (the-as int (+ (* a3-8 64) (* a1-15 2))) + (the-as int (+ (* t1-1 64) (* a2-18 2))) + (the-as int (+ (* t1-1 64) (* a1-15 2))) + ) + ) + (&+! (-> arg0 base) 16) + (let ((a1-21 (the-as (inline-array vector4w) (-> (the-as (inline-array vector4w) (-> arg0 base)) 0)))) + (set! (-> a1-21 0 x) (the-as int (* 0.25 (the float a2-18)))) + (set! (-> a1-21 0 y) (the-as int (* 0.25 (the float a3-8)))) + (set! (-> a1-21 0 z) (the-as int 1.0)) + (set! (-> a1-21 0 w) (the-as int 0.0)) + ) + (set! (-> arg0 base) + (the-as pointer (the-as (inline-array vector4w) (-> (the-as (inline-array vector4w) (-> arg0 base)) 1))) + ) + (let ((a1-24 (the-as (inline-array vector4w) (-> arg0 base)))) + (let ((a2-19 (+ (* 5 (the-as int a3-8)) a2-18))) + (.lvf vf5 (&-> (-> *ocean-trans-corner-table* 0 vector a2-19) quad)) + (.lvf vf6 (&-> (-> *ocean-trans-corner-table* 0 vector (+ a2-19 1)) quad)) + (.lvf vf7 (&-> (-> *ocean-trans-corner-table* 0 vector (+ a2-19 5)) quad)) + (.lvf vf8 (&-> (-> *ocean-trans-corner-table* 0 vector (+ a2-19 6)) quad)) + ) + (.mov a2-23 vf8) + (let ((a2-29 (the-as uint128 (-> obj ocean-colors colors (+ (* 52 (the-as int v1-10)) a0-15)))) + (a3-24 (the-as uint128 (-> obj ocean-colors colors (+ a0-15 1 (* 52 (the-as int v1-10)))))) + (t0-17 (the-as uint128 (-> obj ocean-colors colors (+ (* 52 (the-as int (+ v1-10 1))) a0-15)))) + (v1-16 (the-as uint128 (-> obj ocean-colors colors (+ a0-15 1 (* 52 (the-as int (+ v1-10 1))))))) + ) + (.pextlb a0-18 0 a2-29) + (nop!) + (.pextlb a2-30 0 a3-24) + (nop!) + (.pextlb a3-25 0 t0-17) + (nop!) + (.pextlb v1-17 0 v1-16) + ) + (nop!) + (.pextlh a0-19 0 a0-18) + (nop!) + (.pextlh a2-31 0 a2-30) + (.mov vf1 a0-19) + (.pextlh a0-20 0 a3-25) + (.mov vf2 a2-31) + (.pextlh v1-18 0 v1-17) + (.mov vf3 a0-20) + (nop!) + (.mov vf4 v1-18) + (.itof.vf vf1 vf1) + (nop!) + (.itof.vf vf2 vf2) + (nop!) + (.itof.vf vf3 vf3) + (nop!) + (.itof.vf vf4 vf4) + (nop!) + (.mul.x.vf acc vf1 vf5) + (nop!) + (.add.mul.y.vf acc vf2 vf5 acc) + (nop!) + (.add.mul.z.vf acc vf3 vf5 acc) + (nop!) + (.add.mul.w.vf vf9 vf4 vf5 acc) + (nop!) + (.mul.x.vf acc vf1 vf6) + (nop!) + (.add.mul.y.vf acc vf2 vf6 acc) + (nop!) + (.add.mul.z.vf acc vf3 vf6 acc) + (nop!) + (.add.mul.w.vf vf10 vf4 vf6 acc) + (.svf (&-> a1-24 0 quad) vf9) + (.mul.x.vf acc vf1 vf7) + (nop!) + (.add.mul.y.vf acc vf2 vf7 acc) + (nop!) + (.add.mul.z.vf acc vf3 vf7 acc) + (nop!) + (.add.mul.w.vf vf11 vf4 vf7 acc) + (.svf (&-> a1-24 1 quad) vf10) + (.mul.x.vf acc vf1 vf8) + (nop!) + (.add.mul.y.vf acc vf2 vf8 acc) + (nop!) + (.add.mul.z.vf acc vf3 vf8 acc) + (nop!) + (.add.mul.w.vf vf12 vf4 vf8 acc) + (.svf (&-> a1-24 2 quad) vf11) + (nop!) + (.svf (&-> a1-24 3 quad) vf12) + ) + ) + (.mov v1-19 vf12) + (&+! (-> arg0 base) 64) + 0 + (none) + ) + ) + +;; definition for method 29 of type ocean +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod draw-ocean-near ocean ((obj ocean) (arg0 dma-buffer)) + (local-vars (sv-16 uint)) + (let* ((v1-0 arg0) + (a0-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-1) vif1) (new 'static 'vif-tag :imm #x2 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) + ) + (let* ((v1-1 arg0) + (a0-3 (the-as object (-> v1-1 base))) + ) + (set! (-> (the-as gs-gif-tag a0-3) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1)) + (set! (-> (the-as gs-gif-tag a0-3) regs) GIF_REGS_ALL_AD) + (set! (-> v1-1 base) (&+ (the-as pointer a0-3) 16)) + ) + (let* ((v1-2 arg0) + (a0-5 (-> v1-2 base)) + ) + (set! (-> (the-as (pointer gs-test) a0-5) 0) + (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest greater-equal)) + ) + (set! (-> (the-as (pointer gs-reg64) a0-5) 1) (gs-reg64 test-1)) + (set! (-> v1-2 base) (&+ a0-5 16)) + ) + (dma-buffer-add-vu-function arg0 ocean-near-block 1) + (let* ((v1-3 arg0) + (a0-8 (the-as object (-> v1-3 base))) + ) + (set! (-> (the-as dma-packet a0-8) dma) (new 'static 'dma-tag :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-8) vif0) (new 'static 'vif-tag :cmd (vif-cmd base))) + (set! (-> (the-as dma-packet a0-8) vif1) (new 'static 'vif-tag :imm #x10 :cmd (vif-cmd offset))) + (set! (-> v1-3 base) (&+ (the-as pointer a0-8) 16)) + ) + (ocean-near-add-constants obj arg0) + (ocean-near-add-heights obj arg0) + (ocean-near-add-call obj arg0 0) + (let ((s4-0 (-> obj near-minx)) + (s3-0 (-> obj near-maxx)) + (s2-0 (-> obj near-minz)) + (s1-0 (-> obj near-maxz)) + ) + (when (and (< s4-0 s3-0) (< s2-0 s1-0)) + (while (>= s1-0 s2-0) + (let ((s0-0 s4-0)) + (set! sv-16 s3-0) + (while (>= sv-16 s0-0) + (when (ocean-trans-camera-masks-bit? obj s2-0 s0-0) + (let* ((a1-16 (- (shr s0-0 2) (-> obj mid-minx))) + (a2-3 (- (shr s2-0 2) (-> obj mid-minz))) + (v1-13 (logand s0-0 3)) + (a0-17 (logand s2-0 3)) + (a1-20 (-> (the-as (pointer int16) (+ (* (+ (* a2-3 4) a1-16) 2) (the-as uint obj))) 4002)) + ) + (when (>= a1-20 0) + (let ((a1-22 (-> obj ocean-near-indices data a1-20))) + (when (>= (-> (the-as (pointer int16) (+ (* (+ (* a0-17 4) v1-13) 2) (the-as uint a1-22)))) 0) + (ocean-near-add-upload obj arg0 s2-0 s0-0) + (ocean-near-add-call obj arg0 39) + ) + ) + ) + ) + ) + (+! s0-0 1) + ) + ) + (+! s2-0 1) + ) + ) + ) + 0 + (none) + ) diff --git a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-texture_REF.gc b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-texture_REF.gc new file mode 100644 index 0000000000..b3c00fb7ed --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-texture_REF.gc @@ -0,0 +1,1980 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol ocean-texture-vu1-block, type vu-function +(define ocean-texture-vu1-block (new 'static 'vu-function :length #x7c :qlength 62)) + +;; definition for method 70 of type ocean +;; WARN: Return type mismatch int vs none. +(defmethod ocean-texture-setup-constants ocean ((obj ocean) (arg0 ocean-texture-constants)) + (set! (-> arg0 giftag tag) + (new 'static 'gif-tag64 + :nloop #x42 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1) + :nreg #x3 + ) + ) + (set! (-> arg0 giftag regs) + (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyz2)) + ) + (set-vector! (-> arg0 buffers) 384 583 384 583) + (set-vector! (-> arg0 dests) 782 881 782 881) + (set-vector! (-> arg0 start) 0.0 0.0 1048575.94 0.0) + (set-vector! (-> arg0 offsets) 4.0 8.0 12.0 16.0) + (set-vector! (-> arg0 constants) 0.5 0.5 0.0 128.0) + (set! (-> arg0 cam-nrm x) 0.0) + (set! (-> arg0 cam-nrm y) 0.707) + (set! (-> arg0 cam-nrm z) 0.707) + (set! (-> arg0 cam-nrm w) 0.0) + 0 + (none) + ) + +;; definition for method 71 of type ocean +;; WARN: Return type mismatch int vs none. +(defmethod ocean-texture-add-constants ocean ((obj ocean) (arg0 dma-buffer)) + (let* ((a2-0 7) + (v1-0 arg0) + (a1-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a1-1) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a2-0)) + (set! (-> (the-as dma-packet a1-1) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a1-1) vif1) + (new 'static 'vif-tag :imm #x3d9 :cmd (vif-cmd unpack-v4-32) :num a2-0) + ) + (set! (-> v1-0 base) (&+ (the-as pointer a1-1) 16)) + ) + (ocean-texture-setup-constants obj (the-as ocean-texture-constants (-> arg0 base))) + (&+! (-> arg0 base) 112) + 0 + (none) + ) + +;; definition for method 72 of type ocean +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod ocean-texture-add-envmap ocean ((obj ocean) (arg0 dma-buffer)) + (let ((v1-0 (the-as object (-> arg0 base)))) + (set! (-> (the-as (inline-array vector4w) v1-0) 0 quad) (-> obj adgif-tmpl dma-vif quad)) + (set! (-> (the-as (inline-array vector4w) v1-0) 1 quad) (-> obj adgif-tmpl quad 1)) + (let ((s4-0 (&+ (the-as pointer v1-0) 32))) + (adgif-shader<-texture-simple! + (the-as adgif-shader s4-0) + (lookup-texture-by-id (new 'static 'texture-id :index #x3 :page #x475)) + ) + ) + ) + (&+! (-> arg0 base) 112) + 0 + (none) + ) + +;; definition for method 73 of type ocean +;; WARN: Return type mismatch int vs none. +(defmethod ocean-texture-add-verts ocean ((obj ocean) (arg0 dma-buffer) (arg1 int)) + (let* ((v1-0 arg0) + (a0-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :qwc #xc0 :id (dma-tag-id ref) :addr arg1)) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a0-1) vif1) + (new 'static 'vif-tag :imm #x8000 :num #xc0 :cmd (vif-cmd unpack-v4-32)) + ) + (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) + ) + 0 + (none) + ) + +;; definition for method 74 of type ocean +;; WARN: Return type mismatch int vs none. +(defmethod ocean-texture-add-verts-last ocean ((obj ocean) (arg0 dma-buffer) (arg1 int) (arg2 int)) + (let* ((v1-0 arg0) + (a0-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :qwc #x80 :id (dma-tag-id ref) :addr arg1)) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a0-1) vif1) + (new 'static 'vif-tag :imm #x8000 :num #x80 :cmd (vif-cmd unpack-v4-32)) + ) + (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) + ) + (let* ((v1-1 arg0) + (a0-3 (the-as object (-> v1-1 base))) + ) + (set! (-> (the-as dma-packet a0-3) dma) (new 'static 'dma-tag :qwc #x40 :id (dma-tag-id ref) :addr arg2)) + (set! (-> (the-as dma-packet a0-3) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a0-3) vif1) + (new 'static 'vif-tag :imm #x8080 :num #x40 :cmd (vif-cmd unpack-v4-32)) + ) + (set! (-> v1-1 base) (&+ (the-as pointer a0-3) 16)) + ) + 0 + (none) + ) + +;; definition for method 75 of type ocean +;; WARN: Return type mismatch int vs none. +(defmethod ocean-texture-add-call-start ocean ((obj ocean) (arg0 dma-buffer)) + (let* ((v1-0 arg0) + (a0-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag :cmd (vif-cmd mscalf) :msk #x1)) + (set! (-> (the-as dma-packet a0-1) vif1) (new 'static 'vif-tag :cmd (vif-cmd stmod))) + (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) + ) + 0 + (none) + ) + +;; definition for method 76 of type ocean +;; WARN: Return type mismatch int vs none. +(defmethod ocean-texture-add-call-rest ocean ((obj ocean) (arg0 dma-buffer)) + (let* ((v1-0 arg0) + (a0-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag :imm #x2 :cmd (vif-cmd mscalf) :msk #x1)) + (set! (-> (the-as dma-packet a0-1) vif1) (new 'static 'vif-tag :cmd (vif-cmd stmod))) + (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) + ) + 0 + (none) + ) + +;; definition for method 77 of type ocean +;; WARN: Return type mismatch int vs none. +(defmethod ocean-texture-add-call-done ocean ((obj ocean) (arg0 dma-buffer)) + (let* ((v1-0 arg0) + (a0-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag :imm #x4 :cmd (vif-cmd mscalf) :msk #x1)) + (set! (-> (the-as dma-packet a0-1) vif1) (new 'static 'vif-tag :cmd (vif-cmd stmod))) + (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) + ) + 0 + (none) + ) + +;; definition for method 78 of type ocean +;; WARN: Return type mismatch int vs none. +(defmethod draw-ocean-texture ocean ((obj ocean) (arg0 dma-buffer) (arg1 int)) + (set-display-gs-state arg0 21 128 128 0 0) + (ocean-texture-add-envmap obj arg0) + (let* ((v1-2 arg0) + (a0-3 (the-as object (-> v1-2 base))) + ) + (set! (-> (the-as dma-packet a0-3) dma) (new 'static 'dma-tag :qwc #x4 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-3) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-3) vif1) (new 'static 'vif-tag :imm #x4 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-2 base) (&+ (the-as pointer a0-3) 16)) + ) + (let* ((v1-3 arg0) + (a0-5 (the-as object (-> v1-3 base))) + ) + (set! (-> (the-as gs-gif-tag a0-5) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x3)) + (set! (-> (the-as gs-gif-tag a0-5) regs) GIF_REGS_ALL_AD) + (set! (-> v1-3 base) (&+ (the-as pointer a0-5) 16)) + ) + (let* ((v1-4 arg0) + (a0-7 (-> v1-4 base)) + ) + (set! (-> (the-as (pointer gs-test) a0-7) 0) + (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + ) + (set! (-> (the-as (pointer gs-reg64) a0-7) 1) (gs-reg64 test-1)) + (set! (-> (the-as (pointer gs-alpha) a0-7) 2) (new 'static 'gs-alpha :b #x2 :d #x1)) + (set! (-> (the-as (pointer gs-reg64) a0-7) 3) (gs-reg64 alpha-1)) + (set! (-> (the-as (pointer gs-tex1) a0-7) 4) (new 'static 'gs-tex1)) + (set! (-> (the-as (pointer gs-reg64) a0-7) 5) (gs-reg64 tex1-1)) + (set! (-> v1-4 base) (&+ a0-7 48)) + ) + (dma-buffer-add-vu-function arg0 ocean-texture-vu1-block 1) + (let* ((v1-5 arg0) + (a0-10 (the-as object (-> v1-5 base))) + ) + (set! (-> (the-as dma-packet a0-10) dma) (new 'static 'dma-tag :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-10) vif0) (new 'static 'vif-tag :cmd (vif-cmd base))) + (set! (-> (the-as dma-packet a0-10) vif1) (new 'static 'vif-tag :imm #xc0 :cmd (vif-cmd offset))) + (set! (-> v1-5 base) (&+ (the-as pointer a0-10) 16)) + ) + (ocean-texture-add-constants obj arg0) + (let ((s3-0 (+ arg1 0))) + (ocean-texture-add-verts obj arg0 s3-0) + (let ((s3-1 (+ s3-0 3072))) + (ocean-texture-add-call-start obj arg0) + (dotimes (s2-0 9) + (ocean-texture-add-verts obj arg0 s3-1) + (+! s3-1 3072) + (ocean-texture-add-call-rest obj arg0) + ) + (let ((a2-5 s3-1)) + (ocean-texture-add-verts-last obj arg0 a2-5 (+ arg1 0)) + (ocean-texture-add-call-rest obj arg0) + (ocean-texture-add-call-done obj arg0) + (ocean-method-81 obj arg0) + (reset-display-gs-state *display* arg0 a2-5) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 79 of type ocean +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod ocean-method-79 ocean ((obj ocean) (arg0 dma-buffer)) + (set-display-gs-state arg0 53 64 64 0 0) + (let* ((v1-0 arg0) + (a0-2 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-2) dma) (new 'static 'dma-tag :qwc #x7 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-2) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-2) vif1) (new 'static 'vif-tag :imm #x7 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-0 base) (&+ (the-as pointer a0-2) 16)) + ) + (let* ((v1-1 arg0) + (a0-4 (the-as object (-> v1-1 base))) + ) + (set! (-> (the-as gs-gif-tag a0-4) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x6)) + (set! (-> (the-as gs-gif-tag a0-4) regs) GIF_REGS_ALL_AD) + (set! (-> v1-1 base) (&+ (the-as pointer a0-4) 16)) + ) + (let* ((s4-0 arg0) + (s3-0 (-> s4-0 base)) + ) + (set! (-> (the-as (pointer gs-test) s3-0) 0) + (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest always)) + ) + (set! (-> (the-as (pointer gs-reg64) s3-0) 1) (gs-reg64 test-1)) + (set! (-> (the-as (pointer gs-alpha) s3-0) 2) (new 'static 'gs-alpha :b #x1 :d #x1)) + (set! (-> (the-as (pointer gs-reg64) s3-0) 3) (gs-reg64 alpha-1)) + (set! (-> (the-as (pointer gs-tex0) s3-0) 4) + (new 'static 'gs-tex0 :tbp0 #x2a0 :tbw #x2 :tcc #x1 :th (log2 128) :tw (log2 128)) + ) + (set! (-> (the-as (pointer gs-reg64) s3-0) 5) (gs-reg64 tex0-1)) + (set! (-> (the-as (pointer gs-tex1) s3-0) 6) (new 'static 'gs-tex1 :mmag #x1 :mmin #x1)) + (set! (-> (the-as (pointer gs-reg64) s3-0) 7) (gs-reg64 tex1-1)) + (set! (-> (the-as (pointer gs-clamp) s3-0) 8) (new 'static 'gs-clamp)) + (set! (-> (the-as (pointer gs-reg64) s3-0) 9) (gs-reg64 clamp-1)) + (set! (-> (the-as (pointer uint64) s3-0) 10) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) s3-0) 11) (gs-reg64 texflush)) + (set! (-> s4-0 base) (&+ s3-0 96)) + ) + (let ((v1-17 (the-as (inline-array vector4w) (-> arg0 base)))) + (set! (-> v1-17 0 quad) (-> obj sprite-tmpl dma-vif quad)) + (set! (-> v1-17 1 quad) (-> obj sprite-tmpl quad 1)) + (set! (-> v1-17 2 quad) (-> obj color80808040 quad)) + (set! (-> v1-17 3 quad) (-> obj uv00 quad)) + (set! (-> v1-17 4 quad) (-> obj xy00 quad)) + (set! (-> v1-17 5 quad) (-> obj uv8080 quad)) + (set! (-> v1-17 6 quad) (-> obj xy4040 quad)) + ) + (&+! (-> arg0 base) 112) + (set-display-gs-state arg0 61 32 32 0 0) + (let* ((v1-20 arg0) + (a0-16 (the-as object (-> v1-20 base))) + ) + (set! (-> (the-as dma-packet a0-16) dma) (new 'static 'dma-tag :qwc #x3 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-16) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-16) vif1) (new 'static 'vif-tag :imm #x3 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-20 base) (&+ (the-as pointer a0-16) 16)) + ) + (let* ((v1-21 arg0) + (a0-18 (the-as object (-> v1-21 base))) + ) + (set! (-> (the-as gs-gif-tag a0-18) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x2)) + (set! (-> (the-as gs-gif-tag a0-18) regs) GIF_REGS_ALL_AD) + (set! (-> v1-21 base) (&+ (the-as pointer a0-18) 16)) + ) + (let* ((s4-1 arg0) + (s3-1 (-> s4-1 base)) + ) + (set! (-> (the-as (pointer gs-tex0) s3-1) 0) + (new 'static 'gs-tex0 :tbp0 #x6a0 :tbw #x1 :tcc #x1 :th (log2 64) :tw (log2 64)) + ) + (set! (-> (the-as (pointer gs-reg64) s3-1) 1) (gs-reg64 tex0-1)) + (set! (-> (the-as (pointer uint64) s3-1) 2) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) s3-1) 3) (gs-reg64 texflush)) + (set! (-> s4-1 base) (&+ s3-1 32)) + ) + (let ((v1-30 (the-as (inline-array vector4w) (-> arg0 base)))) + (set! (-> v1-30 0 quad) (-> obj sprite-tmpl dma-vif quad)) + (set! (-> v1-30 1 quad) (-> obj sprite-tmpl quad 1)) + (set! (-> v1-30 2 quad) (-> obj color80808000 quad)) + (set! (-> v1-30 3 quad) (-> obj uv00 quad)) + (set! (-> v1-30 4 quad) (-> obj xy00 quad)) + (set! (-> v1-30 5 quad) (-> obj uv4040 quad)) + (set! (-> v1-30 6 quad) (-> obj xy2020 quad)) + ) + (&+! (-> arg0 base) 112) + (set-display-gs-state arg0 63 16 16 0 0) + (let* ((v1-33 arg0) + (a0-30 (the-as object (-> v1-33 base))) + ) + (set! (-> (the-as dma-packet a0-30) dma) (new 'static 'dma-tag :qwc #x3 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-30) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-30) vif1) (new 'static 'vif-tag :imm #x3 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-33 base) (&+ (the-as pointer a0-30) 16)) + ) + (let* ((v1-34 arg0) + (a0-32 (the-as object (-> v1-34 base))) + ) + (set! (-> (the-as gs-gif-tag a0-32) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x2)) + (set! (-> (the-as gs-gif-tag a0-32) regs) GIF_REGS_ALL_AD) + (set! (-> v1-34 base) (&+ (the-as pointer a0-32) 16)) + ) + (let* ((s4-2 arg0) + (s3-2 (-> s4-2 base)) + ) + (set! (-> (the-as (pointer gs-tex0) s3-2) 0) + (new 'static 'gs-tex0 :tbp0 #x7a0 :tcc #x1 :th (log2 32) :tw (log2 32)) + ) + (set! (-> (the-as (pointer gs-reg64) s3-2) 1) (gs-reg64 tex0-1)) + (set! (-> (the-as (pointer uint64) s3-2) 2) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) s3-2) 3) (gs-reg64 texflush)) + (set! (-> s4-2 base) (&+ s3-2 32)) + ) + (let ((v1-43 (the-as (inline-array vector4w) (-> arg0 base)))) + (set! (-> v1-43 0 quad) (-> obj sprite-tmpl dma-vif quad)) + (set! (-> v1-43 1 quad) (-> obj sprite-tmpl quad 1)) + (set! (-> v1-43 2 quad) (-> obj color80808000 quad)) + (set! (-> v1-43 3 quad) (-> obj uv00 quad)) + (set! (-> v1-43 4 quad) (-> obj xy00 quad)) + (set! (-> v1-43 5 quad) (-> obj uv2020 quad)) + (set! (-> v1-43 6 quad) (-> obj xy1010 quad)) + ) + (&+! (-> arg0 base) 112) + (set-display-gs-state arg0 64 8 8 0 0) + (let* ((v1-46 arg0) + (a0-44 (the-as object (-> v1-46 base))) + ) + (set! (-> (the-as dma-packet a0-44) dma) (new 'static 'dma-tag :qwc #x3 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-44) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-44) vif1) (new 'static 'vif-tag :imm #x3 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-46 base) (&+ (the-as pointer a0-44) 16)) + ) + (let* ((v1-47 arg0) + (a0-46 (the-as object (-> v1-47 base))) + ) + (set! (-> (the-as gs-gif-tag a0-46) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x2)) + (set! (-> (the-as gs-gif-tag a0-46) regs) GIF_REGS_ALL_AD) + (set! (-> v1-47 base) (&+ (the-as pointer a0-46) 16)) + ) + (let* ((s4-3 arg0) + (s3-3 (-> s4-3 base)) + ) + (set! (-> (the-as (pointer gs-tex0) s3-3) 0) + (new 'static 'gs-tex0 :tbp0 #x7e0 :tcc #x1 :th (log2 16) :tw (log2 16)) + ) + (set! (-> (the-as (pointer gs-reg64) s3-3) 1) (gs-reg64 tex0-1)) + (set! (-> (the-as (pointer uint64) s3-3) 2) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) s3-3) 3) (gs-reg64 texflush)) + (set! (-> s4-3 base) (&+ s3-3 32)) + ) + (let ((v1-56 (the-as (inline-array vector4w) (-> arg0 base)))) + (set! (-> v1-56 0 quad) (-> obj sprite-tmpl dma-vif quad)) + (set! (-> v1-56 1 quad) (-> obj sprite-tmpl quad 1)) + (set! (-> v1-56 2 quad) (-> obj color80808000 quad)) + (set! (-> v1-56 3 quad) (-> obj uv00 quad)) + (set! (-> v1-56 4 quad) (-> obj xy00 quad)) + (set! (-> v1-56 5 quad) (-> obj uv1010 quad)) + (set! (-> v1-56 6 quad) (-> obj xy88 quad)) + ) + (&+! (-> arg0 base) 112) + (set-display-gs-state arg0 65 8 8 0 0) + (let* ((v1-59 arg0) + (a0-58 (the-as object (-> v1-59 base))) + ) + (set! (-> (the-as dma-packet a0-58) dma) (new 'static 'dma-tag :qwc #x3 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-58) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-58) vif1) (new 'static 'vif-tag :imm #x3 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-59 base) (&+ (the-as pointer a0-58) 16)) + ) + (let* ((v1-60 arg0) + (a0-60 (the-as object (-> v1-60 base))) + ) + (set! (-> (the-as gs-gif-tag a0-60) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x2)) + (set! (-> (the-as gs-gif-tag a0-60) regs) GIF_REGS_ALL_AD) + (set! (-> v1-60 base) (&+ (the-as pointer a0-60) 16)) + ) + (let* ((s4-4 arg0) + (s3-4 (-> s4-4 base)) + ) + (set! (-> (the-as (pointer gs-tex0) s3-4) 0) + (new 'static 'gs-tex0 :tbp0 #x800 :tcc #x1 :th (log2 8) :tw (log2 8)) + ) + (set! (-> (the-as (pointer gs-reg64) s3-4) 1) (gs-reg64 tex0-1)) + (set! (-> (the-as (pointer uint64) s3-4) 2) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) s3-4) 3) (gs-reg64 texflush)) + (set! (-> s4-4 base) (the-as pointer (the-as (inline-array vector4w) (&+ s3-4 32)))) + ) + (let ((v1-69 (the-as (inline-array vector4w) (-> arg0 base)))) + (set! (-> v1-69 0 quad) (-> obj sprite-tmpl dma-vif quad)) + (set! (-> v1-69 1 quad) (-> obj sprite-tmpl quad 1)) + (set! (-> v1-69 2 quad) (-> obj color80808000 quad)) + (set! (-> v1-69 3 quad) (-> obj uv00 quad)) + (set! (-> v1-69 4 quad) (-> obj xy00 quad)) + (set! (-> v1-69 5 quad) (-> obj uv1010 quad)) + (set! (-> v1-69 6 quad) (-> obj xy88 quad)) + ) + (&+! (-> arg0 base) 112) + (let ((t9-15 set-display-gs-state) + (a0-71 arg0) + (a1-31 66) + (a2-5 8) + ) + (t9-15 a0-71 a1-31 a2-5 8 0 0) + (let ((v1-72 (the-as (inline-array vector4w) (-> arg0 base)))) + (set! (-> v1-72 0 quad) (-> obj erase-tmpl dma-vif quad)) + (set! (-> v1-72 1 quad) (-> obj erase-tmpl quad 1)) + (set! (-> v1-72 2 quad) (-> obj color80808000 quad)) + (set! (-> v1-72 3 quad) (-> obj xy00 quad)) + (set! (-> v1-72 4 quad) (-> obj xy88 quad)) + ) + (set! (-> arg0 base) (the-as pointer (-> (the-as (inline-array vector4w) (-> arg0 base)) 5))) + (reset-display-gs-state *display* arg0 a2-5) + ) + 0 + (none) + ) + +;; definition for method 80 of type ocean +;; WARN: Return type mismatch int vs none. +(defmethod ocean-method-80 ocean ((obj ocean) (arg0 (pointer rgba))) + (dotimes (v1-0 256) + (let ((a0-3 (-> (the-as (pointer uint8) (&+ *clut-translate* v1-0))))) + (set! (-> arg0 a0-3 r) v1-0) + (set! (-> arg0 a0-3 g) v1-0) + (set! (-> arg0 a0-3 b) v1-0) + (set! (-> arg0 a0-3 a) v1-0) + ) + ) + 0 + (none) + ) + +;; definition for method 91 of type ocean +;; WARN: Return type mismatch int vs none. +(defmethod do-tex-scroll! ocean ((obj ocean)) + (with-pp + (when (not (paused?)) + (+! (-> obj st-scroll x) (* 8.0 (-> pp clock seconds-per-frame))) + (set! (-> obj st-scroll y) (- (-> obj st-scroll y) (* 8.0 (-> pp clock seconds-per-frame)))) + (if (< 128.0 (-> obj st-scroll x)) + (set! (-> obj st-scroll x) (+ -128.0 (-> obj st-scroll x))) + ) + (if (< (-> obj st-scroll y) 0.0) + (set! (-> obj st-scroll y) (+ 128.0 (-> obj st-scroll y))) + ) + ) + (set! (-> obj uv-scroll-0 x) (the int (* 16.0 (-> obj st-scroll x)))) + (set! (-> obj uv-scroll-0 y) (the int (* 16.0 (+ 256.0 (-> obj st-scroll y))))) + (set! (-> obj uv-scroll-1 x) (the int (* 16.0 (+ 256.0 (-> obj st-scroll x))))) + (set! (-> obj uv-scroll-1 y) (the int (* 16.0 (-> obj st-scroll y)))) + 0 + (none) + ) + ) + +;; definition for method 81 of type ocean +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod ocean-method-81 ocean ((obj ocean) (arg0 dma-buffer)) + (set-display-gs-state arg0 53 128 128 0 0) + (let* ((v1-0 arg0) + (a0-2 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-2) dma) (new 'static 'dma-tag :qwc #x7 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-2) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-2) vif1) (new 'static 'vif-tag :imm #x7 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-0 base) (&+ (the-as pointer a0-2) 16)) + ) + (let* ((v1-1 arg0) + (a0-4 (the-as object (-> v1-1 base))) + ) + (set! (-> (the-as gs-gif-tag a0-4) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x6)) + (set! (-> (the-as gs-gif-tag a0-4) regs) GIF_REGS_ALL_AD) + (set! (-> v1-1 base) (&+ (the-as pointer a0-4) 16)) + ) + (let* ((s4-0 arg0) + (s3-0 (-> s4-0 base)) + ) + (set! (-> (the-as (pointer gs-test) s3-0) 0) + (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest always)) + ) + (set! (-> (the-as (pointer gs-reg64) s3-0) 1) (gs-reg64 test-1)) + (set! (-> (the-as (pointer gs-alpha) s3-0) 2) (new 'static 'gs-alpha :b #x1 :d #x1)) + (set! (-> (the-as (pointer gs-reg64) s3-0) 3) (gs-reg64 alpha-1)) + (set! (-> (the-as (pointer gs-tex0) s3-0) 4) + (new 'static 'gs-tex0 :tbp0 #x2a0 :tbw #x2 :tcc #x1 :th (log2 128) :tw (log2 128)) + ) + (set! (-> (the-as (pointer gs-reg64) s3-0) 5) (gs-reg64 tex0-1)) + (set! (-> (the-as (pointer gs-tex1) s3-0) 6) (new 'static 'gs-tex1 :mmag #x1 :mmin #x1)) + (set! (-> (the-as (pointer gs-reg64) s3-0) 7) (gs-reg64 tex1-1)) + (set! (-> (the-as (pointer gs-clamp) s3-0) 8) (new 'static 'gs-clamp)) + (set! (-> (the-as (pointer gs-reg64) s3-0) 9) (gs-reg64 clamp-1)) + (set! (-> (the-as (pointer uint64) s3-0) 10) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) s3-0) 11) (gs-reg64 texflush)) + (set! (-> s4-0 base) (&+ s3-0 96)) + ) + (let ((v1-17 (the-as (inline-array vector4w) (-> arg0 base)))) + (set! (-> v1-17 0 quad) (-> obj sprite-tmpl dma-vif quad)) + (set! (-> v1-17 1 quad) (-> obj sprite-tmpl quad 1)) + (set! (-> v1-17 2 quad) (-> obj color80808080 quad)) + (set! (-> v1-17 3 quad) (-> obj uv00 quad)) + (set! (-> v1-17 4 quad) (-> obj xy00 quad)) + (set! (-> v1-17 5 quad) (-> obj uv8080 quad)) + (set! (-> v1-17 6 quad) (-> obj xy8080 quad)) + ) + (&+! (-> arg0 base) 112) + (let* ((v1-20 arg0) + (a0-15 (the-as object (-> v1-20 base))) + ) + (set! (-> (the-as dma-packet a0-15) dma) (new 'static 'dma-tag :qwc #x5 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-15) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-15) vif1) (new 'static 'vif-tag :imm #x5 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-20 base) (&+ (the-as pointer a0-15) 16)) + ) + (let* ((v1-21 arg0) + (a0-17 (the-as object (-> v1-21 base))) + ) + (set! (-> (the-as gs-gif-tag a0-17) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x4)) + (set! (-> (the-as gs-gif-tag a0-17) regs) GIF_REGS_ALL_AD) + (set! (-> v1-21 base) (&+ (the-as pointer a0-17) 16)) + ) + (let* ((v1-22 arg0) + (a0-19 (-> v1-22 base)) + ) + (set! (-> (the-as (pointer gs-bitbltbuf) a0-19) 0) (new 'static 'gs-bitbltbuf :dbp #x860)) + (set! (-> (the-as (pointer gs-reg64) a0-19) 1) (gs-reg64 bitbltbuf)) + (set! (-> (the-as (pointer gs-trxpos) a0-19) 2) (new 'static 'gs-trxpos)) + (set! (-> (the-as (pointer gs-reg64) a0-19) 3) (gs-reg64 trxpos)) + (set! (-> (the-as (pointer gs-trxreg) a0-19) 4) (new 'static 'gs-trxreg :rrw #x10 :rrh #x10)) + (set! (-> (the-as (pointer gs-reg64) a0-19) 5) (gs-reg64 trxreg)) + (set! (-> (the-as (pointer gs-trxdir) a0-19) 6) (new 'static 'gs-trxdir)) + (set! (-> (the-as (pointer gs-reg64) a0-19) 7) (gs-reg64 trxdir)) + (set! (-> v1-22 base) (&+ a0-19 64)) + ) + (let ((v1-23 (the-as object (-> arg0 base)))) + (set! (-> (the-as (inline-array vector4w) v1-23) 0 quad) (-> obj clut-tmpl dma-vif quad)) + (set! (-> (the-as (inline-array vector4w) v1-23) 1 quad) (-> obj clut-tmpl quad 1)) + (ocean-method-80 obj (the-as (pointer rgba) (&+ (the-as pointer v1-23) 32))) + ) + (&+! (-> arg0 base) 1056) + (set-display-gs-state arg0 85 128 128 0 0) + (let* ((v1-27 arg0) + (a0-25 (the-as object (-> v1-27 base))) + ) + (set! (-> (the-as dma-packet a0-25) dma) (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-25) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-25) vif1) (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-27 base) (&+ (the-as pointer a0-25) 16)) + ) + (let* ((v1-28 arg0) + (a0-27 (the-as object (-> v1-28 base))) + ) + (set! (-> (the-as gs-gif-tag a0-27) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x5)) + (set! (-> (the-as gs-gif-tag a0-27) regs) GIF_REGS_ALL_AD) + (set! (-> v1-28 base) (&+ (the-as pointer a0-27) 16)) + ) + (let* ((s4-1 arg0) + (s3-1 (-> s4-1 base)) + ) + (set! (-> (the-as (pointer gs-alpha) s3-1) 0) (new 'static 'gs-alpha)) + (set! (-> (the-as (pointer gs-reg64) s3-1) 1) (gs-reg64 alpha-1)) + (set! (-> (the-as (pointer gs-tex0) s3-1) 2) (new 'static 'gs-tex0 + :tbp0 #x2a0 + :tbw #x2 + :psm #x1b + :tcc #x1 + :cbp #x860 + :cld #x1 + :th (log2 128) + :tw (log2 128) + ) + ) + (set! (-> (the-as (pointer gs-reg64) s3-1) 3) (gs-reg64 tex0-1)) + (set! (-> (the-as (pointer gs-tex1) s3-1) 4) (new 'static 'gs-tex1)) + (set! (-> (the-as (pointer gs-reg64) s3-1) 5) (gs-reg64 tex1-1)) + (set! (-> (the-as (pointer gs-clamp) s3-1) 6) (new 'static 'gs-clamp)) + (set! (-> (the-as (pointer gs-reg64) s3-1) 7) (gs-reg64 clamp-1)) + (set! (-> (the-as (pointer uint64) s3-1) 8) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) s3-1) 9) (gs-reg64 texflush)) + (set! (-> s4-1 base) (&+ s3-1 80)) + ) + (let ((v1-40 (the-as (inline-array vector4w) (-> arg0 base)))) + (set! (-> v1-40 0 quad) (-> obj sprite-tmpl3 dma-vif quad)) + (set! (-> v1-40 1 quad) (-> obj sprite-tmpl3 quad 1)) + (set-vector! (-> v1-40 2) 96 96 96 128) + (set! (-> v1-40 3 quad) (-> obj uv00 quad)) + (set! (-> v1-40 4 quad) (-> obj xy00 quad)) + (set! (-> v1-40 5 quad) (-> obj uv8080 quad)) + (set! (-> v1-40 6 quad) (-> obj xy8080 quad)) + ) + (&+! (-> arg0 base) 112) + (let* ((v1-43 arg0) + (a0-38 (the-as object (-> v1-43 base))) + ) + (set! (-> (the-as dma-packet a0-38) dma) (new 'static 'dma-tag :qwc #x4 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-38) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-38) vif1) (new 'static 'vif-tag :imm #x4 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-43 base) (&+ (the-as pointer a0-38) 16)) + ) + (let* ((v1-44 arg0) + (a0-40 (the-as object (-> v1-44 base))) + ) + (set! (-> (the-as gs-gif-tag a0-40) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x3)) + (set! (-> (the-as gs-gif-tag a0-40) regs) GIF_REGS_ALL_AD) + (set! (-> v1-44 base) (&+ (the-as pointer a0-40) 16)) + ) + (let* ((v1-45 arg0) + (a0-42 (-> v1-45 base)) + ) + (set! (-> (the-as (pointer gs-alpha) a0-42) 0) (new 'static 'gs-alpha :b #x1 :d #x1)) + (set! (-> (the-as (pointer gs-reg64) a0-42) 1) (gs-reg64 alpha-1)) + (set! (-> (the-as (pointer gs-tex1) a0-42) 2) (new 'static 'gs-tex1 :mmag #x1 :mmin #x1)) + (set! (-> (the-as (pointer gs-reg64) a0-42) 3) (gs-reg64 tex1-1)) + (set! (-> (the-as (pointer uint64) a0-42) 4) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) a0-42) 5) (gs-reg64 texflush)) + (set! (-> v1-45 base) (&+ a0-42 48)) + ) + (let ((v1-46 (the-as (inline-array vector4w) (-> arg0 base)))) + (set! (-> v1-46 0 quad) (-> obj sprite-tmpl3 dma-vif quad)) + (set! (-> v1-46 1 quad) (-> obj sprite-tmpl3 quad 1)) + (set-vector! (-> v1-46 2) 64 64 64 64) + (set! (-> v1-46 3 quad) (-> obj uv-scroll-0 quad)) + (set! (-> v1-46 4 quad) (-> obj xy00 quad)) + (set! (-> v1-46 5 quad) (-> obj uv-scroll-1 quad)) + (set! (-> v1-46 6 quad) (-> obj xy8080 quad)) + ) + (&+! (-> arg0 base) 112) + (set-display-gs-state arg0 21 128 128 0 0) + (let* ((v1-49 arg0) + (a0-52 (the-as object (-> v1-49 base))) + ) + (set! (-> (the-as dma-packet a0-52) dma) (new 'static 'dma-tag :qwc #x5 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-52) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-52) vif1) (new 'static 'vif-tag :imm #x5 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-49 base) (&+ (the-as pointer a0-52) 16)) + ) + (let* ((v1-50 arg0) + (a0-54 (the-as object (-> v1-50 base))) + ) + (set! (-> (the-as gs-gif-tag a0-54) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x4)) + (set! (-> (the-as gs-gif-tag a0-54) regs) GIF_REGS_ALL_AD) + (set! (-> v1-50 base) (&+ (the-as pointer a0-54) 16)) + ) + (let* ((s4-2 arg0) + (s3-2 (-> s4-2 base)) + ) + (set! (-> (the-as (pointer gs-alpha) s3-2) 0) (new 'static 'gs-alpha :b #x1 :d #x1)) + (set! (-> (the-as (pointer gs-reg64) s3-2) 1) (gs-reg64 alpha-1)) + (set! (-> (the-as (pointer gs-tex0) s3-2) 2) + (new 'static 'gs-tex0 :tbp0 #x6a0 :tbw #x2 :th (log2 128) :tw (log2 128)) + ) + (set! (-> (the-as (pointer gs-reg64) s3-2) 3) (gs-reg64 tex0-1)) + (set! (-> (the-as (pointer gs-tex1) s3-2) 4) (new 'static 'gs-tex1 :mmag #x1 :mmin #x1)) + (set! (-> (the-as (pointer gs-reg64) s3-2) 5) (gs-reg64 tex1-1)) + (set! (-> (the-as (pointer uint64) s3-2) 6) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) s3-2) 7) (gs-reg64 texflush)) + (set! (-> s4-2 base) (&+ s3-2 64)) + ) + (let ((v1-63 (the-as (inline-array vector4w) (-> arg0 base)))) + (set! (-> v1-63 0 quad) (-> obj sprite-tmpl3 dma-vif quad)) + (set! (-> v1-63 1 quad) (-> obj sprite-tmpl3 quad 1)) + (set-vector! (-> v1-63 2) 128 128 128 64) + (set! (-> v1-63 3 quad) (-> obj uv-scroll-0 quad)) + (set! (-> v1-63 4 quad) (-> obj xy00 quad)) + (set! (-> v1-63 5 quad) (-> obj uv-scroll-1 quad)) + (set! (-> v1-63 6 quad) (-> obj xy8080 quad)) + ) + (&+! (-> arg0 base) 112) + (let ((s5-1 128) + (s4-3 128) + ) + (let ((s1-0 21) + (s2-5 2720) + (s3-3 (log2 (* s5-1 2))) + (v1-66 (log2 s4-3)) + (a0-69 (/ (+ (* s5-1 2) 63) 64)) + (a1-55 #x3fff) + ) + (let* ((a2-3 arg0) + (a3-3 (the-as object (-> a2-3 base))) + ) + (set! (-> (the-as dma-packet a3-3) dma) (new 'static 'dma-tag :qwc #xc :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a3-3) vif0) (new 'static 'vif-tag :cmd (vif-cmd flusha) :msk #x1)) + (set! (-> (the-as dma-packet a3-3) vif1) (new 'static 'vif-tag :imm #xc :cmd (vif-cmd direct) :msk #x1)) + (set! (-> a2-3 base) (&+ (the-as pointer a3-3) 16)) + ) + (let* ((a2-4 arg0) + (a3-5 (the-as object (-> a2-4 base))) + ) + (set! (-> (the-as gs-gif-tag a3-5) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #xb)) + (set! (-> (the-as gs-gif-tag a3-5) regs) GIF_REGS_ALL_AD) + (set! (-> a2-4 base) (&+ (the-as pointer a3-5) 16)) + ) + (let* ((a2-5 arg0) + (a3-7 (-> a2-5 base)) + ) + (set! (-> (the-as (pointer gs-xy-offset) a3-7) 0) (new 'static 'gs-xy-offset)) + (set! (-> (the-as (pointer gs-reg64) a3-7) 1) (gs-reg64 xyoffset-1)) + (set! (-> (the-as (pointer gs-frame) a3-7) 2) + (new 'static 'gs-frame :psm (gs-psm ct16) :fbmsk a1-55 :fbw a0-69 :fbp s1-0) + ) + (set! (-> (the-as (pointer gs-reg64) a3-7) 3) (gs-reg64 frame-1)) + (set! (-> (the-as (pointer gs-scissor) a3-7) 4) + (new 'static 'gs-scissor :scax1 (+ s5-1 -1) :scay1 (+ s4-3 -1)) + ) + (set! (-> (the-as (pointer gs-reg64) a3-7) 5) (gs-reg64 scissor-1)) + (set! (-> (the-as (pointer gs-test) a3-7) 6) + (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + ) + (set! (-> (the-as (pointer gs-reg64) a3-7) 7) (gs-reg64 test-1)) + (set! (-> (the-as (pointer gs-alpha) a3-7) 8) (new 'static 'gs-alpha :a #x2 :b #x2 :c #x2 :fix #x80)) + (set! (-> (the-as (pointer gs-reg64) a3-7) 9) (gs-reg64 alpha-1)) + (set! (-> (the-as (pointer gs-tex0) a3-7) 10) + (new 'static 'gs-tex0 :psm #x2 :tcc #x1 :tfx #x1 :th v1-66 :tw s3-3 :tbw a0-69 :tbp0 s2-5) + ) + (set! (-> (the-as (pointer gs-reg64) a3-7) 11) (gs-reg64 tex0-1)) + (set! (-> (the-as (pointer uint64) a3-7) 12) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) a3-7) 13) (gs-reg64 fba-1)) + (set! (-> (the-as (pointer gs-texa) a3-7) 14) (new 'static 'gs-texa :ta1 #x80)) + (set! (-> (the-as (pointer gs-reg64) a3-7) 15) (gs-reg64 texa)) + (set! (-> (the-as (pointer gs-tex1) a3-7) 16) (new 'static 'gs-tex1 :lcm #x1)) + (set! (-> (the-as (pointer gs-reg64) a3-7) 17) (gs-reg64 tex1-1)) + (set! (-> (the-as (pointer uint64) a3-7) 18) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) a3-7) 19) (gs-reg64 texflush)) + (set! (-> (the-as (pointer gs-prim) a3-7) 20) + (new 'static 'gs-prim :prim (gs-prim-type sprite) :tme #x1 :abe #x1 :fst #x1) + ) + (set! (-> (the-as (pointer gs-reg64) a3-7) 21) (gs-reg64 prim)) + (set! (-> a2-5 base) (&+ a3-7 176)) + ) + (let ((a2-6 s4-3)) + (dotimes (a3-9 (/ s5-1 16)) + (let* ((t0-38 arg0) + (t1-19 (the-as object (-> t0-38 base))) + ) + (set! (-> (the-as dma-packet t1-19) dma) (new 'static 'dma-tag :qwc #x5 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet t1-19) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet t1-19) vif1) (new 'static 'vif-tag :imm #x5 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> t0-38 base) (&+ (the-as pointer t1-19) 16)) + ) + (let* ((t0-39 arg0) + (t1-21 (the-as object (-> t0-39 base))) + ) + (set! (-> (the-as gs-gif-tag t1-21) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x4)) + (set! (-> (the-as gs-gif-tag t1-21) regs) GIF_REGS_ALL_AD) + (set! (-> t0-39 base) (&+ (the-as pointer t1-21) 16)) + ) + (let* ((t0-40 arg0) + (t1-23 (-> t0-40 base)) + ) + (set! (-> (the-as (pointer gs-xyz) t1-23) 0) (new 'static 'gs-xyz :y #x8 :x (+ (* a3-9 256) 8))) + (set! (-> (the-as (pointer gs-reg64) t1-23) 1) (gs-reg64 uv)) + (set! (-> (the-as (pointer gs-xyz) t1-23) 2) (new 'static 'gs-xyz :x (+ (* a3-9 256) 128))) + (set! (-> (the-as (pointer gs-reg64) t1-23) 3) (gs-reg64 xyz2)) + (set! (-> (the-as (pointer gs-xyz) t1-23) 4) + (new 'static 'gs-xyz :x (+ (* a3-9 256) 136) :y (+ (* a2-6 16) 8)) + ) + (set! (-> (the-as (pointer gs-reg64) t1-23) 5) (gs-reg64 uv)) + (set! (-> (the-as (pointer gs-xyz) t1-23) 6) (new 'static 'gs-xyz :y (* a2-6 16) :x (+ (* a3-9 256) 256))) + (set! (-> (the-as (pointer gs-reg64) t1-23) 7) (gs-reg64 xyz2)) + (set! (-> t0-40 base) (&+ t1-23 64)) + ) + ) + ) + (let ((t0-42 (/ s5-1 64))) + (let* ((a2-9 arg0) + (a3-10 (the-as object (-> a2-9 base))) + ) + (set! (-> (the-as dma-packet a3-10) dma) (new 'static 'dma-tag :qwc #x4 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a3-10) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a3-10) vif1) (new 'static 'vif-tag :imm #x4 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> a2-9 base) (&+ (the-as pointer a3-10) 16)) + ) + (let* ((a2-10 arg0) + (a3-12 (the-as object (-> a2-10 base))) + ) + (set! (-> (the-as gs-gif-tag a3-12) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x3)) + (set! (-> (the-as gs-gif-tag a3-12) regs) GIF_REGS_ALL_AD) + (set! (-> a2-10 base) (&+ (the-as pointer a3-12) 16)) + ) + (let* ((a2-11 arg0) + (a3-14 (-> a2-11 base)) + ) + (set! (-> (the-as (pointer gs-frame) a3-14) 0) + (new 'static 'gs-frame :psm (gs-psm ct16) :fbmsk a1-55 :fbw a0-69 :fbp (+ s1-0 t0-42)) + ) + (set! (-> (the-as (pointer gs-reg64) a3-14) 1) (gs-reg64 frame-1)) + (set! (-> (the-as (pointer gs-tex0) a3-14) 2) + (new 'static 'gs-tex0 :psm #x2 :tcc #x1 :tfx #x1 :th v1-66 :tw s3-3 :tbw a0-69 :tbp0 (+ s2-5 (* t0-42 32))) + ) + (set! (-> (the-as (pointer gs-reg64) a3-14) 3) (gs-reg64 tex0-1)) + (set! (-> (the-as (pointer gs-prim) a3-14) 4) + (new 'static 'gs-prim :prim (gs-prim-type sprite) :tme #x1 :abe #x1 :fst #x1) + ) + (set! (-> (the-as (pointer gs-reg64) a3-14) 5) (gs-reg64 prim)) + (set! (-> a2-11 base) (&+ a3-14 48)) + ) + ) + ) + (dotimes (v1-73 (/ s5-1 16)) + (let* ((a0-74 arg0) + (a1-63 (the-as object (-> a0-74 base))) + ) + (set! (-> (the-as dma-packet a1-63) dma) (new 'static 'dma-tag :qwc #x5 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a1-63) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a1-63) vif1) (new 'static 'vif-tag :imm #x5 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> a0-74 base) (&+ (the-as pointer a1-63) 16)) + ) + (let* ((a0-75 arg0) + (a1-65 (the-as object (-> a0-75 base))) + ) + (set! (-> (the-as gs-gif-tag a1-65) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x4)) + (set! (-> (the-as gs-gif-tag a1-65) regs) GIF_REGS_ALL_AD) + (set! (-> a0-75 base) (&+ (the-as pointer a1-65) 16)) + ) + (let* ((a0-76 arg0) + (a1-67 (-> a0-76 base)) + ) + (set! (-> (the-as (pointer gs-xyz) a1-67) 0) (new 'static 'gs-xyz :y #x8 :x (+ (* v1-73 256) 8))) + (set! (-> (the-as (pointer gs-reg64) a1-67) 1) (gs-reg64 uv)) + (set! (-> (the-as (pointer gs-xyz) a1-67) 2) (new 'static 'gs-xyz :x (+ (* v1-73 256) 128))) + (set! (-> (the-as (pointer gs-reg64) a1-67) 3) (gs-reg64 xyz2)) + (set! (-> (the-as (pointer gs-xyz) a1-67) 4) + (new 'static 'gs-xyz :x (+ (* v1-73 256) 136) :y (+ (* s4-3 16) 8)) + ) + (set! (-> (the-as (pointer gs-reg64) a1-67) 5) (gs-reg64 uv)) + (set! (-> (the-as (pointer gs-xyz) a1-67) 6) (new 'static 'gs-xyz :y (* s4-3 16) :x (+ (* v1-73 256) 256))) + (set! (-> (the-as (pointer gs-reg64) a1-67) 7) (gs-reg64 xyz2)) + (set! (-> a0-76 base) (&+ a1-67 64)) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 82 of type ocean +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod draw-envmap-debug ocean ((obj ocean) (arg0 dma-buffer)) + (format *stdcon* "draw-envmap-debug~%") + (-> arg0 base) + (let* ((v1-1 arg0) + (a0-2 (the-as object (-> v1-1 base))) + ) + (set! (-> (the-as dma-packet a0-2) dma) (new 'static 'dma-tag :qwc #x7 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-2) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-2) vif1) (new 'static 'vif-tag :imm #x7 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-1 base) (&+ (the-as pointer a0-2) 16)) + ) + (let* ((v1-2 arg0) + (a0-4 (the-as object (-> v1-2 base))) + ) + (set! (-> (the-as gs-gif-tag a0-4) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x6)) + (set! (-> (the-as gs-gif-tag a0-4) regs) GIF_REGS_ALL_AD) + (set! (-> v1-2 base) (&+ (the-as pointer a0-4) 16)) + ) + (let* ((s4-0 arg0) + (s3-0 (-> s4-0 base)) + ) + (set! (-> (the-as (pointer gs-test) s3-0) 0) + (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest always)) + ) + (set! (-> (the-as (pointer gs-reg64) s3-0) 1) (gs-reg64 test-1)) + (set! (-> (the-as (pointer gs-alpha) s3-0) 2) (new 'static 'gs-alpha :b #x1 :d #x1)) + (set! (-> (the-as (pointer gs-reg64) s3-0) 3) (gs-reg64 alpha-1)) + (set! (-> (the-as (pointer gs-tex0) s3-0) 4) + (new 'static 'gs-tex0 + :tbw #x1 + :tcc #x1 + :th (log2 64) + :tw (log2 64) + :tbp0 (+ (-> *ocean-texture-base* vram-block) 256) + ) + ) + (set! (-> (the-as (pointer gs-reg64) s3-0) 5) (gs-reg64 tex0-1)) + (set! (-> (the-as (pointer gs-tex1) s3-0) 6) (new 'static 'gs-tex1 :mmag #x1 :mmin #x1)) + (set! (-> (the-as (pointer gs-reg64) s3-0) 7) (gs-reg64 tex1-1)) + (set! (-> (the-as (pointer gs-clamp) s3-0) 8) + (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp)) + ) + (set! (-> (the-as (pointer gs-reg64) s3-0) 9) (gs-reg64 clamp-1)) + (set! (-> (the-as (pointer uint64) s3-0) 10) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) s3-0) 11) (gs-reg64 texflush)) + (set! (-> s4-0 base) (&+ s3-0 96)) + ) + (let ((v1-20 (the-as (inline-array vector4w) (-> arg0 base)))) + (set! (-> v1-20 0 quad) (-> obj sprite-tmpl dma-vif quad)) + (set! (-> v1-20 1 quad) (-> obj sprite-tmpl quad 1)) + (set! (-> v1-20 2 quad) (-> obj color80808080 quad)) + (set! (-> v1-20 3 quad) (-> obj uv00 quad)) + (set-vector! (-> v1-20 4) #x7b50 #x8000 #xffffff 0) + (set! (-> v1-20 5 quad) (-> obj uv4040 quad)) + (set-vector! (-> v1-20 6) #x7f60 #x8400 #xffffff 0) + ) + (&+! (-> arg0 base) 112) + (let* ((v1-24 arg0) + (a0-22 (the-as object (-> v1-24 base))) + ) + (set! (-> (the-as dma-packet a0-22) dma) (new 'static 'dma-tag :qwc #x7 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-22) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-22) vif1) (new 'static 'vif-tag :imm #x7 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-24 base) (&+ (the-as pointer a0-22) 16)) + ) + (let* ((v1-25 arg0) + (a0-24 (the-as object (-> v1-25 base))) + ) + (set! (-> (the-as gs-gif-tag a0-24) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x6)) + (set! (-> (the-as gs-gif-tag a0-24) regs) GIF_REGS_ALL_AD) + (set! (-> v1-25 base) (&+ (the-as pointer a0-24) 16)) + ) + (let* ((s4-1 arg0) + (s3-1 (-> s4-1 base)) + ) + (set! (-> (the-as (pointer gs-test) s3-1) 0) + (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest always)) + ) + (set! (-> (the-as (pointer gs-reg64) s3-1) 1) (gs-reg64 test-1)) + (set! (-> (the-as (pointer gs-alpha) s3-1) 2) (new 'static 'gs-alpha)) + (set! (-> (the-as (pointer gs-reg64) s3-1) 3) (gs-reg64 alpha-1)) + (set! (-> (the-as (pointer gs-tex0) s3-1) 4) + (new 'static 'gs-tex0 :tbw #x1 :th (log2 64) :tw (log2 64) :tbp0 (-> *ocean-envmap-texture-base* vram-block)) + ) + (set! (-> (the-as (pointer gs-reg64) s3-1) 5) (gs-reg64 tex0-1)) + (set! (-> (the-as (pointer gs-tex1) s3-1) 6) (new 'static 'gs-tex1)) + (set! (-> (the-as (pointer gs-reg64) s3-1) 7) (gs-reg64 tex1-1)) + (set! (-> (the-as (pointer gs-clamp) s3-1) 8) + (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp)) + ) + (set! (-> (the-as (pointer gs-reg64) s3-1) 9) (gs-reg64 clamp-1)) + (set! (-> (the-as (pointer uint64) s3-1) 10) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) s3-1) 11) (gs-reg64 texflush)) + (set! (-> s4-1 base) (&+ s3-1 96)) + ) + (let ((v1-44 (the-as (inline-array vector4w) (-> arg0 base)))) + (set! (-> v1-44 0 quad) (-> obj sprite-tmpl dma-vif quad)) + (set! (-> v1-44 1 quad) (-> obj sprite-tmpl quad 1)) + (set! (-> v1-44 2 quad) (-> obj color80808080 quad)) + (set! (-> v1-44 3 quad) (-> obj uv00 quad)) + (set-vector! (-> v1-44 4) #x8000 #x8000 #xffffff 0) + (set! (-> v1-44 5 quad) (-> obj uv4040 quad)) + (set-vector! (-> v1-44 6) #x8820 #x8400 #xffffff 0) + ) + (&+! (-> arg0 base) 112) + 0 + (none) + ) + +;; definition for method 83 of type ocean +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod ocean-method-83 ocean ((obj ocean) (arg0 dma-buffer) (arg1 float)) + (let* ((s4-0 64) + (s3-0 0) + (f30-0 (/ -65536.0 (the float s4-0))) + (f28-0 arg1) + ) + (let* ((v1-1 arg0) + (a0-1 (the-as object (-> v1-1 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :qwc #x5 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-1) vif1) (new 'static 'vif-tag :imm #x5 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-1 base) (&+ (the-as pointer a0-1) 16)) + ) + (let* ((v1-2 arg0) + (a0-3 (the-as object (-> v1-2 base))) + ) + (set! (-> (the-as gs-gif-tag a0-3) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x4)) + (set! (-> (the-as gs-gif-tag a0-3) regs) GIF_REGS_ALL_AD) + (set! (-> v1-2 base) (&+ (the-as pointer a0-3) 16)) + ) + (let* ((s2-0 arg0) + (s1-0 (-> s2-0 base)) + ) + (set! (-> (the-as (pointer gs-alpha) s1-0) 0) (new 'static 'gs-alpha :b #x1 :d #x1)) + (set! (-> (the-as (pointer gs-reg64) s1-0) 1) (gs-reg64 alpha-1)) + (set! (-> (the-as (pointer gs-tex0) s1-0) 2) + (new 'static 'gs-tex0 + :tbw #x1 + :tcc #x1 + :th (log2 64) + :tw (log2 64) + :tbp0 (+ (-> *ocean-texture-base* vram-block) 256) + ) + ) + (set! (-> (the-as (pointer gs-reg64) s1-0) 3) (gs-reg64 tex0-1)) + (set! (-> (the-as (pointer gs-clamp) s1-0) 4) + (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp)) + ) + (set! (-> (the-as (pointer gs-reg64) s1-0) 5) (gs-reg64 clamp-1)) + (set! (-> (the-as (pointer uint64) s1-0) 6) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) s1-0) 7) (gs-reg64 texflush)) + (set! (-> s2-0 base) (&+ s1-0 64)) + ) + (let ((v1-16 (-> arg0 base))) + (set! (-> (the-as (pointer uint128) v1-16)) (-> obj line-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) v1-16) 1) (-> obj line-tmpl quad 1)) + ) + (&+! (-> arg0 base) 32) + (dotimes (s2-1 s4-0) + (let ((s1-1 (the-as object (-> arg0 base)))) + (let ((f26-1 (+ 0.5 (* 0.5 (sin f28-0)))) + (f0-5 (+ 0.5 (* 0.5 (cos f28-0)))) + ) + (set! (-> (the-as (inline-array vector4w) s1-1) 0 quad) (-> obj color80808000 quad)) + (set! (-> (the-as (inline-array vector4w) s1-1) 1 quad) (-> obj st0505 quad)) + (set-vector! (-> (the-as (inline-array vector4w) s1-1) 2) s3-0 0 #xffffff 0) + (set-vector! + (-> (the-as (inline-array vector4w) s1-1) 3) + (the-as int f26-1) + (the-as int f0-5) + (the-as int 1.0) + (the-as int 0.0) + ) + ) + (set-vector! (-> (the-as (inline-array vector4w) s1-1) 4) s3-0 512 #xffffff 0) + ) + (+! s3-0 16) + (+! f28-0 f30-0) + (&+! (-> arg0 base) 80) + ) + ) + 0 + (none) + ) + +;; definition for method 84 of type ocean +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod ocean-method-84 ocean ((obj ocean) (arg0 dma-buffer) (arg1 sky-upload-data) (arg2 vector4w) (arg3 float)) + (when (>= (-> arg1 sun 0 pos y) -150.0) + (let* ((f2-0 (* 0.00010050251 (-> arg1 sun 0 pos x))) + (f1-3 (* 0.00010050251 (-> arg1 sun 0 pos z))) + (f0-6 (if (< 0.0 (-> arg1 sun 0 pos y)) + 1.0 + (* 0.006666667 (+ 150.0 (-> arg1 sun 0 pos y))) + ) + ) + (f3-6 (if (< 4000.0 (-> arg1 sun 0 pos y)) + 1.0 + (+ 1.0 (* 0.001 (- 4000.0 (-> arg1 sun 0 pos y)))) + ) + ) + (t0-1 (* arg3 f3-6)) + (v1-14 (the int (+ 1024.0 (* 512.0 f2-0)))) + (a2-3 (the int (+ 1024.0 (* 512.0 f1-3)))) + (t0-2 (the int t0-1)) + (t1-0 (the-as (inline-array vector4w) (-> arg0 base))) + ) + (set! (-> t1-0 0 quad) (-> obj sun-tmpl dma-vif quad)) + (set! (-> t1-0 1 quad) (-> obj sun-tmpl quad 1)) + (set! (-> t1-0 2 quad) (-> arg2 quad)) + (set! (-> t1-0 2 w) (the int (* 128.0 f0-6))) + (set! (-> t1-0 3 quad) (-> obj st0000 quad)) + (set-vector! (-> t1-0 4) (- v1-14 t0-2) (- a2-3 t0-2) #xffffff 0) + (set! (-> t1-0 5 quad) (-> obj st1010 quad)) + (set-vector! (-> t1-0 6) (+ v1-14 t0-2) (+ a2-3 t0-2) #xffffff 0) + ) + (&+! (-> arg0 base) 112) + ) + 0 + (none) + ) + +;; definition for method 85 of type ocean +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod ocean-method-85 ocean ((obj ocean) (arg0 dma-buffer)) + (local-vars (sv-48 vector4w) (sv-64 vector4w)) + (let* ((v1-0 arg0) + (a0-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-1) vif1) (new 'static 'vif-tag :imm #x2 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) + ) + (let* ((v1-1 arg0) + (a0-3 (the-as object (-> v1-1 base))) + ) + (set! (-> (the-as gs-gif-tag a0-3) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1)) + (set! (-> (the-as gs-gif-tag a0-3) regs) GIF_REGS_ALL_AD) + (set! (-> v1-1 base) (&+ (the-as pointer a0-3) 16)) + ) + (let* ((v1-2 arg0) + (a0-5 (-> v1-2 base)) + ) + (set! (-> (the-as (pointer gs-alpha) a0-5) 0) (new 'static 'gs-alpha :b #x2 :d #x1)) + (set! (-> (the-as (pointer gs-reg64) a0-5) 1) (gs-reg64 alpha-1)) + (set! (-> v1-2 base) (&+ a0-5 16)) + ) + (let ((v1-3 (-> arg0 base))) + (set! (-> (the-as (pointer uint128) v1-3)) (-> obj haze-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) v1-3) 1) (-> obj haze-tmpl quad 1)) + ) + (&+! (-> arg0 base) 32) + (let ((f30-0 0.0) + (f28-0 4096.0) + (s3-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'ocean-vertex)) + (s4-0 (-> arg0 base)) + ) + (dotimes (s1-0 16) + (let ((s0-0 (the-as object (-> arg0 base)))) + (set! sv-48 (-> obj haze-verts (* s1-0 2))) + (set! sv-64 (-> obj haze-verts (+ (* s1-0 2) 1))) + (let ((f0-1 (+ -1024.0 (the float (-> sv-48 x)))) + (f1-3 (+ -1024.0 (the float (-> sv-48 y)))) + (v1-22 s2-0) + ) + (set! (-> v1-22 pos x) f0-1) + (set! (-> v1-22 pos y) 0.0) + (set! (-> v1-22 pos z) f1-3) + (set! (-> v1-22 pos w) 1.0) + ) + (add-colors! obj s3-0 s2-0) + (vector-float*! s3-0 s3-0 0.25) + (set-vector! + (-> (the-as (inline-array vector4w) s0-0) 0) + (the int (-> s3-0 x)) + (the int (-> s3-0 y)) + (the int (-> s3-0 z)) + 0 + ) + (set! (-> (the-as (inline-array vector4w) s0-0) 1 quad) (-> sv-48 quad)) + (set-vector! + (-> (the-as (inline-array vector4w) s0-0) 2) + (the int (-> s3-0 x)) + (the int (-> s3-0 y)) + (the int (-> s3-0 z)) + 128 + ) + (set! (-> (the-as (inline-array vector4w) s0-0) 3 quad) (-> sv-64 quad)) + ) + (&+! (-> arg0 base) 64) + (+! f30-0 f28-0) + ) + (let ((v1-37 (the-as (pointer uint128) (-> arg0 base)))) + (set! (-> v1-37 0) (-> (the-as (pointer uint128) s4-0) 0)) + (set! (-> v1-37 1) (-> (the-as (pointer uint128) s4-0) 1)) + (set! (-> v1-37 2) (-> (the-as (pointer uint128) s4-0) 2)) + (set! (-> v1-37 3) (-> (the-as (pointer uint128) s4-0) 3)) + ) + ) + (&+! (-> arg0 base) 64) + 0 + (none) + ) + +;; definition for method 86 of type ocean +;; WARN: Return type mismatch int vs none. +(defmethod ocean-method-86 ocean ((obj ocean) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) + (local-vars (v1-1 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf12 :class vf) + (vf13 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf) + ) + (init-vf0-vector) + (let ((v1-0 (new 'static 'vector :y 128.0 :z 255.0))) + (.max.w.vf vf1 vf0 vf0) + (.lvf vf2 (&-> v1-0 quad)) + ) + (.lvf vf7 (&-> arg1 quad)) + (.lvf vf4 (&-> obj cloud-lights sun0-normal quad)) + (.lvf vf5 (&-> obj cloud-lights sun1-normal quad)) + (.lvf vf6 (&-> obj cloud-lights moon-normal quad)) + (.mul.vf vf8 vf4 vf7) + (.mul.vf vf9 vf5 vf7) + (.mul.vf vf10 vf6 vf7) + (.lvf vf3 (&-> arg3 quad)) + (.mul.w.vf acc vf8 vf0) + (.add.mul.y.vf acc vf1 vf8 acc) + (.add.mul.z.vf vf8 vf1 vf8 acc) + (.mul.w.vf acc vf9 vf0) + (.add.mul.y.vf acc vf1 vf9 acc) + (.add.mul.z.vf vf9 vf1 vf9 acc) + (.mul.w.vf acc vf10 vf0) + (.add.mul.y.vf acc vf1 vf10 acc) + (.add.mul.z.vf vf10 vf1 vf10 acc) + (.lvf vf11 (&-> arg2 quad)) + (.max.vf vf8 vf8 vf0) + (.max.vf vf9 vf9 vf0) + (.max.vf vf10 vf10 vf0) + (.lvf vf12 (&-> obj cloud-lights sun1-color quad)) + (.lvf vf13 (&-> obj cloud-lights moon-color quad)) + (.mul.w.vf acc vf3 vf0) + (.add.mul.x.vf acc vf11 vf8 acc) + (.add.mul.x.vf acc vf12 vf9 acc) + (.add.mul.x.vf vf3 vf13 vf10 acc) + (.mul.y.vf vf3 vf3 vf2) + (.max.x.vf vf3 vf3 vf0) + (.min.z.vf vf3 vf3 vf2) + (.ftoi.vf vf3 vf3) + (.svf (&-> arg0 quad) vf3) + (.mov v1-1 vf3) + 0 + (none) + ) + ) + +;; definition for method 87 of type ocean +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod ocean-method-87 ocean ((obj ocean) (arg0 vector) (arg1 vector) (arg2 vector)) + (let ((s5-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + (f28-0 0.00390625) + (f30-0 0.015625) + ) + (let ((s3-0 (-> obj cloud-lights))) + (set! (-> arg0 quad) (-> arg1 quad)) + (vector--float*! s5-0 arg2 (-> s3-0 sun0-normal) 9.0) + (vector--float*! s2-0 arg2 (-> s3-0 sun1-normal) 9.0) + (vector--float*! s4-0 arg2 (-> s3-0 moon-normal) 9.0) + (vector-float*! s5-0 s5-0 (* (-> s3-0 sun0-scale) f28-0)) + (vector+float*! s5-0 s5-0 s2-0 (* 0.25 f28-0 (-> s3-0 sun1-scale))) + (vector+float*! s5-0 s5-0 s4-0 (* (-> s3-0 moon-scale) f28-0)) + ) + (+! (-> arg0 x) (fmax (fmin (-> s5-0 x) f30-0) (- f30-0))) + (+! (-> arg0 y) (fmax (fmin (-> s5-0 z) f30-0) (- f30-0))) + ) + 0 + (none) + ) + +;; definition for method 88 of type ocean +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod ocean-method-88 ocean ((obj ocean) (arg0 dma-buffer)) + (local-vars (sv-48 vector) (sv-64 uint) (sv-80 vector) (sv-96 vector) (sv-112 vector)) + (let* ((v1-0 arg0) + (a0-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :qwc #x7 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-1) vif1) (new 'static 'vif-tag :imm #x7 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) + ) + (let* ((v1-1 arg0) + (a0-3 (the-as object (-> v1-1 base))) + ) + (set! (-> (the-as gs-gif-tag a0-3) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x6)) + (set! (-> (the-as gs-gif-tag a0-3) regs) GIF_REGS_ALL_AD) + (set! (-> v1-1 base) (&+ (the-as pointer a0-3) 16)) + ) + (let* ((s4-0 arg0) + (s3-0 (-> s4-0 base)) + ) + (set! (-> (the-as (pointer gs-test) s3-0) 0) (new 'static 'gs-test + :ate #x1 + :atst (gs-atest greater-equal) + :aref #x50 + :afail #x1 + :zte #x1 + :ztst (gs-ztest greater-equal) + ) + ) + (set! (-> (the-as (pointer gs-reg64) s3-0) 1) (gs-reg64 test-1)) + (set! (-> (the-as (pointer gs-tex0) s3-0) 2) (new 'static 'gs-tex0 + :tbp0 #x100 + :tbw #x2 + :psm #x1b + :tcc #x1 + :cbp #x300 + :cld #x1 + :th (log2 128) + :tw (log2 128) + ) + ) + (set! (-> (the-as (pointer gs-reg64) s3-0) 3) (gs-reg64 tex0-1)) + (set! (-> (the-as (pointer gs-tex1) s3-0) 4) (new 'static 'gs-tex1 :mmag #x1 :mmin #x1)) + (set! (-> (the-as (pointer gs-reg64) s3-0) 5) (gs-reg64 tex1-1)) + (set! (-> (the-as (pointer gs-clamp) s3-0) 6) (new 'static 'gs-clamp)) + (set! (-> (the-as (pointer gs-reg64) s3-0) 7) (gs-reg64 clamp-1)) + (set! (-> (the-as (pointer gs-alpha) s3-0) 8) (new 'static 'gs-alpha :b #x1 :d #x1)) + (set! (-> (the-as (pointer gs-reg64) s3-0) 9) (gs-reg64 alpha-1)) + (set! (-> (the-as (pointer uint64) s3-0) 10) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) s3-0) 11) (gs-reg64 texflush)) + (set! (-> s4-0 base) (&+ s3-0 96)) + ) + (let* ((v1-17 *sky-work*) + (f0-1 (* 0.000015258789 (the float (-> v1-17 off-s)))) + (f1-3 (* 0.000015258789 (the float (-> v1-17 off-t)))) + ) + (dotimes (v1-19 6) + (dotimes (a0-10 6) + (set-vector! + (-> obj cloud-st0 (+ (* 6 v1-19) a0-10)) + (+ (* 0.5 (the float a0-10)) f0-1) + (+ (* 0.5 (the float v1-19)) f1-3) + 1.0 + 0.0 + ) + ) + ) + ) + (let ((s4-1 (new 'stack-no-clear 'vector)) + (s3-1 (new 'stack-no-clear 'vector)) + (s2-2 (-> obj cloud-lights)) + ) + (vector-float*! (-> s2-2 sun0-color) (-> s2-2 sun0-color) 0.25) + (vector-float*! (-> s2-2 sun0-color-lower) (-> s2-2 sun0-color-lower) 0.25) + (vector-float*! (-> s2-2 sun1-color) (-> s2-2 sun1-color) 0.25) + (vector-float*! (-> s2-2 moon-color) (-> s2-2 moon-color) 0.25) + (vector-float*! (-> s2-2 ambi-color) (-> s2-2 ambi-color) 0.25) + (vector-float*! (-> s2-2 ambi-color-lower) (-> s2-2 ambi-color-lower) 0.25) + (dotimes (s1-0 36) + (let ((v1-36 (-> obj cloud-verts s1-0))) + (set! sv-80 (-> obj cloud-nrms s1-0)) + (let ((s0-0 (-> obj cloud-col0 s1-0))) + (set! sv-48 (-> obj cloud-col1 s1-0)) + (set! sv-112 (-> obj cloud-st0 s1-0)) + (set! sv-96 (-> obj cloud-st1 s1-0)) + (set! sv-64 (-> obj cloud-alpha s1-0)) + (set! (-> s4-1 x) (* 0.140625 (+ -1024.0 (the float (-> v1-36 x))))) + (set! (-> s4-1 z) (* 0.140625 (+ -1024.0 (the float (-> v1-36 z))))) + (vector-negate! s3-1 sv-80) + (let ((a0-41 obj) + (t9-3 (method-of-type ocean ocean-method-86)) + (a1-19 s0-0) + (a3-0 (-> s2-2 sun0-color)) + (t0-0 (-> s2-2 ambi-color)) + ) + (t9-3 a0-41 a1-19 sv-80 a3-0 t0-0) + ) + (ocean-method-86 obj sv-48 s3-1 (-> s2-2 sun0-color-lower) (-> s2-2 ambi-color-lower)) + (set! (-> s0-0 w) (the-as float sv-64)) + ) + ) + (set! (-> sv-48 w) (the-as float sv-64)) + (let ((a0-44 obj) + (t9-5 (method-of-type ocean ocean-method-87)) + (a3-2 s4-1) + ) + (t9-5 a0-44 sv-96 sv-112 a3-2) + ) + ) + ) + (dotimes (v1-46 5) + (let ((a0-45 (the-as (inline-array vector4w) (-> arg0 base)))) + (set! (-> a0-45 0 quad) (-> obj cloud-tmpl dma-vif quad)) + (set! (-> a0-45 1 quad) (-> obj cloud-tmpl quad 1)) + ) + (&+! (-> arg0 base) 32) + (dotimes (a0-48 6) + (let ((a3-3 (+ (* 6 v1-46) a0-48)) + (a2-7 (+ (* 6 (+ v1-46 1)) a0-48)) + (a1-28 (the-as (inline-array vector4w) (-> arg0 base))) + ) + (set! (-> a1-28 0 quad) (-> obj cloud-col0 a3-3 quad)) + (set! (-> a1-28 1 quad) (-> obj cloud-st0 a3-3 quad)) + (set! (-> a1-28 2 quad) (-> obj cloud-verts a3-3 quad)) + (set! (-> a1-28 3 quad) (-> obj cloud-col0 a2-7 quad)) + (set! (-> a1-28 4 quad) (-> obj cloud-st0 a2-7 quad)) + (set! (-> a1-28 5 quad) (-> obj cloud-verts a2-7 quad)) + ) + (&+! (-> arg0 base) 96) + ) + ) + (dotimes (v1-49 5) + (let ((a0-51 (the-as (inline-array vector4w) (-> arg0 base)))) + (set! (-> a0-51 0 quad) (-> obj cloud-tmpl dma-vif quad)) + (set! (-> a0-51 1 quad) (-> obj cloud-tmpl quad 1)) + ) + (&+! (-> arg0 base) 32) + (dotimes (a0-54 6) + (let ((a3-13 (+ (* 6 v1-49) a0-54)) + (a2-12 (+ (* 6 (+ v1-49 1)) a0-54)) + (a1-37 (the-as (inline-array vector4w) (-> arg0 base))) + ) + (set! (-> a1-37 0 quad) (-> obj cloud-col1 a3-13 quad)) + (set! (-> a1-37 1 quad) (-> obj cloud-st1 a3-13 quad)) + (set! (-> a1-37 2 quad) (-> obj cloud-verts a3-13 quad)) + (set! (-> a1-37 3 quad) (-> obj cloud-col1 a2-12 quad)) + (set! (-> a1-37 4 quad) (-> obj cloud-st1 a2-12 quad)) + (set! (-> a1-37 5 quad) (-> obj cloud-verts a2-12 quad)) + ) + (&+! (-> arg0 base) 96) + ) + ) + 0 + (none) + ) + +;; definition for method 89 of type ocean +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod ocean-method-89 ocean ((obj ocean) (arg0 dma-buffer)) + (set-display-gs-state arg0 (the-as int (+ (-> *ocean-texture-base* vram-page) 8)) 64 64 0 0) + (vector-float*! (-> obj sky-color) (-> *time-of-day-context* current-sky-color) 0.25) + (+! (-> obj sky-color x) (* 0.5 (- (-> obj sky-color z) (-> obj sky-color x)))) + (+! (-> obj sky-color y) (* 0.5 (- (-> obj sky-color z) (-> obj sky-color y)))) + (let* ((v1-6 arg0) + (a0-4 (the-as object (-> v1-6 base))) + ) + (set! (-> (the-as dma-packet a0-4) dma) (new 'static 'dma-tag :qwc #x4 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-4) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-4) vif1) (new 'static 'vif-tag :imm #x4 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-6 base) (&+ (the-as pointer a0-4) 16)) + ) + (let* ((v1-7 arg0) + (a0-6 (the-as object (-> v1-7 base))) + ) + (set! (-> (the-as gs-gif-tag a0-6) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x3)) + (set! (-> (the-as gs-gif-tag a0-6) regs) GIF_REGS_ALL_AD) + (set! (-> v1-7 base) (&+ (the-as pointer a0-6) 16)) + ) + (let* ((v1-8 arg0) + (a0-8 (-> v1-8 base)) + ) + (set! (-> (the-as (pointer gs-test) a0-8) 0) + (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest always)) + ) + (set! (-> (the-as (pointer gs-reg64) a0-8) 1) (gs-reg64 test-1)) + (set! (-> (the-as (pointer gs-alpha) a0-8) 2) (new 'static 'gs-alpha :b #x1 :d #x1)) + (set! (-> (the-as (pointer gs-reg64) a0-8) 3) (gs-reg64 alpha-1)) + (set! (-> (the-as (pointer uint64) a0-8) 4) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) a0-8) 5) (gs-reg64 texflush)) + (set! (-> v1-8 base) (&+ a0-8 48)) + ) + (let ((v1-9 (the-as object (-> arg0 base)))) + (let ((a1-13 (-> obj sky-color))) + (set! (-> (the-as (inline-array vector4w) v1-9) 0 quad) (-> obj sprite-tmpl2 dma-vif quad)) + (set! (-> (the-as (inline-array vector4w) v1-9) 1 quad) (-> obj sprite-tmpl2 quad 1)) + (set-vector! + (-> (the-as (inline-array vector4w) v1-9) 2) + (the int (-> a1-13 x)) + (the int (-> a1-13 y)) + (the int (-> a1-13 z)) + 128 + ) + ) + (let ((a0-13 (the-as (inline-array vector4w) (&+ (the-as pointer v1-9) 48)))) + (set! (-> a0-13 0 x) 0) + (set! (-> a0-13 0 y) 0) + (set! (-> a0-13 0 z) #xffffff) + (set! (-> a0-13 0 w) 0) + ) + (let ((v1-10 (the-as (inline-array vector4w) (-> (the-as (inline-array vector4w) v1-9) 4)))) + (set! (-> v1-10 0 x) 1024) + (set! (-> v1-10 0 y) 1024) + (set! (-> v1-10 0 z) #xffffff) + (set! (-> v1-10 0 w) 0) + ) + ) + (&+! (-> arg0 base) 80) + (let* ((v1-13 arg0) + (a0-17 (the-as object (-> v1-13 base))) + ) + (set! (-> (the-as dma-packet a0-17) dma) (new 'static 'dma-tag :qwc #x4 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-17) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-17) vif1) (new 'static 'vif-tag :imm #x4 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-13 base) (&+ (the-as pointer a0-17) 16)) + ) + (let* ((v1-14 arg0) + (a0-19 (the-as object (-> v1-14 base))) + ) + (set! (-> (the-as gs-gif-tag a0-19) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x3)) + (set! (-> (the-as gs-gif-tag a0-19) regs) GIF_REGS_ALL_AD) + (set! (-> v1-14 base) (&+ (the-as pointer a0-19) 16)) + ) + (let* ((v1-15 arg0) + (a0-21 (-> v1-15 base)) + ) + (set! (-> (the-as (pointer gs-xy-offset) a0-21) 0) (new 'static 'gs-xy-offset :ofx #x200 :ofy #x200)) + (set! (-> (the-as (pointer gs-reg64) a0-21) 1) (gs-reg64 xyoffset-1)) + (set! (-> (the-as (pointer gs-texa) a0-21) 2) (new 'static 'gs-texa :ta1 #x80)) + (set! (-> (the-as (pointer gs-reg64) a0-21) 3) (gs-reg64 texa)) + (set! (-> (the-as (pointer uint64) a0-21) 4) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) a0-21) 5) (gs-reg64 texflush)) + (set! (-> v1-15 base) (&+ a0-21 48)) + ) + (let ((v1-16 (the-as adgif-shader (-> arg0 base)))) + (set! (-> v1-16 quad 0 quad) (-> obj adgif-tmpl dma-vif quad)) + (set! (-> v1-16 quad 1 quad) (-> obj adgif-tmpl quad 1)) + (let ((s4-0 (&-> v1-16 miptbp1))) + (adgif-shader<-texture-simple! + (the-as adgif-shader s4-0) + (lookup-texture-by-id-fast (new 'static 'texture-id :index #x4 :page #x475)) + ) + (set! (-> s4-0 8) (new 'static 'gs-miptbp :tbp1 #x48)) + ) + ) + (&+! (-> arg0 base) 112) + (let ((s4-1 (-> *sky-work* upload-data)) + (a3-1 (new 'stack 'vector4w)) + ) + (let ((a0-28 (-> obj cloud-lights sun0-color))) + (set-vector! + a3-1 + (the int (* 128.0 (-> a0-28 x))) + (the int (* 80.0 (-> a0-28 y))) + (the int (* 32.0 (-> a0-28 z))) + 1 + ) + ) + (ocean-method-84 obj arg0 s4-1 a3-1 80.0) + ) + (let ((s4-2 (-> *sky-work* upload-data sun 1)) + (a3-2 (new 'stack 'vector4w)) + ) + (let ((a0-32 (-> obj cloud-lights sun1-color))) + (set-vector! + a3-2 + (the int (* 255.0 (-> a0-32 x))) + (the int (* 255.0 (-> a0-32 y))) + (the int (* 255.0 (-> a0-32 z))) + 1 + ) + ) + (ocean-method-84 obj arg0 (the-as sky-upload-data s4-2) a3-2 64.0) + ) + (let ((v1-30 (the-as adgif-shader (-> arg0 base)))) + (set! (-> v1-30 quad 0 quad) (-> obj adgif-tmpl dma-vif quad)) + (set! (-> v1-30 quad 1 quad) (-> obj adgif-tmpl quad 1)) + (let ((s4-3 (&-> v1-30 miptbp1))) + (adgif-shader<-texture-simple! + (the-as adgif-shader s4-3) + (lookup-texture-by-id-fast (new 'static 'texture-id :index #x1 :page #x475)) + ) + (set! (-> s4-3 8) (new 'static 'gs-miptbp :tbp1 #x44)) + ) + ) + (&+! (-> arg0 base) 112) + (let ((a2-3 (-> *sky-work* upload-data moon)) + (a3-3 (new 'static 'vector4w :x 80 :y 80 :z 80)) + ) + (ocean-method-84 obj arg0 (the-as sky-upload-data a2-3) a3-3 48.0) + ) + (ocean-method-85 obj arg0) + (ocean-method-88 obj arg0) + (set-display-gs-state arg0 (the-as int (-> *ocean-envmap-texture-base* vram-page)) 64 64 0 0) + (let ((a0-43 obj) + (t9-13 (method-of-type ocean ocean-method-83)) + (a1-43 arg0) + (a2-5 32768.0) + ) + (t9-13 a0-43 a1-43 a2-5) + (let* ((v1-44 arg0) + (a0-44 (the-as object (-> v1-44 base))) + ) + (set! (-> (the-as dma-packet a0-44) dma) (new 'static 'dma-tag :qwc #x7 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-44) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-44) vif1) (new 'static 'vif-tag :imm #x7 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-44 base) (&+ (the-as pointer a0-44) 16)) + ) + (let* ((v1-45 arg0) + (a0-46 (the-as object (-> v1-45 base))) + ) + (set! (-> (the-as gs-gif-tag a0-46) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x6)) + (set! (-> (the-as gs-gif-tag a0-46) regs) GIF_REGS_ALL_AD) + (set! (-> v1-45 base) (&+ (the-as pointer a0-46) 16)) + ) + (let* ((s4-4 arg0) + (s3-2 (-> s4-4 base)) + ) + (set! (-> (the-as (pointer gs-alpha) s3-2) 0) (new 'static 'gs-alpha :b #x1 :d #x1)) + (set! (-> (the-as (pointer gs-reg64) s3-2) 1) (gs-reg64 alpha-1)) + (set! (-> (the-as (pointer gs-tex0) s3-2) 2) + (new 'static 'gs-tex0 + :tbw #x1 + :tcc #x1 + :th (log2 32) + :tw (log2 64) + :tbp0 (-> *ocean-envmap-texture-base* vram-block) + ) + ) + (set! (-> (the-as (pointer gs-reg64) s3-2) 3) (gs-reg64 tex0-1)) + (set! (-> (the-as (pointer gs-tex1) s3-2) 4) (new 'static 'gs-tex1 :mmag #x1 :mmin #x1)) + (set! (-> (the-as (pointer gs-reg64) s3-2) 5) (gs-reg64 tex1-1)) + (set! (-> (the-as (pointer gs-clamp) s3-2) 6) + (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp)) + ) + (set! (-> (the-as (pointer gs-reg64) s3-2) 7) (gs-reg64 clamp-1)) + (set! (-> (the-as (pointer gs-rgbaq) s3-2) 8) (new 'static 'gs-rgbaq :r #x80 :g #x80 :b #x80 :a #x80 :q 1.0)) + (set! (-> (the-as (pointer gs-reg64) s3-2) 9) (gs-reg64 rgbaq)) + (set! (-> (the-as (pointer uint64) s3-2) 10) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) s3-2) 11) (gs-reg64 texflush)) + (set! (-> s4-4 base) (&+ s3-2 96)) + ) + (let* ((v1-63 arg0) + (a0-54 (the-as object (-> v1-63 base))) + ) + (set! (-> (the-as dma-packet a0-54) dma) (new 'static 'dma-tag :qwc #x3 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-54) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-54) vif1) (new 'static 'vif-tag :imm #x3 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-63 base) (&+ (the-as pointer a0-54) 16)) + ) + (let* ((v1-64 arg0) + (a0-56 (the-as object (-> v1-64 base))) + ) + (set! (-> (the-as gs-gif-tag a0-56) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x2)) + (set! (-> (the-as gs-gif-tag a0-56) regs) GIF_REGS_ALL_AD) + (set! (-> v1-64 base) (&+ (the-as pointer a0-56) 16)) + ) + (let* ((v1-65 arg0) + (a0-58 (-> v1-65 base)) + ) + (set! (-> (the-as (pointer gs-tex1) a0-58) 0) (new 'static 'gs-tex1)) + (set! (-> (the-as (pointer gs-reg64) a0-58) 1) (gs-reg64 tex1-1)) + (set! (-> (the-as (pointer uint64) a0-58) 2) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) a0-58) 3) (gs-reg64 texflush)) + (set! (-> v1-65 base) (&+ a0-58 32)) + ) + (let ((v1-66 (the-as (inline-array vector4w) (-> arg0 base)))) + (set! (-> v1-66 0 quad) (-> obj sprite-tmpl dma-vif quad)) + (set! (-> v1-66 1 quad) (-> obj sprite-tmpl quad 1)) + (set-vector! (-> v1-66 2) 128 128 128 128) + (set-vector! (-> v1-66 3) 8 520 0 0) + (set-vector! (-> v1-66 4) 0 512 #xffffff 0) + (set-vector! (-> v1-66 5) 1032 8 0 0) + (let ((v1-67 (the-as object (-> v1-66 6)))) + (set! (-> (the-as (inline-array vector4w) v1-67) 0 x) 1024) + (set! (-> (the-as vector4w v1-67) y) 1024) + (set! (-> (the-as vector4w v1-67) z) #xffffff) + (set! (-> (the-as vector4w v1-67) w) 0) + ) + ) + (&+! (-> arg0 base) 112) + (reset-display-gs-state *display* arg0 (the-as int a2-5)) + ) + 0 + (none) + ) + +;; definition (debug) for function check-normals +;; ERROR: Expression building failed: In check-normals: Could not match ArrayFieldAccess (stride power of 2) values: v1-4 +(defun-debug check-normals () + (local-vars + (v0-0 object) + (v0-1 object) + (v0-2 symbol) + (v1-0 ocean) + (v1-4 int) + (v1-6 float) + (v1-7 symbol) + (v1-8 symbol) + (v1-9 float) + (v1-10 symbol) + (v1-11 float) + (v1-12 symbol) + (v1-13 float) + (v1-14 symbol) + (v1-15 float) + (v1-16 symbol) + (v1-17 float) + (v1-18 symbol) + (v1-19 float) + (v1-20 symbol) + (v1-21 float) + (a0-5 symbol) + (a0-8 float) + (a0-9 symbol) + (a0-10 float) + (a0-11 symbol) + (a0-12 float) + (a0-13 symbol) + (a0-14 float) + (a0-15 symbol) + (a0-16 float) + (a0-17 symbol) + (a0-18 float) + (a0-20 int) + (a0-21 int) + (a1-0 string) + (a1-1 string) + (a2-0 float) + (a2-1 float) + (a3-0 float) + (a3-1 float) + (t0-0 float) + (t0-1 float) + (t1-0 float) + (t1-1 float) + (s4-0 int) + (s5-0 int) + (t9-0 (function _varargs_ object)) + (t9-1 (function _varargs_ object)) + (gp-0 ocean-vert-array) + (f0-2 float) + (f0-3 float) + (f0-4 float) + (f0-5 float) + (f0-6 float) + (f0-7 float) + (f0-8 float) + (f0-9 float) + (f0-10 float) + (f0-11 float) + (f0-12 float) + (f0-13 float) + (f0-14 float) + (f0-15 float) + (f0-16 float) + (f0-17 float) + (f0-18 float) + (f0-19 float) + (f0-20 float) + (f0-21 float) + (f0-22 float) + (f0-23 float) + (f1-2 float) + (f1-3 float) + (f1-4 float) + (f1-5 float) + (f1-6 float) + (f1-7 float) + (f1-8 float) + (f1-9 float) + (f1-10 float) + (f1-11 float) + (f1-12 float) + (f1-13 float) + (f1-14 float) + (f1-15 float) + ) + (set! v1-0 *ocean*) + (set! gp-0 (-> *ocean* verts)) + (set! s5-0 0) + (while (<.si s5-0 128) + (when (begin + (when (begin + (or (< (dynamic-array-field-access v1-4 data PLACEHOLDER x) -0.5) + (< 0.5 (dynamic-array-field-access v1-4 data PLACEHOLDER x)) + (begin + (set! f0-2 (dynamic-array-field-access v1-4 data PLACEHOLDER y)) + (set! a0-8 -0.5) + (set! f1-2 (gpr->fpr a0-8)) + (set! a0-9 (<.s f0-2 f1-2)) + a0-9 + ) + (begin + (set! a0-10 0.5) + (set! f0-3 (gpr->fpr a0-10)) + (set! f1-3 (dynamic-array-field-access v1-4 data PLACEHOLDER y)) + (set! a0-11 (<.s f0-3 f1-3)) + a0-11 + ) + (begin + (set! f0-4 (dynamic-array-field-access v1-4 data PLACEHOLDER z)) + (set! a0-12 -0.5) + (set! f1-4 (gpr->fpr a0-12)) + (set! a0-13 (<.s f0-4 f1-4)) + a0-13 + ) + (begin + (set! a0-14 0.5) + (set! f0-5 (gpr->fpr a0-14)) + (set! f1-5 (dynamic-array-field-access v1-4 data PLACEHOLDER z)) + (set! a0-15 (<.s f0-5 f1-5)) + a0-15 + ) + (begin + (set! f0-6 (dynamic-array-field-access v1-4 data PLACEHOLDER w)) + (set! a0-16 -0.5) + (set! f1-6 (gpr->fpr a0-16)) + (set! a0-17 (<.s f0-6 f1-6)) + a0-17 + ) + (begin + (set! a0-18 0.5) + (set! f0-7 (gpr->fpr a0-18)) + (set! f1-7 (dynamic-array-field-access v1-4 data PLACEHOLDER w)) + (set! a0-5 (<.s f0-7 f1-7)) + ) + ) + a0-5 + ) + (set! t9-0 format) + (set! a0-20 0) + (set! a1-0 L115) + (set! f0-8 (dynamic-array-field-access v1-4 data PLACEHOLDER x)) + (set! a2-0 (fpr->gpr f0-8)) + (set! f0-9 (dynamic-array-field-access v1-4 data PLACEHOLDER y)) + (set! a3-0 (fpr->gpr f0-9)) + (set! f0-10 (dynamic-array-field-access v1-4 data PLACEHOLDER z)) + (set! t0-0 (fpr->gpr f0-10)) + (set! f0-11 (dynamic-array-field-access v1-4 data PLACEHOLDER w)) + (set! t1-0 (fpr->gpr f0-11)) + (call! a0-20 a1-0 a2-0 a3-0 t0-0 t1-0) + (set! v1-5 v0-0) + ) + (or (begin + (set! f0-12 (dynamic-array-field-access s4-0 data PLACEHOLDER x)) + (set! v1-6 -0.5) + (set! f1-8 (gpr->fpr v1-6)) + (set! v1-7 (<.s f0-12 f1-8)) + v1-7 + ) + (begin + (set! v1-9 0.5) + (set! f0-13 (gpr->fpr v1-9)) + (set! f1-9 (dynamic-array-field-access s4-0 data PLACEHOLDER x)) + (set! v1-10 (<.s f0-13 f1-9)) + v1-10 + ) + (begin + (set! f0-14 (dynamic-array-field-access s4-0 data PLACEHOLDER y)) + (set! v1-11 -0.5) + (set! f1-10 (gpr->fpr v1-11)) + (set! v1-12 (<.s f0-14 f1-10)) + v1-12 + ) + (begin + (set! v1-13 0.5) + (set! f0-15 (gpr->fpr v1-13)) + (set! f1-11 (dynamic-array-field-access s4-0 data PLACEHOLDER y)) + (set! v1-14 (<.s f0-15 f1-11)) + v1-14 + ) + (begin + (set! f0-16 (dynamic-array-field-access s4-0 data PLACEHOLDER z)) + (set! v1-15 -0.5) + (set! f1-12 (gpr->fpr v1-15)) + (set! v1-16 (<.s f0-16 f1-12)) + v1-16 + ) + (begin + (set! v1-17 0.5) + (set! f0-17 (gpr->fpr v1-17)) + (set! f1-13 (dynamic-array-field-access s4-0 data PLACEHOLDER z)) + (set! v1-18 (<.s f0-17 f1-13)) + v1-18 + ) + (begin + (set! f0-18 (dynamic-array-field-access s4-0 data PLACEHOLDER w)) + (set! v1-19 -0.5) + (set! f1-14 (gpr->fpr v1-19)) + (set! v1-20 (<.s f0-18 f1-14)) + v1-20 + ) + (begin + (set! v1-21 0.5) + (set! f0-19 (gpr->fpr v1-21)) + (set! f1-15 (dynamic-array-field-access s4-0 data PLACEHOLDER w)) + (set! v1-8 (<.s f0-19 f1-15)) + ) + ) + v1-8 + ) + (set! t9-1 format) + (set! a0-21 0) + (set! a1-1 L114) + (set! f0-20 (dynamic-array-field-access s4-0 data PLACEHOLDER x)) + (set! a2-1 (fpr->gpr f0-20)) + (set! f0-21 (dynamic-array-field-access s4-0 data PLACEHOLDER y)) + (set! a3-1 (fpr->gpr f0-21)) + (set! f0-22 (dynamic-array-field-access s4-0 data PLACEHOLDER z)) + (set! t0-1 (fpr->gpr f0-22)) + (set! f0-23 (dynamic-array-field-access s4-0 data PLACEHOLDER w)) + (set! t1-1 (fpr->gpr f0-23)) + (call! a0-21 a1-1 a2-1 a3-1 t0-1 t1-1) + (set! v1-23 v0-1) + ) + (set! s5-0 (+ s5-0 1)) + ) + (set! v0-2 #f) + (ret-value v0-2) + ) + +;; definition (debug) for function generate-cloud-verts +(defun-debug generate-cloud-verts ((arg0 int) (arg1 float)) + (let ((f30-0 8192.0) + (f28-0 (/ 65536.0 (the float arg0))) + ) + (dotimes (s4-0 arg0) + (let* ((f26-0 (sin f30-0)) + (f0-1 (cos f30-0)) + (a2-0 (* (the int (+ 64.0 (* f26-0 arg1))) 16)) + (a3-0 (* (the int (+ 64.0 (* f0-1 arg1))) 16)) + ) + (format + 0 + "(new 'static 'vector4w :x #x~x :y #x~x :z #xffffff :w 0) ; ~f degrees~%" + a2-0 + a3-0 + (* 0.005493164 f30-0) + ) + ) + (+! f30-0 f28-0) + ) + ) + #f + ) + +;; definition (debug) for function generate-cloud-nrms +(defun-debug generate-cloud-nrms ((arg0 int) (arg1 float)) + (let ((f30-0 8192.0) + (f28-0 (/ 65536.0 (the float arg0))) + ) + (dotimes (s4-0 arg0) + (let ((f26-0 (sin f30-0)) + (f0-1 (cos f30-0)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (set-vector! s3-0 f26-0 arg1 f0-1 1.0) + (vector-normalize! s3-0 1.0) + (format + 0 + "(new 'static 'vector :x ~f :y ~f :z ~f :w 0) ; ~f degrees~%" + (-> s3-0 x) + (-> s3-0 y) + (-> s3-0 z) + (* 0.005493164 f30-0) + ) + ) + (+! f30-0 f28-0) + ) + ) + #f + ) + +;; definition (debug) for function set-ocean-lk +;; WARN: Return type mismatch gs-tex1 vs none. +(defun-debug set-ocean-lk ((arg0 int) (arg1 int)) + (let ((v1-0 *ocean*)) + (set! (-> v1-0 tex1 l) arg0) + (set! (-> v1-0 tex1 k) arg1) + (set! (-> v1-0 tex1-near l) arg0) + (set! (-> v1-0 tex1-near k) arg1) + ) + (none) + ) + +;; definition (debug) for function set-ocean-normal-scale +(defun-debug set-ocean-normal-scale ((arg0 float)) + (let* ((v1-0 *ocean*) + (f0-1 (/ -1.0 (* 4096.0 arg0))) + (v0-0 (-> v1-0 scales)) + ) + (set! (-> v0-0 x) f0-1) + (set! (-> v0-0 y) 255.0) + (set! (-> v0-0 z) f0-1) + (set! (-> v0-0 w) 128.0) + v0-0 + ) + ) diff --git a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-transition_REF.gc b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-transition_REF.gc new file mode 100644 index 0000000000..14b52f4594 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-transition_REF.gc @@ -0,0 +1,845 @@ +(in-package goal) + +(defmethod ocean-trans-camera-masks-bit? ocean ((obj ocean) (arg0 uint) (arg1 uint)) + (let ((v1-2 (- arg0 (* (-> obj mid-minz) 4))) + (a1-3 (- arg1 (* (-> obj mid-minx) 4))) + ) + (cond + ((or (< v1-2 0) (>= v1-2 (the-as uint 16)) (< a1-3 0) (>= a1-3 (the-as uint 16))) + #f + ) + (else + (let* ((t0-0 (shr v1-2 2)) + (a3-3 (shr a1-3 2)) + (a2-2 (logand v1-2 3)) + (v1-3 (logand a1-3 3)) + (a1-5 (+ (* t0-0 4) a3-3)) + ) + (logtest? (-> (the-as (pointer uint8) (+ (+ a2-2 (* a1-5 4)) (the-as uint obj))) 2928) (ash 1 v1-3)) + ) + ) + ) + ) + ) + +(defmethod ocean-trans-mask-ptrs-bit? ocean ((obj ocean) (arg0 int) (arg1 int)) + (let ((v1-2 (- arg0 (the-as int (* (-> obj mid-minz) 4)))) + (a1-3 (- arg1 (the-as int (* (-> obj mid-minx) 4)))) + ) + (cond + ((or (< (the-as uint v1-2) 0) + (>= (the-as uint v1-2) (the-as uint 16)) + (< (the-as uint a1-3) 0) + (>= (the-as uint a1-3) (the-as uint 16)) + ) + #f + ) + (else + (let* ((t0-0 (shr v1-2 2)) + (a3-3 (shr a1-3 2)) + (a2-2 (logand v1-2 3)) + (v1-3 (logand a1-3 3)) + (a0-2 (-> obj trans-mask-ptrs (+ (* (+ (* t0-0 4) a3-3) 4) a2-2))) + ) + (if a0-2 + (logtest? (-> (the-as (pointer int32) a0-2) 1) (ash 1 v1-3)) + #f + ) + ) + ) + ) + ) + ) + +(defmethod ocean-trans-mask-ptrs-set! ocean ((obj ocean) (arg0 uint) (arg1 uint)) + (let ((v1-2 (- arg0 (* (-> obj mid-minz) 4))) + (a1-3 (- arg1 (* (-> obj mid-minx) 4))) + ) + (cond + ((or (< v1-2 0) (>= v1-2 (the-as uint 16)) (< a1-3 0) (>= a1-3 (the-as uint 16))) + #f + ) + (else + (let* ((a3-3 (shr v1-2 2)) + (a2-2 (shr a1-3 2)) + (v1-3 (logand v1-2 3)) + (a1-4 (logand a1-3 3)) + (t0-6 (-> obj trans-mask-ptrs (+ (* (+ (* a3-3 4) a2-2) 4) v1-3))) + ) + (cond + (t0-6 + (cond + ((logtest? (-> (the-as (pointer int32) t0-6) 1) (ash 1 a1-4)) + #f + ) + (else + (let ((a0-1 (&-> obj trans-temp-masks (+ (* a3-3 4) a2-2)))) + (set! (-> (the-as (pointer int8) (+ v1-3 (the-as uint a0-1))) 0) + (the-as int (logior (-> (the-as (pointer uint8) (+ v1-3 (the-as uint a0-1))) 0) (ash 1 a1-4))) + ) + ) + #t + ) + ) + ) + (else + #f + ) + ) + ) + ) + ) + ) + ) + +(defmethod ocean-trans-add-upload-table ocean ((obj ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint) (arg3 int) (arg4 int) (arg5 symbol)) + (local-vars + (v1-16 (inline-array vector4w)) + (v1-18 float) + (a0-24 uint128) + (a0-25 uint128) + (a1-14 uint128) + (a1-15 uint128) + (a1-16 uint128) + (a2-17 uint128) + (a2-18 uint128) + (a3-9 uint128) + ) + (rlet ((acc :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf12 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf) + ) + (when (ocean-trans-mask-ptrs-set! obj arg1 arg2) + (let ((a2-2 (new-stack-vector0))) + (let ((v1-2 (-> obj start-corner))) + (set! (-> a2-2 x) (+ (-> v1-2 x) (* 98304.0 (the float arg2)))) + (set! (-> a2-2 y) (-> v1-2 y)) + (set! (-> a2-2 z) (+ (-> v1-2 z) (* 98304.0 (the float arg1)))) + ) + (set! (-> a2-2 w) 1.0) + (ocean-mid-add-matrices obj arg0 a2-2) + ) + (let* ((a1-3 9) + (v1-7 arg0) + (a0-4 (the-as object (-> v1-7 base))) + ) + (set! (-> (the-as dma-packet a0-4) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a1-3)) + (set! (-> (the-as dma-packet a0-4) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a0-4) vif1) + (new 'static 'vif-tag :imm #x8008 :cmd (vif-cmd unpack-v4-32) :num a1-3) + ) + (set! (-> v1-7 base) (&+ (the-as pointer a0-4) 16)) + ) + (set-vector! (the-as vector4w (-> arg0 base)) arg4 0 0 0) + (&+! (-> arg0 base) 16) + (let* ((a0-6 (logand arg1 3)) + (v1-11 (logand arg2 3)) + (v1-12 (+ (* 5 (the-as int a0-6)) v1-11)) + ) + (.lvf vf5 (&-> (-> *ocean-trans-corner-table* 0 vector v1-12) quad)) + (.lvf vf6 (&-> (-> *ocean-trans-corner-table* 0 vector (+ v1-12 1)) quad)) + (.lvf vf7 (&-> (-> *ocean-trans-corner-table* 0 vector (+ v1-12 5)) quad)) + (.lvf vf8 (&-> (the-as (inline-array vector4w) (-> *ocean-trans-corner-table* 0 vector (+ v1-12 6))) 0 quad)) + ) + (.mov v1-16 vf8) + (let ((v1-17 (the-as (inline-array vector4w) (-> arg0 base)))) + (let ((a0-17 (/ (the-as int arg1) 4)) + (a1-11 (/ (the-as int arg2) 4)) + ) + (.lvf vf1 (&-> *ocean-trans-st-table* 0 quad)) + (.lvf vf2 (&-> *ocean-trans-st-table* 1 quad)) + (.lvf vf3 (&-> *ocean-trans-st-table* 2 quad)) + (.lvf vf4 (&-> *ocean-trans-st-table* 3 quad)) + (.mul.x.vf acc vf1 vf5) + (nop!) + (.add.mul.y.vf acc vf2 vf5 acc) + (nop!) + (.add.mul.z.vf acc vf3 vf5 acc) + (nop!) + (.add.mul.w.vf vf9 vf4 vf5 acc) + (nop!) + (.mul.x.vf acc vf1 vf6) + (nop!) + (.add.mul.y.vf acc vf2 vf6 acc) + (nop!) + (.add.mul.z.vf acc vf3 vf6 acc) + (nop!) + (.add.mul.w.vf vf10 vf4 vf6 acc) + (.svf (&-> v1-17 0 quad) vf9) + (.mul.x.vf acc vf1 vf7) + (nop!) + (.add.mul.y.vf acc vf2 vf7 acc) + (nop!) + (.add.mul.z.vf acc vf3 vf7 acc) + (nop!) + (.add.mul.w.vf vf11 vf4 vf7 acc) + (.svf (&-> v1-17 1 quad) vf10) + (.mul.x.vf acc vf1 vf8) + (nop!) + (.add.mul.y.vf acc vf2 vf8 acc) + (nop!) + (.add.mul.z.vf acc vf3 vf8 acc) + (nop!) + (.add.mul.w.vf vf12 vf4 vf8 acc) + (.svf (&-> v1-17 2 quad) vf11) + (nop!) + (.svf (&-> v1-17 3 quad) vf12) + (let ((a2-16 (the-as uint128 (-> obj ocean-colors colors (+ (* 52 (the-as int a0-17)) a1-11)))) + (a3-8 (the-as uint128 (-> obj ocean-colors colors (+ a1-11 1 (* 52 (the-as int a0-17)))))) + (t0-9 (the-as uint128 (-> obj ocean-colors colors (+ (* 52 (the-as int (+ a0-17 1))) a1-11)))) + (a0-23 (the-as uint128 (-> obj ocean-colors colors (+ a1-11 1 (* 52 (the-as int (+ a0-17 1))))))) + ) + (.pextlb a1-14 0 a2-16) + (nop!) + (.pextlb a2-17 0 a3-8) + (nop!) + (.pextlb a3-9 0 t0-9) + (nop!) + (.pextlb a0-24 0 a0-23) + ) + ) + (nop!) + (.pextlh a1-15 0 a1-14) + (nop!) + (.pextlh a2-18 0 a2-17) + (.mov vf1 a1-15) + (.pextlh a1-16 0 a3-9) + (.mov vf2 a2-18) + (.pextlh a0-25 0 a0-24) + (.mov vf3 a1-16) + (nop!) + (.mov vf4 a0-25) + (.itof.vf vf1 vf1) + (nop!) + (.itof.vf vf2 vf2) + (nop!) + (.itof.vf vf3 vf3) + (nop!) + (.itof.vf vf4 vf4) + (nop!) + (.mul.x.vf acc vf1 vf5) + (nop!) + (.add.mul.y.vf acc vf2 vf5 acc) + (nop!) + (.add.mul.z.vf acc vf3 vf5 acc) + (nop!) + (.add.mul.w.vf vf9 vf4 vf5 acc) + (nop!) + (.mul.x.vf acc vf1 vf6) + (nop!) + (.add.mul.y.vf acc vf2 vf6 acc) + (nop!) + (.add.mul.z.vf acc vf3 vf6 acc) + (nop!) + (.add.mul.w.vf vf10 vf4 vf6 acc) + (.svf (&-> v1-17 4 quad) vf9) + (.mul.x.vf acc vf1 vf7) + (nop!) + (.add.mul.y.vf acc vf2 vf7 acc) + (nop!) + (.add.mul.z.vf acc vf3 vf7 acc) + (nop!) + (.add.mul.w.vf vf11 vf4 vf7 acc) + (.svf (&-> v1-17 5 quad) vf10) + (.mul.x.vf acc vf1 vf8) + (nop!) + (.add.mul.y.vf acc vf2 vf8 acc) + (nop!) + (.add.mul.z.vf acc vf3 vf8 acc) + (nop!) + (.add.mul.w.vf vf12 vf4 vf8 acc) + (.svf (&-> v1-17 6 quad) vf11) + (nop!) + (.svf (&-> v1-17 7 quad) vf12) + ) + (.mov v1-18 vf12) + (&+! (-> arg0 base) 128) + (let* ((v1-21 arg0) + (a0-26 (the-as object (-> v1-21 base))) + ) + (set! (-> (the-as dma-packet a0-26) dma) (new 'static 'dma-tag :id (dma-tag-id ref) :addr arg3 :qwc arg4)) + (set! (-> (the-as dma-packet a0-26) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a0-26) vif1) + (new 'static 'vif-tag :imm #x8011 :cmd (vif-cmd unpack-v4-32) :num arg4) + ) + (set! (-> v1-21 base) (&+ (the-as pointer a0-26) 16)) + ) + (if arg5 + (ocean-mid-add-call obj arg0 275) + (ocean-mid-add-call obj arg0 107) + ) + ) + (none) + ) + ) + +(defmethod ocean-trans-add-upload-strip ocean ((obj ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint) (arg3 int) (arg4 int) (arg5 int)) + (local-vars + (v1-10 float) + (a0-24 uint128) + (a0-25 uint128) + (a0-26 uint128) + (a1-12 uint128) + (a1-13 uint128) + (a1-14 uint128) + (a2-15 uint128) + (a3-10 uint128) + ) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (let ((a2-1 (new-stack-vector0))) + (let ((v1-0 (-> obj start-corner))) + (set! (-> a2-1 x) (+ (-> v1-0 x) (* 393216.0 (the float arg2)))) + (set! (-> a2-1 y) (-> v1-0 y)) + (set! (-> a2-1 z) (+ (-> v1-0 z) (* 393216.0 (the float arg1)))) + ) + (set! (-> a2-1 w) 1.0) + (ocean-mid-add-matrices obj arg0 a2-1) + ) + (let* ((a1-2 9) + (v1-5 arg0) + (a0-3 (the-as object (-> v1-5 base))) + ) + (set! (-> (the-as dma-packet a0-3) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a1-2)) + (set! (-> (the-as dma-packet a0-3) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a0-3) vif1) + (new 'static 'vif-tag :imm #x8008 :cmd (vif-cmd unpack-v4-32) :num a1-2) + ) + (set! (-> v1-5 base) (&+ (the-as pointer a0-3) 16)) + ) + (let ((v1-6 (the-as object (-> arg0 base)))) + (set! (-> obj trans-mask-ptrs (+ (* arg4 4) arg5)) (the-as pointer v1-6)) + (set! (-> (the-as vector4w v1-6) x) 10) + (set! (-> (the-as vector4w v1-6) y) arg3) + (set! (-> (the-as vector4w v1-6) z) 0) + (set! (-> (the-as vector4w v1-6) w) 0) + ) + (&+! (-> arg0 base) 16) + (let ((v1-9 (the-as (inline-array vector4w) (-> arg0 base)))) + (set! (-> v1-9 0 quad) (-> *ocean-trans-st-table* 0 quad)) + (set! (-> v1-9 1 quad) (-> *ocean-trans-st-table* 1 quad)) + (set! (-> v1-9 2 quad) (-> *ocean-trans-st-table* 2 quad)) + (set! (-> v1-9 3 quad) (-> *ocean-trans-st-table* 3 quad)) + (let ((a0-23 (the-as uint128 (-> obj ocean-colors colors (+ (* 52 (the-as int arg1)) arg2)))) + (a1-11 (the-as uint128 (-> obj ocean-colors colors (+ arg2 1 (* 52 (the-as int arg1)))))) + (a2-14 (the-as uint128 (-> obj ocean-colors colors (+ (* 52 (the-as int (+ arg1 1))) arg2)))) + (a3-9 (the-as uint128 (-> obj ocean-colors colors (+ arg2 1 (* 52 (the-as int (+ arg1 1))))))) + ) + (.pextlb a0-24 0 a0-23) + (nop!) + (.pextlb a1-12 0 a1-11) + (nop!) + (.pextlb a2-15 0 a2-14) + (nop!) + (.pextlb a3-10 0 a3-9) + ) + (nop!) + (.pextlh a0-25 0 a0-24) + (nop!) + (.pextlh a1-13 0 a1-12) + (.mov vf1 a0-25) + (.pextlh a0-26 0 a2-15) + (.mov vf2 a1-13) + (.pextlh a1-14 0 a3-10) + (.mov vf3 a0-26) + (nop!) + (.mov vf4 a1-14) + (.itof.vf vf1 vf1) + (nop!) + (.itof.vf vf2 vf2) + (nop!) + (.itof.vf vf3 vf3) + (nop!) + (.itof.vf vf4 vf4) + (nop!) + (nop!) + (.svf (&-> v1-9 4 quad) vf1) + (nop!) + (.svf (&-> v1-9 5 quad) vf2) + (nop!) + (.svf (&-> v1-9 6 quad) vf3) + (nop!) + (.svf (&-> v1-9 7 quad) vf4) + ) + (.mov v1-10 vf4) + (&+! (-> arg0 base) 128) + (let* ((a1-15 10) + (v1-13 arg0) + (a0-27 (the-as object (-> v1-13 base))) + ) + (set! (-> (the-as dma-packet a0-27) dma) + (new 'static 'dma-tag + :id (dma-tag-id ref) + :addr (the-as int (+ (+ (* 160 arg5) 0) (the-as int *ocean-trans-strip-array*))) + :qwc a1-15 + ) + ) + (set! (-> (the-as dma-packet a0-27) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a0-27) vif1) + (new 'static 'vif-tag :imm #x8011 :cmd (vif-cmd unpack-v4-32) :num a1-15) + ) + (set! (-> v1-13 base) (&+ (the-as pointer a0-27) 16)) + ) + (ocean-mid-add-call obj arg0 107) + 0 + (none) + ) + ) + +(defmethod ocean-transition-check ocean ((obj ocean) (arg0 ocean-trans-mask) (arg1 int) (arg2 int) (arg3 vector)) + (local-vars (v1-13 float) (t0-3 float) (t0-8 float) (t0-13 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (let ((v1-0 (new-stack-vector0)) + (a0-2 (-> *math-camera* trans)) + ) + 1.0 + (set! (-> v1-0 x) (+ (-> arg3 x) (* 98304.0 (the float arg1)))) + (set! (-> v1-0 y) (-> arg3 y)) + (set! (-> v1-0 z) (+ (-> arg3 z) (* 98304.0 (the float arg2)))) + (let ((t0-2 v1-0) + (t1-2 a0-2) + ) + (.lvf vf2 (&-> t0-2 quad)) + (.lvf vf3 (&-> t1-2 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov t0-3 vf1) + (when (< t0-3 19327350000.0) + (logior! (-> arg0 mask arg2) (ash 1 arg1)) + (goto cfg-24) + ) + (set! (-> v1-0 x) (+ 98304.0 (-> v1-0 x))) + (let ((t0-7 v1-0) + (t1-3 a0-2) + ) + (.lvf vf2 (&-> t0-7 quad)) + (.lvf vf3 (&-> t1-3 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov t0-8 vf1) + (when (< t0-8 19327350000.0) + (logior! (-> arg0 mask arg2) (ash 1 arg1)) + (goto cfg-24) + ) + (set! (-> v1-0 z) (+ 98304.0 (-> v1-0 z))) + (let ((t0-12 v1-0) + (t1-4 a0-2) + ) + (.lvf vf2 (&-> t0-12 quad)) + (.lvf vf3 (&-> t1-4 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov t0-13 vf1) + (when (< t0-13 19327350000.0) + (logior! (-> arg0 mask arg2) (ash 1 arg1)) + (goto cfg-24) + ) + (set! (-> v1-0 x) (+ -98304.0 (-> v1-0 x))) + (.lvf vf2 (&-> v1-0 quad)) + (.lvf vf3 (&-> a0-2 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov v1-13 vf1) + (when (< v1-13 19327350000.0) + (logior! (-> arg0 mask arg2) (ash 1 arg1)) + (goto cfg-24) + ) + (label cfg-24) + 0 + (none) + ) + ) + +(defmethod ocean-make-trans-camera-masks ocean ((obj ocean) (arg0 uint) (arg1 uint) (arg2 uint) (arg3 uint)) + (local-vars (sv-48 ocean-trans-mask) (sv-52 vector) (sv-56 vector) (sv-60 vector)) + (set! sv-48 (the-as ocean-trans-mask (&-> obj trans-camera-masks (+ (* arg2 4) arg3)))) + (set! sv-52 (-> *math-camera* trans)) + (set! sv-56 (new-stack-vector0)) + (set! sv-60 (new-stack-vector0)) + (set! (-> sv-56 x) (+ (-> obj start-corner x) (* 393216.0 (the float arg1)))) + (set! (-> sv-56 y) (-> obj start-corner y)) + (set! (-> sv-56 z) (+ (-> obj start-corner z) (* 393216.0 (the float arg0)))) + (set! (-> sv-56 w) 1.0) + (dotimes (s5-0 4) + (dotimes (s4-0 4) + (set! (-> sv-60 x) (- (+ (-> sv-56 x) (* 98304.0 (the float s4-0))) (-> sv-52 x))) + (set! (-> sv-60 y) (- (-> sv-56 y) (-> sv-52 y))) + (set! (-> sv-60 z) (- (+ (-> sv-56 z) (* 98304.0 (the float s5-0))) (-> sv-52 z))) + (ocean-transition-check obj sv-48 s4-0 s5-0 sv-56) + ) + ) + 0 + (none) + ) + +(defmethod ocean-trans-add-upload ocean ((obj ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) + (when (not (ocean-trans-mask-ptrs-bit? obj (the-as int arg1) (the-as int arg2))) + (let ((s0-0 (ocean-trans-camera-masks-bit? obj (+ arg1 -1) arg2)) + (s1-0 (ocean-trans-camera-masks-bit? obj (+ arg1 1) arg2)) + (s2-0 (ocean-trans-camera-masks-bit? obj arg1 (+ arg2 -1))) + (a0-6 (ocean-trans-camera-masks-bit? obj arg1 (+ arg2 1))) + (v1-7 0) + ) + (if s0-0 + (+! v1-7 1) + ) + (if s1-0 + (+! v1-7 2) + ) + (if s2-0 + (+! v1-7 4) + ) + (if a0-6 + (+! v1-7 8) + ) + (cond + ((= v1-7 1) + (if (not (ocean-trans-mask-ptrs-bit? obj (the-as int (+ arg1 -1)) (the-as int arg2))) + (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-up-table*) 11 #t) + ) + ) + ((= v1-7 2) + (if (not (ocean-trans-mask-ptrs-bit? obj (the-as int (+ arg1 1)) (the-as int arg2))) + (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-down-table*) 11 #t) + ) + ) + ((= v1-7 4) + (if (not (ocean-trans-mask-ptrs-bit? obj (the-as int arg1) (the-as int (+ arg2 -1)))) + (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-left-table*) 11 #t) + ) + ) + ((= v1-7 5) + (let ((s2-1 (ocean-trans-mask-ptrs-bit? obj (the-as int (+ arg1 -1)) (the-as int arg2))) + (v1-25 (ocean-trans-mask-ptrs-bit? obj (the-as int arg1) (the-as int (+ arg2 -1)))) + ) + (cond + ((and s2-1 v1-25) + ) + (s2-1 + (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-left-table*) 11 #t) + ) + (v1-25 + (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-up-table*) 11 #t) + ) + (else + (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-up-left-table*) 18 #f) + ) + ) + ) + ) + ((= v1-7 6) + (let ((s2-2 (ocean-trans-mask-ptrs-bit? obj (the-as int (+ arg1 1)) (the-as int arg2))) + (v1-35 (ocean-trans-mask-ptrs-bit? obj (the-as int arg1) (the-as int (+ arg2 -1)))) + ) + (cond + ((and s2-2 v1-35) + ) + (s2-2 + (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-left-table*) 11 #t) + ) + (v1-35 + (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-down-table*) 11 #t) + ) + (else + (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-down-left-table*) 18 #t) + ) + ) + ) + ) + ((= v1-7 8) + (if (not (ocean-trans-mask-ptrs-bit? obj (the-as int arg1) (the-as int (+ arg2 1)))) + (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-right-table*) 11 #t) + ) + ) + ((= v1-7 9) + (let ((s2-3 (ocean-trans-mask-ptrs-bit? obj (the-as int (+ arg1 -1)) (the-as int arg2))) + (v1-50 (ocean-trans-mask-ptrs-bit? obj (the-as int arg1) (the-as int (+ arg2 1)))) + ) + (cond + ((and s2-3 v1-50) + ) + (s2-3 + (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-right-table*) 11 #t) + ) + (v1-50 + (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-up-table*) 11 #t) + ) + (else + (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-up-right-table*) 18 #t) + ) + ) + ) + ) + ((= v1-7 10) + (let ((s2-4 (ocean-trans-mask-ptrs-bit? obj (the-as int (+ arg1 1)) (the-as int arg2))) + (v1-61 (ocean-trans-mask-ptrs-bit? obj (the-as int arg1) (the-as int (+ arg2 1)))) + ) + (cond + ((and s2-4 v1-61) + ) + (s2-4 + (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-right-table*) 11 #t) + ) + (v1-61 + (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-down-table*) 11 #t) + ) + (else + (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-down-right-table*) 18 #f) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod draw-ocean-transition-seams ocean ((obj ocean) (arg0 dma-buffer)) + (local-vars (sv-32 uint) (sv-33 uint) (sv-34 uint) (sv-35 uint) (sv-36 sphere)) + (set! sv-32 (-> obj near-minx)) + (set! sv-33 (-> obj near-maxx)) + (set! sv-34 (-> obj near-minz)) + (set! sv-35 (-> obj near-maxz)) + (set! sv-36 (new 'stack 'sphere)) + (set! (-> sv-36 y) (-> obj start-corner y)) + (set! (-> sv-36 r) 69511.42) + (when (and (< sv-32 sv-33) (< sv-34 sv-35)) + (let ((s4-0 sv-34) + (s3-0 sv-35) + ) + (while (>= s3-0 s4-0) + (let ((s2-0 sv-32) + (s1-0 sv-33) + ) + (while (>= s1-0 s2-0) + (set! (-> sv-36 x) (+ 49152.0 (* 98304.0 (the float s2-0)) (-> obj start-corner x))) + (set! (-> sv-36 z) (+ 49152.0 (* 98304.0 (the float s4-0)) (-> obj start-corner z))) + (when (sphere-cull sv-36) + (if (not (ocean-trans-camera-masks-bit? obj s4-0 s2-0)) + (ocean-trans-add-upload obj arg0 s4-0 s2-0) + ) + ) + (+! s2-0 1) + ) + ) + (+! s4-0 1) + ) + ) + ) + (dotimes (v1-28 16) + (when (nonzero? (-> obj trans-camera-masks v1-28)) + (dotimes (a0-12 4) + (let ((a1-8 (-> obj trans-mask-ptrs (+ (* v1-28 4) a0-12)))) + (if a1-8 + (logior! + (-> (the-as (pointer int32) a1-8) 1) + (-> (the-as (pointer uint8) (+ (+ a0-12 (* v1-28 4)) (the-as int obj))) 2992) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod ocean-trans-add-constants ocean ((obj ocean) (arg0 dma-buffer)) + (let* ((a2-0 4) + (v1-0 arg0) + (a0-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a2-0)) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a0-1) vif1) + (new 'static 'vif-tag :imm #x2fd :cmd (vif-cmd unpack-v4-32) :num a2-0) + ) + (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) + ) + (let ((v1-1 (the-as matrix (-> arg0 base)))) + (set-vector! (-> v1-1 vector 0) 0.0 0.0 0.0 1.0) + (set-vector! (-> v1-1 vector 1) 98304.0 0.0 0.0 1.0) + (set-vector! (-> v1-1 vector 2) 0.0 0.0 98304.0 1.0) + (set-vector! (-> v1-1 trans) 98304.0 0.0 98304.0 1.0) + ) + (&+! (-> arg0 base) 64) + 0 + (none) + ) + +(defmethod draw-ocean-transition ocean ((obj ocean) (arg0 dma-buffer)) + (local-vars + (sv-32 uint) + (sv-33 uint) + (sv-34 uint) + (sv-35 uint) + (sv-36 sphere) + (sv-40 ocean-trans-mask) + (sv-44 uint) + (sv-48 int) + ) + (dotimes (v1-0 16) + (set! (-> obj trans-camera-masks v1-0) (the-as ocean-trans-mask 0)) + (set! (-> obj near-mask-indices v1-0) (the-as uint -1)) + ) + (dotimes (v1-3 64) + (set! (-> obj trans-mask-ptrs v1-3) (the-as pointer #f)) + ) + (set! sv-32 (-> obj mid-minx)) + (set! sv-33 (-> obj mid-maxx)) + (set! sv-34 (-> obj mid-minz)) + (set! sv-35 (-> obj mid-maxz)) + (set! sv-36 (new 'stack 'sphere)) + (set! (-> sv-36 y) (-> obj start-corner y)) + (set! (-> sv-36 r) 278045.7) + (let ((s4-0 sv-34) + (s3-0 sv-35) + ) + (while (>= s3-0 s4-0) + (let ((s2-0 sv-32) + (s1-0 sv-33) + ) + (while (>= s1-0 s2-0) + (when (not (ocean-mid-mask-ptrs-bit? obj s4-0 s2-0)) + (when (ocean-mid-camera-masks-bit? obj s4-0 s2-0) + (set! (-> sv-36 x) (+ 196608.0 (* 393216.0 (the float s2-0)) (-> obj start-corner x))) + (set! (-> sv-36 z) (+ 196608.0 (* 393216.0 (the float s4-0)) (-> obj start-corner z))) + (if (sphere-cull sv-36) + (ocean-make-trans-camera-masks obj s4-0 s2-0 (- s4-0 sv-34) (- s2-0 sv-32)) + ) + ) + ) + (+! s2-0 1) + ) + ) + (+! s4-0 1) + ) + ) + (let ((a2-3 192) + (a1-7 0) + (a0-11 192) + (v1-33 0) + ) + (let ((a3-1 sv-34) + (t0-1 sv-35) + ) + (while (>= t0-1 a3-1) + (let ((t1-0 sv-32) + (t2-0 sv-33) + ) + (while (>= t2-0 t1-0) + (set! sv-40 (the-as ocean-trans-mask (&-> obj trans-camera-masks (+ (* (- a3-1 sv-34) 4) (- t1-0 sv-32))))) + (when (nonzero? (-> sv-40 word)) + (dotimes (t3-10 4) + (let ((t4-4 (-> sv-40 mask t3-10))) + (when (nonzero? t4-4) + (let ((t5-2 (+ (* a3-1 4) t3-10))) + (if (< t5-2 (the-as uint a0-11)) + (set! a0-11 (the-as int t5-2)) + ) + (if (< (the-as uint v1-33) t5-2) + (set! v1-33 (the-as int t5-2)) + ) + ) + (dotimes (t5-3 4) + (when (logtest? t4-4 (ash 1 t5-3)) + (let ((t6-9 (+ (* t1-0 4) t5-3))) + (if (< t6-9 (the-as uint a2-3)) + (set! a2-3 (the-as int t6-9)) + ) + (if (< (the-as uint a1-7) t6-9) + (set! a1-7 (the-as int t6-9)) + ) + ) + ) + ) + ) + ) + ) + ) + (+! t1-0 1) + ) + ) + (+! a3-1 1) + ) + ) + (set! (-> obj near-minx) (the-as uint (+ a2-3 -1))) + (set! (-> obj near-maxx) (the-as uint (+ a1-7 1))) + (set! (-> obj near-minz) (the-as uint (+ a0-11 -1))) + (set! (-> obj near-maxz) (the-as uint (+ v1-33 1))) + ) + (dotimes (v1-35 16) + (set! (-> obj trans-temp-masks v1-35) (the-as uint (-> obj trans-camera-masks v1-35))) + ) + (let ((s4-1 sv-34) + (s3-1 sv-35) + ) + (while (>= s3-1 s4-1) + (let ((s2-1 sv-32) + (s1-1 sv-33) + ) + (while (>= s1-1 s2-1) + (when (not (ocean-mid-mask-ptrs-bit? obj s4-1 s2-1)) + (when (ocean-mid-camera-masks-bit? obj s4-1 s2-1) + (let ((v1-46 (-> obj ocean-trans-indices data (+ (* (the-as uint 48) s4-1) s2-1)))) + (when (>= (-> v1-46 parent) 0) + (set! sv-44 (+ (* (- s4-1 sv-34) 4) (- s2-1 sv-32))) + (set! (-> obj near-mask-indices sv-44) (the-as uint (-> v1-46 child))) + (let ((s0-0 (-> obj ocean-mid-masks data (-> v1-46 parent)))) + (set! sv-48 0) + (while (< sv-48 4) + (let ((t0-2 (-> s0-0 mask sv-48))) + (if (!= t0-2 255) + (ocean-trans-add-upload-strip obj arg0 s4-1 s2-1 (the-as int t0-2) (the-as int sv-44) sv-48) + ) + ) + (set! sv-48 (+ sv-48 1)) + ) + ) + ) + ) + ) + ) + (+! s2-1 1) + ) + ) + (+! s4-1 1) + ) + ) + (ocean-mid-add-call-flush obj arg0 (the-as uint 41)) + (ocean-trans-add-constants obj arg0) + (draw-ocean-transition-seams obj arg0) + (ocean-mid-add-call-flush obj arg0 (the-as uint 41)) + 0 + (none) + ) diff --git a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-vu0_REF.gc b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-vu0_REF.gc new file mode 100644 index 0000000000..3d333af97d --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-vu0_REF.gc @@ -0,0 +1,18 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 14 of type ocean +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition for method 15 of type ocean +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition for symbol ocean-vu0-block, type vu-function +(define ocean-vu0-block (new 'static 'vu-function :length 64 :qlength 32)) + +;; definition for method 16 of type ocean +;; ERROR: function was not converted to expressions. Cannot decompile. + + + + diff --git a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean_REF.gc b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean_REF.gc new file mode 100644 index 0000000000..07cef8920b --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean_REF.gc @@ -0,0 +1,1616 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 21 of type ocean +(defmethod set-corners! ocean ((obj ocean) (corner-x float) (corner-z float)) + (let* ((f2-0 (* 0.00008138021 corner-x)) + (f3-0 (* 0.00008138021 corner-z)) + (f0-2 f2-0) + (f0-4 (- f0-2 (the float (the int f0-2)))) + (f1-6 f3-0) + (f1-8 (- f1-6 (the float (the int f1-6)))) + (a1-1 (logand (the int f2-0) 31)) + (a3-0 (logand (the int f3-0) 31)) + (v1-9 (logand (+ a1-1 1) 31)) + (a2-2 (logand (+ a3-0 1) 31)) + (f2-3 (-> obj heights data (+ (* a3-0 32) a1-1))) + (f3-1 (-> obj heights data (+ (* a3-0 32) v1-9))) + (f4-4 (-> obj heights data (+ (* a2-2 32) a1-1))) + (f5-0 (-> obj heights data (+ (* a2-2 32) v1-9))) + (f6-1 (+ (* f3-1 f0-4) (* f2-3 (- 1.0 f0-4)))) + (f0-9 (+ (* (+ (* f5-0 f0-4) (* f4-4 (- 1.0 f0-4))) f1-8) (* f6-1 (- 1.0 f1-8)))) + ) + (set! (-> obj corner00) f2-3) + (set! (-> obj corner01) f3-1) + (set! (-> obj corner10) f4-4) + (set! (-> obj corner11) f5-0) + f0-9 + ) + ) + +;; definition for method 11 of type ocean +(defmethod get-height ocean ((obj ocean) (arg0 vector) (arg1 symbol)) + (local-vars (v1-12 int)) + (cond + ((and (-> obj heights) *ocean-map*) + (let* ((f30-0 (- (-> arg0 x) (-> obj start-corner x))) + (f28-0 (- (-> arg0 z) (-> obj start-corner z))) + (v1-3 (the int (* 0.0000025431316 f30-0))) + (a0-2 (the int (* 0.0000025431316 f28-0))) + (v1-7 (-> obj ocean-trans-indices data (+ (* 48 a0-2) v1-3))) + ) + (cond + ((= (-> v1-7 parent) -1) + (if arg1 + (-> obj start-corner y) + 4095996000.0 + ) + ) + ((begin + (let ((a0-8 (logand (the int (* 0.000010172526 f30-0)) 3)) + (a3-4 (logand (the int (* 0.000010172526 f28-0)) 3)) + (v1-10 (-> obj ocean-near-indices data (-> v1-7 child))) + ) + (set! v1-12 (-> (the-as (pointer int16) (+ (* (+ (* a3-4 4) a0-8) 2) (the-as int v1-10))))) + ) + (= v1-12 -1) + ) + (if arg1 + (-> obj start-corner y) + 4095996000.0 + ) + ) + (else + (let ((a0-14 (logand (the int (* 0.00008138021 f30-0)) 7))) + (cond + ((not (logtest? (-> obj ocean-mid-masks data v1-12 mask (logand (the int (* 0.00008138021 f28-0)) 7)) (ash 1 a0-14)) + ) + (let* ((f1-2 (vector-vector-distance arg0 (math-camera-pos))) + (f26-0 (- 1.0 (fmin 1.0 (* 0.000010172526 f1-2)))) + ) + (if (-> obj ocean-near-translucent?) + (+ (* f26-0 (set-corners! obj f30-0 f28-0)) (-> obj start-corner y)) + (-> obj start-corner y) + ) + ) + ) + (arg1 + (-> obj start-corner y) + ) + (else + 4095996000.0 + ) + ) + ) + ) + ) + ) + ) + (arg1 + 0.0 + ) + (else + 4095996000.0 + ) + ) + ) + +;; definition for function init-ocean-far-regs +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition for function draw-large-polygon-ocean +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition for function render-ocean-quad +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition for method 17 of type ocean +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod add-colors! ocean ((obj ocean) (arg0 vector) (arg1 ocean-vertex)) + (let ((s3-0 (new 'stack-no-clear 'vector)) + (s4-0 (-> obj haze-lights)) + ) + (set! (-> s3-0 quad) (-> arg1 pos quad)) + (set! (-> s3-0 y) 0.0) + (vector-normalize! s3-0 1.0) + (set! (-> s3-0 y) (+ 0.1 (-> s3-0 y))) + (vector-normalize! s3-0 1.0) + (let ((s5-0 (new 'stack-no-clear 'vector4))) + (let* ((f0-4 (vector-dot (-> s4-0 sun0-normal) s3-0)) + (f1-2 (vector-dot (-> s4-0 sun1-normal) s3-0)) + (f2-1 (vector-dot (-> s4-0 moon-normal) s3-0)) + (f0-5 (fmax 0.0 f0-4)) + (f30-0 (fmax 0.0 f1-2)) + (f28-0 (fmax 0.0 f2-1)) + ) + (set! (-> s5-0 quad) (-> s4-0 ambi-color quad)) + (vector4-madd! s5-0 s5-0 (the-as vector4 (-> s4-0 sun0-color)) f0-5) + (vector4-madd! s5-0 s5-0 (the-as vector4 (-> s4-0 sun1-color)) f30-0) + (vector4-madd! s5-0 s5-0 (the-as vector4 (-> s4-0 moon-color)) f28-0) + ) + (vector4-scale! s5-0 s5-0 128.0) + (set! (-> arg0 x) (fmax 0.0 (fmin 255.0 (-> s5-0 x)))) + (set! (-> arg0 y) (fmax 0.0 (fmin 255.0 (-> s5-0 y)))) + (set! (-> arg0 z) (fmax 0.0 (fmin 255.0 (-> s5-0 z)))) + ) + ) + 0 + (none) + ) + +;; definition for method 60 of type ocean +;; INFO: Used lq/sq +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Return type mismatch int vs none. +(defmethod ocean-method-60 ocean ((obj ocean) (arg0 dma-buffer)) + (local-vars (sv-48 float) (sv-52 vector) (sv-56 vector)) + (let ((vertices (the-as (inline-array ocean-vertex) (+ #x70000000 0)))) + (let ((f0-0 (-> obj start-corner z))) + (let ((f1-1 (+ -5898240.0 f0-0))) + (set! (-> vertices 0 pos z) f1-1) + (set! (-> vertices 1 pos z) f1-1) + ) + (set! (-> vertices 2 pos z) f0-0) + (set! (-> vertices 3 pos z) f0-0) + ) + (set! (-> vertices 0 pos w) 0.5) + (set! (-> vertices 1 pos w) 0.5) + (set! (-> vertices 2 pos w) 1.0) + (set! (-> vertices 3 pos w) 1.0) + (set! sv-48 (-> obj start-corner x)) + (set! sv-52 (new 'stack-no-clear 'vector)) + (set! sv-56 (new 'stack-no-clear 'vector)) + (let ((s3-0 (-> obj ocean-colors))) + (let ((s2-0 #f)) + (rgba-to-vector! obj sv-52 (-> s3-0 colors)) + (dotimes (s1-0 48) + (let ((f0-8 (+ (* 393216.0 (the float s1-0)) sv-48))) + (let ((f1-6 (+ 393216.0 f0-8))) + (set! (-> vertices 0 pos x) f0-8) + (set! (-> vertices 1 pos x) f1-6) + (set! (-> vertices 2 pos x) f1-6) + ) + (set! (-> vertices 3 pos x) f0-8) + ) + (rgba-to-vector! obj sv-56 (&+ (-> s3-0 colors) (* (+ s1-0 1) 4))) + (set! (-> vertices 0 col quad) (-> sv-52 quad)) + (set! (-> vertices 1 col quad) (-> sv-56 quad)) + (set! (-> vertices 2 col quad) (-> sv-56 quad)) + (set! (-> vertices 3 col quad) (-> sv-52 quad)) + (set! (-> sv-52 quad) (-> sv-56 quad)) + (cond + ((render-ocean-quad vertices arg0) + (set! s2-0 #t) + ) + (else + (if s2-0 + (goto cfg-9) + ) + ) + ) + ) + ) + ) + (label cfg-9) + (let ((f0-10 (+ -5898240.0 (-> obj start-corner z)))) + (let ((f1-9 (+ -5898240.0 f0-10))) + (set! (-> vertices 0 pos z) f1-9) + (set! (-> vertices 1 pos z) f1-9) + ) + (set! (-> vertices 2 pos z) f0-10) + (set! (-> vertices 3 pos z) f0-10) + ) + (set! (-> vertices 0 pos w) 0.0) + (set! (-> vertices 1 pos w) 0.0) + (set! (-> vertices 2 pos w) 0.5) + (set! (-> vertices 3 pos w) 0.5) + (let ((s3-1 (-> obj ocean-colors))) + (let ((s2-1 #f)) + (rgba-to-vector! obj sv-52 (-> s3-1 colors)) + (dotimes (s1-1 48) + (let ((f0-17 (+ (* 393216.0 (the float s1-1)) sv-48))) + (let ((f1-14 (+ 393216.0 f0-17))) + (set! (-> vertices 0 pos x) f0-17) + (set! (-> vertices 1 pos x) f1-14) + (set! (-> vertices 2 pos x) f1-14) + ) + (set! (-> vertices 3 pos x) f0-17) + ) + (rgba-to-vector! obj sv-56 (&+ (-> s3-1 colors) (* (+ s1-1 1) 4))) + (add-colors! obj (-> vertices 0 col) (-> vertices 0)) + (add-colors! obj (-> vertices 1 col) (-> vertices 1)) + (set! (-> vertices 2 col quad) (-> sv-56 quad)) + (set! (-> vertices 3 col quad) (-> sv-52 quad)) + (set! (-> sv-52 quad) (-> sv-56 quad)) + (cond + ((render-ocean-quad vertices arg0) + (set! s2-1 #t) + ) + (else + (if s2-1 + (goto cfg-18) + ) + ) + ) + ) + ) + ) + ) + (label cfg-18) + 0 + (none) + ) + +;; definition for method 61 of type ocean +;; INFO: Used lq/sq +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Return type mismatch int vs none. +(defmethod ocean-method-61 ocean ((obj ocean) (arg0 dma-buffer)) + (local-vars (sv-48 float) (sv-52 vector) (sv-56 vector)) + (let ((vertices (the-as (inline-array ocean-vertex) (+ #x70000000 0)))) + (let* ((f0-1 (+ 18874368.0 (-> obj start-corner z))) + (f1-2 (+ 5898240.0 f0-1)) + ) + (set! (-> vertices 0 pos z) f0-1) + (set! (-> vertices 1 pos z) f0-1) + (set! (-> vertices 2 pos z) f1-2) + (set! (-> vertices 3 pos z) f1-2) + ) + (set! (-> vertices 0 pos w) 1.0) + (set! (-> vertices 1 pos w) 1.0) + (set! (-> vertices 2 pos w) 0.5) + (set! (-> vertices 3 pos w) 0.5) + (set! sv-48 (-> obj start-corner x)) + (set! sv-52 (new 'stack-no-clear 'vector)) + (set! sv-56 (new 'stack-no-clear 'vector)) + (let ((s3-0 (-> obj ocean-colors))) + (let ((s2-0 #f)) + (rgba-to-vector! obj sv-52 (&-> s3-0 colors 2444)) + (dotimes (s1-0 48) + (let ((f0-9 (+ (* 393216.0 (the float s1-0)) sv-48))) + (let ((f1-7 (+ 393216.0 f0-9))) + (set! (-> vertices 0 pos x) f0-9) + (set! (-> vertices 1 pos x) f1-7) + (set! (-> vertices 2 pos x) f1-7) + ) + (set! (-> vertices 3 pos x) f0-9) + ) + (rgba-to-vector! obj sv-56 (&+ (-> s3-0 colors) (* (+ s1-0 2445) 4))) + (set! (-> vertices 0 col quad) (-> sv-52 quad)) + (set! (-> vertices 1 col quad) (-> sv-56 quad)) + (set! (-> vertices 2 col quad) (-> sv-56 quad)) + (set! (-> vertices 3 col quad) (-> sv-52 quad)) + (set! (-> sv-52 quad) (-> sv-56 quad)) + (cond + ((render-ocean-quad vertices arg0) + (set! s2-0 #t) + ) + (else + (if s2-0 + (goto cfg-9) + ) + ) + ) + ) + ) + ) + (label cfg-9) + (let* ((f0-11 (+ 24772608.0 (-> obj start-corner z))) + (f1-10 (+ 5898240.0 f0-11)) + ) + (set! (-> vertices 0 pos z) f0-11) + (set! (-> vertices 1 pos z) f0-11) + (set! (-> vertices 2 pos z) f1-10) + (set! (-> vertices 3 pos z) f1-10) + ) + (set! (-> vertices 0 pos w) 0.5) + (set! (-> vertices 1 pos w) 0.5) + (set! (-> vertices 2 pos w) 0.0) + (set! (-> vertices 3 pos w) 0.0) + (let ((s3-1 (-> obj ocean-colors))) + (let ((s2-1 #f)) + (rgba-to-vector! obj sv-52 (&-> s3-1 colors 2444)) + (dotimes (s1-1 48) + (let ((f0-18 (+ (* 393216.0 (the float s1-1)) sv-48))) + (let ((f1-15 (+ 393216.0 f0-18))) + (set! (-> vertices 0 pos x) f0-18) + (set! (-> vertices 1 pos x) f1-15) + (set! (-> vertices 2 pos x) f1-15) + ) + (set! (-> vertices 3 pos x) f0-18) + ) + (rgba-to-vector! obj sv-56 (&+ (-> s3-1 colors) (* (+ s1-1 2445) 4))) + (set! (-> vertices 0 col quad) (-> sv-52 quad)) + (set! (-> vertices 1 col quad) (-> sv-56 quad)) + (add-colors! obj (-> vertices 2 col) (-> vertices 2)) + (add-colors! obj (-> vertices 3 col) (-> vertices 3)) + (set! (-> sv-52 quad) (-> sv-56 quad)) + (cond + ((render-ocean-quad vertices arg0) + (set! s2-1 #t) + ) + (else + (if s2-1 + (goto cfg-18) + ) + ) + ) + ) + ) + ) + ) + (label cfg-18) + 0 + (none) + ) + +;; definition for method 62 of type ocean +;; INFO: Used lq/sq +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Return type mismatch int vs none. +(defmethod ocean-method-62 ocean ((obj ocean) (arg0 dma-buffer)) + (local-vars (sv-48 float) (sv-52 vector) (sv-56 vector)) + (let ((vertices (the-as (inline-array ocean-vertex) (+ #x70000000 0)))) + (let* ((f0-0 (-> obj start-corner x)) + (f1-1 (+ -5898240.0 f0-0)) + ) + (set! (-> vertices 0 pos x) f1-1) + (set! (-> vertices 1 pos x) f0-0) + (set! (-> vertices 2 pos x) f0-0) + (set! (-> vertices 3 pos x) f1-1) + ) + (set! (-> vertices 0 pos w) 0.5) + (set! (-> vertices 1 pos w) 1.0) + (set! (-> vertices 2 pos w) 1.0) + (set! (-> vertices 3 pos w) 0.5) + (set! sv-48 (-> obj start-corner z)) + (set! sv-52 (new 'stack-no-clear 'vector)) + (set! sv-56 (new 'stack-no-clear 'vector)) + (let ((s3-0 (-> obj ocean-colors))) + (let ((s2-0 #f)) + (rgba-to-vector! obj sv-52 (-> s3-0 colors)) + (dotimes (s1-0 48) + (let* ((f0-8 (+ (* 393216.0 (the float s1-0)) sv-48)) + (f1-6 (+ 393216.0 f0-8)) + ) + (set! (-> vertices 0 pos z) f0-8) + (set! (-> vertices 1 pos z) f0-8) + (set! (-> vertices 2 pos z) f1-6) + (set! (-> vertices 3 pos z) f1-6) + ) + (rgba-to-vector! obj sv-56 (&+ (-> s3-0 colors) (* 208 (+ s1-0 1)))) + (set! (-> vertices 0 col quad) (-> sv-52 quad)) + (set! (-> vertices 1 col quad) (-> sv-52 quad)) + (set! (-> vertices 2 col quad) (-> sv-56 quad)) + (set! (-> vertices 3 col quad) (-> sv-56 quad)) + (set! (-> sv-52 quad) (-> sv-56 quad)) + (cond + ((render-ocean-quad vertices arg0) + (set! s2-0 #t) + ) + (else + (if s2-0 + (goto cfg-9) + ) + ) + ) + ) + ) + ) + (label cfg-9) + (let* ((f0-10 (+ -5898240.0 (-> obj start-corner x))) + (f1-9 (+ -5898240.0 f0-10)) + ) + (set! (-> vertices 0 pos x) f1-9) + (set! (-> vertices 1 pos x) f0-10) + (set! (-> vertices 2 pos x) f0-10) + (set! (-> vertices 3 pos x) f1-9) + ) + (set! (-> vertices 0 pos w) 0.0) + (set! (-> vertices 1 pos w) 0.5) + (set! (-> vertices 2 pos w) 0.5) + (set! (-> vertices 3 pos w) 0.0) + (let ((s3-1 (-> obj ocean-colors))) + (let ((s2-1 #f)) + (rgba-to-vector! obj sv-52 (-> s3-1 colors)) + (dotimes (s1-1 48) + (let* ((f0-17 (+ (* 393216.0 (the float s1-1)) sv-48)) + (f1-14 (+ 393216.0 f0-17)) + ) + (set! (-> vertices 0 pos z) f0-17) + (set! (-> vertices 1 pos z) f0-17) + (set! (-> vertices 2 pos z) f1-14) + (set! (-> vertices 3 pos z) f1-14) + ) + (rgba-to-vector! obj sv-56 (&+ (-> s3-1 colors) (* 208 (+ s1-1 1)))) + (add-colors! obj (-> vertices 0 col) (-> vertices 0)) + (set! (-> vertices 1 col quad) (-> sv-52 quad)) + (set! (-> vertices 2 col quad) (-> sv-56 quad)) + (add-colors! obj (-> vertices 3 col) (-> vertices 3)) + (set! (-> sv-52 quad) (-> sv-56 quad)) + (cond + ((render-ocean-quad vertices arg0) + (set! s2-1 #t) + ) + (else + (if s2-1 + (goto cfg-18) + ) + ) + ) + ) + ) + ) + ) + (label cfg-18) + 0 + (none) + ) + +;; definition for method 63 of type ocean +;; INFO: Used lq/sq +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Return type mismatch int vs none. +(defmethod ocean-method-63 ocean ((obj ocean) (arg0 dma-buffer)) + (local-vars (sv-48 float) (sv-52 vector) (sv-56 vector)) + (let ((vertices (the-as (inline-array ocean-vertex) (+ #x70000000 0)))) + (let ((f0-1 (+ 18874368.0 (-> obj start-corner x)))) + (let ((f1-2 (+ 5898240.0 f0-1))) + (set! (-> vertices 0 pos x) f0-1) + (set! (-> vertices 1 pos x) f1-2) + (set! (-> vertices 2 pos x) f1-2) + ) + (set! (-> vertices 3 pos x) f0-1) + ) + (set! (-> vertices 0 pos w) 1.0) + (set! (-> vertices 1 pos w) 0.5) + (set! (-> vertices 2 pos w) 0.5) + (set! (-> vertices 3 pos w) 1.0) + (set! sv-48 (-> obj start-corner z)) + (set! sv-52 (new 'stack-no-clear 'vector)) + (set! sv-56 (new 'stack-no-clear 'vector)) + (let ((s3-0 (-> obj ocean-colors))) + (let ((s2-0 #f)) + (rgba-to-vector! obj sv-52 (&-> s3-0 colors 47)) + (dotimes (s1-0 48) + (let* ((f0-9 (+ (* 393216.0 (the float s1-0)) sv-48)) + (f1-7 (+ 393216.0 f0-9)) + ) + (set! (-> vertices 0 pos z) f0-9) + (set! (-> vertices 1 pos z) f0-9) + (set! (-> vertices 2 pos z) f1-7) + (set! (-> vertices 3 pos z) f1-7) + ) + (rgba-to-vector! obj sv-56 (&+ (-> s3-0 colors) (* (+ (* 52 (+ s1-0 1)) 47) 4))) + (set! (-> vertices 0 col quad) (-> sv-52 quad)) + (set! (-> vertices 1 col quad) (-> sv-52 quad)) + (set! (-> vertices 2 col quad) (-> sv-56 quad)) + (set! (-> vertices 3 col quad) (-> sv-56 quad)) + (set! (-> sv-52 quad) (-> sv-56 quad)) + (cond + ((render-ocean-quad vertices arg0) + (set! s2-0 #t) + ) + (else + (if s2-0 + (goto cfg-9) + ) + ) + ) + ) + ) + ) + (label cfg-9) + (let ((f0-11 (+ 24772608.0 (-> obj start-corner x)))) + (let ((f1-10 (+ 5898240.0 f0-11))) + (set! (-> vertices 0 pos x) f0-11) + (set! (-> vertices 1 pos x) f1-10) + (set! (-> vertices 2 pos x) f1-10) + ) + (set! (-> vertices 3 pos x) f0-11) + ) + (set! (-> vertices 0 pos w) 0.5) + (set! (-> vertices 1 pos w) 0.0) + (set! (-> vertices 2 pos w) 0.0) + (set! (-> vertices 3 pos w) 0.5) + (let ((s3-1 (-> obj ocean-colors))) + (let ((s2-1 #f)) + (rgba-to-vector! obj sv-52 (&-> s3-1 colors 47)) + (dotimes (s1-1 48) + (let* ((f0-18 (+ (* 393216.0 (the float s1-1)) sv-48)) + (f1-15 (+ 393216.0 f0-18)) + ) + (set! (-> vertices 0 pos z) f0-18) + (set! (-> vertices 1 pos z) f0-18) + (set! (-> vertices 2 pos z) f1-15) + (set! (-> vertices 3 pos z) f1-15) + ) + (rgba-to-vector! obj sv-56 (&+ (-> s3-1 colors) (* (+ (* 52 (+ s1-1 1)) 47) 4))) + (set! (-> vertices 0 col quad) (-> sv-52 quad)) + (add-colors! obj (-> vertices 1 col) (-> vertices 1)) + (add-colors! obj (-> vertices 2 col) (-> vertices 2)) + (set! (-> vertices 3 col quad) (-> sv-56 quad)) + (set! (-> sv-52 quad) (-> sv-56 quad)) + (cond + ((render-ocean-quad vertices arg0) + (set! s2-1 #t) + ) + (else + (if s2-1 + (goto cfg-18) + ) + ) + ) + ) + ) + ) + ) + (label cfg-18) + 0 + (none) + ) + +;; definition for method 64 of type ocean +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod ocean-method-64 ocean ((obj ocean) (arg0 dma-buffer)) + (let ((vertices (the-as (inline-array ocean-vertex) (+ #x70000000 0)))) + (let* ((v1-1 (-> obj ocean-colors)) + (f30-0 (-> obj start-corner x)) + (f28-0 (-> obj start-corner z)) + (f26-0 (+ -5898240.0 f30-0)) + (f24-0 (+ -5898240.0 f28-0)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (rgba-to-vector! obj s3-0 (-> v1-1 colors)) + (set! (-> vertices 0 pos x) f26-0) + (set! (-> vertices 1 pos x) f30-0) + (set! (-> vertices 2 pos x) f30-0) + (set! (-> vertices 3 pos x) f26-0) + (set! (-> vertices 0 pos z) f24-0) + (set! (-> vertices 1 pos z) f24-0) + (set! (-> vertices 2 pos z) f28-0) + (set! (-> vertices 3 pos z) f28-0) + (set! (-> vertices 0 pos w) 0.5) + (set! (-> vertices 1 pos w) 0.5) + (set! (-> vertices 2 pos w) 1.0) + (set! (-> vertices 3 pos w) 0.5) + (set! (-> vertices 0 col quad) (-> s3-0 quad)) + (set! (-> vertices 1 col quad) (-> s3-0 quad)) + (set! (-> vertices 2 col quad) (-> s3-0 quad)) + (set! (-> vertices 3 col quad) (-> s3-0 quad)) + (render-ocean-quad vertices arg0) + (let ((f0-7 (+ -5898240.0 (-> obj start-corner x))) + (f1-1 (-> obj start-corner z)) + ) + (let ((f2-1 (+ -5898240.0 f0-7)) + (f3-1 (+ -5898240.0 f1-1)) + ) + (set! (-> vertices 0 pos x) f2-1) + (set! (-> vertices 1 pos x) f0-7) + (set! (-> vertices 2 pos x) f0-7) + (set! (-> vertices 3 pos x) f2-1) + (set! (-> vertices 0 pos z) f3-1) + (set! (-> vertices 1 pos z) f3-1) + ) + (set! (-> vertices 2 pos z) f1-1) + (set! (-> vertices 3 pos z) f1-1) + ) + (set! (-> vertices 0 pos w) 0.0) + (set! (-> vertices 1 pos w) 0.5) + (set! (-> vertices 2 pos w) 0.5) + (set! (-> vertices 3 pos w) 0.0) + (add-colors! obj (-> vertices 0 col) (-> vertices 0)) + (set! (-> vertices 1 col quad) (-> s3-0 quad)) + (set! (-> vertices 2 col quad) (-> s3-0 quad)) + (add-colors! obj (-> vertices 3 col) (-> vertices 3)) + (render-ocean-quad vertices arg0) + (let ((f0-13 (+ -5898240.0 (-> obj start-corner x))) + (f1-4 (+ -5898240.0 (-> obj start-corner z))) + ) + (let ((f2-4 (+ -5898240.0 f0-13)) + (f3-3 (+ -5898240.0 f1-4)) + ) + (set! (-> vertices 0 pos x) f2-4) + (set! (-> vertices 1 pos x) f0-13) + (set! (-> vertices 2 pos x) f0-13) + (set! (-> vertices 3 pos x) f2-4) + (set! (-> vertices 0 pos z) f3-3) + (set! (-> vertices 1 pos z) f3-3) + ) + (set! (-> vertices 2 pos z) f1-4) + (set! (-> vertices 3 pos z) f1-4) + ) + (set! (-> vertices 0 pos w) 0.0) + (set! (-> vertices 1 pos w) 0.0) + (set! (-> vertices 2 pos w) 0.5) + (set! (-> vertices 3 pos w) 0.0) + (add-colors! obj (-> vertices 0 col) (-> vertices 0)) + (add-colors! obj (-> vertices 1 col) (-> vertices 1)) + (set! (-> vertices 2 col quad) (-> s3-0 quad)) + (add-colors! obj (-> vertices 3 col) (-> vertices 3)) + (render-ocean-quad vertices arg0) + (let ((f0-18 (-> obj start-corner x)) + (f1-6 (+ -5898240.0 (-> obj start-corner z))) + ) + (let ((f2-7 (+ -5898240.0 f0-18)) + (f3-5 (+ -5898240.0 f1-6)) + ) + (set! (-> vertices 0 pos x) f2-7) + (set! (-> vertices 1 pos x) f0-18) + (set! (-> vertices 2 pos x) f0-18) + (set! (-> vertices 3 pos x) f2-7) + (set! (-> vertices 0 pos z) f3-5) + (set! (-> vertices 1 pos z) f3-5) + ) + (set! (-> vertices 2 pos z) f1-6) + (set! (-> vertices 3 pos z) f1-6) + ) + (set! (-> vertices 0 pos w) 0.0) + (set! (-> vertices 1 pos w) 0.0) + (set! (-> vertices 2 pos w) 0.5) + (set! (-> vertices 3 pos w) 0.5) + (add-colors! obj (-> vertices 0 col) (-> vertices 0)) + (add-colors! obj (-> vertices 1 col) (-> vertices 2)) + (set! (-> vertices 2 col quad) (-> s3-0 quad)) + (set! (-> vertices 3 col quad) (-> s3-0 quad)) + ) + (render-ocean-quad vertices arg0) + ) + 0 + (none) + ) + +;; definition for method 65 of type ocean +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod ocean-method-65 ocean ((obj ocean) (arg0 dma-buffer)) + (let ((vertices (the-as (inline-array ocean-vertex) (+ #x70000000 0)))) + (let* ((v1-1 (-> obj ocean-colors)) + (f30-0 (+ 18874368.0 (-> obj start-corner x))) + (f28-0 (-> obj start-corner z)) + (f26-0 (+ 5898240.0 f30-0)) + (f24-0 (+ -5898240.0 f28-0)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (rgba-to-vector! obj s3-0 (&-> v1-1 colors 47)) + (set! (-> vertices 0 pos x) f30-0) + (set! (-> vertices 1 pos x) f26-0) + (set! (-> vertices 2 pos x) f26-0) + (set! (-> vertices 3 pos x) f30-0) + (set! (-> vertices 0 pos z) f24-0) + (set! (-> vertices 1 pos z) f24-0) + (set! (-> vertices 2 pos z) f28-0) + (set! (-> vertices 3 pos z) f28-0) + (set! (-> vertices 0 pos w) 0.5) + (set! (-> vertices 1 pos w) 0.5) + (set! (-> vertices 2 pos w) 0.5) + (set! (-> vertices 3 pos w) 1.0) + (set! (-> vertices 0 col quad) (-> s3-0 quad)) + (set! (-> vertices 1 col quad) (-> s3-0 quad)) + (set! (-> vertices 2 col quad) (-> s3-0 quad)) + (set! (-> vertices 3 col quad) (-> s3-0 quad)) + (render-ocean-quad vertices arg0) + (let ((f0-8 (+ 24772608.0 (-> obj start-corner x))) + (f1-2 (-> obj start-corner z)) + ) + (let ((f2-1 (+ 5898240.0 f0-8)) + (f3-1 (+ -5898240.0 f1-2)) + ) + (set! (-> vertices 0 pos x) f0-8) + (set! (-> vertices 1 pos x) f2-1) + (set! (-> vertices 2 pos x) f2-1) + (set! (-> vertices 3 pos x) f0-8) + (set! (-> vertices 0 pos z) f3-1) + (set! (-> vertices 1 pos z) f3-1) + ) + (set! (-> vertices 2 pos z) f1-2) + (set! (-> vertices 3 pos z) f1-2) + ) + (set! (-> vertices 0 pos w) 0.5) + (set! (-> vertices 1 pos w) 0.0) + (set! (-> vertices 2 pos w) 0.0) + (set! (-> vertices 3 pos w) 0.5) + (set! (-> vertices 0 col quad) (-> s3-0 quad)) + (add-colors! obj (-> vertices 1 col) (-> vertices 1)) + (add-colors! obj (-> vertices 2 col) (-> vertices 2)) + (set! (-> vertices 3 col quad) (-> s3-0 quad)) + (render-ocean-quad vertices arg0) + (let ((f0-14 (+ 18874368.0 (-> obj start-corner x))) + (f1-5 (+ -5898240.0 (-> obj start-corner z))) + ) + (let ((f2-4 (+ 5898240.0 f0-14)) + (f3-3 (+ -5898240.0 f1-5)) + ) + (set! (-> vertices 0 pos x) f0-14) + (set! (-> vertices 1 pos x) f2-4) + (set! (-> vertices 2 pos x) f2-4) + (set! (-> vertices 3 pos x) f0-14) + (set! (-> vertices 0 pos z) f3-3) + (set! (-> vertices 1 pos z) f3-3) + ) + (set! (-> vertices 2 pos z) f1-5) + (set! (-> vertices 3 pos z) f1-5) + ) + (set! (-> vertices 0 pos w) 0.0) + (set! (-> vertices 1 pos w) 0.0) + (set! (-> vertices 2 pos w) 0.5) + (set! (-> vertices 3 pos w) 0.5) + (add-colors! obj (-> vertices 0 col) (-> vertices 0)) + (add-colors! obj (-> vertices 1 col) (-> vertices 1)) + (set! (-> vertices 2 col quad) (-> s3-0 quad)) + (set! (-> vertices 3 col quad) (-> s3-0 quad)) + (render-ocean-quad vertices arg0) + (let ((f0-20 (+ 24772608.0 (-> obj start-corner x))) + (f1-8 (+ -5898240.0 (-> obj start-corner z))) + ) + (let ((f2-7 (+ 5898240.0 f0-20)) + (f3-5 (+ -5898240.0 f1-8)) + ) + (set! (-> vertices 0 pos x) f0-20) + (set! (-> vertices 1 pos x) f2-7) + (set! (-> vertices 2 pos x) f2-7) + (set! (-> vertices 3 pos x) f0-20) + (set! (-> vertices 0 pos z) f3-5) + (set! (-> vertices 1 pos z) f3-5) + ) + (set! (-> vertices 2 pos z) f1-8) + (set! (-> vertices 3 pos z) f1-8) + ) + (set! (-> vertices 0 pos w) 0.0) + (set! (-> vertices 1 pos w) 0.0) + (set! (-> vertices 2 pos w) 0.0) + (set! (-> vertices 3 pos w) 0.5) + (add-colors! obj (-> vertices 0 col) (-> vertices 0)) + (add-colors! obj (-> vertices 1 col) (-> vertices 1)) + (add-colors! obj (-> vertices 2 col) (-> vertices 2)) + (set! (-> vertices 3 col quad) (-> s3-0 quad)) + ) + (render-ocean-quad vertices arg0) + ) + 0 + (none) + ) + +;; definition for method 66 of type ocean +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod ocean-method-66 ocean ((obj ocean) (arg0 dma-buffer)) + (let ((vertices (the-as (inline-array ocean-vertex) (+ #x70000000 0)))) + (let* ((v1-1 (-> obj ocean-colors)) + (f30-0 (-> obj start-corner x)) + (f28-0 (+ 18874368.0 (-> obj start-corner z))) + (f26-0 (+ -5898240.0 f30-0)) + (f24-0 (+ 5898240.0 f28-0)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (rgba-to-vector! obj s3-0 (&-> v1-1 colors 2444)) + (set! (-> vertices 0 pos x) f26-0) + (set! (-> vertices 1 pos x) f30-0) + (set! (-> vertices 2 pos x) f30-0) + (set! (-> vertices 3 pos x) f26-0) + (set! (-> vertices 0 pos z) f28-0) + (set! (-> vertices 1 pos z) f28-0) + (set! (-> vertices 2 pos z) f24-0) + (set! (-> vertices 3 pos z) f24-0) + (set! (-> vertices 0 pos w) 0.5) + (set! (-> vertices 1 pos w) 1.0) + (set! (-> vertices 2 pos w) 0.5) + (set! (-> vertices 3 pos w) 0.5) + (set! (-> vertices 0 col quad) (-> s3-0 quad)) + (set! (-> vertices 1 col quad) (-> s3-0 quad)) + (set! (-> vertices 2 col quad) (-> s3-0 quad)) + (set! (-> vertices 3 col quad) (-> s3-0 quad)) + (render-ocean-quad vertices arg0) + (let* ((f0-8 (+ -5898240.0 (-> obj start-corner x))) + (f1-3 (+ 18874368.0 (-> obj start-corner z))) + (f2-2 (+ -5898240.0 f0-8)) + (f3-1 (+ 5898240.0 f1-3)) + ) + (set! (-> vertices 0 pos x) f2-2) + (set! (-> vertices 1 pos x) f0-8) + (set! (-> vertices 2 pos x) f0-8) + (set! (-> vertices 3 pos x) f2-2) + (set! (-> vertices 0 pos z) f1-3) + (set! (-> vertices 1 pos z) f1-3) + (set! (-> vertices 2 pos z) f3-1) + (set! (-> vertices 3 pos z) f3-1) + ) + (set! (-> vertices 0 pos w) 0.0) + (set! (-> vertices 1 pos w) 0.5) + (set! (-> vertices 2 pos w) 0.5) + (set! (-> vertices 3 pos w) 0.0) + (add-colors! obj (-> vertices 0 col) (-> vertices 0)) + (set! (-> vertices 1 col quad) (-> s3-0 quad)) + (set! (-> vertices 2 col quad) (-> s3-0 quad)) + (add-colors! obj (-> vertices 3 col) (-> vertices 3)) + (render-ocean-quad vertices arg0) + (let* ((f0-14 (+ -5898240.0 (-> obj start-corner x))) + (f1-6 (+ 24772608.0 (-> obj start-corner z))) + (f2-5 (+ -5898240.0 f0-14)) + (f3-3 (+ 5898240.0 f1-6)) + ) + (set! (-> vertices 0 pos x) f2-5) + (set! (-> vertices 1 pos x) f0-14) + (set! (-> vertices 2 pos x) f0-14) + (set! (-> vertices 3 pos x) f2-5) + (set! (-> vertices 0 pos z) f1-6) + (set! (-> vertices 1 pos z) f1-6) + (set! (-> vertices 2 pos z) f3-3) + (set! (-> vertices 3 pos z) f3-3) + ) + (set! (-> vertices 0 pos w) 0.0) + (set! (-> vertices 1 pos w) 0.5) + (set! (-> vertices 2 pos w) 0.0) + (set! (-> vertices 3 pos w) 0.0) + (add-colors! obj (-> vertices 0 col) (-> vertices 0)) + (set! (-> vertices 1 col quad) (-> s3-0 quad)) + (add-colors! obj (-> vertices 2 col) (-> vertices 2)) + (add-colors! obj (-> vertices 3 col) (-> vertices 3)) + (render-ocean-quad vertices arg0) + (let* ((f0-19 (-> obj start-corner x)) + (f1-8 (+ 24772608.0 (-> obj start-corner z))) + (f2-8 (+ -5898240.0 f0-19)) + (f3-5 (+ 5898240.0 f1-8)) + ) + (set! (-> vertices 0 pos x) f2-8) + (set! (-> vertices 1 pos x) f0-19) + (set! (-> vertices 2 pos x) f0-19) + (set! (-> vertices 3 pos x) f2-8) + (set! (-> vertices 0 pos z) f1-8) + (set! (-> vertices 1 pos z) f1-8) + (set! (-> vertices 2 pos z) f3-5) + (set! (-> vertices 3 pos z) f3-5) + ) + (set! (-> vertices 0 pos w) 0.5) + (set! (-> vertices 1 pos w) 0.5) + (set! (-> vertices 2 pos w) 0.0) + (set! (-> vertices 3 pos w) 0.0) + (set! (-> vertices 0 col quad) (-> s3-0 quad)) + (set! (-> vertices 1 col quad) (-> s3-0 quad)) + ) + (add-colors! obj (-> vertices 2 col) (-> vertices 2)) + (add-colors! obj (-> vertices 3 col) (-> vertices 3)) + (render-ocean-quad vertices arg0) + ) + 0 + (none) + ) + +;; definition for method 67 of type ocean +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod ocean-method-67 ocean ((obj ocean) (arg0 dma-buffer)) + (let ((vertices (the-as (inline-array ocean-vertex) (+ #x70000000 0)))) + (let* ((v1-1 (-> obj ocean-colors)) + (f30-0 (+ 18874368.0 (-> obj start-corner x))) + (f28-0 (+ 18874368.0 (-> obj start-corner z))) + (f26-0 (+ 5898240.0 f30-0)) + (f24-0 (+ 5898240.0 f28-0)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (rgba-to-vector! obj s3-0 (&-> v1-1 colors 2491)) + (set! (-> vertices 0 pos x) f30-0) + (set! (-> vertices 1 pos x) f26-0) + (set! (-> vertices 2 pos x) f26-0) + (set! (-> vertices 3 pos x) f30-0) + (set! (-> vertices 0 pos z) f28-0) + (set! (-> vertices 1 pos z) f28-0) + (set! (-> vertices 2 pos z) f24-0) + (set! (-> vertices 3 pos z) f24-0) + (set! (-> vertices 0 pos w) 1.0) + (set! (-> vertices 1 pos w) 0.5) + (set! (-> vertices 2 pos w) 0.5) + (set! (-> vertices 3 pos w) 0.5) + (set! (-> vertices 0 col quad) (-> s3-0 quad)) + (set! (-> vertices 1 col quad) (-> s3-0 quad)) + (set! (-> vertices 2 col quad) (-> s3-0 quad)) + (set! (-> vertices 3 col quad) (-> s3-0 quad)) + (render-ocean-quad vertices arg0) + (let* ((f0-9 (+ 24772608.0 (-> obj start-corner x))) + (f1-4 (+ 18874368.0 (-> obj start-corner z))) + (f2-2 (+ 5898240.0 f0-9)) + (f3-1 (+ 5898240.0 f1-4)) + ) + (set! (-> vertices 0 pos x) f0-9) + (set! (-> vertices 1 pos x) f2-2) + (set! (-> vertices 2 pos x) f2-2) + (set! (-> vertices 3 pos x) f0-9) + (set! (-> vertices 0 pos z) f1-4) + (set! (-> vertices 1 pos z) f1-4) + (set! (-> vertices 2 pos z) f3-1) + (set! (-> vertices 3 pos z) f3-1) + ) + (set! (-> vertices 0 pos w) 0.5) + (set! (-> vertices 1 pos w) 0.0) + (set! (-> vertices 2 pos w) 0.0) + (set! (-> vertices 3 pos w) 0.5) + (set! (-> vertices 0 col quad) (-> s3-0 quad)) + (add-colors! obj (-> vertices 1 col) (-> vertices 1)) + (add-colors! obj (-> vertices 2 col) (-> vertices 2)) + (set! (-> vertices 3 col quad) (-> s3-0 quad)) + (render-ocean-quad vertices arg0) + (let* ((f0-15 (+ 18874368.0 (-> obj start-corner x))) + (f1-7 (+ 24772608.0 (-> obj start-corner z))) + (f2-5 (+ 5898240.0 f0-15)) + (f3-3 (+ 5898240.0 f1-7)) + ) + (set! (-> vertices 0 pos x) f0-15) + (set! (-> vertices 1 pos x) f2-5) + (set! (-> vertices 2 pos x) f2-5) + (set! (-> vertices 3 pos x) f0-15) + (set! (-> vertices 0 pos z) f1-7) + (set! (-> vertices 1 pos z) f1-7) + (set! (-> vertices 2 pos z) f3-3) + (set! (-> vertices 3 pos z) f3-3) + ) + (set! (-> vertices 0 pos w) 0.5) + (set! (-> vertices 1 pos w) 0.5) + (set! (-> vertices 2 pos w) 0.0) + (set! (-> vertices 3 pos w) 0.0) + (set! (-> vertices 0 col quad) (-> s3-0 quad)) + (set! (-> vertices 1 col quad) (-> s3-0 quad)) + (add-colors! obj (-> vertices 2 col) (-> vertices 2)) + (add-colors! obj (-> vertices 3 col) (-> vertices 3)) + (render-ocean-quad vertices arg0) + (let* ((f0-21 (+ 24772608.0 (-> obj start-corner x))) + (f1-10 (+ 24772608.0 (-> obj start-corner z))) + (f2-8 (+ 5898240.0 f0-21)) + (f3-5 (+ 5898240.0 f1-10)) + ) + (set! (-> vertices 0 pos x) f0-21) + (set! (-> vertices 1 pos x) f2-8) + (set! (-> vertices 2 pos x) f2-8) + (set! (-> vertices 3 pos x) f0-21) + (set! (-> vertices 0 pos z) f1-10) + (set! (-> vertices 1 pos z) f1-10) + (set! (-> vertices 2 pos z) f3-5) + (set! (-> vertices 3 pos z) f3-5) + ) + (set! (-> vertices 0 pos w) 0.5) + (set! (-> vertices 1 pos w) 0.0) + (set! (-> vertices 2 pos w) 0.0) + (set! (-> vertices 3 pos w) 0.0) + (set! (-> vertices 0 col quad) (-> s3-0 quad)) + ) + (add-colors! obj (-> vertices 1 col) (-> vertices 1)) + (add-colors! obj (-> vertices 2 col) (-> vertices 2)) + (add-colors! obj (-> vertices 3 col) (-> vertices 3)) + (render-ocean-quad vertices arg0) + ) + 0 + (none) + ) + +;; definition for method 68 of type ocean +;; WARN: Return type mismatch int vs none. +(defmethod render-ocean-far ocean ((obj ocean) (arg1 dma-buffer) (facing int)) + (let ((vertices (the-as (inline-array ocean-vertex) (+ #x70000000 0)))) + (let ((f0-0 (-> obj start-corner y))) + (set! (-> vertices 0 pos y) f0-0) + (set! (-> vertices 1 pos y) f0-0) + (set! (-> vertices 2 pos y) f0-0) + (set! (-> vertices 3 pos y) f0-0) + ) + (set-vector! (-> vertices 0 stq) 0.0 0.0 1.0 1.0) + (set-vector! (-> vertices 1 stq) 1.0 0.0 1.0 1.0) + (set-vector! (-> vertices 2 stq) 1.0 15.0 1.0 1.0) + (set-vector! (-> vertices 3 stq) 0.0 15.0 1.0 1.0) + (if (not (logtest? facing 2)) + (ocean-method-60 obj arg1) + ) + (if (not (logtest? facing 4)) + (ocean-method-61 obj arg1) + ) + (set-vector! (-> vertices 0 stq) 0.0 0.0 1.0 1.0) + (set-vector! (-> vertices 1 stq) 15.0 0.0 1.0 1.0) + (set-vector! (-> vertices 2 stq) 15.0 1.0 1.0 1.0) + (set-vector! (-> vertices 3 stq) 0.0 1.0 1.0 1.0) + (if (not (logtest? facing 16)) + (ocean-method-62 obj arg1) + ) + (if (not (logtest? facing 8)) + (ocean-method-63 obj arg1) + ) + (set-vector! (-> vertices 0 stq) 0.0 0.0 1.0 1.0) + (set-vector! (-> vertices 1 stq) 15.0 0.0 1.0 1.0) + (set-vector! (-> vertices 2 stq) 15.0 15.0 1.0 1.0) + (set-vector! (-> vertices 3 stq) 0.0 15.0 1.0 1.0) + ) + (if (not (or (logtest? facing 2) (logtest? facing 16))) + (ocean-method-64 obj arg1) + ) + (if (not (or (logtest? facing 2) (logtest? facing 8))) + (ocean-method-65 obj arg1) + ) + (if (not (or (logtest? facing 4) (logtest? facing 16))) + (ocean-method-66 obj arg1) + ) + (if (not (or (logtest? facing 4) (logtest? facing 8))) + (ocean-method-67 obj arg1) + ) + 0 + (none) + ) + +;; definition for method 69 of type ocean +;; WARN: Return type mismatch uint vs none. +(defmethod draw-ocean-far ocean ((obj ocean) (arg0 dma-buffer)) + (init-ocean-far-regs) + (let ((gp-0 (the-as object (-> arg0 base)))) + (&+! (-> arg0 base) 16) + (let ((v1-2 (-> obj ocean-facing))) + (cond + ((zero? v1-2) + (render-ocean-far obj arg0 4) + ) + ((= v1-2 1) + (render-ocean-far obj arg0 2) + ) + ((= v1-2 3) + (render-ocean-far obj arg0 8) + ) + ((= v1-2 2) + (render-ocean-far obj arg0 16) + ) + ) + ) + (close-sky-buffer arg0) + (let ((v1-15 (/ (the-as int (+ (- -16 (the-as int gp-0)) (the-as int (-> arg0 base)))) 16))) + (set! (-> (the-as dma-packet gp-0) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc v1-15)) + (set! (-> (the-as dma-packet gp-0) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet gp-0) vif1) (new 'static 'vif-tag :cmd (vif-cmd direct) :msk #x1 :imm v1-15)) + ) + ) + (none) + ) + +;; definition for method 19 of type ocean +(defmethod init-buffer! ocean ((obj ocean) (arg0 dma-buffer)) + "Initialize [[ocean]] DMA buffer. + @returns Pointer to the next DMA buffer" + (let* ((v1-0 arg0) + (a0-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :qwc #xa :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-1) vif1) (new 'static 'vif-tag :imm #xa :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) + ) + (let* ((v1-1 arg0) + (a0-3 (the-as object (-> v1-1 base))) + ) + (set! (-> (the-as gs-gif-tag a0-3) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x9)) + (set! (-> (the-as gs-gif-tag a0-3) regs) GIF_REGS_ALL_AD) + (set! (-> v1-1 base) (&+ (the-as pointer a0-3) 16)) + ) + (let* ((s5-0 arg0) + (s4-0 (-> s5-0 base)) + ) + (set! (-> (the-as (pointer gs-test) s4-0) 0) + (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest always)) + ) + (set! (-> (the-as (pointer gs-reg64) s4-0) 1) (gs-reg64 test-1)) + (set! (-> (the-as (pointer gs-alpha) s4-0) 2) (new 'static 'gs-alpha :b #x1 :d #x1)) + (set! (-> (the-as (pointer gs-reg64) s4-0) 3) (gs-reg64 alpha-1)) + (set! (-> (the-as (pointer gs-tex0) s4-0) 4) + (new 'static 'gs-tex0 :tbp0 #x2a0 :tbw #x2 :th (log2 128) :tw (log2 128)) + ) + (set! (-> (the-as (pointer gs-reg64) s4-0) 5) (gs-reg64 tex0-1)) + (set! (-> (the-as (pointer gs-tex1) s4-0) 6) (-> obj tex1)) + (set! (-> (the-as (pointer gs-reg64) s4-0) 7) (gs-reg64 tex1-1)) + (set! (-> (the-as (pointer gs-texa) s4-0) 8) (new 'static 'gs-texa :ta0 #x80 :ta1 #x80)) + (set! (-> (the-as (pointer gs-reg64) s4-0) 9) (gs-reg64 texa)) + (set! (-> (the-as (pointer gs-miptbp) s4-0) 10) + (new 'static 'gs-miptbp :tbp1 #x6a0 :tbw1 #x1 :tbp2 #x7a0 :tbp3 #x7e0) + ) + (set! (-> (the-as (pointer gs-reg64) s4-0) 11) (gs-reg64 miptbp1-1)) + (set! (-> (the-as (pointer gs-miptbp) s4-0) 12) (new 'static 'gs-miptbp :tbp1 #x800 :tbp2 #x820 :tbp3 #x840)) + (set! (-> (the-as (pointer gs-reg64) s4-0) 13) (gs-reg64 miptbp2-1)) + (set! (-> (the-as (pointer gs-clamp) s4-0) 14) (new 'static 'gs-clamp)) + (set! (-> (the-as (pointer gs-reg64) s4-0) 15) (gs-reg64 clamp-1)) + (set! (-> (the-as (pointer gs-fogcol) s4-0) 16) (the-as gs-fogcol *fog-color*)) + (set! (-> (the-as (pointer gs-reg64) s4-0) 17) (gs-reg64 fogcol)) + (let ((v0-2 (&+ s4-0 144))) + (set! (-> s5-0 base) v0-2) + v0-2 + ) + ) + ) + +;; definition for method 20 of type ocean +;; WARN: Return type mismatch int vs none. +(defmethod end-buffer! ocean ((obj ocean) (arg0 dma-buffer)) + (let* ((v1-0 arg0) + (a0-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-1) vif1) (new 'static 'vif-tag :imm #x2 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) + ) + (let* ((v1-1 arg0) + (a0-3 (the-as object (-> v1-1 base))) + ) + (set! (-> (the-as gs-gif-tag a0-3) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1)) + (set! (-> (the-as gs-gif-tag a0-3) regs) GIF_REGS_ALL_AD) + (set! (-> v1-1 base) (&+ (the-as pointer a0-3) 16)) + ) + (let* ((v1-2 arg0) + (a0-5 (-> v1-2 base)) + ) + (set! (-> (the-as (pointer gs-texa) a0-5) 0) (new 'static 'gs-texa :ta1 #x80)) + (set! (-> (the-as (pointer gs-reg64) a0-5) 1) (gs-reg64 texa)) + (set! (-> v1-2 base) (&+ a0-5 16)) + ) + 0 + (none) + ) + +;; definition for method 9 of type ocean-map +;; WARN: Return type mismatch int vs none. +(defmethod set-height! ocean-map ((obj ocean-map) (arg0 float)) + (if obj + (set! (-> obj start-corner y) arg0) + ) + 0 + (none) + ) + +;; definition for method 10 of type ocean-map +(defmethod get-base-height ocean-map ((obj ocean-map)) + (if obj + (-> obj start-corner y) + 0.0 + ) + ) + +;; definition for method 90 of type ocean +;; WARN: Return type mismatch int vs none. +(defmethod rgba-to-vector! ocean ((obj ocean) (arg0 vector) (arg1 (pointer rgba))) + "Pack an [[rgba]]'s bytes into a vector." + (local-vars (v1-1 uint128) (v1-2 uint128)) + (rlet ((vf1 :class vf)) + (let ((v1-0 (the-as uint128 (-> (the-as (pointer int32) arg1) 0)))) + (.pextlb v1-1 0 v1-0) + ) + (.pextlh v1-2 0 v1-1) + (.mov vf1 v1-2) + (.itof.vf vf1 vf1) + (.svf (&-> arg0 quad) vf1) + 0 + (none) + ) + ) + +;; definition for method 18 of type ocean +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +;; ERROR: Unsupported inline assembly instruction kind - [psrah a2, a2, 8] +(defmethod ocean-method-18 ocean ((obj ocean) (arg0 (pointer ocean-colors)) (arg1 (pointer ocean-colors))) + "Unused" + (local-vars + (a1-17 (pointer ocean-colors)) + (a2-8 (pointer ocean-colors)) + (a2-10 uint128) + (a2-11 uint128) + (a2-12 uint128) + (a2-13 uint128) + (a2-14 uint128) + (a2-15 uint128) + ) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf12 :class vf) + (vf13 :class vf) + (vf14 :class vf) + (vf15 :class vf) + (vf16 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf) + ) + (init-vf0-vector) + *time-of-day-context* + (let ((v1-1 #f)) + (dotimes (a0-1 (-> *level* length)) + (let ((a1-4 (-> *level* level a0-1))) + (when (= (-> a1-4 status) 'active) + (if (-> a1-4 info sky) + (set! v1-1 #t) + ) + ) + ) + ) + (cond + (v1-1 + (let ((s2-0 (new 'stack-no-clear 'vector))) + (let ((f0-0 (-> obj constant w)) + (a2-6 (-> *level* default-level mood-context times)) + ) + (set! (-> s2-0 quad) (-> obj sky-color quad)) + (vector4-lerp! s2-0 s2-0 (the-as vector a2-6) f0-0) + ) + (let ((s1-0 (new 'stack-no-clear 'vector4)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (let ((v1-5 (math-camera-pos))) + (vector-! (the-as vector s1-0) v1-5 (-> obj start-corner)) + ) + (vector4-scale! s1-0 s1-0 0.0000025431316) + (set! (-> s3-0 y) (* 0.0000025431316 (-> obj start-corner y))) + (.lvf vf16 (&-> obj constant quad)) + (.lvf vf3 (&-> s2-0 quad)) + (.lvf vf4 (&-> s1-0 quad)) + (.sub.vf vf16 vf0 vf16 :mask #b1000) + (let ((f3-0 48.0)) + (.lvf vf7 (&-> obj haze-lights sun0-normal quad)) + (.lvf vf8 (&-> obj haze-lights sun1-normal quad)) + (.lvf vf9 (&-> obj haze-lights moon-normal quad)) + (.sub.vf vf7 vf0 vf7 :mask #b101) + (.sub.vf vf8 vf0 vf8 :mask #b101) + (.sub.vf vf9 vf0 vf9 :mask #b101) + (.lvf vf10 (&-> obj haze-lights sun0-color quad)) + (.lvf vf11 (&-> obj haze-lights sun1-color quad)) + (.lvf vf12 (&-> obj haze-lights moon-color quad)) + (.max.w.vf vf1 vf0 vf0) + (dotimes (v1-8 49) + (dotimes (a0-10 52) + (* (+ (* 52 v1-8) a0-10) 4) + (let ((a2-9 (the-as uint128 (dynamic-array-field-access a2-8 PLACEHOLDER)))) + (.pextlb a2-10 a2-9 0) + ) + (let ((f1-1 (gpr->fpr v1-8))) + (.pextlh a2-11 0 a2-10) + (let ((f2-0 (gpr->fpr a0-10))) + (.mov vf2 a2-11) + (let ((f1-2 (the float f1-1))) + (vitof15.xyzw vf2 vf2) + (let* ((f2-1 (the float f2-0)) + (f1-3 (fmin f1-2 f3-0)) + (f2-2 (fmin f2-1 f3-0)) + ) + (nop!) + (set! (-> s3-0 z) f1-3) + (set! (-> s3-0 x) f2-2) + ) + ) + ) + ) + (.lvf vf5 (&-> s3-0 quad)) + (.sub.vf vf6 vf4 vf5) + (.mul.vf vf13 vf6 vf6 :mask #b111) + (.mul.x.vf acc vf1 vf13 :mask #b1) + (.add.mul.y.vf acc vf1 vf13 acc :mask #b1) + (.add.mul.z.vf vf13 vf1 vf13 acc :mask #b1) + (.isqrt.vf Q vf0 vf13 :fsf #b11 :ftf #b0) + (.wait.vf) + (.mul.vf vf6 vf6 Q) + (.mul.vf vf13 vf7 vf6) + (.mul.vf vf14 vf8 vf6) + (.mul.vf vf15 vf9 vf6) + (.mul.x.vf acc vf1 vf13 :mask #b1) + (.add.mul.y.vf acc vf1 vf13 acc :mask #b1) + (.add.mul.z.vf vf13 vf1 vf13 acc :mask #b1) + (.mul.x.vf acc vf1 vf14 :mask #b1) + (.add.mul.y.vf acc vf1 vf14 acc :mask #b1) + (.add.mul.z.vf vf14 vf1 vf14 acc :mask #b1) + (.max.vf vf13 vf13 vf0) + (.mul.x.vf acc vf1 vf15 :mask #b1) + (.add.mul.y.vf acc vf1 vf15 acc :mask #b1) + (.add.mul.z.vf vf15 vf1 vf15 acc :mask #b1) + (.max.vf vf14 vf14 vf0) + (.max.vf vf15 vf15 vf0) + (.mul.vf vf13 vf13 vf13) + (.mul.vf vf14 vf14 vf14) + (.mul.vf vf15 vf15 vf15) + (.mul.vf vf13 vf13 vf13) + (.mul.vf vf14 vf14 vf14) + (.mul.vf vf15 vf15 vf15) + (.mul.vf vf13 vf13 vf13) + (.mul.vf vf14 vf14 vf14) + (.mul.vf vf15 vf15 vf15) + (.mul.vf vf13 vf13 vf13) + (.mul.vf vf14 vf14 vf14) + (.mul.vf vf15 vf15 vf15) + (.mul.w.vf vf13 vf13 vf16) + (.mul.w.vf vf14 vf14 vf16) + (.mul.w.vf vf15 vf15 vf16) + (.mul.vf acc vf1 vf2) + (.add.mul.x.vf acc vf10 vf13 acc) + (.add.mul.x.vf acc vf11 vf14 acc) + (.add.mul.x.vf vf2 vf12 vf15 acc) + (.max.vf vf2 vf2 vf0) + (.min.x.vf vf2 vf2 vf16) + (vftoi15.xyzw vf2 vf2) + (.mov a2-12 vf2) + (.ppach a2-13 (the-as uint128 0) a2-12) + (.psrah a2-14 (the-as int a2-13) 8) + (.ppacb a2-15 (the-as uint128 0) a2-14) + (set! (dynamic-array-field-access a1-17 PLACEHOLDER) (the-as ocean-colors a2-15)) + ) + ) + ) + ) + ) + ) + (else + (mem-copy! arg0 arg1 #x27d0) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 13 of type ocean +;; WARN: Return type mismatch int vs none. +(defmethod update-map ocean ((obj ocean)) + (with-pp + (set! (-> obj heights) #f) + (set! (-> obj verts) #f) + (let ((s5-0 *mood-control*)) + (set! (-> obj constant w) (if (and (-> s5-0 overide-weather-flag) (not (movie?))) + (-> s5-0 overide cloud) + (-> s5-0 current-interp cloud) + ) + ) + ) + (set! (-> obj constant w) (fmin 1.0 (* 2.0 (-> obj constant w)))) + (let ((f0-5 1.0) + (f30-0 1.0) + ) + (when (= (-> *bigmap* bigmap-index) 13) + (set! f0-5 0.333) + (set! f30-0 0.75) + ) + (set! (-> obj frame-speed) (* (+ 4.0 (-> *setting-control* user-current rain)) f0-5)) + (set! (-> obj frame-speed2) (* (+ 5.0 (-> *setting-control* user-current rain)) f0-5)) + (when (not (paused?)) + (let ((f0-8 (+ (-> obj frame-num) (* (-> obj frame-speed) (-> pp clock seconds-per-frame))))) + (set! (-> obj frame-num) (- f0-8 (* (the float (the int (/ f0-8 64.0))) 64.0))) + ) + (let ((f0-11 (+ (-> obj frame-num2) (* (-> obj frame-speed2) (-> pp clock seconds-per-frame))))) + (set! (-> obj frame-num2) (- f0-11 (* (the float (the int (/ f0-11 64.0))) 64.0))) + ) + ) + (let ((s5-1 (-> *display* frames (-> *display* on-screen) global-buf))) + (set! (-> obj heights) (the-as ocean-height-array (-> s5-1 base))) + (interp-wave obj (the-as ocean-wave-info (-> obj heights)) (the-as uint (-> obj frame-num)) (* 0.08325 f30-0)) + (&+! (-> s5-1 base) 4096) + (set! (-> obj heights2) (the-as ocean-height-array (-> s5-1 base))) + (interp-wave + obj + (the-as ocean-wave-info (-> obj heights2)) + (the-as uint (-> obj frame-num2)) + (* 0.01665 f30-0) + ) + (&+! (-> s5-1 base) 4096) + (ocean-method-15 obj (the-as matrix (-> obj heights)) (the-as matrix (-> obj heights2))) + (set! (-> obj verts) (the-as ocean-vert-array (-> s5-1 base))) + (&+! (-> s5-1 base) #x8000) + ) + ) + (when (not (or (-> obj off) (-> *blit-displays-work* menu-mode))) + (when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask ocean)) + (mem-copy! (the-as pointer (-> obj cloud-lights)) (the-as pointer (-> *sky-work* cloud-lights)) 156) + (mem-copy! (the-as pointer (-> obj haze-lights)) (the-as pointer (-> *sky-work* haze-lights)) 124) + (vector4-scale! + (the-as vector4 (-> obj sky-color)) + (the-as vector4 (-> *time-of-day-context* current-sky-color)) + 0.0078125 + ) + (let ((t9-8 (method-of-type ocean generate-verts))) + (-> obj verts) + (-> obj heights) + (t9-8) + ) + (let* ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (s5-2 (-> s4-0 base)) + ) + (if (-> *time-of-day-context* sky) + (ocean-method-89 obj s4-0) + ) + (draw-ocean-texture obj s4-0 (the-as int (-> obj verts))) + (ocean-method-79 obj s4-0) + (init-buffer! obj s4-0) + (if (-> obj far-on) + (draw-ocean-far obj s4-0) + ) + (if (not (-> obj mid-off)) + (draw-ocean-mid obj s4-0) + ) + (end-buffer! obj s4-0) + (set-dirty-mask! (-> *level* default-level) 9 #xc0000 #x2a000) + (let ((a3-3 (-> s4-0 base))) + (let ((v1-87 (the-as object (-> s4-0 base)))) + (set! (-> (the-as dma-packet v1-87) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-87) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-87) vif1) (new 'static 'vif-tag)) + (set! (-> s4-0 base) (&+ (the-as pointer v1-87) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id bucket-6) + s5-2 + (the-as (pointer dma-tag) a3-3) + ) + ) + ) + (when (not (or (-> obj near-off) + (or (-> obj mid-off) (< 196608.0 (fabs (- (-> obj start-corner y) (-> *math-camera* trans y))))) + ) + ) + (let* ((s4-1 (-> *display* frames (-> *display* on-screen) global-buf)) + (s5-3 (-> s4-1 base)) + ) + (draw-ocean-texture obj s4-1 (the-as int (-> obj verts))) + (draw-ocean-near obj s4-1) + (end-buffer! obj s4-1) + (set-dirty-mask! (-> *level* default-level) 7 #xc0000 #x2a000) + (let ((a3-5 (-> s4-1 base))) + (let ((v1-113 (the-as object (-> s4-1 base)))) + (set! (-> (the-as dma-packet v1-113) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-113) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-113) vif1) (new 'static 'vif-tag)) + (set! (-> s4-1 base) (&+ (the-as pointer v1-113) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id bucket-310) + s5-3 + (the-as (pointer dma-tag) a3-5) + ) + ) + ) + ) + ) + ) + (when (not (paused?)) + (set! (-> obj off) #f) + (set! (-> obj mid-off) #f) + (set! (-> obj near-off) (if obj + (not (-> obj ocean-near-translucent?)) + #f + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 12 of type ocean +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod draw! ocean ((obj ocean)) + (do-tex-scroll! obj) + (set! *ocean-map* #f) + (set! (-> obj far-on) #f) + (dotimes (v1-2 (-> *level* length)) + (let ((a0-5 (-> *level* level v1-2))) + (when (= (-> a0-5 status) 'active) + (if (-> a0-5 info ocean-far?) + (set! (-> obj far-on) #t) + ) + (let ((a1-7 (-> a0-5 info ocean))) + (cond + ((= a1-7 'none) + (when (-> a0-5 meta-inside?) + (set! *ocean-map* #f) + (goto cfg-17) + ) + ) + ((and a1-7 (nonzero? (-> a1-7 value))) + (set! *ocean-map* (the-as ocean-map (-> a1-7 value))) + (set! (-> obj ocean-near-translucent?) (-> a0-5 info ocean-near-translucent?)) + ) + ) + ) + ) + ) + ) + (label cfg-17) + (if *ocean-map* + (mem-copy! (the-as pointer obj) (the-as pointer *ocean-map*) 56) + ) + (let ((v1-9 (new 'stack-no-clear 'vector))) + (if (-> *time-of-day-context* use-camera-other) + (set! (-> v1-9 quad) (-> *math-camera* inv-camera-rot-other vector 2 quad)) + (set! (-> v1-9 quad) (-> *math-camera* inv-camera-rot vector 2 quad)) + ) + (cond + ((< (fabs (-> v1-9 z)) (fabs (-> v1-9 x))) + (if (< (-> v1-9 x) 0.0) + (set! (-> obj ocean-facing) (the-as uint 3)) + (set! (-> obj ocean-facing) (the-as uint 2)) + ) + ) + ((< (-> v1-9 z) 0.0) + (set! (-> obj ocean-facing) (the-as uint 0)) + 0 + ) + (else + (set! (-> obj ocean-facing) (the-as uint 1)) + ) + ) + ) + 0 + (none) + ) + +;; definition (debug) for function test-seq-read +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition (debug) for function test-worst-read +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition (debug) for function test-seq-write +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition (debug) for function test-worst-write +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition (debug) for function test-to-spr +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition (debug) for function test-from-spr +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition (debug) for function test-to-from-spr +;; ERROR: function was not converted to expressions. Cannot decompile. diff --git a/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher_REF.gc index 21aefd3a07..eab5931a9d 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher_REF.gc @@ -2091,9 +2091,7 @@ ) (defun birth-func-ocean-height ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) - (set! (-> arg2 vector 0 y) - (+ (ocean-method-11 *ocean* (the-as vector (-> arg2 vector)) #t) (-> arg1 user-float)) - ) + (set! (-> arg2 vector 0 y) (+ (get-height *ocean* (the-as vector (-> arg2 vector)) #t) (-> arg1 user-float))) 0 (none) ) diff --git a/test/decompiler/test_VuDisasm.cpp b/test/decompiler/test_VuDisasm.cpp index 6bac79db5d..c24a88ee62 100644 --- a/test/decompiler/test_VuDisasm.cpp +++ b/test/decompiler/test_VuDisasm.cpp @@ -30,6 +30,34 @@ std::string get_expected(const std::string& name) { } } // namespace +TEST(VuDisasm, OceanTexture_Jak2) { + auto data = get_test_data("jak2/ocean-texture"); + VuDisassembler disasm(VuDisassembler::VuKind::VU1); + auto prog = disasm.disassemble(data.data(), data.size() * 4, false); + EXPECT_EQ(disasm.to_string(prog), get_expected("jak2/ocean-texture")); +} + +TEST(VuDisasm, OceanMid_Jak2) { + auto data = get_test_data("jak2/ocean-mid"); + VuDisassembler disasm(VuDisassembler::VuKind::VU1); + auto prog = disasm.disassemble(data.data(), data.size() * 4, false); + EXPECT_EQ(disasm.to_string(prog), get_expected("jak2/ocean-mid")); +} + +TEST(VuDisasm, OceanNear_Jak2) { + auto data = get_test_data("jak2/ocean-near"); + VuDisassembler disasm(VuDisassembler::VuKind::VU1); + auto prog = disasm.disassemble(data.data(), data.size() * 4, false); + EXPECT_EQ(disasm.to_string(prog), get_expected("jak2/ocean-near")); +} + +TEST(VuDisasm, OceanVu0_Jak2) { + auto data = get_test_data("jak2/ocean-vu0"); + VuDisassembler disasm(VuDisassembler::VuKind::VU0); + auto prog = disasm.disassemble(data.data(), data.size() * 4, false); + EXPECT_EQ(disasm.to_string(prog), get_expected("jak2/ocean-vu0")); +} + TEST(VuDisasm, Merc_Jak2) { auto data = get_test_data("jak2/merc-vu1"); VuDisassembler disasm(VuDisassembler::VuKind::VU1); diff --git a/test/decompiler/vu_reference/jak2/ocean-mid-result.txt b/test/decompiler/vu_reference/jak2/ocean-mid-result.txt new file mode 100644 index 0000000000..f960eb149f --- /dev/null +++ b/test/decompiler/vu_reference/jak2/ocean-mid-result.txt @@ -0,0 +1,1235 @@ + lq. vf00, -880(vi00) | addx. vf00, vf00, vf00 + lq. vf00, 584(vi00) | addx. vf00, vf00, vf00 + lq.xyzw vf01, 733(vi00) | nop + lq.xyzw vf02, 735(vi00) | nop + lq.xyzw vf03, 736(vi00) | nop + lq.xyzw vf05, 737(vi00) | nop + lq.xyzw vf06, 738(vi00) | nop + iaddiu vi09, vi00, 0x14f | nop + iaddi vi01, vi00, 0x6 | nop +L1: + lq.xyzw vf20, 741(vi01) | nop + lq.xyzw vf21, 749(vi01) | nop + sq.xyzw vf20, 335(vi01) | nop + sq.xyzw vf20, 457(vi01) | nop + sq.xyzw vf21, 396(vi01) | nop + sq.xyzw vf21, 518(vi01) | nop + ibgtz vi01, L1 | nop + iaddi vi01, vi01, -0x1 | nop + iaddi vi05, vi00, 0x0 | mul.xyzw vf16, vf00, vf00 + iaddi vi07, vi00, 0x8 | nop +L2: + iaddi vi06, vi00, 0x8 | mul.x vf16, vf00, vf00 +L3: + sq.xyzw vf16, 236(vi05) | nop + iaddi vi05, vi05, 0x1 | addw.x vf16, vf16, vf05 + ibgtz vi06, L3 | nop + iaddi vi06, vi06, -0x1 | nop + ibgtz vi07, L2 | addw.z vf16, vf16, vf05 + iaddi vi07, vi07, -0x1 | nop + nop | sub.xyzw vf20, vf20, vf20 + nop | sub.xyzw vf21, vf21, vf21 + iaddi vi03, vi00, 0x0 | addw.z vf20, vf20, vf00 + iaddi vi06, vi00, 0x8 | addw.yz vf21, vf21, vf00 +L4: + sq.xyzw vf20, 317(vi03) | nop + sq.xyzw vf21, 318(vi03) | addw.x vf20, vf20, vf00 + iaddi vi03, vi03, 0x2 | addw.x vf21, vf21, vf00 + ibgtz vi06, L4 | nop + iaddi vi06, vi06, -0x1 | nop + lq.xyzw vf08, 756(vi00) | nop + iaddi vi04, vi00, 0x8 | nop + iaddiu vi06, vi00, 0x11 | ftoi0.xyzw vf08, vf08 +L5: + sq.xyzw vf08, 396(vi04) | nop + sq.xyzw vf08, 518(vi04) | nop + iaddi vi04, vi04, 0x3 | nop + ibgtz vi06, L5 | nop + iaddi vi06, vi06, -0x1 | nop + nop | nop :e + nop | nop + iaddiu vi10, vi00, 0x243 | nop + nop | nop :e + nop | nop + xtop vi02 | nop + lq.xyzw vf07, 748(vi00) | nop + lq.xyzw vf12, 4(vi02) | nop + lq.xyzw vf13, 5(vi02) | nop + lq.xyzw vf14, 6(vi02) | nop + lq.xyzw vf15, 7(vi02) | nop + sq.xyzw vf07, 341(vi00) | nop + sq.xyzw vf07, 463(vi00) | nop + iaddi vi07, vi00, 0x7 | nop + lq.xyzw vf04, 116(vi02) | nop +L6: + iaddi vi01, vi07, -0x4 | nop + mtir vi10, vf04.x | nop + iaddiu vi11, vi00, 0xff | nop + ibne vi00, vi01, L7 | nop + mr32.xyzw vf04, vf04 | nop + lq.xyzw vf04, 117(vi02) | nop +L7: + ibeq vi11, vi10, L8 | nop + iaddi vi08, vi09, 0x7 | nop + bal vi15, L20 | nop + nop | nop + iaddiu vi01, vi00, 0x318 | nop + xgkick vi09 | nop + isub vi09, vi01, vi09 | nop +L8: + ibgtz vi07, L6 | nop + iaddi vi07, vi07, -0x1 | nop + nop | nop :e + nop | nop + xtop vi02 | nop + lq.xyzw vf07, 747(vi00) | nop + lq.xyzw vf08, 0(vi02) | nop + lq.xyzw vf09, 1(vi02) | nop + lq.xyzw vf10, 2(vi02) | nop + lq.xyzw vf11, 3(vi02) | nop + lq.xyzw vf12, 4(vi02) | nop + lq.xyzw vf13, 5(vi02) | nop + lq.xyzw vf14, 6(vi02) | nop + lq.xyzw vf15, 7(vi02) | nop + sq.xyzw vf07, 341(vi00) | nop + sq.xyzw vf07, 463(vi00) | nop + iaddi vi07, vi00, 0x7 | nop + lq.xyzw vf04, 116(vi02) | nop +L9: + iaddi vi01, vi07, -0x4 | nop + mtir vi10, vf04.x | nop + iaddiu vi11, vi00, 0xff | nop + ibne vi00, vi01, L10 | nop + mr32.xyzw vf04, vf04 | nop + lq.xyzw vf04, 117(vi02) | nop +L10: + ibeq vi11, vi10, L11 | nop + iaddi vi08, vi09, 0x7 | nop + bal vi15, L26 | nop + nop | nop + iaddiu vi01, vi00, 0x318 | nop + xgkick vi09 | nop + ibeq vi00, vi14, L11 | nop + isub vi09, vi01, vi09 | nop + bal vi15, L32 | nop + nop | nop +L11: + ibgtz vi07, L9 | nop + iaddi vi07, vi07, -0x1 | nop + nop | nop :e + nop | nop + xtop vi02 | nop + xtop vi03 | nop + ior vi04, vi00, vi00 | nop + ilw.x vi05, 8(vi02) | nop + lq.xyzw vf08, 0(vi02) | nop + lq.xyzw vf09, 1(vi02) | nop + lq.xyzw vf10, 2(vi02) | nop + lq.xyzw vf11, 3(vi02) | nop + lq.xyzw vf12, 4(vi02) | nop + lq.xyzw vf13, 5(vi02) | nop + lq.xyzw vf14, 6(vi02) | nop + lq.xyzw vf15, 7(vi02) | nop +L12: + lq.xyzw vf16, 17(vi03) | nop + lq.xyzw vf28, 765(vi00) | nop + lq.xyzw vf29, 766(vi00) | nop + lq.xyzw vf30, 767(vi00) | nop + lq.xyzw vf31, 768(vi00) | nop + lq.xyzw vf24, 9(vi02) | mulax.xyzw ACC, vf28, vf16 + lq.xyzw vf25, 10(vi02) | madday.xyzw ACC, vf29, vf16 + lq.xyzw vf26, 11(vi02) | maddaz.xyzw ACC, vf30, vf16 + lq.xyzw vf27, 12(vi02) | maddw.xyzw vf28, vf31, vf16 + lq.xyzw vf22, 13(vi02) | mulax.xyzw ACC, vf24, vf16 + lq.xyzw vf23, 14(vi02) | madday.xyzw ACC, vf25, vf16 + lq.xyzw vf18, 15(vi02) | maddaz.xyzw ACC, vf26, vf16 + lq.xyzw vf19, 16(vi02) | maddw.xyzw vf20, vf27, vf16 + iaddi vi05, vi05, -0x1 | mulax.xyzw ACC, vf08, vf28 + nop | madday.xyzw ACC, vf09, vf28 + nop | maddaz.xyzw ACC, vf10, vf28 + nop | maddw.xyzw vf24, vf11, vf00 + nop | mulax.xyzw ACC, vf12, vf28 + nop | madday.xyzw ACC, vf13, vf28 + nop | maddaz.xyzw ACC, vf14, vf28 + erleng.xyz P, vf24 | maddw.xyzw vf28, vf15, vf00 + waitp | nop + nop | mul.xyzw vf28, vf28, vf01 + mfp.w vf24, P | mulax.xyzw ACC, vf22, vf16 + iaddi vi03, vi03, 0x1 | madday.xyzw ACC, vf23, vf16 + nop | maddaz.xyzw ACC, vf18, vf16 + sq.xyzw vf20, 791(vi04) | maddw.xyzw vf22, vf19, vf16 + sq.xyzw vf28, 793(vi04) | mulw.xy vf24, vf24, vf24 + sq.xyzw vf22, 792(vi04) | mula.xyzw ACC, vf24, vf05 + iaddi vi04, vi04, 0x4 | maddw.xyzw vf24, vf06, vf00 + ibgtz vi05, L12 | nop + sq.xyzw vf24, 790(vi04) | nop + ior vi14, vi00, vi00 | nop + lq.xyzw vf31, 734(vi00) | nop + ilw.x vi11, 8(vi02) | nop + ilw.y vi07, 8(vi02) | nop + iaddi vi15, vi00, 0x1 | nop + lq.xyzw vf28, 741(vi00) | nop + lq.xyzw vf29, 742(vi00) | nop + lq.xyzw vf30, 743(vi00) | nop + lq.xyzw vf24, 744(vi00) | nop + lq.xyzw vf25, 745(vi00) | nop + lq.xyzw vf26, 746(vi00) | nop + lq.xyzw vf07, 739(vi00) | nop + sq.xyzw vf28, 579(vi00) | nop + sq.xyzw vf29, 580(vi00) | nop + sq.xyzw vf30, 581(vi00) | nop + sq.xyzw vf24, 582(vi00) | nop + sq.xyzw vf25, 583(vi00) | nop + sq.xyzw vf26, 584(vi00) | nop + sq.xyzw vf28, 656(vi00) | nop + sq.xyzw vf29, 657(vi00) | nop + sq.xyzw vf30, 658(vi00) | nop + sq.xyzw vf24, 659(vi00) | nop + sq.xyzw vf25, 660(vi00) | nop + sq.xyzw vf26, 661(vi00) | nop + iaddi vi11, vi11, -0x2 | nop +L13: + iand vi01, vi07, vi15 | nop + iaddi vi11, vi11, -0x2 | nop + ibne vi00, vi01, L14 | nop + iadd vi15, vi15, vi15 | nop + iaddi vi08, vi10, 0x7 | nop + iaddi vi03, vi10, 0x7 | nop + iaddi vi05, vi00, 0x4 | nop + lq.xyzw vf20, 791(vi14) | nop + lq.xyzw vf22, 792(vi14) | nop + lq.xyzw vf28, 793(vi14) | nop + lq.xyzw vf21, 795(vi14) | nop + lq.xyzw vf23, 796(vi14) | nop + lq.xyzw vf29, 797(vi14) | nop + sq.xyzw vf20, 0(vi08) | nop + sq.xyzw vf22, 1(vi08) | nop + sq.xyzw vf28, 2(vi08) | nop + sq.xyzw vf21, 3(vi08) | nop + sq.xyzw vf23, 4(vi08) | nop + sq.xyzw vf29, 5(vi08) | nop + sq.xyzw vf20, 12(vi08) | nop + sq.xyzw vf22, 13(vi08) | nop + sq.xyzw vf28, 14(vi08) | nop + lq.xyzw vf20, 803(vi14) | nop + lq.xyzw vf22, 804(vi14) | nop + lq.xyzw vf28, 805(vi14) | nop + lq.xyzw vf21, 799(vi14) | nop + lq.xyzw vf23, 800(vi14) | nop + lq.xyzw vf29, 801(vi14) | nop + sq.xyzw vf20, 6(vi08) | nop + sq.xyzw vf22, 7(vi08) | nop + sq.xyzw vf28, 8(vi08) | nop + sq.xyzw vf21, 9(vi08) | nop + sq.xyzw vf23, 10(vi08) | nop + bal vi13, L39 | nop + sq.xyzw vf29, 11(vi08) | nop + ibeq vi00, vi05, L14 | nop + iaddiu vi06, vi05, 0x4000 | nop + bal vi13, L37 | nop + iaddiu vi06, vi06, 0x4000 | nop +L14: + ibgtz vi11, L13 | nop + iaddi vi14, vi14, 0x8 | nop + ior vi14, vi00, vi00 | nop + ilw.x vi11, 8(vi02) | nop + ilw.y vi07, 8(vi02) | nop + iaddi vi15, vi00, 0x1 | nop + lq.xyzw vf07, 740(vi00) | nop + iaddi vi11, vi11, -0x2 | nop +L15: + iand vi01, vi07, vi15 | nop + iaddi vi11, vi11, -0x2 | nop + ibne vi00, vi01, L16 | nop + iadd vi15, vi15, vi15 | nop + iaddi vi08, vi10, 0x7 | nop + iaddi vi03, vi10, 0x7 | nop + iaddi vi05, vi00, 0x4 | nop + lq.xyzw vf24, 794(vi14) | nop + lq.xyzw vf22, 756(vi00) | nop + lq.xyzw vf28, 793(vi14) | nop + lq.xyzw vf25, 798(vi14) | nop + lq.xyzw vf29, 797(vi14) | nop + sq.xyzw vf24, 0(vi08) | nop + sq.xyzw vf22, 1(vi08) | nop + sq.xyzw vf28, 2(vi08) | nop + sq.xyzw vf25, 3(vi08) | nop + sq.xyzw vf22, 4(vi08) | nop + sq.xyzw vf29, 5(vi08) | nop + sq.xyzw vf24, 12(vi08) | nop + sq.xyzw vf22, 13(vi08) | nop + sq.xyzw vf28, 14(vi08) | nop + lq.xyzw vf24, 806(vi14) | nop + lq.xyzw vf28, 805(vi14) | nop + lq.xyzw vf25, 802(vi14) | nop + lq.xyzw vf29, 801(vi14) | nop + sq.xyzw vf24, 6(vi08) | nop + sq.xyzw vf22, 7(vi08) | nop + sq.xyzw vf28, 8(vi08) | nop + sq.xyzw vf25, 9(vi08) | nop + sq.xyzw vf22, 10(vi08) | nop + bal vi13, L39 | nop + sq.xyzw vf29, 11(vi08) | nop + lq.xyzw vf28, 749(vi00) | nop + ibeq vi00, vi05, L16 | nop + lq.xyzw vf29, 750(vi00) | nop + lq.xyzw vf30, 751(vi00) | nop + lq.xyzw vf24, 752(vi00) | nop + lq.xyzw vf25, 753(vi00) | nop + lq.xyzw vf26, 754(vi00) | nop + sq.xyzw vf28, 0(vi10) | nop + sq.xyzw vf29, 1(vi10) | nop + sq.xyzw vf30, 2(vi10) | nop + sq.xyzw vf24, 3(vi10) | nop + sq.xyzw vf25, 4(vi10) | nop + sq.xyzw vf26, 5(vi10) | nop + iaddiu vi06, vi05, 0x4000 | nop + bal vi13, L37 | nop + iaddiu vi06, vi06, 0x4000 | nop +L16: + ibgtz vi11, L15 | nop + iaddi vi14, vi14, 0x8 | nop + nop | nop :e + nop | nop + xtop vi02 | nop + xtop vi03 | nop + ior vi04, vi00, vi00 | nop + iaddi vi08, vi10, 0x7 | nop + ilw.x vi05, 8(vi02) | nop + lq.xyzw vf08, 0(vi02) | nop + lq.xyzw vf09, 1(vi02) | nop + lq.xyzw vf10, 2(vi02) | nop + lq.xyzw vf11, 3(vi02) | nop + lq.xyzw vf12, 4(vi02) | nop + lq.xyzw vf13, 5(vi02) | nop + lq.xyzw vf14, 6(vi02) | nop + lq.xyzw vf15, 7(vi02) | nop +L17: + lq.xyzw vf16, 17(vi03) | nop + lq.xyzw vf28, 765(vi00) | nop + lq.xyzw vf29, 766(vi00) | nop + lq.xyzw vf30, 767(vi00) | nop + lq.xyzw vf31, 768(vi00) | nop + lq.xyzw vf24, 9(vi02) | mulax.xyzw ACC, vf28, vf16 + lq.xyzw vf25, 10(vi02) | madday.xyzw ACC, vf29, vf16 + lq.xyzw vf26, 11(vi02) | maddaz.xyzw ACC, vf30, vf16 + lq.xyzw vf27, 12(vi02) | maddw.xyzw vf28, vf31, vf16 + lq.xyzw vf22, 13(vi02) | mulax.xyzw ACC, vf24, vf16 + lq.xyzw vf23, 14(vi02) | madday.xyzw ACC, vf25, vf16 + lq.xyzw vf18, 15(vi02) | maddaz.xyzw ACC, vf26, vf16 + lq.xyzw vf19, 16(vi02) | maddw.xyzw vf20, vf27, vf16 + iaddi vi05, vi05, -0x1 | mulax.xyzw ACC, vf08, vf28 + nop | madday.xyzw ACC, vf09, vf28 + nop | maddaz.xyzw ACC, vf10, vf28 + nop | maddw.xyzw vf24, vf11, vf00 + nop | mulax.xyzw ACC, vf12, vf28 + nop | madday.xyzw ACC, vf13, vf28 + nop | maddaz.xyzw ACC, vf14, vf28 + erleng.xyz P, vf24 | maddw.xyzw vf28, vf15, vf00 + waitp | nop + nop | mul.xyzw vf28, vf28, vf01 + mfp.w vf24, P | mulax.xyzw ACC, vf22, vf16 + iaddi vi03, vi03, 0x1 | madday.xyzw ACC, vf23, vf16 + nop | maddaz.xyzw ACC, vf18, vf16 + sq.xyzw vf20, 0(vi08) | maddw.xyzw vf22, vf19, vf16 + sq.xyzw vf28, 2(vi08) | mulw.xy vf24, vf24, vf24 + sq.xyzw vf28, 792(vi04) | nop + sq.xyzw vf22, 1(vi08) | mula.xyzw ACC, vf24, vf05 + iaddi vi04, vi04, 0x2 | maddw.xyzw vf24, vf06, vf00 + iaddi vi08, vi08, 0x3 | nop + ibgtz vi05, L17 | nop + sq.xyzw vf24, 789(vi04) | nop + lq.xyzw vf31, 734(vi00) | nop + ilw.x vi05, 8(vi02) | nop + lq.xyzw vf20, 7(vi10) | nop + lq.xyzw vf22, 8(vi10) | nop + lq.xyzw vf28, 9(vi10) | nop + sq.xyzw vf20, 0(vi08) | nop + sq.xyzw vf22, 1(vi08) | nop + sq.xyzw vf28, 2(vi08) | nop + iaddi vi08, vi10, 0x7 | nop + bal vi13, L39 | nop + iaddi vi03, vi10, 0x7 | nop + lq.xyzw vf28, 741(vi00) | nop + ibeq vi00, vi05, L19 | nop + lq.xyzw vf29, 742(vi00) | nop + lq.xyzw vf30, 743(vi00) | nop + lq.xyzw vf24, 744(vi00) | nop + lq.xyzw vf25, 745(vi00) | nop + lq.xyzw vf26, 746(vi00) | nop + lq.xyzw vf07, 739(vi00) | nop + sq.xyzw vf28, 0(vi10) | nop + sq.xyzw vf29, 1(vi10) | nop + sq.xyzw vf30, 2(vi10) | nop + sq.xyzw vf24, 3(vi10) | nop + sq.xyzw vf25, 4(vi10) | nop + sq.xyzw vf26, 5(vi10) | nop + iaddiu vi06, vi05, 0x4000 | nop + bal vi13, L37 | nop + iaddiu vi06, vi06, 0x4000 | nop + ior vi03, vi00, vi00 | nop + lq.xyzw vf22, 756(vi00) | nop + ilw.x vi05, 8(vi02) | nop + iaddi vi08, vi10, 0x7 | nop +L18: + lq.xyzw vf28, 792(vi03) | nop + lq.xyzw vf24, 791(vi03) | nop + iaddi vi03, vi03, 0x2 | nop + iaddi vi05, vi05, -0x1 | nop + sq.xyzw vf22, 1(vi08) | nop + sq.xyzw vf28, 2(vi08) | nop + sq.xyzw vf24, 0(vi08) | nop + ibgtz vi05, L18 | nop + iaddi vi08, vi08, 0x3 | nop + ilw.x vi05, 8(vi02) | nop + lq.xyzw vf20, 7(vi10) | nop + lq.xyzw vf22, 8(vi10) | nop + lq.xyzw vf24, 9(vi10) | nop + sq.xyzw vf24, 0(vi08) | nop + sq.xyzw vf22, 1(vi08) | nop + sq.xyzw vf28, 2(vi08) | nop + iaddi vi08, vi10, 0x7 | nop + bal vi13, L39 | nop + iaddi vi03, vi10, 0x7 | nop + lq.xyzw vf28, 749(vi00) | nop + lq.xyzw vf29, 750(vi00) | nop + lq.xyzw vf30, 751(vi00) | nop + lq.xyzw vf24, 752(vi00) | nop + lq.xyzw vf25, 753(vi00) | nop + lq.xyzw vf26, 754(vi00) | nop + lq.xyzw vf07, 740(vi00) | nop + sq.xyzw vf28, 0(vi10) | nop + sq.xyzw vf29, 1(vi10) | nop + sq.xyzw vf30, 2(vi10) | nop + sq.xyzw vf24, 3(vi10) | nop + sq.xyzw vf25, 4(vi10) | nop + sq.xyzw vf26, 5(vi10) | nop + iaddiu vi06, vi05, 0x4000 | nop + bal vi13, L37 | nop + iaddiu vi06, vi06, 0x4000 | nop +L19: + nop | nop :e + nop | nop +L20: + ilw.x vi05, 757(vi07) | nop + ilw.y vi04, 757(vi07) | nop + iaddi vi03, vi00, 0x0 | nop + iadd vi04, vi04, vi02 | nop + iaddi vi06, vi00, 0x8 | nop + lq.xyzw vf28, 236(vi05) | nop + lq.xyzw vf29, 245(vi05) | mulax.xyzw ACC, vf12, vf28 + iaddi vi05, vi05, 0x1 | madday.xyzw ACC, vf13, vf28 + fcset 0x0 | maddaz.xyzw ACC, vf14, vf28 + nop | maddw.xyzw vf30, vf15, vf00 + div Q, vf03.x, vf30.w | mulax.xyzw ACC, vf12, vf29 + lq.xyzw vf28, 236(vi05) | madday.xyzw ACC, vf13, vf29 + lq.xyzw vf20, 317(vi03) | maddaz.xyzw ACC, vf14, vf29 + lq.xyzw vf22, 8(vi04) | maddw.xyzw vf31, vf15, vf00 + nop | mul.xyzw vf18, vf30, vf01 + waitq | mulaw.w ACC, vf30, vf00 + nop | mula.xyz ACC, vf30, Q + nop | maddw.xyzw vf16, vf02, vf00 + nop | clipw.xyz vf18, vf18 + nop | mul.xyzw vf19, vf31, vf01 + div Q, vf03.x, vf31.w | mul.xyzw vf20, vf20, Q + nop | mulax.xyzw ACC, vf12, vf28 + nop | madday.xyzw ACC, vf13, vf28 + iaddi vi13, vi00, 0x0 | clipw.xyz vf19, vf19 + iaddi vi12, vi00, 0x1 | maxy.w vf16, vf16, vf03 + lq.xyzw vf29, 245(vi05) | maddaz.xyzw ACC, vf14, vf28 + iaddi vi01, vi00, 0x0 | nop + b L23 | maddw.xyzw vf30, vf15, vf00 + iaddi vi05, vi05, 0x1 | miniz.w vf16, vf16, vf03 +L21: + iand vi13, vi10, vi12 | nop + ibeq vi00, vi01, L22 | mulaw.w ACC, vf30, vf00 + lq.xyzw vf20, 317(vi03) | mula.xyz ACC, vf30, Q + nop | addw.w vf17, vf17, vf03 +L22: + lq.xyzw vf22, 8(vi04) | maddw.xyzw vf16, vf02, vf00 + fcand vi01, 0x3ffff | mul.xyzw vf19, vf31, vf01 + div Q, vf03.x, vf31.w | mul.xyzw vf20, vf20, Q + ior vi01, vi01, vi13 | ftoi4.xyzw vf17, vf17 + iadd vi12, vi12, vi12 | maxy.w vf16, vf16, vf03 + sq.xyzw vf21, 3(vi08) | mulax.xyzw ACC, vf12, vf28 + sq.xyzw vf23, 4(vi08) | madday.xyzw ACC, vf13, vf28 + sq.xyzw vf17, 5(vi08) | clipw.xyz vf19, vf19 + lq.xyzw vf29, 245(vi05) | miniz.w vf16, vf16, vf03 + iaddi vi08, vi08, 0x6 | maddaz.xyzw ACC, vf14, vf28 + iaddi vi05, vi05, 0x1 | maddw.xyzw vf30, vf15, vf00 +L23: + ibeq vi00, vi01, L24 | mulaw.w ACC, vf31, vf00 + lq.xyzw vf21, 318(vi03) | mula.xyz ACC, vf31, Q + nop | addw.w vf16, vf16, vf03 +L24: + lq.xyzw vf23, 20(vi04) | maddw.xyzw vf17, vf02, vf00 + fcand vi01, 0x3ffff | mul.xyzw vf18, vf30, vf01 + div Q, vf03.x, vf30.w | mul.xyzw vf21, vf21, Q + iaddi vi03, vi03, 0x2 | ftoi4.xyzw vf16, vf16 + ior vi01, vi01, vi13 | nop + iaddi vi04, vi04, 0x1 | maxy.w vf17, vf17, vf03 + sq.xyzw vf20, 0(vi08) | mulax.xyzw ACC, vf12, vf29 + sq.xyzw vf22, 1(vi08) | madday.xyzw ACC, vf13, vf29 + sq.xyzw vf16, 2(vi08) | clipw.xyz vf18, vf18 + lq.xyzw vf28, 236(vi05) | miniz.w vf17, vf17, vf03 + ibgtz vi06, L21 | maddaz.xyzw ACC, vf14, vf29 + iaddi vi06, vi06, -0x1 | maddw.xyzw vf31, vf15, vf00 + ibeq vi00, vi01, L25 | nop + nop | nop + nop | addw.w vf17, vf17, vf03 +L25: + nop | ftoi4.xyzw vf17, vf17 + sq.xyzw vf21, 3(vi08) | nop + sq.xyzw vf23, 4(vi08) | nop + sq.xyzw vf17, 5(vi08) | nop + jr vi15 | nop + nop | nop +L26: + ilw.x vi05, 757(vi07) | nop + ilw.y vi04, 757(vi07) | nop + iaddi vi03, vi00, 0x0 | nop + iadd vi04, vi04, vi02 | nop + iaddi vi06, vi00, 0x8 | nop + lq.xyzw vf28, 236(vi05) | nop + lq.xyzw vf29, 245(vi05) | mulax.xyzw ACC, vf12, vf28 + iaddi vi05, vi05, 0x1 | madday.xyzw ACC, vf13, vf28 + fcset 0x0 | maddaz.xyzw ACC, vf14, vf28 + nop | maddw.xyzw vf30, vf15, vf00 + nop | mulax.xyzw ACC, vf08, vf28 + nop | madday.xyzw ACC, vf09, vf28 + nop | maddaz.xyzw ACC, vf10, vf28 + nop | maddw.xyzw vf26, vf11, vf00 + lq.xyzw vf20, 317(vi03) | mulax.xyzw ACC, vf12, vf29 + lq.xyzw vf22, 8(vi04) | madday.xyzw ACC, vf13, vf29 + div Q, vf03.x, vf30.w | maddaz.xyzw ACC, vf14, vf29 + erleng.xyz P, vf26 | maddw.xyzw vf31, vf15, vf00 + nop | mulax.xyzw ACC, vf08, vf29 + nop | madday.xyzw ACC, vf09, vf29 + lq.xyzw vf28, 236(vi05) | maddaz.xyzw ACC, vf10, vf29 + lq.xyzw vf29, 245(vi05) | maddw.xyzw vf27, vf11, vf00 + nop | mul.xyzw vf18, vf30, vf01 + nop | mul.xyzw vf19, vf31, vf01 + nop | mulaw.w ACC, vf30, vf00 + nop | mula.xyz ACC, vf30, Q + nop | maddw.xyzw vf16, vf02, vf00 + div Q, vf03.x, vf31.w | mul.xyzw vf20, vf20, Q + waitp | maxy.w vf16, vf16, vf03 + mfp.w vf26, P | mulax.xyzw ACC, vf12, vf28 + erleng.xyz P, vf27 | madday.xyzw ACC, vf13, vf28 + iaddi vi12, vi00, 0x1 | maddaz.xyzw ACC, vf14, vf28 + iaddi vi01, vi00, 0x0 | maddw.xyzw vf30, vf15, vf00 + iaddi vi13, vi00, 0x0 | mulw.xy vf24, vf26, vf26 + iaddi vi11, vi00, 0x0 | miniz.w vf16, vf16, vf03 + iaddi vi14, vi00, 0x0 | mulax.xyzw ACC, vf08, vf28 + nop | madday.xyzw ACC, vf09, vf28 + nop | maddaz.xyzw ACC, vf10, vf28 + nop | maddw.xyzw vf26, vf11, vf00 + nop | clipw.xyz vf18, vf18 + waitp | clipw.xyz vf19, vf19 + b L29 | mula.xyzw ACC, vf24, vf05 + iaddi vi05, vi05, 0x1 | maddw.xyzw vf24, vf06, vf00 +L27: + ibeq vi00, vi01, L28 | mulaw.w ACC, vf30, vf00 + lq.xyzw vf20, 317(vi03) | mula.xyz ACC, vf30, Q + ibne vi00, vi13, L28 | addw.w vf17, vf17, vf03 + fcor vi01, 0x7df7ff | nop + isw.x vi12, 775(vi14) | nop + ibne vi00, vi01, L28 | nop + fcor vi01, 0xdf7dff | nop + isw.y vi05, 775(vi14) | nop + ibne vi00, vi01, L28 | nop + fcor vi01, 0xefbeff | nop + ilw.z vi11, 757(vi07) | nop + ibne vi00, vi01, L28 | nop + fcor vi01, 0xf7df7f | nop + isw.z vi04, 775(vi14) | nop + ibne vi00, vi01, L28 | nop + fcor vi01, 0xfbefbf | nop + isub vi11, vi05, vi11 | nop + ibne vi00, vi01, L28 | nop + nop | nop + ibltz vi11, L28 | nop + nop | nop + iaddi vi14, vi14, 0x1 | nop +L28: + lq.xyzw vf22, 8(vi04) | maddw.xyzw vf16, vf02, vf00 + div Q, vf03.x, vf31.w | mul.xyzw vf20, vf20, Q + fcand vi01, 0x3ffff | mul.xyzw vf19, vf31, vf01 + waitp | ftoi4.xyzw vf17, vf17 + mfp.w vf26, P | maxy.w vf16, vf16, vf03 + erleng.xyz P, vf27 | clipw.xyz vf19, vf19 + sq.xyzw vf21, 3(vi08) | mulz.xyzw vf25, vf25, vf21 + sq.xyzw vf23, 4(vi08) | mulw.xy vf24, vf26, vf26 + sq.xyzw vf17, 5(vi08) | mulax.xyzw ACC, vf12, vf28 + sq.xyzw vf17, 66(vi08) | madday.xyzw ACC, vf13, vf28 + sq.xyzw vf25, 64(vi08) | maddaz.xyzw ACC, vf14, vf28 + iaddi vi08, vi08, 0x6 | maddw.xyzw vf30, vf15, vf00 + iand vi13, vi10, vi12 | mulax.xyzw ACC, vf08, vf28 + iadd vi12, vi12, vi12 | madday.xyzw ACC, vf09, vf28 + ior vi01, vi01, vi13 | maddaz.xyzw ACC, vf10, vf28 + nop | maddw.xyzw vf26, vf11, vf00 + lq.xyzw vf29, 245(vi05) | miniz.w vf16, vf16, vf03 + iaddi vi05, vi05, 0x1 | mula.xyzw ACC, vf24, vf05 + nop | maddw.xyzw vf24, vf06, vf00 +L29: + ibeq vi00, vi01, L30 | mulaw.w ACC, vf31, vf00 + lq.xyzw vf21, 318(vi03) | mula.xyz ACC, vf31, Q + ibne vi00, vi13, L30 | addw.w vf16, vf16, vf03 + fcor vi01, 0x7df7ff | nop + isw.x vi00, 775(vi14) | nop + ibne vi00, vi01, L30 | nop + fcor vi01, 0xdf7dff | nop + isw.y vi05, 775(vi14) | nop + ibne vi00, vi01, L30 | nop + fcor vi01, 0xefbeff | nop + isw.z vi04, 775(vi14) | nop + ibne vi00, vi01, L30 | nop + fcor vi01, 0xf7df7f | nop + nop | nop + ibne vi00, vi01, L30 | nop + fcor vi01, 0xfbefbf | nop + nop | nop + ibne vi00, vi01, L30 | nop + nop | nop + iaddi vi14, vi14, 0x1 | nop +L30: + lq.xyzw vf23, 20(vi04) | maddw.xyzw vf17, vf02, vf00 + div Q, vf03.x, vf30.w | mul.xyzw vf21, vf21, Q + fcand vi01, 0x3ffff | mul.xyzw vf18, vf30, vf01 + waitp | ftoi4.xyzw vf16, vf16 + mfp.w vf27, P | maxy.w vf17, vf17, vf03 + erleng.xyz P, vf26 | clipw.xyz vf18, vf18 + sq.xyzw vf20, 0(vi08) | mulz.xyzw vf24, vf24, vf20 + sq.xyzw vf22, 1(vi08) | mulw.xy vf25, vf27, vf27 + sq.xyzw vf16, 2(vi08) | mulax.xyzw ACC, vf12, vf29 + sq.xyzw vf16, 63(vi08) | madday.xyzw ACC, vf13, vf29 + sq.xyzw vf24, 61(vi08) | maddaz.xyzw ACC, vf14, vf29 + iaddi vi04, vi04, 0x1 | maddw.xyzw vf31, vf15, vf00 + iaddi vi03, vi03, 0x2 | mulax.xyzw ACC, vf08, vf29 + ior vi01, vi01, vi13 | madday.xyzw ACC, vf09, vf29 + nop | maddaz.xyzw ACC, vf10, vf29 + nop | maddw.xyzw vf27, vf11, vf00 + lq.xyzw vf28, 236(vi05) | miniz.w vf17, vf17, vf03 + ibgtz vi06, L27 | mula.xyzw ACC, vf25, vf05 + iaddi vi06, vi06, -0x1 | maddw.xyzw vf25, vf06, vf00 + ibeq vi00, vi01, L31 | nop + nop | nop + ibne vi00, vi13, L31 | addw.w vf17, vf17, vf03 + fcor vi01, 0x7df7ff | nop + isw.x vi12, 775(vi14) | nop + ibne vi00, vi01, L31 | nop + fcor vi01, 0xdf7dff | nop + isw.y vi05, 775(vi14) | nop + ibne vi00, vi01, L31 | nop + fcor vi01, 0xefbeff | nop + isw.z vi04, 775(vi14) | nop + ibne vi00, vi01, L31 | nop + fcor vi01, 0xf7df7f | nop + nop | nop + ibne vi00, vi01, L31 | nop + fcor vi01, 0xfbefbf | nop + nop | nop + ibne vi00, vi01, L31 | nop + nop | nop + iaddi vi14, vi14, 0x1 | nop +L31: + nop | ftoi4.xyzw vf17, vf17 + sq.xyzw vf21, 3(vi08) | mulz.xyzw vf25, vf25, vf21 + sq.xyzw vf23, 4(vi08) | nop + sq.xyzw vf17, 5(vi08) | nop + sq.xyzw vf17, 66(vi08) | nop + sq.xyzw vf25, 64(vi08) | nop + jr vi15 | nop + nop | nop +L32: + lq.xyzw vf31, 734(vi00) | nop + iaddiu vi10, vi00, 0x243 | nop +L33: + iaddi vi14, vi14, -0x1 | nop + iaddi vi08, vi10, 0x7 | nop + ilw.x vi12, 775(vi14) | nop + ilw.y vi05, 775(vi14) | nop + ilw.z vi04, 775(vi14) | nop + ibne vi00, vi12, L34 | nop + nop | nop + lq.xyzw vf28, 233(vi05) | nop + lq.xyzw vf29, 242(vi05) | nop + lq.xyzw vf30, 234(vi05) | nop + lq.xyzw vf22, 7(vi04) | nop + lq.xyzw vf23, 19(vi04) | mulax.xyzw ACC, vf08, vf28 + lq.xyzw vf16, 8(vi04) | madday.xyzw ACC, vf09, vf28 + lq.xyzw vf20, 317(vi00) | maddaz.xyzw ACC, vf10, vf28 + lq.xyzw vf21, 318(vi00) | maddw.xyzw vf24, vf11, vf00 + b L35 | mulax.xyzw ACC, vf12, vf28 + lq.xyzw vf07, 319(vi00) | madday.xyzw ACC, vf13, vf28 +L34: + lq.xyzw vf28, 242(vi05) | nop + lq.xyzw vf29, 234(vi05) | nop + lq.xyzw vf30, 243(vi05) | nop + lq.xyzw vf22, 18(vi04) | nop + lq.xyzw vf23, 7(vi04) | mulax.xyzw ACC, vf08, vf28 + lq.xyzw vf16, 19(vi04) | madday.xyzw ACC, vf09, vf28 + lq.xyzw vf20, 318(vi00) | maddaz.xyzw ACC, vf10, vf28 + lq.xyzw vf21, 319(vi00) | maddw.xyzw vf24, vf11, vf00 + nop | mulax.xyzw ACC, vf12, vf28 + lq.xyzw vf07, 320(vi00) | madday.xyzw ACC, vf13, vf28 +L35: + nop | maddaz.xyzw ACC, vf14, vf28 + erleng.xyz P, vf24 | maddw.xyzw vf28, vf15, vf00 + nop | itof0.xyzw vf22, vf22 + nop | itof0.xyzw vf23, vf23 + nop | itof0.xyzw vf16, vf16 + sq.xyzw vf20, 0(vi08) | mulax.xyzw ACC, vf08, vf29 + sq.xyzw vf22, 1(vi08) | madday.xyzw ACC, vf09, vf29 + sq.xyzw vf21, 3(vi08) | maddaz.xyzw ACC, vf10, vf29 + sq.xyzw vf23, 4(vi08) | maddw.xyzw vf25, vf11, vf00 + sq.xyzw vf07, 6(vi08) | mulax.xyzw ACC, vf12, vf29 + sq.xyzw vf16, 7(vi08) | madday.xyzw ACC, vf13, vf29 + sq.xyzw vf20, 9(vi08) | maddaz.xyzw ACC, vf14, vf29 + sq.xyzw vf22, 10(vi08) | maddw.xyzw vf29, vf15, vf00 + waitp | mul.xyzw vf28, vf28, vf01 + mfp.w vf24, P | nop + erleng.xyz P, vf25 | nop + sq.xyzw vf28, 2(vi08) | mulax.xyzw ACC, vf08, vf30 + sq.xyzw vf28, 11(vi08) | mulw.xy vf24, vf24, vf24 + sq.xyzw vf28, 772(vi00) | madday.xyzw ACC, vf09, vf30 + nop | maddaz.xyzw ACC, vf10, vf30 + nop | maddw.xyzw vf26, vf11, vf00 + nop | mula.xyzw ACC, vf24, vf05 + nop | maddw.xyzw vf24, vf06, vf00 + nop | mulax.xyzw ACC, vf12, vf30 + nop | madday.xyzw ACC, vf13, vf30 + nop | maddaz.xyzw ACC, vf14, vf30 + sq.xyzw vf24, 769(vi00) | maddw.xyzw vf30, vf15, vf00 + waitp | mul.xyzw vf29, vf29, vf01 + mfp.w vf25, P | nop + erleng.xyz P, vf26 | nop + sq.xyzw vf29, 5(vi08) | nop + sq.xyzw vf29, 773(vi00) | mulw.xy vf25, vf25, vf25 + nop | mula.xyzw ACC, vf25, vf05 + nop | maddw.xyzw vf25, vf06, vf00 + waitp | mul.xyzw vf30, vf30, vf01 + mfp.w vf26, P | nop + sq.xyzw vf30, 8(vi08) | nop + sq.xyzw vf30, 774(vi00) | mulw.xy vf26, vf26, vf26 + sq.xyzw vf25, 770(vi00) | mula.xyzw ACC, vf26, vf05 + lq.xyzw vf07, 739(vi00) | maddw.xyzw vf26, vf06, vf00 + ior vi03, vi08, vi00 | nop + iaddi vi05, vi00, 0x3 | nop + bal vi13, L39 | nop + sq.xyzw vf26, 771(vi00) | nop + lq.xyzw vf28, 741(vi00) | nop + ibeq vi00, vi05, L36 | nop + lq.xyzw vf29, 742(vi00) | nop + lq.xyzw vf30, 743(vi00) | nop + lq.xyzw vf24, 744(vi00) | nop + lq.xyzw vf25, 745(vi00) | nop + lq.xyzw vf26, 746(vi00) | nop + sq.xyzw vf28, 0(vi10) | nop + sq.xyzw vf29, 1(vi10) | nop + sq.xyzw vf30, 2(vi10) | nop + sq.xyzw vf24, 3(vi10) | nop + sq.xyzw vf25, 4(vi10) | nop + sq.xyzw vf26, 5(vi10) | nop + iaddiu vi06, vi05, 0x4000 | nop + bal vi13, L37 | nop + iaddiu vi06, vi06, 0x4000 | nop + iaddi vi08, vi10, 0x7 | nop + lq.xyzw vf24, 769(vi00) | nop + lq.xyzw vf25, 770(vi00) | nop + lq.xyzw vf26, 771(vi00) | nop + lq.xyzw vf22, 756(vi00) | nop + lq.xyzw vf28, 772(vi00) | nop + lq.xyzw vf29, 773(vi00) | nop + lq.xyzw vf30, 774(vi00) | nop + sq.xyzw vf24, 0(vi08) | nop + sq.xyzw vf22, 1(vi08) | nop + sq.xyzw vf28, 2(vi08) | nop + sq.xyzw vf25, 3(vi08) | nop + sq.xyzw vf22, 4(vi08) | nop + sq.xyzw vf29, 5(vi08) | nop + sq.xyzw vf26, 6(vi08) | nop + sq.xyzw vf22, 7(vi08) | nop + sq.xyzw vf30, 8(vi08) | nop + sq.xyzw vf24, 9(vi08) | nop + sq.xyzw vf22, 10(vi08) | nop + sq.xyzw vf28, 11(vi08) | nop + ior vi03, vi08, vi00 | nop + iaddi vi05, vi00, 0x3 | nop + bal vi13, L39 | nop + lq.xyzw vf07, 740(vi00) | nop + lq.xyzw vf28, 749(vi00) | nop + lq.xyzw vf29, 750(vi00) | nop + lq.xyzw vf30, 751(vi00) | nop + lq.xyzw vf24, 752(vi00) | nop + lq.xyzw vf25, 753(vi00) | nop + lq.xyzw vf26, 754(vi00) | nop + sq.xyzw vf28, 0(vi10) | nop + sq.xyzw vf29, 1(vi10) | nop + sq.xyzw vf30, 2(vi10) | nop + sq.xyzw vf24, 3(vi10) | nop + sq.xyzw vf25, 4(vi10) | nop + sq.xyzw vf26, 5(vi10) | nop + iaddiu vi06, vi05, 0x4000 | nop + bal vi13, L37 | nop + iaddiu vi06, vi06, 0x4000 | nop +L36: + ibgtz vi14, L33 | nop + nop | nop + jr vi15 | nop + nop | nop +L37: + sq.xyzw vf07, -1(vi08) | nop + isw.x vi06, -1(vi08) | nop +L38: + lqi.xyzw vf24, vi08 | nop + lqi.xyzw vf27, vi08 | nop + lqi.xyzw vf21, vi08 | nop + nop | nop + nop | nop + nop | nop + div Q, vf00.w, vf21.w | mul.xyzw vf21, vf21, vf31 + nop | nop + nop | nop + nop | nop + nop | nop + nop | nop + nop | nop + nop | mul.xyz vf21, vf21, Q + nop | mul.xyzw vf24, vf24, Q + nop | nop + nop | nop + nop | add.xyzw vf21, vf21, vf02 + nop | nop + nop | nop + nop | nop + nop | maxy.w vf21, vf21, vf03 + nop | nop + nop | nop + nop | nop + nop | miniz.w vf21, vf21, vf03 + nop | nop + nop | nop + nop | ftoi0.xyzw vf27, vf27 + nop | ftoi4.xyzw vf21, vf21 + nop | nop + sq.xyzw vf24, -3(vi08) | nop + sq.xyzw vf27, -2(vi08) | nop + sq.xyzw vf21, -1(vi08) | nop + iaddi vi05, vi05, -0x1 | nop + nop | nop + ibne vi00, vi05, L38 | nop + nop | nop + iaddiu vi01, vi00, 0x4d3 | nop + xgkick vi10 | nop + jr vi13 | nop + isub vi10, vi01, vi10 | nop +L39: + ior vi04, vi03, vi00 | nop + lq.xyzw vf21, 2(vi03) | nop + ior vi06, vi05, vi00 | nop + lq.xyzw vf24, 0(vi03) | nop + lq.xyzw vf27, 1(vi03) | nop + iaddi vi03, vi03, 0x3 | clipw.xyz vf21, vf21 +L40: + lq.xyzw vf22, 2(vi03) | nop + lq.xyzw vf25, 0(vi03) | nop + lq.xyzw vf28, 1(vi03) | nop + iaddi vi03, vi03, 0x3 | nop + nop | clipw.xyz vf22, vf22 + nop | nop + nop | nop + nop | nop + fcor vi01, 0xfff7df | nop + ibne vi00, vi01, L51 | nop + fcand vi01, 0x20 | nop + ibne vi00, vi01, L52 | nop + fcand vi01, 0x800 | nop + ibne vi00, vi01, L53 | nop + nop | nop + sqi.xyzw vf24, vi04 | nop + sqi.xyzw vf27, vi04 | nop + sqi.xyzw vf21, vi04 | nop +L41: + move.xyzw vf24, vf25 | nop + iaddi vi05, vi05, -0x1 | nop + move.xyzw vf27, vf28 | nop + ibne vi00, vi05, L40 | nop + move.xyzw vf21, vf22 | nop + lq.xyzw vf24, 0(vi08) | nop + lq.xyzw vf27, 1(vi08) | nop + lq.xyzw vf21, 2(vi08) | nop + ior vi03, vi08, vi00 | nop + sqi.xyzw vf24, vi04 | nop + sqi.xyzw vf27, vi04 | nop + sqi.xyzw vf21, vi04 | nop + ibeq vi00, vi06, L50 | nop + ior vi05, vi06, vi00 | nop + ior vi04, vi03, vi00 | nop + lq.xyzw vf21, 2(vi03) | nop + ior vi06, vi05, vi00 | nop + lq.xyzw vf24, 0(vi03) | nop + lq.xyzw vf27, 1(vi03) | nop + iaddi vi03, vi03, 0x3 | clipw.xyz vf21, vf21 +L42: + lq.xyzw vf22, 2(vi03) | nop + lq.xyzw vf25, 0(vi03) | nop + lq.xyzw vf28, 1(vi03) | nop + iaddi vi03, vi03, 0x3 | nop + nop | clipw.xyz vf22, vf22 + nop | nop + nop | nop + nop | nop + fcor vi01, 0xfffdf7 | nop + ibne vi00, vi01, L54 | nop + fcand vi01, 0x8 | nop + ibne vi00, vi01, L55 | nop + fcand vi01, 0x200 | nop + ibne vi00, vi01, L56 | nop + nop | nop + sqi.xyzw vf24, vi04 | nop + sqi.xyzw vf27, vi04 | nop + sqi.xyzw vf21, vi04 | nop +L43: + move.xyzw vf24, vf25 | nop + iaddi vi05, vi05, -0x1 | nop + move.xyzw vf27, vf28 | nop + ibne vi00, vi05, L42 | nop + move.xyzw vf21, vf22 | nop + lq.xyzw vf24, 0(vi08) | nop + lq.xyzw vf27, 1(vi08) | nop + lq.xyzw vf21, 2(vi08) | nop + ior vi03, vi08, vi00 | nop + sqi.xyzw vf24, vi04 | nop + sqi.xyzw vf27, vi04 | nop + sqi.xyzw vf21, vi04 | nop + ibeq vi00, vi06, L50 | nop + ior vi05, vi06, vi00 | nop + ior vi04, vi03, vi00 | nop + lq.xyzw vf21, 2(vi03) | nop + ior vi06, vi05, vi00 | nop + lq.xyzw vf24, 0(vi03) | nop + lq.xyzw vf27, 1(vi03) | nop + iaddi vi03, vi03, 0x3 | clipw.xyz vf21, vf21 +L44: + lq.xyzw vf22, 2(vi03) | nop + lq.xyzw vf25, 0(vi03) | nop + lq.xyzw vf28, 1(vi03) | nop + iaddi vi03, vi03, 0x3 | nop + nop | clipw.xyz vf22, vf22 + nop | nop + nop | nop + nop | nop + fcor vi01, 0xfffefb | nop + ibne vi00, vi01, L57 | nop + fcand vi01, 0x4 | nop + ibne vi00, vi01, L58 | nop + fcand vi01, 0x100 | nop + ibne vi00, vi01, L59 | nop + nop | nop + sqi.xyzw vf24, vi04 | nop + sqi.xyzw vf27, vi04 | nop + sqi.xyzw vf21, vi04 | nop +L45: + move.xyzw vf24, vf25 | nop + iaddi vi05, vi05, -0x1 | nop + move.xyzw vf27, vf28 | nop + ibne vi00, vi05, L44 | nop + move.xyzw vf21, vf22 | nop + lq.xyzw vf24, 0(vi08) | nop + lq.xyzw vf27, 1(vi08) | nop + lq.xyzw vf21, 2(vi08) | nop + ior vi03, vi08, vi00 | nop + sqi.xyzw vf24, vi04 | nop + sqi.xyzw vf27, vi04 | nop + sqi.xyzw vf21, vi04 | nop + ibeq vi00, vi06, L50 | nop + ior vi05, vi06, vi00 | nop + ior vi04, vi03, vi00 | nop + lq.xyzw vf21, 2(vi03) | nop + ior vi06, vi05, vi00 | nop + lq.xyzw vf24, 0(vi03) | nop + lq.xyzw vf27, 1(vi03) | nop + iaddi vi03, vi03, 0x3 | clipw.xyz vf21, vf21 +L46: + lq.xyzw vf22, 2(vi03) | nop + lq.xyzw vf25, 0(vi03) | nop + lq.xyzw vf28, 1(vi03) | nop + iaddi vi03, vi03, 0x3 | nop + nop | clipw.xyz vf22, vf22 + nop | nop + nop | nop + nop | nop + fcor vi01, 0xffff7d | nop + ibne vi00, vi01, L60 | nop + fcand vi01, 0x2 | nop + ibne vi00, vi01, L61 | nop + fcand vi01, 0x80 | nop + ibne vi00, vi01, L62 | nop + nop | nop + sqi.xyzw vf24, vi04 | nop + sqi.xyzw vf27, vi04 | nop + sqi.xyzw vf21, vi04 | nop +L47: + move.xyzw vf24, vf25 | nop + iaddi vi05, vi05, -0x1 | nop + move.xyzw vf27, vf28 | nop + ibne vi00, vi05, L46 | nop + move.xyzw vf21, vf22 | nop + lq.xyzw vf24, 0(vi08) | nop + lq.xyzw vf27, 1(vi08) | nop + lq.xyzw vf21, 2(vi08) | nop + ior vi03, vi08, vi00 | nop + sqi.xyzw vf24, vi04 | nop + sqi.xyzw vf27, vi04 | nop + sqi.xyzw vf21, vi04 | nop + ibeq vi00, vi06, L50 | nop + ior vi05, vi06, vi00 | nop + ior vi04, vi03, vi00 | nop + lq.xyzw vf21, 2(vi03) | nop + ior vi06, vi05, vi00 | nop + lq.xyzw vf24, 0(vi03) | nop + lq.xyzw vf27, 1(vi03) | nop + iaddi vi03, vi03, 0x3 | clipw.xyz vf21, vf21 +L48: + lq.xyzw vf22, 2(vi03) | nop + lq.xyzw vf25, 0(vi03) | nop + lq.xyzw vf28, 1(vi03) | nop + iaddi vi03, vi03, 0x3 | nop + nop | clipw.xyz vf22, vf22 + nop | nop + nop | nop + nop | nop + fcor vi01, 0xffffbe | nop + ibne vi00, vi01, L63 | nop + fcand vi01, 0x1 | nop + ibne vi00, vi01, L64 | nop + fcand vi01, 0x40 | nop + ibne vi00, vi01, L65 | nop + nop | nop + sqi.xyzw vf24, vi04 | nop + sqi.xyzw vf27, vi04 | nop + sqi.xyzw vf21, vi04 | nop +L49: + move.xyzw vf24, vf25 | nop + iaddi vi05, vi05, -0x1 | nop + move.xyzw vf27, vf28 | nop + ibne vi00, vi05, L48 | nop + move.xyzw vf21, vf22 | nop + lq.xyzw vf24, 0(vi08) | nop + lq.xyzw vf27, 1(vi08) | nop + lq.xyzw vf21, 2(vi08) | nop + ior vi03, vi08, vi00 | nop + sqi.xyzw vf24, vi04 | nop + sqi.xyzw vf27, vi04 | nop + sqi.xyzw vf21, vi04 | nop + ibeq vi00, vi06, L50 | nop + ior vi05, vi06, vi00 | nop +L50: + jr vi13 | nop + nop | nop +L51: + b L41 | nop + iaddi vi06, vi06, -0x1 | nop +L52: + sqi.xyzw vf24, vi04 | sub.xyzw vf23, vf22, vf21 + sqi.xyzw vf27, vi04 | sub.xyzw vf26, vf25, vf24 + sqi.xyzw vf21, vi04 | sub.xyzw vf29, vf28, vf27 + ibeq vi03, vi04, L41 | nop + nop | addz.w vf30, vf23, vf23 + nop | addw.z vf30, vf21, vf21 + div Q, vf30.z, vf30.w | nop + waitq | nop + nop | mul.xyzw vf26, vf26, Q + nop | mul.xyzw vf29, vf29, Q + nop | mul.xyzw vf23, vf23, Q + nop | sub.xyzw vf26, vf24, vf26 + nop | sub.xyzw vf29, vf27, vf29 + nop | sub.xyzw vf23, vf21, vf23 + iaddi vi06, vi06, 0x1 | nop + sqi.xyzw vf26, vi04 | nop + sqi.xyzw vf29, vi04 | nop + b L41 | nop + sqi.xyzw vf23, vi04 | nop +L53: + nop | sub.xyzw vf23, vf21, vf22 + nop | sub.xyzw vf26, vf24, vf25 + nop | sub.xyzw vf29, vf27, vf28 + nop | addz.w vf30, vf23, vf23 + nop | addw.z vf30, vf22, vf22 + div Q, vf30.z, vf30.w | nop + waitq | nop + nop | mul.xyzw vf26, vf26, Q + nop | mul.xyzw vf29, vf29, Q + nop | mul.xyzw vf23, vf23, Q + nop | sub.xyzw vf26, vf25, vf26 + nop | sub.xyzw vf29, vf28, vf29 + nop | sub.xyzw vf23, vf22, vf23 + sqi.xyzw vf26, vi04 | nop + sqi.xyzw vf29, vi04 | nop + b L41 | nop + sqi.xyzw vf23, vi04 | nop +L54: + b L43 | nop + iaddi vi06, vi06, -0x1 | nop +L55: + sqi.xyzw vf24, vi04 | sub.xyzw vf23, vf22, vf21 + sqi.xyzw vf27, vi04 | sub.xyzw vf26, vf25, vf24 + sqi.xyzw vf21, vi04 | sub.xyzw vf29, vf28, vf27 + ibeq vi03, vi04, L43 | nop + nop | addy.w vf30, vf23, vf23 + nop | addw.y vf30, vf21, vf21 + div Q, vf30.y, vf30.w | nop + waitq | nop + nop | mul.xyzw vf26, vf26, Q + nop | mul.xyzw vf29, vf29, Q + nop | mul.xyzw vf23, vf23, Q + nop | sub.xyzw vf26, vf24, vf26 + nop | sub.xyzw vf29, vf27, vf29 + nop | sub.xyzw vf23, vf21, vf23 + iaddi vi06, vi06, 0x1 | nop + sqi.xyzw vf26, vi04 | nop + sqi.xyzw vf29, vi04 | nop + b L43 | nop + sqi.xyzw vf23, vi04 | nop +L56: + nop | sub.xyzw vf23, vf21, vf22 + nop | sub.xyzw vf26, vf24, vf25 + nop | sub.xyzw vf29, vf27, vf28 + nop | addy.w vf30, vf23, vf23 + nop | addw.y vf30, vf22, vf22 + div Q, vf30.y, vf30.w | nop + waitq | nop + nop | mul.xyzw vf26, vf26, Q + nop | mul.xyzw vf29, vf29, Q + nop | mul.xyzw vf23, vf23, Q + nop | sub.xyzw vf26, vf25, vf26 + nop | sub.xyzw vf29, vf28, vf29 + nop | sub.xyzw vf23, vf22, vf23 + sqi.xyzw vf26, vi04 | nop + sqi.xyzw vf29, vi04 | nop + b L43 | nop + sqi.xyzw vf23, vi04 | nop +L57: + b L45 | nop + iaddi vi06, vi06, -0x1 | nop +L58: + sqi.xyzw vf24, vi04 | sub.xyzw vf23, vf22, vf21 + sqi.xyzw vf27, vi04 | sub.xyzw vf26, vf25, vf24 + sqi.xyzw vf21, vi04 | sub.xyzw vf29, vf28, vf27 + ibeq vi03, vi04, L45 | nop + nop | suby.w vf30, vf23, vf23 + nop | subw.y vf30, vf21, vf21 + div Q, vf30.y, vf30.w | nop + waitq | nop + nop | mul.xyzw vf26, vf26, Q + nop | mul.xyzw vf29, vf29, Q + nop | mul.xyzw vf23, vf23, Q + nop | add.xyzw vf26, vf24, vf26 + nop | add.xyzw vf29, vf27, vf29 + nop | add.xyzw vf23, vf21, vf23 + iaddi vi06, vi06, 0x1 | nop + sqi.xyzw vf26, vi04 | nop + sqi.xyzw vf29, vi04 | nop + b L45 | nop + sqi.xyzw vf23, vi04 | nop +L59: + nop | sub.xyzw vf23, vf21, vf22 + nop | sub.xyzw vf26, vf24, vf25 + nop | sub.xyzw vf29, vf27, vf28 + nop | suby.w vf30, vf23, vf23 + nop | subw.y vf30, vf22, vf22 + div Q, vf30.y, vf30.w | nop + waitq | nop + nop | mul.xyzw vf26, vf26, Q + nop | mul.xyzw vf29, vf29, Q + nop | mul.xyzw vf23, vf23, Q + nop | add.xyzw vf26, vf25, vf26 + nop | add.xyzw vf29, vf28, vf29 + nop | add.xyzw vf23, vf22, vf23 + sqi.xyzw vf26, vi04 | nop + sqi.xyzw vf29, vi04 | nop + b L45 | nop + sqi.xyzw vf23, vi04 | nop +L60: + b L47 | nop + iaddi vi06, vi06, -0x1 | nop +L61: + sqi.xyzw vf24, vi04 | sub.xyzw vf23, vf22, vf21 + sqi.xyzw vf27, vi04 | sub.xyzw vf26, vf25, vf24 + sqi.xyzw vf21, vi04 | sub.xyzw vf29, vf28, vf27 + ibeq vi03, vi04, L47 | nop + nop | addx.w vf30, vf23, vf23 + nop | addw.x vf30, vf21, vf21 + div Q, vf30.x, vf30.w | nop + waitq | nop + nop | mul.xyzw vf26, vf26, Q + nop | mul.xyzw vf29, vf29, Q + nop | mul.xyzw vf23, vf23, Q + nop | sub.xyzw vf26, vf24, vf26 + nop | sub.xyzw vf29, vf27, vf29 + nop | sub.xyzw vf23, vf21, vf23 + iaddi vi06, vi06, 0x1 | nop + sqi.xyzw vf26, vi04 | nop + sqi.xyzw vf29, vi04 | nop + b L47 | nop + sqi.xyzw vf23, vi04 | nop +L62: + nop | sub.xyzw vf23, vf21, vf22 + nop | sub.xyzw vf26, vf24, vf25 + nop | sub.xyzw vf29, vf27, vf28 + nop | addx.w vf30, vf23, vf23 + nop | addw.x vf30, vf22, vf22 + div Q, vf30.x, vf30.w | nop + waitq | nop + nop | mul.xyzw vf26, vf26, Q + nop | mul.xyzw vf29, vf29, Q + nop | mul.xyzw vf23, vf23, Q + nop | sub.xyzw vf26, vf25, vf26 + nop | sub.xyzw vf29, vf28, vf29 + nop | sub.xyzw vf23, vf22, vf23 + sqi.xyzw vf26, vi04 | nop + sqi.xyzw vf29, vi04 | nop + b L47 | nop + sqi.xyzw vf23, vi04 | nop +L63: + b L49 | nop + iaddi vi06, vi06, -0x1 | nop +L64: + sqi.xyzw vf24, vi04 | sub.xyzw vf23, vf22, vf21 + sqi.xyzw vf27, vi04 | sub.xyzw vf26, vf25, vf24 + sqi.xyzw vf21, vi04 | sub.xyzw vf29, vf28, vf27 + ibeq vi03, vi04, L49 | nop + nop | subx.w vf30, vf23, vf23 + nop | subw.x vf30, vf21, vf21 + div Q, vf30.x, vf30.w | nop + waitq | nop + nop | mul.xyzw vf26, vf26, Q + nop | mul.xyzw vf29, vf29, Q + nop | mul.xyzw vf23, vf23, Q + nop | add.xyzw vf26, vf24, vf26 + nop | add.xyzw vf29, vf27, vf29 + nop | add.xyzw vf23, vf21, vf23 + iaddi vi06, vi06, 0x1 | nop + sqi.xyzw vf26, vi04 | nop + sqi.xyzw vf29, vi04 | nop + b L49 | nop + sqi.xyzw vf23, vi04 | nop +L65: + nop | sub.xyzw vf23, vf21, vf22 + nop | sub.xyzw vf26, vf24, vf25 + nop | sub.xyzw vf29, vf27, vf28 + nop | subx.w vf30, vf23, vf23 + nop | subw.x vf30, vf22, vf22 + div Q, vf30.x, vf30.w | nop + waitq | nop + nop | mul.xyzw vf26, vf26, Q + nop | mul.xyzw vf29, vf29, Q + nop | mul.xyzw vf23, vf23, Q + nop | add.xyzw vf26, vf25, vf26 + nop | add.xyzw vf29, vf28, vf29 + nop | add.xyzw vf23, vf22, vf23 + sqi.xyzw vf26, vi04 | nop + sqi.xyzw vf29, vi04 | nop + b L49 | nop + sqi.xyzw vf23, vi04 | nop diff --git a/test/decompiler/vu_reference/jak2/ocean-mid.txt b/test/decompiler/vu_reference/jak2/ocean-mid.txt new file mode 100644 index 0000000000..371271a95e --- /dev/null +++ b/test/decompiler/vu_reference/jak2/ocean-mid.txt @@ -0,0 +1,2340 @@ + .word 0x490 + .word 0x0 + .word 0x248 + .word 0x0 + .word 0x1e102dd + .word 0x2ff + .word 0x1e202df + .word 0x2ff + .word 0x1e302e0 + .word 0x2ff + .word 0x1e502e1 + .word 0x2ff + .word 0x1e602e2 + .word 0x2ff + .word 0x1009014f + .word 0x2ff + .word 0x800101b2 + .word 0x2ff + .word 0x1f40ae5 + .word 0x2ff + .word 0x1f50aed + .word 0x2ff + .word 0x3e1a14f + .word 0x2ff + .word 0x3e1a1c9 + .word 0x2ff + .word 0x3e1a98c + .word 0x2ff + .word 0x3e1aa06 + .word 0x2ff + .word 0x5a000ff9 + .word 0x2ff + .word 0x80010ff2 + .word 0x2ff + .word 0x80050032 + .word 0x1e0042a + .word 0x80070232 + .word 0x2ff + .word 0x80060232 + .word 0x100042a + .word 0x3e580ec + .word 0x2ff + .word 0x80052872 + .word 0x1058403 + .word 0x5a0037fd + .word 0x2ff + .word 0x800637f2 + .word 0x2ff + .word 0x5a003ffa + .word 0x458403 + .word 0x80073ff2 + .word 0x2ff + .word 0x80000030 + .word 0x1f4a52c + .word 0x80000030 + .word 0x1f5ad6c + .word 0x80030032 + .word 0x40a503 + .word 0x80060232 + .word 0xc0ad43 + .word 0x3e3a13d + .word 0x2ff + .word 0x3e3a93e + .word 0x100a503 + .word 0x800318b2 + .word 0x100ad43 + .word 0x5a0037fc + .word 0x2ff + .word 0x800637f2 + .word 0x2ff + .word 0x1e802f4 + .word 0x2ff + .word 0x80040232 + .word 0x2ff + .word 0x10060011 + .word 0x1e8417c + .word 0x3e4418c + .word 0x2ff + .word 0x3e44206 + .word 0x2ff + .word 0x800420f2 + .word 0x2ff + .word 0x5a0037fc + .word 0x2ff + .word 0x800637f2 + .word 0x2ff + .word 0x80000030 + .word 0x400002ff + .word 0x80000030 + .word 0x2ff + .word 0x100a0243 + .word 0x2ff + .word 0x80000030 + .word 0x400002ff + .word 0x80000030 + .word 0x2ff + .word 0x800206bc + .word 0x2ff + .word 0x1e702ec + .word 0x2ff + .word 0x1ec1004 + .word 0x2ff + .word 0x1ed1005 + .word 0x2ff + .word 0x1ee1006 + .word 0x2ff + .word 0x1ef1007 + .word 0x2ff + .word 0x3e03955 + .word 0x2ff + .word 0x3e039cf + .word 0x2ff + .word 0x800701f2 + .word 0x2ff + .word 0x1e41074 + .word 0x2ff + .word 0x80013f32 + .word 0x2ff + .word 0x800a23fc + .word 0x2ff + .word 0x100b00ff + .word 0x2ff + .word 0x52000802 + .word 0x2ff + .word 0x81e4233d + .word 0x2ff + .word 0x1e41075 + .word 0x2ff + .word 0x500b5006 + .word 0x2ff + .word 0x800849f2 + .word 0x2ff + .word 0x420f0146 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x10010318 + .word 0x2ff + .word 0x80004efc + .word 0x2ff + .word 0x80090a71 + .word 0x2ff + .word 0x5a003ff2 + .word 0x2ff + .word 0x80073ff2 + .word 0x2ff + .word 0x80000030 + .word 0x400002ff + .word 0x80000030 + .word 0x2ff + .word 0x800206bc + .word 0x2ff + .word 0x1e702eb + .word 0x2ff + .word 0x1e81000 + .word 0x2ff + .word 0x1e91001 + .word 0x2ff + .word 0x1ea1002 + .word 0x2ff + .word 0x1eb1003 + .word 0x2ff + .word 0x1ec1004 + .word 0x2ff + .word 0x1ed1005 + .word 0x2ff + .word 0x1ee1006 + .word 0x2ff + .word 0x1ef1007 + .word 0x2ff + .word 0x3e03955 + .word 0x2ff + .word 0x3e039cf + .word 0x2ff + .word 0x800701f2 + .word 0x2ff + .word 0x1e41074 + .word 0x2ff + .word 0x80013f32 + .word 0x2ff + .word 0x800a23fc + .word 0x2ff + .word 0x100b00ff + .word 0x2ff + .word 0x52000802 + .word 0x2ff + .word 0x81e4233d + .word 0x2ff + .word 0x1e41075 + .word 0x2ff + .word 0x500b5009 + .word 0x2ff + .word 0x800849f2 + .word 0x2ff + .word 0x420f016b + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x10010318 + .word 0x2ff + .word 0x80004efc + .word 0x2ff + .word 0x50007003 + .word 0x2ff + .word 0x80090a71 + .word 0x2ff + .word 0x420f01fc + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x5a003fef + .word 0x2ff + .word 0x80073ff2 + .word 0x2ff + .word 0x80000030 + .word 0x400002ff + .word 0x80000030 + .word 0x2ff + .word 0x800206bc + .word 0x2ff + .word 0x800306bc + .word 0x2ff + .word 0x80000135 + .word 0x2ff + .word 0x9051008 + .word 0x2ff + .word 0x1e81000 + .word 0x2ff + .word 0x1e91001 + .word 0x2ff + .word 0x1ea1002 + .word 0x2ff + .word 0x1eb1003 + .word 0x2ff + .word 0x1ec1004 + .word 0x2ff + .word 0x1ed1005 + .word 0x2ff + .word 0x1ee1006 + .word 0x2ff + .word 0x1ef1007 + .word 0x2ff + .word 0x1f01811 + .word 0x2ff + .word 0x1fc02fd + .word 0x2ff + .word 0x1fd02fe + .word 0x2ff + .word 0x1fe02ff + .word 0x2ff + .word 0x1ff0300 + .word 0x2ff + .word 0x1f81009 + .word 0x1f0e1bc + .word 0x1f9100a + .word 0x1f0e8bd + .word 0x1fa100b + .word 0x1f0f0be + .word 0x1fb100c + .word 0x1f0ff0b + .word 0x1f6100d + .word 0x1f0c1bc + .word 0x1f7100e + .word 0x1f0c8bd + .word 0x1f2100f + .word 0x1f0d0be + .word 0x1f31010 + .word 0x1f0dd0b + .word 0x80052ff2 + .word 0x1fc41bc + .word 0x80000030 + .word 0x1fc48bd + .word 0x80000030 + .word 0x1fc50be + .word 0x80000030 + .word 0x1e05e0b + .word 0x80000030 + .word 0x1fc61bc + .word 0x80000030 + .word 0x1fc68bd + .word 0x80000030 + .word 0x1fc70be + .word 0x81c0c73f + .word 0x1e07f0b + .word 0x800007bf + .word 0x2ff + .word 0x80000030 + .word 0x1e1e72a + .word 0x8038067c + .word 0x1f0b1bc + .word 0x80031872 + .word 0x1f0b8bd + .word 0x80000030 + .word 0x1f090be + .word 0x3e4a317 + .word 0x1f09d8b + .word 0x3e4e319 + .word 0x198c61b + .word 0x3e4b318 + .word 0x1e5c2be + .word 0x80042132 + .word 0x1e0360b + .word 0x5a002fe1 + .word 0x2ff + .word 0x3e4c316 + .word 0x2ff + .word 0x800003b5 + .word 0x2ff + .word 0x1ff02de + .word 0x2ff + .word 0x90b1008 + .word 0x2ff + .word 0x8871008 + .word 0x2ff + .word 0x800f0072 + .word 0x2ff + .word 0x1fc02e5 + .word 0x2ff + .word 0x1fd02e6 + .word 0x2ff + .word 0x1fe02e7 + .word 0x2ff + .word 0x1f802e8 + .word 0x2ff + .word 0x1f902e9 + .word 0x2ff + .word 0x1fa02ea + .word 0x2ff + .word 0x1e702e3 + .word 0x2ff + .word 0x3e0e243 + .word 0x2ff + .word 0x3e0ea44 + .word 0x2ff + .word 0x3e0f245 + .word 0x2ff + .word 0x3e0c246 + .word 0x2ff + .word 0x3e0ca47 + .word 0x2ff + .word 0x3e0d248 + .word 0x2ff + .word 0x3e0e290 + .word 0x2ff + .word 0x3e0ea91 + .word 0x2ff + .word 0x3e0f292 + .word 0x2ff + .word 0x3e0c293 + .word 0x2ff + .word 0x3e0ca94 + .word 0x2ff + .word 0x3e0d295 + .word 0x2ff + .word 0x800b5fb2 + .word 0x2ff + .word 0x800f3874 + .word 0x2ff + .word 0x800b5fb2 + .word 0x2ff + .word 0x52000824 + .word 0x2ff + .word 0x800f7bf0 + .word 0x2ff + .word 0x800851f2 + .word 0x2ff + .word 0x800351f2 + .word 0x2ff + .word 0x80050132 + .word 0x2ff + .word 0x1f47317 + .word 0x2ff + .word 0x1f67318 + .word 0x2ff + .word 0x1fc7319 + .word 0x2ff + .word 0x1f5731b + .word 0x2ff + .word 0x1f7731c + .word 0x2ff + .word 0x1fd731d + .word 0x2ff + .word 0x3e8a000 + .word 0x2ff + .word 0x3e8b001 + .word 0x2ff + .word 0x3e8e002 + .word 0x2ff + .word 0x3e8a803 + .word 0x2ff + .word 0x3e8b804 + .word 0x2ff + .word 0x3e8e805 + .word 0x2ff + .word 0x3e8a00c + .word 0x2ff + .word 0x3e8b00d + .word 0x2ff + .word 0x3e8e00e + .word 0x2ff + .word 0x1f47323 + .word 0x2ff + .word 0x1f67324 + .word 0x2ff + .word 0x1fc7325 + .word 0x2ff + .word 0x1f5731f + .word 0x2ff + .word 0x1f77320 + .word 0x2ff + .word 0x1fd7321 + .word 0x2ff + .word 0x3e8a006 + .word 0x2ff + .word 0x3e8b007 + .word 0x2ff + .word 0x3e8e008 + .word 0x2ff + .word 0x3e8a809 + .word 0x2ff + .word 0x3e8b80a + .word 0x2ff + .word 0x420d0240 + .word 0x2ff + .word 0x3e8e80b + .word 0x2ff + .word 0x50002803 + .word 0x2ff + .word 0x11062800 + .word 0x2ff + .word 0x420d0210 + .word 0x2ff + .word 0x11063000 + .word 0x2ff + .word 0x5a005fd8 + .word 0x2ff + .word 0x800e7232 + .word 0x2ff + .word 0x800003b5 + .word 0x2ff + .word 0x90b1008 + .word 0x2ff + .word 0x8871008 + .word 0x2ff + .word 0x800f0072 + .word 0x2ff + .word 0x1e702e4 + .word 0x2ff + .word 0x800b5fb2 + .word 0x2ff + .word 0x800f3874 + .word 0x2ff + .word 0x800b5fb2 + .word 0x2ff + .word 0x5200082d + .word 0x2ff + .word 0x800f7bf0 + .word 0x2ff + .word 0x800851f2 + .word 0x2ff + .word 0x800351f2 + .word 0x2ff + .word 0x80050132 + .word 0x2ff + .word 0x1f8731a + .word 0x2ff + .word 0x1f602f4 + .word 0x2ff + .word 0x1fc7319 + .word 0x2ff + .word 0x1f9731e + .word 0x2ff + .word 0x1fd731d + .word 0x2ff + .word 0x3e8c000 + .word 0x2ff + .word 0x3e8b001 + .word 0x2ff + .word 0x3e8e002 + .word 0x2ff + .word 0x3e8c803 + .word 0x2ff + .word 0x3e8b004 + .word 0x2ff + .word 0x3e8e805 + .word 0x2ff + .word 0x3e8c00c + .word 0x2ff + .word 0x3e8b00d + .word 0x2ff + .word 0x3e8e00e + .word 0x2ff + .word 0x1f87326 + .word 0x2ff + .word 0x1fc7325 + .word 0x2ff + .word 0x1f97322 + .word 0x2ff + .word 0x1fd7321 + .word 0x2ff + .word 0x3e8c006 + .word 0x2ff + .word 0x3e8b007 + .word 0x2ff + .word 0x3e8e008 + .word 0x2ff + .word 0x3e8c809 + .word 0x2ff + .word 0x3e8b00a + .word 0x2ff + .word 0x420d0214 + .word 0x2ff + .word 0x3e8e80b + .word 0x2ff + .word 0x1fc02ed + .word 0x2ff + .word 0x5000280e + .word 0x2ff + .word 0x1fd02ee + .word 0x2ff + .word 0x1fe02ef + .word 0x2ff + .word 0x1f802f0 + .word 0x2ff + .word 0x1f902f1 + .word 0x2ff + .word 0x1fa02f2 + .word 0x2ff + .word 0x3eae000 + .word 0x2ff + .word 0x3eae801 + .word 0x2ff + .word 0x3eaf002 + .word 0x2ff + .word 0x3eac003 + .word 0x2ff + .word 0x3eac804 + .word 0x2ff + .word 0x3ead005 + .word 0x2ff + .word 0x11062800 + .word 0x2ff + .word 0x420d01d8 + .word 0x2ff + .word 0x11063000 + .word 0x2ff + .word 0x5a005fcf + .word 0x2ff + .word 0x800e7232 + .word 0x2ff + .word 0x80000030 + .word 0x400002ff + .word 0x80000030 + .word 0x2ff + .word 0x800206bc + .word 0x2ff + .word 0x800306bc + .word 0x2ff + .word 0x80000135 + .word 0x2ff + .word 0x800851f2 + .word 0x2ff + .word 0x9051008 + .word 0x2ff + .word 0x1e81000 + .word 0x2ff + .word 0x1e91001 + .word 0x2ff + .word 0x1ea1002 + .word 0x2ff + .word 0x1eb1003 + .word 0x2ff + .word 0x1ec1004 + .word 0x2ff + .word 0x1ed1005 + .word 0x2ff + .word 0x1ee1006 + .word 0x2ff + .word 0x1ef1007 + .word 0x2ff + .word 0x1f01811 + .word 0x2ff + .word 0x1fc02fd + .word 0x2ff + .word 0x1fd02fe + .word 0x2ff + .word 0x1fe02ff + .word 0x2ff + .word 0x1ff0300 + .word 0x2ff + .word 0x1f81009 + .word 0x1f0e1bc + .word 0x1f9100a + .word 0x1f0e8bd + .word 0x1fa100b + .word 0x1f0f0be + .word 0x1fb100c + .word 0x1f0ff0b + .word 0x1f6100d + .word 0x1f0c1bc + .word 0x1f7100e + .word 0x1f0c8bd + .word 0x1f2100f + .word 0x1f0d0be + .word 0x1f31010 + .word 0x1f0dd0b + .word 0x80052ff2 + .word 0x1fc41bc + .word 0x80000030 + .word 0x1fc48bd + .word 0x80000030 + .word 0x1fc50be + .word 0x80000030 + .word 0x1e05e0b + .word 0x80000030 + .word 0x1fc61bc + .word 0x80000030 + .word 0x1fc68bd + .word 0x80000030 + .word 0x1fc70be + .word 0x81c0c73f + .word 0x1e07f0b + .word 0x800007bf + .word 0x2ff + .word 0x80000030 + .word 0x1e1e72a + .word 0x8038067c + .word 0x1f0b1bc + .word 0x80031872 + .word 0x1f0b8bd + .word 0x80000030 + .word 0x1f090be + .word 0x3e8a000 + .word 0x1f09d8b + .word 0x3e8e002 + .word 0x198c61b + .word 0x3e4e318 + .word 0x2ff + .word 0x3e8b001 + .word 0x1e5c2be + .word 0x800420b2 + .word 0x1e0360b + .word 0x800840f2 + .word 0x2ff + .word 0x5a002fdf + .word 0x2ff + .word 0x3e4c315 + .word 0x2ff + .word 0x1ff02de + .word 0x2ff + .word 0x9051008 + .word 0x2ff + .word 0x1f45007 + .word 0x2ff + .word 0x1f65008 + .word 0x2ff + .word 0x1fc5009 + .word 0x2ff + .word 0x3e8a000 + .word 0x2ff + .word 0x3e8b001 + .word 0x2ff + .word 0x3e8e002 + .word 0x2ff + .word 0x800851f2 + .word 0x2ff + .word 0x420d01c6 + .word 0x2ff + .word 0x800351f2 + .word 0x2ff + .word 0x1fc02e5 + .word 0x2ff + .word 0x50002836 + .word 0x2ff + .word 0x1fd02e6 + .word 0x2ff + .word 0x1fe02e7 + .word 0x2ff + .word 0x1f802e8 + .word 0x2ff + .word 0x1f902e9 + .word 0x2ff + .word 0x1fa02ea + .word 0x2ff + .word 0x1e702e3 + .word 0x2ff + .word 0x3eae000 + .word 0x2ff + .word 0x3eae801 + .word 0x2ff + .word 0x3eaf002 + .word 0x2ff + .word 0x3eac003 + .word 0x2ff + .word 0x3eac804 + .word 0x2ff + .word 0x3ead005 + .word 0x2ff + .word 0x11062800 + .word 0x2ff + .word 0x420d0189 + .word 0x2ff + .word 0x11063000 + .word 0x2ff + .word 0x800000f5 + .word 0x2ff + .word 0x1f602f4 + .word 0x2ff + .word 0x9051008 + .word 0x2ff + .word 0x800851f2 + .word 0x2ff + .word 0x1fc1b18 + .word 0x2ff + .word 0x1f81b17 + .word 0x2ff + .word 0x800318b2 + .word 0x2ff + .word 0x80052ff2 + .word 0x2ff + .word 0x3e8b001 + .word 0x2ff + .word 0x3e8e002 + .word 0x2ff + .word 0x3e8c000 + .word 0x2ff + .word 0x5a002ff8 + .word 0x2ff + .word 0x800840f2 + .word 0x2ff + .word 0x9051008 + .word 0x2ff + .word 0x1f45007 + .word 0x2ff + .word 0x1f65008 + .word 0x2ff + .word 0x1f85009 + .word 0x2ff + .word 0x3e8c000 + .word 0x2ff + .word 0x3e8b001 + .word 0x2ff + .word 0x3e8e002 + .word 0x2ff + .word 0x800851f2 + .word 0x2ff + .word 0x420d019e + .word 0x2ff + .word 0x800351f2 + .word 0x2ff + .word 0x1fc02ed + .word 0x2ff + .word 0x1fd02ee + .word 0x2ff + .word 0x1fe02ef + .word 0x2ff + .word 0x1f802f0 + .word 0x2ff + .word 0x1f902f1 + .word 0x2ff + .word 0x1fa02f2 + .word 0x2ff + .word 0x1e702e4 + .word 0x2ff + .word 0x3eae000 + .word 0x2ff + .word 0x3eae801 + .word 0x2ff + .word 0x3eaf002 + .word 0x2ff + .word 0x3eac003 + .word 0x2ff + .word 0x3eac804 + .word 0x2ff + .word 0x3ead005 + .word 0x2ff + .word 0x11062800 + .word 0x2ff + .word 0x420d0162 + .word 0x2ff + .word 0x11063000 + .word 0x2ff + .word 0x80000030 + .word 0x400002ff + .word 0x80000030 + .word 0x2ff + .word 0x9053af5 + .word 0x2ff + .word 0x8843af5 + .word 0x2ff + .word 0x80030032 + .word 0x2ff + .word 0x80022130 + .word 0x2ff + .word 0x80060232 + .word 0x2ff + .word 0x1fc28ec + .word 0x2ff + .word 0x1fd28f5 + .word 0x1fc61bc + .word 0x80052872 + .word 0x1fc68bd + .word 0x22000000 + .word 0x1fc70be + .word 0x80000030 + .word 0x1e07f8b + .word 0x819e1bbc + .word 0x1fd61bc + .word 0x1fc28ec + .word 0x1fd68bd + .word 0x1f4193d + .word 0x1fd70be + .word 0x1f62008 + .word 0x1e07fcb + .word 0x80000030 + .word 0x1e1f4aa + .word 0x800003bf + .word 0x20f1bf + .word 0x80000030 + .word 0x1c0f1fc + .word 0x80000030 + .word 0x1e0140b + .word 0x80000030 + .word 0x1d291ff + .word 0x80000030 + .word 0x1e1fcea + .word 0x819f1bbc + .word 0x1e0a51c + .word 0x80000030 + .word 0x1fc61bc + .word 0x80000030 + .word 0x1fc68bd + .word 0x800d0032 + .word 0x1d399ff + .word 0x800c0072 + .word 0x238411 + .word 0x1fd28f5 + .word 0x1fc70be + .word 0x80010032 + .word 0x2ff + .word 0x40000010 + .word 0x1e07f8b + .word 0x80052872 + .word 0x238416 + .word 0x800c5374 + .word 0x2ff + .word 0x50000802 + .word 0x20f1bf + .word 0x1f4193d + .word 0x1c0f1fc + .word 0x80000030 + .word 0x238c43 + .word 0x1f62008 + .word 0x1e0140b + .word 0x2403ffff + .word 0x1e1fcea + .word 0x819f1bbc + .word 0x1e0a51c + .word 0x800d0875 + .word 0x1f1897d + .word 0x800c6330 + .word 0x238411 + .word 0x3e8a803 + .word 0x1fc61bc + .word 0x3e8b804 + .word 0x1fc68bd + .word 0x3e88805 + .word 0x1d399ff + .word 0x1fd28f5 + .word 0x238416 + .word 0x800841b2 + .word 0x1fc70be + .word 0x80052872 + .word 0x1e07f8b + .word 0x50000802 + .word 0x20f9bf + .word 0x1f5193e + .word 0x1c0f9fc + .word 0x80000030 + .word 0x238403 + .word 0x1f72014 + .word 0x1e0144b + .word 0x2403ffff + .word 0x1e1f4aa + .word 0x819e1bbc + .word 0x1e0ad5c + .word 0x800318b2 + .word 0x1f0817d + .word 0x800d0875 + .word 0x2ff + .word 0x80042072 + .word 0x238c51 + .word 0x3e8a000 + .word 0x1fd61bc + .word 0x3e8b001 + .word 0x1fd68bd + .word 0x3e88002 + .word 0x1d291ff + .word 0x1fc28ec + .word 0x238c56 + .word 0x5a0037e3 + .word 0x1fd70be + .word 0x800637f2 + .word 0x1e07fcb + .word 0x50000802 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x238c43 + .word 0x80000030 + .word 0x1f1897d + .word 0x3e8a803 + .word 0x2ff + .word 0x3e8b804 + .word 0x2ff + .word 0x3e88805 + .word 0x2ff + .word 0x48007800 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x9053af5 + .word 0x2ff + .word 0x8843af5 + .word 0x2ff + .word 0x80030032 + .word 0x2ff + .word 0x80022130 + .word 0x2ff + .word 0x80060232 + .word 0x2ff + .word 0x1fc28ec + .word 0x2ff + .word 0x1fd28f5 + .word 0x1fc61bc + .word 0x80052872 + .word 0x1fc68bd + .word 0x22000000 + .word 0x1fc70be + .word 0x80000030 + .word 0x1e07f8b + .word 0x80000030 + .word 0x1fc41bc + .word 0x80000030 + .word 0x1fc48bd + .word 0x80000030 + .word 0x1fc50be + .word 0x80000030 + .word 0x1e05e8b + .word 0x1f4193d + .word 0x1fd61bc + .word 0x1f62008 + .word 0x1fd68bd + .word 0x819e1bbc + .word 0x1fd70be + .word 0x81c0d73f + .word 0x1e07fcb + .word 0x80000030 + .word 0x1fd41bc + .word 0x80000030 + .word 0x1fd48bd + .word 0x1fc28ec + .word 0x1fd50be + .word 0x1fd28f5 + .word 0x1e05ecb + .word 0x80000030 + .word 0x1e1f4aa + .word 0x80000030 + .word 0x1e1fcea + .word 0x80000030 + .word 0x20f1bf + .word 0x80000030 + .word 0x1c0f1fc + .word 0x80000030 + .word 0x1e0140b + .word 0x819f1bbc + .word 0x1e0a51c + .word 0x800007bf + .word 0x238411 + .word 0x803a067c + .word 0x1fc61bc + .word 0x81c0df3f + .word 0x1fc68bd + .word 0x800c0072 + .word 0x1fc70be + .word 0x80010032 + .word 0x1e07f8b + .word 0x800d0032 + .word 0x19ad61b + .word 0x800b0032 + .word 0x238416 + .word 0x800e0032 + .word 0x1fc41bc + .word 0x80000030 + .word 0x1fc48bd + .word 0x80000030 + .word 0x1fc50be + .word 0x80000030 + .word 0x1e05e8b + .word 0x80000030 + .word 0x1d291ff + .word 0x800007bf + .word 0x1d399ff + .word 0x4000002a + .word 0x1e5c2be + .word 0x80052872 + .word 0x1e0360b + .word 0x50000815 + .word 0x20f1bf + .word 0x1f4193d + .word 0x1c0f1fc + .word 0x52006813 + .word 0x238c43 + .word 0x267df7ff + .word 0x2ff + .word 0xb0c7307 + .word 0x2ff + .word 0x52000810 + .word 0x2ff + .word 0x26df7dff + .word 0x2ff + .word 0xa857307 + .word 0x2ff + .word 0x5200080d + .word 0x2ff + .word 0x26efbeff + .word 0x2ff + .word 0x84b3af5 + .word 0x2ff + .word 0x5200080a + .word 0x2ff + .word 0x26f7df7f + .word 0x2ff + .word 0xa447307 + .word 0x2ff + .word 0x52000807 + .word 0x2ff + .word 0x26fbefbf + .word 0x2ff + .word 0x800b2af1 + .word 0x2ff + .word 0x52000804 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x58005802 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x800e7072 + .word 0x2ff + .word 0x1f62008 + .word 0x1e0140b + .word 0x819f1bbc + .word 0x1e0a51c + .word 0x2403ffff + .word 0x1e1fcea + .word 0x800007bf + .word 0x1f1897d + .word 0x803a067c + .word 0x238411 + .word 0x81c0df3f + .word 0x1d399ff + .word 0x3e8a803 + .word 0x1f5ce5a + .word 0x3e8b804 + .word 0x19ad61b + .word 0x3e88805 + .word 0x1fc61bc + .word 0x3e88842 + .word 0x1fc68bd + .word 0x3e8c840 + .word 0x1fc70be + .word 0x800841b2 + .word 0x1e07f8b + .word 0x800c5374 + .word 0x1fc41bc + .word 0x800c6330 + .word 0x1fc48bd + .word 0x800d0875 + .word 0x1fc50be + .word 0x80000030 + .word 0x1e05e8b + .word 0x1fd28f5 + .word 0x238416 + .word 0x80052872 + .word 0x1e5c2be + .word 0x80000030 + .word 0x1e0360b + .word 0x50000813 + .word 0x20f9bf + .word 0x1f5193e + .word 0x1c0f9fc + .word 0x52006811 + .word 0x238403 + .word 0x267df7ff + .word 0x2ff + .word 0xb007307 + .word 0x2ff + .word 0x5200080e + .word 0x2ff + .word 0x26df7dff + .word 0x2ff + .word 0xa857307 + .word 0x2ff + .word 0x5200080b + .word 0x2ff + .word 0x26efbeff + .word 0x2ff + .word 0xa447307 + .word 0x2ff + .word 0x52000808 + .word 0x2ff + .word 0x26f7df7f + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x52000805 + .word 0x2ff + .word 0x26fbefbf + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x52000802 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x800e7072 + .word 0x2ff + .word 0x1f72014 + .word 0x1e0144b + .word 0x819e1bbc + .word 0x1e0ad5c + .word 0x2403ffff + .word 0x1e1f4aa + .word 0x800007bf + .word 0x1f0817d + .word 0x803b067c + .word 0x238c51 + .word 0x81c0d73f + .word 0x1d291ff + .word 0x3e8a000 + .word 0x1f4c61a + .word 0x3e8b001 + .word 0x19bde5b + .word 0x3e88002 + .word 0x1fd61bc + .word 0x3e8803f + .word 0x1fd68bd + .word 0x3e8c03d + .word 0x1fd70be + .word 0x80042072 + .word 0x1e07fcb + .word 0x800318b2 + .word 0x1fd41bc + .word 0x800d0875 + .word 0x1fd48bd + .word 0x80000030 + .word 0x1fd50be + .word 0x80000030 + .word 0x1e05ecb + .word 0x1fc28ec + .word 0x238c56 + .word 0x5a0037b1 + .word 0x1e5cabe + .word 0x800637f2 + .word 0x1e0364b + .word 0x50000813 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x52006811 + .word 0x238c43 + .word 0x267df7ff + .word 0x2ff + .word 0xb0c7307 + .word 0x2ff + .word 0x5200080e + .word 0x2ff + .word 0x26df7dff + .word 0x2ff + .word 0xa857307 + .word 0x2ff + .word 0x5200080b + .word 0x2ff + .word 0x26efbeff + .word 0x2ff + .word 0xa447307 + .word 0x2ff + .word 0x52000808 + .word 0x2ff + .word 0x26f7df7f + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x52000805 + .word 0x2ff + .word 0x26fbefbf + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x52000802 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x800e7072 + .word 0x2ff + .word 0x80000030 + .word 0x1f1897d + .word 0x3e8a803 + .word 0x1f5ce5a + .word 0x3e8b804 + .word 0x2ff + .word 0x3e88805 + .word 0x2ff + .word 0x3e88842 + .word 0x2ff + .word 0x3e8c840 + .word 0x2ff + .word 0x48007800 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x1ff02de + .word 0x2ff + .word 0x100a0243 + .word 0x2ff + .word 0x800e77f2 + .word 0x2ff + .word 0x800851f2 + .word 0x2ff + .word 0x90c7307 + .word 0x2ff + .word 0x8857307 + .word 0x2ff + .word 0x8447307 + .word 0x2ff + .word 0x5200600b + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x1fc28e9 + .word 0x2ff + .word 0x1fd28f2 + .word 0x2ff + .word 0x1fe28ea + .word 0x2ff + .word 0x1f62007 + .word 0x2ff + .word 0x1f72013 + .word 0x1fc41bc + .word 0x1f02008 + .word 0x1fc48bd + .word 0x1f4013d + .word 0x1fc50be + .word 0x1f5013e + .word 0x1e05e0b + .word 0x4000000b + .word 0x1fc61bc + .word 0x1e7013f + .word 0x1fc68bd + .word 0x1fc28f2 + .word 0x2ff + .word 0x1fd28ea + .word 0x2ff + .word 0x1fe28f3 + .word 0x2ff + .word 0x1f62012 + .word 0x2ff + .word 0x1f72007 + .word 0x1fc41bc + .word 0x1f02013 + .word 0x1fc48bd + .word 0x1f4013e + .word 0x1fc50be + .word 0x1f5013f + .word 0x1e05e0b + .word 0x80000030 + .word 0x1fc61bc + .word 0x1e70140 + .word 0x1fc68bd + .word 0x80000030 + .word 0x1fc70be + .word 0x81c0c73f + .word 0x1e07f0b + .word 0x80000030 + .word 0x1f6b13c + .word 0x80000030 + .word 0x1f7b93c + .word 0x80000030 + .word 0x1f0813c + .word 0x3e8a000 + .word 0x1fd41bc + .word 0x3e8b001 + .word 0x1fd48bd + .word 0x3e8a803 + .word 0x1fd50be + .word 0x3e8b804 + .word 0x1e05e4b + .word 0x3e83806 + .word 0x1fd61bc + .word 0x3e88007 + .word 0x1fd68bd + .word 0x3e8a009 + .word 0x1fd70be + .word 0x3e8b00a + .word 0x1e07f4b + .word 0x800007bf + .word 0x1e1e72a + .word 0x8038067c + .word 0x2ff + .word 0x81c0cf3f + .word 0x2ff + .word 0x3e8e002 + .word 0x1fe41bc + .word 0x3e8e00b + .word 0x198c61b + .word 0x3e0e304 + .word 0x1fe48bd + .word 0x80000030 + .word 0x1fe50be + .word 0x80000030 + .word 0x1e05e8b + .word 0x80000030 + .word 0x1e5c2be + .word 0x80000030 + .word 0x1e0360b + .word 0x80000030 + .word 0x1fe61bc + .word 0x80000030 + .word 0x1fe68bd + .word 0x80000030 + .word 0x1fe70be + .word 0x3e0c301 + .word 0x1e07f8b + .word 0x800007bf + .word 0x1e1ef6a + .word 0x8039067c + .word 0x2ff + .word 0x81c0d73f + .word 0x2ff + .word 0x3e8e805 + .word 0x2ff + .word 0x3e0eb05 + .word 0x199ce5b + .word 0x80000030 + .word 0x1e5cabe + .word 0x80000030 + .word 0x1e0364b + .word 0x800007bf + .word 0x1e1f7aa + .word 0x803a067c + .word 0x2ff + .word 0x3e8f008 + .word 0x2ff + .word 0x3e0f306 + .word 0x19ad69b + .word 0x3e0cb02 + .word 0x1e5d2be + .word 0x1e702e3 + .word 0x1e0368b + .word 0x800040f5 + .word 0x2ff + .word 0x800500f2 + .word 0x2ff + .word 0x420d0068 + .word 0x2ff + .word 0x3e0d303 + .word 0x2ff + .word 0x1fc02e5 + .word 0x2ff + .word 0x50002835 + .word 0x2ff + .word 0x1fd02e6 + .word 0x2ff + .word 0x1fe02e7 + .word 0x2ff + .word 0x1f802e8 + .word 0x2ff + .word 0x1f902e9 + .word 0x2ff + .word 0x1fa02ea + .word 0x2ff + .word 0x3eae000 + .word 0x2ff + .word 0x3eae801 + .word 0x2ff + .word 0x3eaf002 + .word 0x2ff + .word 0x3eac003 + .word 0x2ff + .word 0x3eac804 + .word 0x2ff + .word 0x3ead005 + .word 0x2ff + .word 0x11062800 + .word 0x2ff + .word 0x420d002c + .word 0x2ff + .word 0x11063000 + .word 0x2ff + .word 0x800851f2 + .word 0x2ff + .word 0x1f80301 + .word 0x2ff + .word 0x1f90302 + .word 0x2ff + .word 0x1fa0303 + .word 0x2ff + .word 0x1f602f4 + .word 0x2ff + .word 0x1fc0304 + .word 0x2ff + .word 0x1fd0305 + .word 0x2ff + .word 0x1fe0306 + .word 0x2ff + .word 0x3e8c000 + .word 0x2ff + .word 0x3e8b001 + .word 0x2ff + .word 0x3e8e002 + .word 0x2ff + .word 0x3e8c803 + .word 0x2ff + .word 0x3e8b004 + .word 0x2ff + .word 0x3e8e805 + .word 0x2ff + .word 0x3e8d006 + .word 0x2ff + .word 0x3e8b007 + .word 0x2ff + .word 0x3e8f008 + .word 0x2ff + .word 0x3e8c009 + .word 0x2ff + .word 0x3e8b00a + .word 0x2ff + .word 0x3e8e00b + .word 0x2ff + .word 0x800040f5 + .word 0x2ff + .word 0x800500f2 + .word 0x2ff + .word 0x420d0040 + .word 0x2ff + .word 0x1e702e4 + .word 0x2ff + .word 0x1fc02ed + .word 0x2ff + .word 0x1fd02ee + .word 0x2ff + .word 0x1fe02ef + .word 0x2ff + .word 0x1f802f0 + .word 0x2ff + .word 0x1f902f1 + .word 0x2ff + .word 0x1fa02f2 + .word 0x2ff + .word 0x3eae000 + .word 0x2ff + .word 0x3eae801 + .word 0x2ff + .word 0x3eaf002 + .word 0x2ff + .word 0x3eac003 + .word 0x2ff + .word 0x3eac804 + .word 0x2ff + .word 0x3ead005 + .word 0x2ff + .word 0x11062800 + .word 0x2ff + .word 0x420d0005 + .word 0x2ff + .word 0x11063000 + .word 0x2ff + .word 0x5a007781 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x48007800 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x3e83fff + .word 0x2ff + .word 0xb0647ff + .word 0x2ff + .word 0x81f8437c + .word 0x2ff + .word 0x81fb437c + .word 0x2ff + .word 0x81f5437c + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x81f503bc + .word 0x1ffad6a + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x1c0ad5c + .word 0x80000030 + .word 0x1e0c61c + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x1e2ad68 + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x23ad51 + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x23ad56 + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x1fbd97c + .word 0x80000030 + .word 0x1f5a97d + .word 0x80000030 + .word 0x2ff + .word 0x3e8c7fd + .word 0x2ff + .word 0x3e8dffe + .word 0x2ff + .word 0x3e8afff + .word 0x2ff + .word 0x80052ff2 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x52002fdb + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x100104d3 + .word 0x2ff + .word 0x800056fc + .word 0x2ff + .word 0x48006800 + .word 0x2ff + .word 0x800a0ab1 + .word 0x2ff + .word 0x80001935 + .word 0x2ff + .word 0x1f51802 + .word 0x2ff + .word 0x800029b5 + .word 0x2ff + .word 0x1f81800 + .word 0x2ff + .word 0x1fb1801 + .word 0x2ff + .word 0x800318f2 + .word 0x1d5a9ff + .word 0x1f61802 + .word 0x2ff + .word 0x1f91800 + .word 0x2ff + .word 0x1fc1801 + .word 0x2ff + .word 0x800318f2 + .word 0x2ff + .word 0x80000030 + .word 0x1d6b1ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x26fff7df + .word 0x2ff + .word 0x520008b0 + .word 0x2ff + .word 0x24000020 + .word 0x2ff + .word 0x520008b0 + .word 0x2ff + .word 0x24000800 + .word 0x2ff + .word 0x520008c1 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x81e4c37d + .word 0x2ff + .word 0x81e4db7d + .word 0x2ff + .word 0x81e4ab7d + .word 0x2ff + .word 0x81f8cb3c + .word 0x2ff + .word 0x80052ff2 + .word 0x2ff + .word 0x81fbe33c + .word 0x2ff + .word 0x52002fea + .word 0x2ff + .word 0x81f5b33c + .word 0x2ff + .word 0x1f84000 + .word 0x2ff + .word 0x1fb4001 + .word 0x2ff + .word 0x1f54002 + .word 0x2ff + .word 0x800040f5 + .word 0x2ff + .word 0x81e4c37d + .word 0x2ff + .word 0x81e4db7d + .word 0x2ff + .word 0x81e4ab7d + .word 0x2ff + .word 0x50003099 + .word 0x2ff + .word 0x80003175 + .word 0x2ff + .word 0x80001935 + .word 0x2ff + .word 0x1f51802 + .word 0x2ff + .word 0x800029b5 + .word 0x2ff + .word 0x1f81800 + .word 0x2ff + .word 0x1fb1801 + .word 0x2ff + .word 0x800318f2 + .word 0x1d5a9ff + .word 0x1f61802 + .word 0x2ff + .word 0x1f91800 + .word 0x2ff + .word 0x1fc1801 + .word 0x2ff + .word 0x800318f2 + .word 0x2ff + .word 0x80000030 + .word 0x1d6b1ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x26fffdf7 + .word 0x2ff + .word 0x520008b0 + .word 0x2ff + .word 0x24000008 + .word 0x2ff + .word 0x520008b0 + .word 0x2ff + .word 0x24000200 + .word 0x2ff + .word 0x520008c1 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x81e4c37d + .word 0x2ff + .word 0x81e4db7d + .word 0x2ff + .word 0x81e4ab7d + .word 0x2ff + .word 0x81f8cb3c + .word 0x2ff + .word 0x80052ff2 + .word 0x2ff + .word 0x81fbe33c + .word 0x2ff + .word 0x52002fea + .word 0x2ff + .word 0x81f5b33c + .word 0x2ff + .word 0x1f84000 + .word 0x2ff + .word 0x1fb4001 + .word 0x2ff + .word 0x1f54002 + .word 0x2ff + .word 0x800040f5 + .word 0x2ff + .word 0x81e4c37d + .word 0x2ff + .word 0x81e4db7d + .word 0x2ff + .word 0x81e4ab7d + .word 0x2ff + .word 0x50003073 + .word 0x2ff + .word 0x80003175 + .word 0x2ff + .word 0x80001935 + .word 0x2ff + .word 0x1f51802 + .word 0x2ff + .word 0x800029b5 + .word 0x2ff + .word 0x1f81800 + .word 0x2ff + .word 0x1fb1801 + .word 0x2ff + .word 0x800318f2 + .word 0x1d5a9ff + .word 0x1f61802 + .word 0x2ff + .word 0x1f91800 + .word 0x2ff + .word 0x1fc1801 + .word 0x2ff + .word 0x800318f2 + .word 0x2ff + .word 0x80000030 + .word 0x1d6b1ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x26fffefb + .word 0x2ff + .word 0x520008b0 + .word 0x2ff + .word 0x24000004 + .word 0x2ff + .word 0x520008b0 + .word 0x2ff + .word 0x24000100 + .word 0x2ff + .word 0x520008c1 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x81e4c37d + .word 0x2ff + .word 0x81e4db7d + .word 0x2ff + .word 0x81e4ab7d + .word 0x2ff + .word 0x81f8cb3c + .word 0x2ff + .word 0x80052ff2 + .word 0x2ff + .word 0x81fbe33c + .word 0x2ff + .word 0x52002fea + .word 0x2ff + .word 0x81f5b33c + .word 0x2ff + .word 0x1f84000 + .word 0x2ff + .word 0x1fb4001 + .word 0x2ff + .word 0x1f54002 + .word 0x2ff + .word 0x800040f5 + .word 0x2ff + .word 0x81e4c37d + .word 0x2ff + .word 0x81e4db7d + .word 0x2ff + .word 0x81e4ab7d + .word 0x2ff + .word 0x5000304d + .word 0x2ff + .word 0x80003175 + .word 0x2ff + .word 0x80001935 + .word 0x2ff + .word 0x1f51802 + .word 0x2ff + .word 0x800029b5 + .word 0x2ff + .word 0x1f81800 + .word 0x2ff + .word 0x1fb1801 + .word 0x2ff + .word 0x800318f2 + .word 0x1d5a9ff + .word 0x1f61802 + .word 0x2ff + .word 0x1f91800 + .word 0x2ff + .word 0x1fc1801 + .word 0x2ff + .word 0x800318f2 + .word 0x2ff + .word 0x80000030 + .word 0x1d6b1ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x26ffff7d + .word 0x2ff + .word 0x520008b0 + .word 0x2ff + .word 0x24000002 + .word 0x2ff + .word 0x520008b0 + .word 0x2ff + .word 0x24000080 + .word 0x2ff + .word 0x520008c1 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x81e4c37d + .word 0x2ff + .word 0x81e4db7d + .word 0x2ff + .word 0x81e4ab7d + .word 0x2ff + .word 0x81f8cb3c + .word 0x2ff + .word 0x80052ff2 + .word 0x2ff + .word 0x81fbe33c + .word 0x2ff + .word 0x52002fea + .word 0x2ff + .word 0x81f5b33c + .word 0x2ff + .word 0x1f84000 + .word 0x2ff + .word 0x1fb4001 + .word 0x2ff + .word 0x1f54002 + .word 0x2ff + .word 0x800040f5 + .word 0x2ff + .word 0x81e4c37d + .word 0x2ff + .word 0x81e4db7d + .word 0x2ff + .word 0x81e4ab7d + .word 0x2ff + .word 0x50003027 + .word 0x2ff + .word 0x80003175 + .word 0x2ff + .word 0x80001935 + .word 0x2ff + .word 0x1f51802 + .word 0x2ff + .word 0x800029b5 + .word 0x2ff + .word 0x1f81800 + .word 0x2ff + .word 0x1fb1801 + .word 0x2ff + .word 0x800318f2 + .word 0x1d5a9ff + .word 0x1f61802 + .word 0x2ff + .word 0x1f91800 + .word 0x2ff + .word 0x1fc1801 + .word 0x2ff + .word 0x800318f2 + .word 0x2ff + .word 0x80000030 + .word 0x1d6b1ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x26ffffbe + .word 0x2ff + .word 0x520008b0 + .word 0x2ff + .word 0x24000001 + .word 0x2ff + .word 0x520008b0 + .word 0x2ff + .word 0x24000040 + .word 0x2ff + .word 0x520008c1 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x81e4c37d + .word 0x2ff + .word 0x81e4db7d + .word 0x2ff + .word 0x81e4ab7d + .word 0x2ff + .word 0x81f8cb3c + .word 0x2ff + .word 0x80052ff2 + .word 0x2ff + .word 0x81fbe33c + .word 0x2ff + .word 0x52002fea + .word 0x2ff + .word 0x81f5b33c + .word 0x2ff + .word 0x1f84000 + .word 0x2ff + .word 0x1fb4001 + .word 0x2ff + .word 0x1f54002 + .word 0x2ff + .word 0x800040f5 + .word 0x2ff + .word 0x81e4c37d + .word 0x2ff + .word 0x81e4db7d + .word 0x2ff + .word 0x81e4ab7d + .word 0x2ff + .word 0x50003001 + .word 0x2ff + .word 0x80003175 + .word 0x2ff + .word 0x48006800 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x40000757 + .word 0x2ff + .word 0x800637f2 + .word 0x2ff + .word 0x81e4c37d + .word 0x1f5b5ec + .word 0x81e4db7d + .word 0x1f8ceac + .word 0x81e4ab7d + .word 0x1fbe76c + .word 0x50032752 + .word 0x2ff + .word 0x80000030 + .word 0x37bf82 + .word 0x80000030 + .word 0x55af83 + .word 0x81def3bc + .word 0x2ff + .word 0x800003bf + .word 0x2ff + .word 0x80000030 + .word 0x1e0d69c + .word 0x80000030 + .word 0x1e0ef5c + .word 0x80000030 + .word 0x1e0bddc + .word 0x80000030 + .word 0x1fac6ac + .word 0x80000030 + .word 0x1fddf6c + .word 0x80000030 + .word 0x1f7adec + .word 0x80063072 + .word 0x2ff + .word 0x81e4d37d + .word 0x2ff + .word 0x81e4eb7d + .word 0x2ff + .word 0x40000744 + .word 0x2ff + .word 0x81e4bb7d + .word 0x2ff + .word 0x80000030 + .word 0x1f6adec + .word 0x80000030 + .word 0x1f9c6ac + .word 0x80000030 + .word 0x1fcdf6c + .word 0x80000030 + .word 0x37bf82 + .word 0x80000030 + .word 0x56b783 + .word 0x81def3bc + .word 0x2ff + .word 0x800003bf + .word 0x2ff + .word 0x80000030 + .word 0x1e0d69c + .word 0x80000030 + .word 0x1e0ef5c + .word 0x80000030 + .word 0x1e0bddc + .word 0x80000030 + .word 0x1faceac + .word 0x80000030 + .word 0x1fde76c + .word 0x80000030 + .word 0x1f7b5ec + .word 0x81e4d37d + .word 0x2ff + .word 0x81e4eb7d + .word 0x2ff + .word 0x40000733 + .word 0x2ff + .word 0x81e4bb7d + .word 0x2ff + .word 0x40000757 + .word 0x2ff + .word 0x800637f2 + .word 0x2ff + .word 0x81e4c37d + .word 0x1f5b5ec + .word 0x81e4db7d + .word 0x1f8ceac + .word 0x81e4ab7d + .word 0x1fbe76c + .word 0x50032752 + .word 0x2ff + .word 0x80000030 + .word 0x37bf81 + .word 0x80000030 + .word 0x95af83 + .word 0x81bef3bc + .word 0x2ff + .word 0x800003bf + .word 0x2ff + .word 0x80000030 + .word 0x1e0d69c + .word 0x80000030 + .word 0x1e0ef5c + .word 0x80000030 + .word 0x1e0bddc + .word 0x80000030 + .word 0x1fac6ac + .word 0x80000030 + .word 0x1fddf6c + .word 0x80000030 + .word 0x1f7adec + .word 0x80063072 + .word 0x2ff + .word 0x81e4d37d + .word 0x2ff + .word 0x81e4eb7d + .word 0x2ff + .word 0x40000744 + .word 0x2ff + .word 0x81e4bb7d + .word 0x2ff + .word 0x80000030 + .word 0x1f6adec + .word 0x80000030 + .word 0x1f9c6ac + .word 0x80000030 + .word 0x1fcdf6c + .word 0x80000030 + .word 0x37bf81 + .word 0x80000030 + .word 0x96b783 + .word 0x81bef3bc + .word 0x2ff + .word 0x800003bf + .word 0x2ff + .word 0x80000030 + .word 0x1e0d69c + .word 0x80000030 + .word 0x1e0ef5c + .word 0x80000030 + .word 0x1e0bddc + .word 0x80000030 + .word 0x1faceac + .word 0x80000030 + .word 0x1fde76c + .word 0x80000030 + .word 0x1f7b5ec + .word 0x81e4d37d + .word 0x2ff + .word 0x81e4eb7d + .word 0x2ff + .word 0x40000733 + .word 0x2ff + .word 0x81e4bb7d + .word 0x2ff + .word 0x40000757 + .word 0x2ff + .word 0x800637f2 + .word 0x2ff + .word 0x81e4c37d + .word 0x1f5b5ec + .word 0x81e4db7d + .word 0x1f8ceac + .word 0x81e4ab7d + .word 0x1fbe76c + .word 0x50032752 + .word 0x2ff + .word 0x80000030 + .word 0x37bf85 + .word 0x80000030 + .word 0x95af87 + .word 0x81bef3bc + .word 0x2ff + .word 0x800003bf + .word 0x2ff + .word 0x80000030 + .word 0x1e0d69c + .word 0x80000030 + .word 0x1e0ef5c + .word 0x80000030 + .word 0x1e0bddc + .word 0x80000030 + .word 0x1fac6a8 + .word 0x80000030 + .word 0x1fddf68 + .word 0x80000030 + .word 0x1f7ade8 + .word 0x80063072 + .word 0x2ff + .word 0x81e4d37d + .word 0x2ff + .word 0x81e4eb7d + .word 0x2ff + .word 0x40000744 + .word 0x2ff + .word 0x81e4bb7d + .word 0x2ff + .word 0x80000030 + .word 0x1f6adec + .word 0x80000030 + .word 0x1f9c6ac + .word 0x80000030 + .word 0x1fcdf6c + .word 0x80000030 + .word 0x37bf85 + .word 0x80000030 + .word 0x96b787 + .word 0x81bef3bc + .word 0x2ff + .word 0x800003bf + .word 0x2ff + .word 0x80000030 + .word 0x1e0d69c + .word 0x80000030 + .word 0x1e0ef5c + .word 0x80000030 + .word 0x1e0bddc + .word 0x80000030 + .word 0x1facea8 + .word 0x80000030 + .word 0x1fde768 + .word 0x80000030 + .word 0x1f7b5e8 + .word 0x81e4d37d + .word 0x2ff + .word 0x81e4eb7d + .word 0x2ff + .word 0x40000733 + .word 0x2ff + .word 0x81e4bb7d + .word 0x2ff + .word 0x40000757 + .word 0x2ff + .word 0x800637f2 + .word 0x2ff + .word 0x81e4c37d + .word 0x1f5b5ec + .word 0x81e4db7d + .word 0x1f8ceac + .word 0x81e4ab7d + .word 0x1fbe76c + .word 0x50032752 + .word 0x2ff + .word 0x80000030 + .word 0x37bf80 + .word 0x80000030 + .word 0x115af83 + .word 0x819ef3bc + .word 0x2ff + .word 0x800003bf + .word 0x2ff + .word 0x80000030 + .word 0x1e0d69c + .word 0x80000030 + .word 0x1e0ef5c + .word 0x80000030 + .word 0x1e0bddc + .word 0x80000030 + .word 0x1fac6ac + .word 0x80000030 + .word 0x1fddf6c + .word 0x80000030 + .word 0x1f7adec + .word 0x80063072 + .word 0x2ff + .word 0x81e4d37d + .word 0x2ff + .word 0x81e4eb7d + .word 0x2ff + .word 0x40000744 + .word 0x2ff + .word 0x81e4bb7d + .word 0x2ff + .word 0x80000030 + .word 0x1f6adec + .word 0x80000030 + .word 0x1f9c6ac + .word 0x80000030 + .word 0x1fcdf6c + .word 0x80000030 + .word 0x37bf80 + .word 0x80000030 + .word 0x116b783 + .word 0x819ef3bc + .word 0x2ff + .word 0x800003bf + .word 0x2ff + .word 0x80000030 + .word 0x1e0d69c + .word 0x80000030 + .word 0x1e0ef5c + .word 0x80000030 + .word 0x1e0bddc + .word 0x80000030 + .word 0x1faceac + .word 0x80000030 + .word 0x1fde76c + .word 0x80000030 + .word 0x1f7b5ec + .word 0x81e4d37d + .word 0x2ff + .word 0x81e4eb7d + .word 0x2ff + .word 0x40000733 + .word 0x2ff + .word 0x81e4bb7d + .word 0x2ff + .word 0x40000757 + .word 0x2ff + .word 0x800637f2 + .word 0x2ff + .word 0x81e4c37d + .word 0x1f5b5ec + .word 0x81e4db7d + .word 0x1f8ceac + .word 0x81e4ab7d + .word 0x1fbe76c + .word 0x50032752 + .word 0x2ff + .word 0x80000030 + .word 0x37bf84 + .word 0x80000030 + .word 0x115af87 + .word 0x819ef3bc + .word 0x2ff + .word 0x800003bf + .word 0x2ff + .word 0x80000030 + .word 0x1e0d69c + .word 0x80000030 + .word 0x1e0ef5c + .word 0x80000030 + .word 0x1e0bddc + .word 0x80000030 + .word 0x1fac6a8 + .word 0x80000030 + .word 0x1fddf68 + .word 0x80000030 + .word 0x1f7ade8 + .word 0x80063072 + .word 0x2ff + .word 0x81e4d37d + .word 0x2ff + .word 0x81e4eb7d + .word 0x2ff + .word 0x40000744 + .word 0x2ff + .word 0x81e4bb7d + .word 0x2ff + .word 0x80000030 + .word 0x1f6adec + .word 0x80000030 + .word 0x1f9c6ac + .word 0x80000030 + .word 0x1fcdf6c + .word 0x80000030 + .word 0x37bf84 + .word 0x80000030 + .word 0x116b787 + .word 0x819ef3bc + .word 0x2ff + .word 0x800003bf + .word 0x2ff + .word 0x80000030 + .word 0x1e0d69c + .word 0x80000030 + .word 0x1e0ef5c + .word 0x80000030 + .word 0x1e0bddc + .word 0x80000030 + .word 0x1facea8 + .word 0x80000030 + .word 0x1fde768 + .word 0x80000030 + .word 0x1f7b5e8 + .word 0x81e4d37d + .word 0x2ff + .word 0x81e4eb7d + .word 0x2ff + .word 0x40000733 + .word 0x2ff + .word 0x81e4bb7d + .word 0x2ff \ No newline at end of file diff --git a/test/decompiler/vu_reference/jak2/ocean-near-result.txt b/test/decompiler/vu_reference/jak2/ocean-near-result.txt new file mode 100644 index 0000000000..c362f2463c --- /dev/null +++ b/test/decompiler/vu_reference/jak2/ocean-near-result.txt @@ -0,0 +1,1048 @@ + lq. vf00, 989(vi00) | addx. vf00, vf00, vf00 + lq. vf00, 495(vi00) | addx. vf00, vf00, vf00 + lq.xyzw vf01, 951(vi00) | nop + lq.xyzw vf02, 953(vi00) | nop + lq.xyzw vf03, 954(vi00) | nop + lq.xyzw vf05, 955(vi00) | nop + lq.xyzw vf06, 956(vi00) | nop + iaddiu vi09, vi00, 0x213 | nop + iaddi vi01, vi00, 0x6 | nop +L1: + lq.xyzw vf12, 963(vi01) | nop + lq.xyzw vf13, 970(vi01) | nop + sq.xyzw vf12, 531(vi01) | nop + sq.xyzw vf12, 671(vi01) | nop + sq.xyzw vf13, 592(vi01) | nop + sq.xyzw vf13, 732(vi01) | nop + sq.xyzw vf12, 811(vi01) | nop + sq.xyzw vf12, 881(vi01) | nop + sq.xyzw vf13, 846(vi01) | nop + sq.xyzw vf13, 916(vi01) | nop + ibgtz vi01, L1 | nop + iaddi vi01, vi01, -0x1 | nop + lq.xyzw vf08, 977(vi00) | nop + iaddi vi04, vi00, 0x8 | nop + iaddiu vi06, vi00, 0x11 | ftoi0.xyzw vf08, vf08 +L2: + sq.xyzw vf08, 592(vi04) | nop + sq.xyzw vf08, 732(vi04) | nop + iaddi vi04, vi04, 0x3 | nop + ibgtz vi06, L2 | nop + iaddi vi06, vi06, -0x1 | nop + lq.xyzw vf07, 957(vi00) | nop + iaddi vi05, vi00, 0x0 | mul.xyzw vf16, vf00, vf00 + iaddi vi07, vi00, 0x8 | nop +L3: + iaddi vi06, vi00, 0x8 | mul.x vf16, vf00, vf00 +L4: + sq.xyzw vf16, 290(vi05) | nop + iaddi vi05, vi05, 0x3 | addx.x vf16, vf16, vf07 + ibgtz vi06, L4 | nop + iaddi vi06, vi06, -0x1 | nop + ibgtz vi07, L3 | addx.z vf16, vf16, vf07 + iaddi vi07, vi07, -0x1 | nop + nop | nop :e + nop | nop + xtop vi02 | nop + ilw.x vi03, 10(vi02) | nop + ilw.y vi04, 10(vi02) | nop + iaddi vi05, vi00, 0x0 | nop + iaddi vi07, vi00, 0x7 | nop +L5: + lq.xyzw vf28, 32(vi03) | nop + lq.xyzw vf29, 33(vi03) | nop + lq.xyzw vf30, 32(vi04) | nop + lq.xyzw vf24, 290(vi05) | nop + lq.xyzw vf25, 293(vi05) | nop + lq.xyzw vf26, 296(vi05) | nop + lq.xyzw vf27, 299(vi05) | nop + lq.xyzw vf12, 302(vi05) | addx.y vf24, vf00, vf28 + lq.xyzw vf13, 305(vi05) | addy.y vf25, vf00, vf28 + lq.xyzw vf14, 308(vi05) | addz.y vf26, vf00, vf28 + lq.xyzw vf15, 311(vi05) | addw.y vf27, vf00, vf28 + lq.xyzw vf08, 314(vi05) | addx.y vf12, vf00, vf29 + sq.xyzw vf24, 290(vi05) | addy.y vf13, vf00, vf29 + sq.xyzw vf25, 293(vi05) | addz.y vf14, vf00, vf29 + sq.xyzw vf26, 296(vi05) | addw.y vf15, vf00, vf29 + sq.xyzw vf27, 299(vi05) | addx.y vf08, vf00, vf30 + sq.xyzw vf12, 302(vi05) | nop + sq.xyzw vf13, 305(vi05) | nop + sq.xyzw vf14, 308(vi05) | nop + sq.xyzw vf15, 311(vi05) | nop + sq.xyzw vf08, 314(vi05) | nop + iaddi vi03, vi03, 0x8 | nop + iaddi vi04, vi04, 0x8 | nop + iaddiu vi05, vi05, 0x1b | nop + ibgtz vi07, L5 | nop + iaddi vi07, vi07, -0x1 | nop + ilw.z vi03, 10(vi02) | nop + ilw.w vi04, 10(vi02) | nop + lq.xyzw vf28, 32(vi03) | nop + lq.xyzw vf29, 33(vi03) | nop + lq.xyzw vf30, 32(vi04) | nop + lq.xyzw vf24, 290(vi05) | nop + lq.xyzw vf25, 293(vi05) | nop + lq.xyzw vf26, 296(vi05) | nop + lq.xyzw vf27, 299(vi05) | nop + lq.xyzw vf12, 302(vi05) | addx.y vf24, vf00, vf28 + lq.xyzw vf13, 305(vi05) | addy.y vf25, vf00, vf28 + lq.xyzw vf14, 308(vi05) | addz.y vf26, vf00, vf28 + lq.xyzw vf15, 311(vi05) | addw.y vf27, vf00, vf28 + lq.xyzw vf08, 314(vi05) | addx.y vf12, vf00, vf29 + sq.xyzw vf24, 290(vi05) | addy.y vf13, vf00, vf29 + sq.xyzw vf25, 293(vi05) | addz.y vf14, vf00, vf29 + sq.xyzw vf26, 296(vi05) | addw.y vf15, vf00, vf29 + sq.xyzw vf27, 299(vi05) | addx.y vf08, vf00, vf30 + sq.xyzw vf12, 302(vi05) | nop + sq.xyzw vf13, 305(vi05) | nop + sq.xyzw vf14, 308(vi05) | nop + sq.xyzw vf15, 311(vi05) | nop + sq.xyzw vf08, 314(vi05) | nop + lq.xyzw vf07, 957(vi00) | nop + lq.xyzw vf12, 11(vi02) | nop + lq.xyzw vf13, 11(vi02) | nop + lq.xyzw vf22, 12(vi02) | nop + lq.xyzw vf23, 13(vi02) | nop + lq.xyzw vf16, 14(vi02) | nop + lq.xyzw vf17, 15(vi02) | nop + nop | sub.xyzw vf09, vf16, vf22 + nop | sub.xyzw vf11, vf17, vf23 + nop | muly.xyzw vf09, vf09, vf07 + nop | muly.xyzw vf11, vf11, vf07 + iaddi vi05, vi00, 0x0 | nop + iaddi vi07, vi00, 0x8 | nop +L6: + nop | sub.xyzw vf08, vf23, vf22 + nop | mulw.xyzw vf16, vf22, vf00 + iaddi vi06, vi00, 0x8 | mulw.x vf12, vf13, vf00 + nop | muly.xyzw vf08, vf08, vf07 +L7: + sq.xyzw vf12, 288(vi05) | nop + sq.xyzw vf16, 289(vi05) | nop + iaddi vi05, vi05, 0x3 | addw.x vf12, vf12, vf07 + ibgtz vi06, L7 | add.xyzw vf16, vf16, vf08 + iaddi vi06, vi06, -0x1 | nop + nop | add.xyzw vf22, vf22, vf09 + nop | add.xyzw vf23, vf23, vf11 + ibgtz vi07, L6 | addw.y vf12, vf12, vf07 + iaddi vi07, vi07, -0x1 | nop + lq.xyzw vf08, 0(vi02) | nop + lq.xyzw vf09, 1(vi02) | nop + lq.xyzw vf10, 2(vi02) | nop + lq.xyzw vf04, 8(vi02) | nop + iaddi vi07, vi00, 0x3 | nop +L8: + mtir vi10, vf04.x | nop + iaddiu vi11, vi00, 0xff | nop + mr32.xyzw vf04, vf04 | nop + ibeq vi11, vi10, L10 | nop + lq.xyzw vf11, 3(vi02) | nop + lq.xyzw vf12, 4(vi02) | nop + lq.xyzw vf13, 5(vi02) | nop + lq.xyzw vf14, 6(vi02) | nop + lq.xyzw vf15, 7(vi02) | nop + ilw.x vi05, 984(vi07) | nop + bal vi15, L14 | nop + iaddi vi08, vi09, 0x7 | nop + lq.xyzw vf07, 969(vi00) | nop + iaddiu vi08, vi00, 0x3d2 | nop + sq.xyzw vf07, 6(vi09) | nop + xgkick vi09 | nop + lq.xyzw vf07, 981(vi00) | nop + xgkick vi08 | nop + sq.xyzw vf07, 6(vi09) | nop + iaddi vi08, vi09, 0x6 | nop + nop | nop + xgkick vi08 | nop + iaddiu vi08, vi00, 0x3d6 | nop + nop | nop + xgkick vi08 | nop + bal vi15, L20 | nop + iaddiu vi08, vi09, 0x44 | nop + ibeq vi00, vi14, L9 | nop + nop | nop + bal vi15, L24 | nop + nop | nop +L9: + bal vi15, L22 | nop + iaddiu vi08, vi09, 0x44 | nop + iaddiu vi08, vi09, 0x3d | nop + iaddiu vi01, vi00, 0x4b2 | nop + xgkick vi08 | nop + isub vi09, vi01, vi09 | nop +L10: + ibgtz vi07, L8 | nop + iaddi vi07, vi07, -0x1 | nop + lq.xyzw vf04, 9(vi02) | nop + iaddi vi07, vi00, 0x3 | nop +L11: + mtir vi10, vf04.x | nop + iaddiu vi11, vi00, 0xff | nop + mr32.xyzw vf04, vf04 | nop + ibeq vi11, vi10, L13 | nop + lq.xyzw vf11, 3(vi02) | nop + lq.xyzw vf12, 4(vi02) | nop + lq.xyzw vf13, 5(vi02) | nop + lq.xyzw vf14, 6(vi02) | nop + lq.xyzw vf15, 7(vi02) | nop + ilw.y vi05, 984(vi07) | nop + bal vi15, L14 | nop + iaddi vi08, vi09, 0x7 | nop + lq.xyzw vf07, 969(vi00) | nop + iaddiu vi08, vi00, 0x3d2 | nop + sq.xyzw vf07, 6(vi09) | nop + xgkick vi09 | nop + lq.xyzw vf07, 981(vi00) | nop + xgkick vi08 | nop + sq.xyzw vf07, 6(vi09) | nop + iaddi vi08, vi09, 0x6 | nop + nop | nop + xgkick vi08 | nop + iaddiu vi08, vi00, 0x3d6 | nop + nop | nop + xgkick vi08 | nop + bal vi15, L20 | nop + iaddiu vi08, vi09, 0x44 | nop + ibeq vi00, vi14, L12 | nop + nop | nop + bal vi15, L24 | nop + nop | nop +L12: + bal vi15, L22 | nop + iaddiu vi08, vi09, 0x44 | nop + iaddiu vi08, vi09, 0x3d | nop + iaddiu vi01, vi00, 0x4b2 | nop + nop | nop + xgkick vi08 | nop + isub vi09, vi01, vi09 | nop +L13: + ibgtz vi07, L11 | nop + iaddi vi07, vi07, -0x1 | nop + nop | nop :e + nop | nop +L14: + iaddi vi01, vi05, 0x9 | nop + lq.xyzw vf24, 290(vi05) | nop + lq.xyzw vf25, 317(vi05) | nop + lq.xyzw vf05, 959(vi00) | mulax.xyzw ACC, vf08, vf24 + iaddi vi05, vi05, 0x3 | madday.xyzw ACC, vf09, vf24 + isw.x vi01, 988(vi00) | nop + iaddi vi01, vi00, 0x0 | maddaz.xyzw ACC, vf10, vf24 + iaddi vi13, vi00, 0x0 | maddw.xyzw vf26, vf11, vf00 + iaddi vi11, vi00, 0x0 | mulax.xyzw ACC, vf08, vf25 + fcset 0x0 | madday.xyzw ACC, vf09, vf25 + lq.xyzw vf28, 287(vi05) | maddaz.xyzw ACC, vf10, vf25 + eleng.xyz P, vf26 | maddw.xyzw vf27, vf11, vf00 + iaddi vi14, vi00, 0x0 | mulw.xyzw vf20, vf26, vf00 + lq.xyzw vf22, 286(vi05) | nop + waitp | nop + mfp.w vf20, P | nop + eleng.xyz P, vf27 | mulw.xyzw vf21, vf27, vf00 + lq.xyzw vf07, 958(vi00) | nop + nop | nop + iaddi vi12, vi00, 0x1 | mulw.w vf22, vf20, vf05 + nop | nop + nop | nop + nop | nop + nop | miniw.w vf22, vf22, vf00 + nop | nop + nop | nop + nop | nop + nop | subw.w vf28, vf00, vf22 + nop | maxx.w vf22, vf22, vf05 + nop | nop + nop | mulaz.w ACC, vf00, vf07 + nop | mulw.y vf28, vf28, vf28 + lq.xyzw vf24, 290(vi05) | msubx.w vf07, vf22, vf07 + nop | mulax.xyzw ACC, vf12, vf28 + nop | madday.xyzw ACC, vf13, vf28 + nop | maddaz.xyzw ACC, vf14, vf28 + nop | maddw.xyzw vf30, vf15, vf00 + nop | mulax.xyzw ACC, vf08, vf24 + nop | madday.xyzw ACC, vf09, vf24 + nop | maddaz.xyzw ACC, vf10, vf24 + nop | maddw.xyzw vf26, vf11, vf00 + div Q, vf03.x, vf30.w | mul.xyzw vf18, vf30, vf01 + lq.xyzw vf23, 313(vi05) | mulw.w vf22, vf22, vf06 + waitp | mulw.xyz vf22, vf22, vf07 + mfp.w vf21, P | nop + eleng.xyz P, vf26 | nop + nop | clipw.xyz vf18, vf18 + nop | mulaw.w ACC, vf30, vf00 + lq.xyzw vf29, 314(vi05) | mulw.w vf23, vf21, vf05 + nop | mula.xyz ACC, vf30, Q + nop | maddw.xyzw vf16, vf02, vf00 + nop | miniy.xyzw vf22, vf22, vf07 + nop | miniw.w vf23, vf23, vf00 + nop | nop + nop | miniz.w vf16, vf16, vf03 + nop | ftoi0.xyzw vf22, vf22 + waitp | subw.w vf29, vf00, vf23 + b L17 | maxx.w vf23, vf23, vf05 + iaddi vi06, vi00, 0x8 | maxy.w vf16, vf16, vf03 +L15: + ibeq vi00, vi01, L16 | nop + lq.xyzw vf26, 309(vi05) | nop + ibne vi00, vi13, L16 | addw.w vf17, vf17, vf03 + fcor vi01, 0xfdf7df | nop + isw.x vi12, 989(vi14) | nop + ibne vi00, vi01, L16 | nop + fcor vi01, 0xff7df7 | nop + isw.y vi05, 989(vi14) | nop + ibne vi00, vi01, L16 | nop + fcor vi01, 0xffbefb | nop + ilw.x vi11, 988(vi00) | nop + ibne vi00, vi01, L16 | nop + fcor vi01, 0xffdf7d | nop + isw.z vi08, 989(vi14) | nop + ibne vi00, vi01, L16 | nop + fcor vi01, 0xffefbe | nop + isub vi11, vi05, vi11 | nop + ibne vi00, vi01, L16 | nop + nop | nop + ibltz vi11, L16 | nop + nop | nop + iaddi vi14, vi14, 0x1 | nop +L16: + nop | mulw.y vf28, vf28, vf28 + nop | mulaz.w ACC, vf00, vf07 + nop | msubx.w vf07, vf22, vf07 + nop | ftoi4.xyzw vf17, vf17 + lq.xyzw vf24, 290(vi05) | mul.xyzw vf26, vf26, Q + sq.xyzw vf21, 64(vi08) | mulax.xyzw ACC, vf12, vf28 + sq.xyzw vf23, 4(vi08) | madday.xyzw ACC, vf13, vf28 + sq.xyzw vf17, 5(vi08) | maddaz.xyzw ACC, vf14, vf28 + sq.xyzw vf19, 66(vi08) | maddw.xyzw vf30, vf15, vf00 + sq.xyzw vf26, 3(vi08) | mulax.xyzw ACC, vf08, vf24 + nop | madday.xyzw ACC, vf09, vf24 + nop | maddaz.xyzw ACC, vf10, vf24 + nop | maddw.xyzw vf26, vf11, vf00 + div Q, vf03.x, vf30.w | mul.xyzw vf18, vf30, vf01 + lq.xyzw vf23, 313(vi05) | mulw.xyz vf21, vf27, vf00 + mfp.w vf21, P | mulw.w vf22, vf22, vf06 + eleng.xyz P, vf26 | mulw.xyz vf22, vf22, vf07 + iaddi vi08, vi08, 0x6 | clipw.xyz vf18, vf18 + nop | mulaw.w ACC, vf30, vf00 + nop | mulw.w vf23, vf21, vf05 + iand vi13, vi10, vi12 | mula.xyz ACC, vf30, Q + fcand vi01, 0x3ffff | maddw.xyzw vf16, vf02, vf00 + iadd vi12, vi12, vi12 | miniy.xyzw vf22, vf22, vf07 + lq.xyzw vf29, 314(vi05) | miniw.w vf23, vf23, vf00 + nop | nop + ior vi01, vi01, vi13 | miniz.w vf16, vf16, vf03 + nop | ftoi0.xyzw vf22, vf22 + nop | subw.w vf29, vf00, vf23 + nop | maxx.w vf23, vf23, vf05 + nop | maxy.w vf16, vf16, vf03 + nop | nop +L17: + ibeq vi00, vi01, L18 | nop + lq.xyzw vf27, 285(vi05) | nop + ibne vi00, vi13, L18 | addw.w vf16, vf16, vf03 + fcor vi01, 0xfdf7df | nop + isw.x vi00, 989(vi14) | nop + ibne vi00, vi01, L18 | nop + fcor vi01, 0xff7df7 | nop + isw.y vi05, 989(vi14) | nop + ibne vi00, vi01, L18 | nop + fcor vi01, 0xffbefb | nop + isw.z vi08, 989(vi14) | nop + ibne vi00, vi01, L18 | nop + fcor vi01, 0xffdf7d | nop + nop | nop + ibne vi00, vi01, L18 | nop + fcor vi01, 0xffefbe | nop + nop | nop + ibne vi00, vi01, L18 | nop + nop | nop + iaddi vi14, vi14, 0x1 | nop +L18: + nop | mulw.y vf29, vf29, vf29 + nop | mulaz.w ACC, vf00, vf07 + nop | msubx.w vf07, vf23, vf07 + nop | ftoi4.xyzw vf16, vf16 + lq.xyzw vf25, 317(vi05) | mul.xyzw vf27, vf27, Q + sq.xyzw vf20, 61(vi08) | mulax.xyzw ACC, vf12, vf29 + sq.xyzw vf22, 1(vi08) | madday.xyzw ACC, vf13, vf29 + sq.xyzw vf16, 2(vi08) | maddaz.xyzw ACC, vf14, vf29 + sq.xyzw vf18, 63(vi08) | maddw.xyzw vf31, vf15, vf00 + sq.xyzw vf27, 0(vi08) | mulax.xyzw ACC, vf08, vf25 + nop | madday.xyzw ACC, vf09, vf25 + iaddi vi05, vi05, 0x3 | maddaz.xyzw ACC, vf10, vf25 + nop | maddw.xyzw vf27, vf11, vf00 + div Q, vf03.x, vf31.w | mul.xyzw vf19, vf31, vf01 + lq.xyzw vf22, 286(vi05) | mulw.xyz vf20, vf26, vf00 + mfp.w vf20, P | mulw.w vf23, vf23, vf06 + eleng.xyz P, vf27 | mulw.xyz vf23, vf23, vf07 + nop | clipw.xyz vf19, vf19 + nop | mulaw.w ACC, vf31, vf00 + nop | mulw.w vf22, vf20, vf05 + nop | mula.xyz ACC, vf31, Q + fcand vi01, 0x3ffff | maddw.xyzw vf17, vf02, vf00 + nop | miniy.xyzw vf23, vf23, vf07 + lq.xyzw vf28, 287(vi05) | miniw.w vf22, vf22, vf00 + nop | nop + ior vi01, vi01, vi13 | miniz.w vf17, vf17, vf03 + nop | ftoi0.xyzw vf23, vf23 + nop | subw.w vf28, vf00, vf22 + nop | maxx.w vf22, vf22, vf05 + ibgtz vi06, L15 | maxy.w vf17, vf17, vf03 + iaddi vi06, vi06, -0x1 | nop + ibeq vi00, vi01, L19 | nop + lq.xyzw vf26, 309(vi05) | nop + ibne vi00, vi13, L19 | addw.w vf17, vf17, vf03 + fcor vi01, 0xfdf7df | nop + isw.x vi12, 989(vi14) | nop + ibne vi00, vi01, L19 | nop + fcor vi01, 0xff7df7 | nop + isw.y vi05, 989(vi14) | nop + ibne vi00, vi01, L19 | nop + fcor vi01, 0xffbefb | nop + isw.z vi08, 989(vi14) | nop + ibne vi00, vi01, L19 | nop + fcor vi01, 0xffdf7d | nop + nop | nop + ibne vi00, vi01, L19 | nop + fcor vi01, 0xffefbe | nop + nop | nop + ibne vi00, vi01, L19 | nop + nop | nop + iaddi vi14, vi14, 0x1 | nop +L19: + isw.y vi14, 988(vi00) | ftoi4.xyzw vf17, vf17 + sq.xyzw vf21, 64(vi08) | mul.xyzw vf26, vf26, Q + sq.xyzw vf23, 4(vi08) | nop + sq.xyzw vf17, 5(vi08) | nop + sq.xyzw vf19, 66(vi08) | nop + sq.xyzw vf26, 3(vi08) | nop + jr vi15 | nop + nop | nop +L20: + lq.xyzw vf05, 955(vi00) | nop + iaddi vi06, vi00, 0x5 | nop +L21: + lq.xyzw vf20, 0(vi08) | nop + lq.xyzw vf21, 3(vi08) | nop + lq.xyzw vf18, 6(vi08) | nop + lq.xyzw vf19, 9(vi08) | maxw.xyzw vf11, vf00, vf00 + div Q, vf00.w, vf20.w | nop + nop | nop + nop | nop + nop | nop + nop | nop + nop | nop + nop | nop + div Q, vf00.w, vf21.w | mul.xy vf20, vf20, Q + nop | nop + nop | nop + nop | nop + nop | nop + nop | nop + nop | nop + div Q, vf00.w, vf18.w | mul.xy vf21, vf21, Q + nop | mula.xyzw ACC, vf20, vf05 + nop | maddw.xyzw vf20, vf06, vf00 + nop | nop + nop | mula.xyzw ACC, vf21, vf05 + nop | maddw.xyzw vf21, vf06, vf00 + nop | nop + div Q, vf00.w, vf19.w | mul.xy vf18, vf18, Q + nop | nop + nop | nop + nop | nop + nop | nop + nop | nop + nop | nop + sq.xyz vf20, 0(vi08) | mul.xy vf19, vf19, Q + sq.xyz vf21, 3(vi08) | mula.xyzw ACC, vf18, vf05 + nop | maddw.xyzw vf18, vf06, vf00 + nop | nop + nop | mula.xyzw ACC, vf19, vf05 + iaddi vi08, vi08, 0xc | maddw.xyzw vf19, vf06, vf00 + iaddi vi06, vi06, -0x1 | nop + sq.xyz vf18, -6(vi08) | nop + ibgtz vi06, L21 | nop + sq.xyz vf19, -3(vi08) | nop + jr vi15 | nop + nop | nop +L22: + iaddi vi06, vi00, 0x4 | nop +L23: + lq.xyzw vf12, 0(vi08) | nop + lq.xyzw vf13, 3(vi08) | nop + lq.xyzw vf14, 6(vi08) | nop + lq.xyzw vf15, 9(vi08) | nop + lq.xyzw vf24, -59(vi08) | nop + lq.xyzw vf25, -56(vi08) | nop + lq.xyzw vf26, -53(vi08) | nop + lq.xyzw vf27, -50(vi08) | nop + lq.xyzw vf28, -61(vi08) | nop + lq.xyzw vf29, -58(vi08) | nop + lq.xyzw vf30, -55(vi08) | nop + lq.xyzw vf31, -52(vi08) | nop + iaddi vi08, vi08, 0xc | mulz.xyzw vf12, vf12, vf28 + sq.xyzw vf24, -10(vi08) | mulz.xyzw vf13, vf13, vf29 + sq.xyzw vf25, -7(vi08) | mulz.xyzw vf14, vf14, vf30 + sq.xyzw vf26, -4(vi08) | mulz.xyzw vf15, vf15, vf31 + sq.xyzw vf27, -1(vi08) | nop + sq.xyzw vf12, -12(vi08) | nop + sq.xyzw vf13, -9(vi08) | nop + sq.xyzw vf14, -6(vi08) | nop + sq.xyzw vf15, -3(vi08) | nop + ibgtz vi06, L23 | nop + iaddi vi06, vi06, -0x1 | nop + jr vi15 | nop + nop | nop +L24: + lq.xyzw vf31, 952(vi00) | nop + iaddiu vi10, vi00, 0x32b | nop +L25: + iaddi vi14, vi14, -0x1 | nop + iaddi vi08, vi10, 0x7 | nop + ilw.x vi12, 989(vi14) | nop + ilw.y vi05, 989(vi14) | nop + ibne vi00, vi12, L26 | nop + ilw.z vi03, 989(vi14) | nop + lq.xyzw vf20, 282(vi05) | nop + lq.xyzw vf21, 309(vi05) | nop + lq.xyzw vf18, 285(vi05) | nop + lq.xyzw vf22, -5(vi03) | nop + lq.xyzw vf23, -2(vi03) | nop + lq.xyzw vf16, 1(vi03) | nop + lq.xyzw vf08, 55(vi03) | nop + lq.xyzw vf09, 58(vi03) | nop + lq.xyzw vf10, 61(vi03) | nop + lq.xyzw vf28, 57(vi03) | nop + lq.xyzw vf29, 60(vi03) | nop + b L27 | nop + lq.xyzw vf30, 63(vi03) | nop +L26: + lq.xyzw vf20, 306(vi05) | nop + lq.xyzw vf21, 282(vi05) | nop + lq.xyzw vf18, 309(vi05) | nop + lq.xyzw vf22, -2(vi03) | nop + lq.xyzw vf23, 1(vi03) | nop + lq.xyzw vf16, 4(vi03) | nop + lq.xyzw vf08, 58(vi03) | nop + lq.xyzw vf09, 61(vi03) | nop + lq.xyzw vf10, 64(vi03) | nop + lq.xyzw vf28, 60(vi03) | nop + lq.xyzw vf29, 63(vi03) | nop + lq.xyzw vf30, 66(vi03) | nop +L27: + sq.xyzw vf20, 0(vi08) | itof0.xyzw vf22, vf22 + sq.xyzw vf21, 3(vi08) | itof0.xyzw vf23, vf23 + sq.xyzw vf18, 6(vi08) | itof0.xyzw vf16, vf16 + sq.xyzw vf20, 9(vi08) | nop + sq.xyzw vf22, 1(vi08) | nop + sq.xyzw vf23, 4(vi08) | nop + sq.xyzw vf16, 7(vi08) | nop + sq.xyzw vf22, 10(vi08) | nop + sq.xyzw vf28, 2(vi08) | nop + sq.xyzw vf29, 5(vi08) | nop + sq.xyzw vf30, 8(vi08) | nop + sq.xyzw vf28, 11(vi08) | nop + lq.xyzw vf22, 977(vi00) | nop + sq.xyzw vf08, 35(vi08) | nop + sq.xyzw vf09, 38(vi08) | nop + sq.xyzw vf10, 41(vi08) | nop + sq.xyzw vf08, 44(vi08) | nop + sq.xyzw vf22, 36(vi08) | nop + sq.xyzw vf22, 39(vi08) | nop + sq.xyzw vf22, 42(vi08) | nop + sq.xyzw vf22, 45(vi08) | nop + sq.xyzw vf28, 37(vi08) | nop + sq.xyzw vf29, 40(vi08) | nop + sq.xyzw vf30, 43(vi08) | nop + sq.xyzw vf28, 46(vi08) | nop + lq.xyzw vf07, 960(vi00) | maddw.xyzw vf26, vf06, vf00 + ior vi03, vi08, vi00 | nop + bal vi13, L31 | nop + iaddi vi05, vi00, 0x3 | nop + ibeq vi00, vi05, L28 | nop + iaddiu vi06, vi05, 0x4000 | nop + bal vi13, L29 | nop + iaddiu vi06, vi06, 0x4000 | nop + iaddiu vi08, vi00, 0x3d2 | nop + xgkick vi10 | nop + lq.xyzw vf07, 961(vi00) | nop + xgkick vi08 | nop + iaddi vi08, vi10, 0x6 | nop + sq.xyzw vf07, 6(vi10) | nop + isw.x vi06, 6(vi10) | nop + xgkick vi08 | nop + iaddiu vi08, vi00, 0x3d6 | nop + nop | nop + xgkick vi08 | nop + iaddiu vi08, vi10, 0x2a | nop + iaddiu vi03, vi10, 0x2a | nop + iaddi vi05, vi00, 0x3 | nop + bal vi13, L31 | nop + lq.xyzw vf07, 962(vi00) | nop + iaddiu vi06, vi05, 0x4000 | nop + bal vi13, L29 | nop + iaddiu vi06, vi06, 0x4000 | nop + iaddiu vi08, vi10, 0x23 | nop + iaddiu vi01, vi00, 0x69c | nop + xgkick vi08 | nop + isub vi10, vi01, vi10 | nop +L28: + ibgtz vi14, L25 | nop + nop | nop + lq.xyzw vf08, 0(vi02) | nop + lq.xyzw vf09, 1(vi02) | nop + jr vi15 | nop + lq.xyzw vf10, 2(vi02) | nop +L29: + sq.xyzw vf07, -1(vi08) | nop + isw.x vi06, -1(vi08) | nop +L30: + lqi.xyzw vf24, vi08 | nop + lqi.xyzw vf27, vi08 | nop + lqi.xyzw vf21, vi08 | nop + nop | nop + nop | nop + nop | nop + div Q, vf00.w, vf21.w | mul.xyzw vf21, vf21, vf31 + nop | nop + nop | nop + nop | nop + nop | nop + nop | nop + nop | nop + nop | mul.xyz vf21, vf21, Q + nop | mul.xyzw vf24, vf24, Q + nop | nop + nop | nop + nop | add.xyzw vf21, vf21, vf02 + nop | nop + nop | nop + nop | nop + nop | maxy.w vf21, vf21, vf03 + nop | nop + nop | nop + nop | nop + nop | miniz.w vf21, vf21, vf03 + nop | nop + nop | nop + nop | ftoi0.xyzw vf27, vf27 + nop | ftoi4.xyzw vf21, vf21 + nop | nop + sq.xyzw vf24, -3(vi08) | nop + sq.xyzw vf27, -2(vi08) | nop + sq.xyzw vf21, -1(vi08) | nop + iaddi vi05, vi05, -0x1 | nop + nop | nop + ibne vi00, vi05, L30 | nop + nop | nop + jr vi13 | nop + nop | nop +L31: + ior vi04, vi03, vi00 | nop + lq.xyzw vf21, 2(vi03) | nop + ior vi06, vi05, vi00 | nop + lq.xyzw vf24, 0(vi03) | nop + lq.xyzw vf27, 1(vi03) | nop + iaddi vi03, vi03, 0x3 | clipw.xyz vf21, vf21 +L32: + lq.xyzw vf22, 2(vi03) | nop + lq.xyzw vf25, 0(vi03) | nop + lq.xyzw vf28, 1(vi03) | nop + iaddi vi03, vi03, 0x3 | nop + nop | clipw.xyz vf22, vf22 + nop | nop + nop | nop + nop | nop + fcor vi01, 0xfff7df | nop + ibne vi00, vi01, L43 | nop + fcand vi01, 0x20 | nop + ibne vi00, vi01, L44 | nop + fcand vi01, 0x800 | nop + ibne vi00, vi01, L45 | nop + nop | nop + sqi.xyzw vf24, vi04 | nop + sqi.xyzw vf27, vi04 | nop + sqi.xyzw vf21, vi04 | nop +L33: + move.xyzw vf24, vf25 | nop + iaddi vi05, vi05, -0x1 | nop + move.xyzw vf27, vf28 | nop + ibne vi00, vi05, L32 | nop + move.xyzw vf21, vf22 | nop + lq.xyzw vf24, 0(vi08) | nop + lq.xyzw vf27, 1(vi08) | nop + lq.xyzw vf21, 2(vi08) | nop + ior vi03, vi08, vi00 | nop + sqi.xyzw vf24, vi04 | nop + sqi.xyzw vf27, vi04 | nop + sqi.xyzw vf21, vi04 | nop + ibeq vi00, vi06, L42 | nop + ior vi05, vi06, vi00 | nop + ior vi04, vi03, vi00 | nop + lq.xyzw vf21, 2(vi03) | nop + ior vi06, vi05, vi00 | nop + lq.xyzw vf24, 0(vi03) | nop + lq.xyzw vf27, 1(vi03) | nop + iaddi vi03, vi03, 0x3 | clipw.xyz vf21, vf21 +L34: + lq.xyzw vf22, 2(vi03) | nop + lq.xyzw vf25, 0(vi03) | nop + lq.xyzw vf28, 1(vi03) | nop + iaddi vi03, vi03, 0x3 | nop + nop | clipw.xyz vf22, vf22 + nop | nop + nop | nop + nop | nop + fcor vi01, 0xfffdf7 | nop + ibne vi00, vi01, L46 | nop + fcand vi01, 0x8 | nop + ibne vi00, vi01, L47 | nop + fcand vi01, 0x200 | nop + ibne vi00, vi01, L48 | nop + nop | nop + sqi.xyzw vf24, vi04 | nop + sqi.xyzw vf27, vi04 | nop + sqi.xyzw vf21, vi04 | nop +L35: + move.xyzw vf24, vf25 | nop + iaddi vi05, vi05, -0x1 | nop + move.xyzw vf27, vf28 | nop + ibne vi00, vi05, L34 | nop + move.xyzw vf21, vf22 | nop + lq.xyzw vf24, 0(vi08) | nop + lq.xyzw vf27, 1(vi08) | nop + lq.xyzw vf21, 2(vi08) | nop + ior vi03, vi08, vi00 | nop + sqi.xyzw vf24, vi04 | nop + sqi.xyzw vf27, vi04 | nop + sqi.xyzw vf21, vi04 | nop + ibeq vi00, vi06, L42 | nop + ior vi05, vi06, vi00 | nop + ior vi04, vi03, vi00 | nop + lq.xyzw vf21, 2(vi03) | nop + ior vi06, vi05, vi00 | nop + lq.xyzw vf24, 0(vi03) | nop + lq.xyzw vf27, 1(vi03) | nop + iaddi vi03, vi03, 0x3 | clipw.xyz vf21, vf21 +L36: + lq.xyzw vf22, 2(vi03) | nop + lq.xyzw vf25, 0(vi03) | nop + lq.xyzw vf28, 1(vi03) | nop + iaddi vi03, vi03, 0x3 | nop + nop | clipw.xyz vf22, vf22 + nop | nop + nop | nop + nop | nop + fcor vi01, 0xfffefb | nop + ibne vi00, vi01, L49 | nop + fcand vi01, 0x4 | nop + ibne vi00, vi01, L50 | nop + fcand vi01, 0x100 | nop + ibne vi00, vi01, L51 | nop + nop | nop + sqi.xyzw vf24, vi04 | nop + sqi.xyzw vf27, vi04 | nop + sqi.xyzw vf21, vi04 | nop +L37: + move.xyzw vf24, vf25 | nop + iaddi vi05, vi05, -0x1 | nop + move.xyzw vf27, vf28 | nop + ibne vi00, vi05, L36 | nop + move.xyzw vf21, vf22 | nop + lq.xyzw vf24, 0(vi08) | nop + lq.xyzw vf27, 1(vi08) | nop + lq.xyzw vf21, 2(vi08) | nop + ior vi03, vi08, vi00 | nop + sqi.xyzw vf24, vi04 | nop + sqi.xyzw vf27, vi04 | nop + sqi.xyzw vf21, vi04 | nop + ibeq vi00, vi06, L42 | nop + ior vi05, vi06, vi00 | nop + ior vi04, vi03, vi00 | nop + lq.xyzw vf21, 2(vi03) | nop + ior vi06, vi05, vi00 | nop + lq.xyzw vf24, 0(vi03) | nop + lq.xyzw vf27, 1(vi03) | nop + iaddi vi03, vi03, 0x3 | clipw.xyz vf21, vf21 +L38: + lq.xyzw vf22, 2(vi03) | nop + lq.xyzw vf25, 0(vi03) | nop + lq.xyzw vf28, 1(vi03) | nop + iaddi vi03, vi03, 0x3 | nop + nop | clipw.xyz vf22, vf22 + nop | nop + nop | nop + nop | nop + fcor vi01, 0xffff7d | nop + ibne vi00, vi01, L52 | nop + fcand vi01, 0x2 | nop + ibne vi00, vi01, L53 | nop + fcand vi01, 0x80 | nop + ibne vi00, vi01, L54 | nop + nop | nop + sqi.xyzw vf24, vi04 | nop + sqi.xyzw vf27, vi04 | nop + sqi.xyzw vf21, vi04 | nop +L39: + move.xyzw vf24, vf25 | nop + iaddi vi05, vi05, -0x1 | nop + move.xyzw vf27, vf28 | nop + ibne vi00, vi05, L38 | nop + move.xyzw vf21, vf22 | nop + lq.xyzw vf24, 0(vi08) | nop + lq.xyzw vf27, 1(vi08) | nop + lq.xyzw vf21, 2(vi08) | nop + ior vi03, vi08, vi00 | nop + sqi.xyzw vf24, vi04 | nop + sqi.xyzw vf27, vi04 | nop + sqi.xyzw vf21, vi04 | nop + ibeq vi00, vi06, L42 | nop + ior vi05, vi06, vi00 | nop + ior vi04, vi03, vi00 | nop + lq.xyzw vf21, 2(vi03) | nop + ior vi06, vi05, vi00 | nop + lq.xyzw vf24, 0(vi03) | nop + lq.xyzw vf27, 1(vi03) | nop + iaddi vi03, vi03, 0x3 | clipw.xyz vf21, vf21 +L40: + lq.xyzw vf22, 2(vi03) | nop + lq.xyzw vf25, 0(vi03) | nop + lq.xyzw vf28, 1(vi03) | nop + iaddi vi03, vi03, 0x3 | nop + nop | clipw.xyz vf22, vf22 + nop | nop + nop | nop + nop | nop + fcor vi01, 0xffffbe | nop + ibne vi00, vi01, L55 | nop + fcand vi01, 0x1 | nop + ibne vi00, vi01, L56 | nop + fcand vi01, 0x40 | nop + ibne vi00, vi01, L57 | nop + nop | nop + sqi.xyzw vf24, vi04 | nop + sqi.xyzw vf27, vi04 | nop + sqi.xyzw vf21, vi04 | nop +L41: + move.xyzw vf24, vf25 | nop + iaddi vi05, vi05, -0x1 | nop + move.xyzw vf27, vf28 | nop + ibne vi00, vi05, L40 | nop + move.xyzw vf21, vf22 | nop + lq.xyzw vf24, 0(vi08) | nop + lq.xyzw vf27, 1(vi08) | nop + lq.xyzw vf21, 2(vi08) | nop + ior vi03, vi08, vi00 | nop + sqi.xyzw vf24, vi04 | nop + sqi.xyzw vf27, vi04 | nop + sqi.xyzw vf21, vi04 | nop + ibeq vi00, vi06, L42 | nop + ior vi05, vi06, vi00 | nop +L42: + jr vi13 | nop + nop | nop +L43: + b L33 | nop + iaddi vi06, vi06, -0x1 | nop +L44: + sqi.xyzw vf24, vi04 | sub.xyzw vf23, vf22, vf21 + sqi.xyzw vf27, vi04 | sub.xyzw vf26, vf25, vf24 + sqi.xyzw vf21, vi04 | sub.xyzw vf29, vf28, vf27 + ibeq vi03, vi04, L33 | nop + nop | addz.w vf30, vf23, vf23 + nop | addw.z vf30, vf21, vf21 + div Q, vf30.z, vf30.w | nop + waitq | nop + nop | mul.xyzw vf26, vf26, Q + nop | mul.xyzw vf29, vf29, Q + nop | mul.xyzw vf23, vf23, Q + nop | sub.xyzw vf26, vf24, vf26 + nop | sub.xyzw vf29, vf27, vf29 + nop | sub.xyzw vf23, vf21, vf23 + iaddi vi06, vi06, 0x1 | nop + sqi.xyzw vf26, vi04 | nop + sqi.xyzw vf29, vi04 | nop + b L33 | nop + sqi.xyzw vf23, vi04 | nop +L45: + nop | sub.xyzw vf23, vf21, vf22 + nop | sub.xyzw vf26, vf24, vf25 + nop | sub.xyzw vf29, vf27, vf28 + nop | addz.w vf30, vf23, vf23 + nop | addw.z vf30, vf22, vf22 + div Q, vf30.z, vf30.w | nop + waitq | nop + nop | mul.xyzw vf26, vf26, Q + nop | mul.xyzw vf29, vf29, Q + nop | mul.xyzw vf23, vf23, Q + nop | sub.xyzw vf26, vf25, vf26 + nop | sub.xyzw vf29, vf28, vf29 + nop | sub.xyzw vf23, vf22, vf23 + sqi.xyzw vf26, vi04 | nop + sqi.xyzw vf29, vi04 | nop + b L33 | nop + sqi.xyzw vf23, vi04 | nop +L46: + b L35 | nop + iaddi vi06, vi06, -0x1 | nop +L47: + sqi.xyzw vf24, vi04 | sub.xyzw vf23, vf22, vf21 + sqi.xyzw vf27, vi04 | sub.xyzw vf26, vf25, vf24 + sqi.xyzw vf21, vi04 | sub.xyzw vf29, vf28, vf27 + ibeq vi03, vi04, L35 | nop + nop | addy.w vf30, vf23, vf23 + nop | addw.y vf30, vf21, vf21 + div Q, vf30.y, vf30.w | nop + waitq | nop + nop | mul.xyzw vf26, vf26, Q + nop | mul.xyzw vf29, vf29, Q + nop | mul.xyzw vf23, vf23, Q + nop | sub.xyzw vf26, vf24, vf26 + nop | sub.xyzw vf29, vf27, vf29 + nop | sub.xyzw vf23, vf21, vf23 + iaddi vi06, vi06, 0x1 | nop + sqi.xyzw vf26, vi04 | nop + sqi.xyzw vf29, vi04 | nop + b L35 | nop + sqi.xyzw vf23, vi04 | nop +L48: + nop | sub.xyzw vf23, vf21, vf22 + nop | sub.xyzw vf26, vf24, vf25 + nop | sub.xyzw vf29, vf27, vf28 + nop | addy.w vf30, vf23, vf23 + nop | addw.y vf30, vf22, vf22 + div Q, vf30.y, vf30.w | nop + waitq | nop + nop | mul.xyzw vf26, vf26, Q + nop | mul.xyzw vf29, vf29, Q + nop | mul.xyzw vf23, vf23, Q + nop | sub.xyzw vf26, vf25, vf26 + nop | sub.xyzw vf29, vf28, vf29 + nop | sub.xyzw vf23, vf22, vf23 + sqi.xyzw vf26, vi04 | nop + sqi.xyzw vf29, vi04 | nop + b L35 | nop + sqi.xyzw vf23, vi04 | nop +L49: + b L37 | nop + iaddi vi06, vi06, -0x1 | nop +L50: + sqi.xyzw vf24, vi04 | sub.xyzw vf23, vf22, vf21 + sqi.xyzw vf27, vi04 | sub.xyzw vf26, vf25, vf24 + sqi.xyzw vf21, vi04 | sub.xyzw vf29, vf28, vf27 + ibeq vi03, vi04, L37 | nop + nop | suby.w vf30, vf23, vf23 + nop | subw.y vf30, vf21, vf21 + div Q, vf30.y, vf30.w | nop + waitq | nop + nop | mul.xyzw vf26, vf26, Q + nop | mul.xyzw vf29, vf29, Q + nop | mul.xyzw vf23, vf23, Q + nop | add.xyzw vf26, vf24, vf26 + nop | add.xyzw vf29, vf27, vf29 + nop | add.xyzw vf23, vf21, vf23 + iaddi vi06, vi06, 0x1 | nop + sqi.xyzw vf26, vi04 | nop + sqi.xyzw vf29, vi04 | nop + b L37 | nop + sqi.xyzw vf23, vi04 | nop +L51: + nop | sub.xyzw vf23, vf21, vf22 + nop | sub.xyzw vf26, vf24, vf25 + nop | sub.xyzw vf29, vf27, vf28 + nop | suby.w vf30, vf23, vf23 + nop | subw.y vf30, vf22, vf22 + div Q, vf30.y, vf30.w | nop + waitq | nop + nop | mul.xyzw vf26, vf26, Q + nop | mul.xyzw vf29, vf29, Q + nop | mul.xyzw vf23, vf23, Q + nop | add.xyzw vf26, vf25, vf26 + nop | add.xyzw vf29, vf28, vf29 + nop | add.xyzw vf23, vf22, vf23 + sqi.xyzw vf26, vi04 | nop + sqi.xyzw vf29, vi04 | nop + b L37 | nop + sqi.xyzw vf23, vi04 | nop +L52: + b L39 | nop + iaddi vi06, vi06, -0x1 | nop +L53: + sqi.xyzw vf24, vi04 | sub.xyzw vf23, vf22, vf21 + sqi.xyzw vf27, vi04 | sub.xyzw vf26, vf25, vf24 + sqi.xyzw vf21, vi04 | sub.xyzw vf29, vf28, vf27 + ibeq vi03, vi04, L39 | nop + nop | addx.w vf30, vf23, vf23 + nop | addw.x vf30, vf21, vf21 + div Q, vf30.x, vf30.w | nop + waitq | nop + nop | mul.xyzw vf26, vf26, Q + nop | mul.xyzw vf29, vf29, Q + nop | mul.xyzw vf23, vf23, Q + nop | sub.xyzw vf26, vf24, vf26 + nop | sub.xyzw vf29, vf27, vf29 + nop | sub.xyzw vf23, vf21, vf23 + iaddi vi06, vi06, 0x1 | nop + sqi.xyzw vf26, vi04 | nop + sqi.xyzw vf29, vi04 | nop + b L39 | nop + sqi.xyzw vf23, vi04 | nop +L54: + nop | sub.xyzw vf23, vf21, vf22 + nop | sub.xyzw vf26, vf24, vf25 + nop | sub.xyzw vf29, vf27, vf28 + nop | addx.w vf30, vf23, vf23 + nop | addw.x vf30, vf22, vf22 + div Q, vf30.x, vf30.w | nop + waitq | nop + nop | mul.xyzw vf26, vf26, Q + nop | mul.xyzw vf29, vf29, Q + nop | mul.xyzw vf23, vf23, Q + nop | sub.xyzw vf26, vf25, vf26 + nop | sub.xyzw vf29, vf28, vf29 + nop | sub.xyzw vf23, vf22, vf23 + sqi.xyzw vf26, vi04 | nop + sqi.xyzw vf29, vi04 | nop + b L39 | nop + sqi.xyzw vf23, vi04 | nop +L55: + b L41 | nop + iaddi vi06, vi06, -0x1 | nop +L56: + sqi.xyzw vf24, vi04 | sub.xyzw vf23, vf22, vf21 + sqi.xyzw vf27, vi04 | sub.xyzw vf26, vf25, vf24 + sqi.xyzw vf21, vi04 | sub.xyzw vf29, vf28, vf27 + ibeq vi03, vi04, L41 | nop + nop | subx.w vf30, vf23, vf23 + nop | subw.x vf30, vf21, vf21 + div Q, vf30.x, vf30.w | nop + waitq | nop + nop | mul.xyzw vf26, vf26, Q + nop | mul.xyzw vf29, vf29, Q + nop | mul.xyzw vf23, vf23, Q + nop | add.xyzw vf26, vf24, vf26 + nop | add.xyzw vf29, vf27, vf29 + nop | add.xyzw vf23, vf21, vf23 + iaddi vi06, vi06, 0x1 | nop + sqi.xyzw vf26, vi04 | nop + sqi.xyzw vf29, vi04 | nop + b L41 | nop + sqi.xyzw vf23, vi04 | nop +L57: + nop | sub.xyzw vf23, vf21, vf22 + nop | sub.xyzw vf26, vf24, vf25 + nop | sub.xyzw vf29, vf27, vf28 + nop | subx.w vf30, vf23, vf23 + nop | subw.x vf30, vf22, vf22 + div Q, vf30.x, vf30.w | nop + waitq | nop + nop | mul.xyzw vf26, vf26, Q + nop | mul.xyzw vf29, vf29, Q + nop | mul.xyzw vf23, vf23, Q + nop | add.xyzw vf26, vf25, vf26 + nop | add.xyzw vf29, vf28, vf29 + nop | add.xyzw vf23, vf22, vf23 + sqi.xyzw vf26, vi04 | nop + sqi.xyzw vf29, vi04 | nop + b L41 | nop + sqi.xyzw vf23, vi04 | nop diff --git a/test/decompiler/vu_reference/jak2/ocean-near.txt b/test/decompiler/vu_reference/jak2/ocean-near.txt new file mode 100644 index 0000000000..4fe6f021b6 --- /dev/null +++ b/test/decompiler/vu_reference/jak2/ocean-near.txt @@ -0,0 +1,1982 @@ + .word 0x3dd + .word 0x0 + .word 0x1ef + .word 0x0 + .word 0x1e103b7 + .word 0x2ff + .word 0x1e203b9 + .word 0x2ff + .word 0x1e303ba + .word 0x2ff + .word 0x1e503bb + .word 0x2ff + .word 0x1e603bc + .word 0x2ff + .word 0x10090213 + .word 0x2ff + .word 0x800101b2 + .word 0x2ff + .word 0x1ec0bc3 + .word 0x2ff + .word 0x1ed0bca + .word 0x2ff + .word 0x3e16213 + .word 0x2ff + .word 0x3e1629f + .word 0x2ff + .word 0x3e16a50 + .word 0x2ff + .word 0x3e16adc + .word 0x2ff + .word 0x3e1632b + .word 0x2ff + .word 0x3e16371 + .word 0x2ff + .word 0x3e16b4e + .word 0x2ff + .word 0x3e16b94 + .word 0x2ff + .word 0x5a000ff5 + .word 0x2ff + .word 0x80010ff2 + .word 0x2ff + .word 0x1e803d1 + .word 0x2ff + .word 0x80040232 + .word 0x2ff + .word 0x10060011 + .word 0x1e8417c + .word 0x3e44250 + .word 0x2ff + .word 0x3e442dc + .word 0x2ff + .word 0x800420f2 + .word 0x2ff + .word 0x5a0037fc + .word 0x2ff + .word 0x800637f2 + .word 0x2ff + .word 0x1e703bd + .word 0x2ff + .word 0x80050032 + .word 0x1e0042a + .word 0x80070232 + .word 0x2ff + .word 0x80060232 + .word 0x100042a + .word 0x3e58122 + .word 0x2ff + .word 0x800528f2 + .word 0x1078400 + .word 0x5a0037fd + .word 0x2ff + .word 0x800637f2 + .word 0x2ff + .word 0x5a003ffa + .word 0x478400 + .word 0x80073ff2 + .word 0x2ff + .word 0x80000030 + .word 0x400002ff + .word 0x80000030 + .word 0x2ff + .word 0x800206bc + .word 0x2ff + .word 0x903100a + .word 0x2ff + .word 0x884100a + .word 0x2ff + .word 0x80050032 + .word 0x2ff + .word 0x800701f2 + .word 0x2ff + .word 0x1fc1820 + .word 0x2ff + .word 0x1fd1821 + .word 0x2ff + .word 0x1fe2020 + .word 0x2ff + .word 0x1f82922 + .word 0x2ff + .word 0x1f92925 + .word 0x2ff + .word 0x1fa2928 + .word 0x2ff + .word 0x1fb292b + .word 0x2ff + .word 0x1ec292e + .word 0x9c0600 + .word 0x1ed2931 + .word 0x9c0641 + .word 0x1ee2934 + .word 0x9c0682 + .word 0x1ef2937 + .word 0x9c06c3 + .word 0x1e8293a + .word 0x9d0300 + .word 0x3e5c122 + .word 0x9d0341 + .word 0x3e5c925 + .word 0x9d0382 + .word 0x3e5d128 + .word 0x9d03c3 + .word 0x3e5d92b + .word 0x9e0200 + .word 0x3e5612e + .word 0x2ff + .word 0x3e56931 + .word 0x2ff + .word 0x3e57134 + .word 0x2ff + .word 0x3e57937 + .word 0x2ff + .word 0x3e5413a + .word 0x2ff + .word 0x80031a32 + .word 0x2ff + .word 0x80042232 + .word 0x2ff + .word 0x1005281b + .word 0x2ff + .word 0x5a003fe7 + .word 0x2ff + .word 0x80073ff2 + .word 0x2ff + .word 0x843100a + .word 0x2ff + .word 0x824100a + .word 0x2ff + .word 0x1fc1820 + .word 0x2ff + .word 0x1fd1821 + .word 0x2ff + .word 0x1fe2020 + .word 0x2ff + .word 0x1f82922 + .word 0x2ff + .word 0x1f92925 + .word 0x2ff + .word 0x1fa2928 + .word 0x2ff + .word 0x1fb292b + .word 0x2ff + .word 0x1ec292e + .word 0x9c0600 + .word 0x1ed2931 + .word 0x9c0641 + .word 0x1ee2934 + .word 0x9c0682 + .word 0x1ef2937 + .word 0x9c06c3 + .word 0x1e8293a + .word 0x9d0300 + .word 0x3e5c122 + .word 0x9d0341 + .word 0x3e5c925 + .word 0x9d0382 + .word 0x3e5d128 + .word 0x9d03c3 + .word 0x3e5d92b + .word 0x9e0200 + .word 0x3e5612e + .word 0x2ff + .word 0x3e56931 + .word 0x2ff + .word 0x3e57134 + .word 0x2ff + .word 0x3e57937 + .word 0x2ff + .word 0x3e5413a + .word 0x2ff + .word 0x1e703bd + .word 0x2ff + .word 0x1ec100b + .word 0x2ff + .word 0x1ed100b + .word 0x2ff + .word 0x1f6100c + .word 0x2ff + .word 0x1f7100d + .word 0x2ff + .word 0x1f0100e + .word 0x2ff + .word 0x1f1100f + .word 0x2ff + .word 0x80000030 + .word 0x1f6826c + .word 0x80000030 + .word 0x1f78aec + .word 0x80000030 + .word 0x1e74a59 + .word 0x80000030 + .word 0x1e75ad9 + .word 0x80050032 + .word 0x2ff + .word 0x80070232 + .word 0x2ff + .word 0x80000030 + .word 0x1f6ba2c + .word 0x80000030 + .word 0x1e0b41b + .word 0x80060232 + .word 0x1006b1b + .word 0x80000030 + .word 0x1e74219 + .word 0x3e56120 + .word 0x2ff + .word 0x3e58121 + .word 0x2ff + .word 0x800528f2 + .word 0x1076303 + .word 0x5a0037fc + .word 0x1e88428 + .word 0x800637f2 + .word 0x2ff + .word 0x80000030 + .word 0x1e9b5a8 + .word 0x80000030 + .word 0x1ebbde8 + .word 0x5a003ff4 + .word 0x876303 + .word 0x80073ff2 + .word 0x2ff + .word 0x1e81000 + .word 0x2ff + .word 0x1e91001 + .word 0x2ff + .word 0x1ea1002 + .word 0x2ff + .word 0x1e41008 + .word 0x2ff + .word 0x800700f2 + .word 0x2ff + .word 0x800a23fc + .word 0x2ff + .word 0x100b00ff + .word 0x2ff + .word 0x81e4233d + .word 0x2ff + .word 0x500b5021 + .word 0x2ff + .word 0x1eb1003 + .word 0x2ff + .word 0x1ec1004 + .word 0x2ff + .word 0x1ed1005 + .word 0x2ff + .word 0x1ee1006 + .word 0x2ff + .word 0x1ef1007 + .word 0x2ff + .word 0x9053bd8 + .word 0x2ff + .word 0x420f0048 + .word 0x2ff + .word 0x800849f2 + .word 0x2ff + .word 0x1e703c9 + .word 0x2ff + .word 0x100803d2 + .word 0x2ff + .word 0x3e93806 + .word 0x2ff + .word 0x80004efc + .word 0x2ff + .word 0x1e703d5 + .word 0x2ff + .word 0x800046fc + .word 0x2ff + .word 0x3e93806 + .word 0x2ff + .word 0x800849b2 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x800046fc + .word 0x2ff + .word 0x100803d6 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x800046fc + .word 0x2ff + .word 0x420f00f8 + .word 0x2ff + .word 0x10084844 + .word 0x2ff + .word 0x50007003 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x420f013c + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x420f0120 + .word 0x2ff + .word 0x10084844 + .word 0x2ff + .word 0x1008483d + .word 0x2ff + .word 0x100104b2 + .word 0x2ff + .word 0x800046fc + .word 0x2ff + .word 0x80090a71 + .word 0x2ff + .word 0x5a003fda + .word 0x2ff + .word 0x80073ff2 + .word 0x2ff + .word 0x1e41009 + .word 0x2ff + .word 0x800700f2 + .word 0x2ff + .word 0x800a23fc + .word 0x2ff + .word 0x100b00ff + .word 0x2ff + .word 0x81e4233d + .word 0x2ff + .word 0x500b5022 + .word 0x2ff + .word 0x1eb1003 + .word 0x2ff + .word 0x1ec1004 + .word 0x2ff + .word 0x1ed1005 + .word 0x2ff + .word 0x1ee1006 + .word 0x2ff + .word 0x1ef1007 + .word 0x2ff + .word 0x8853bd8 + .word 0x2ff + .word 0x420f001f + .word 0x2ff + .word 0x800849f2 + .word 0x2ff + .word 0x1e703c9 + .word 0x2ff + .word 0x100803d2 + .word 0x2ff + .word 0x3e93806 + .word 0x2ff + .word 0x80004efc + .word 0x2ff + .word 0x1e703d5 + .word 0x2ff + .word 0x800046fc + .word 0x2ff + .word 0x3e93806 + .word 0x2ff + .word 0x800849b2 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x800046fc + .word 0x2ff + .word 0x100803d6 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x800046fc + .word 0x2ff + .word 0x420f00cf + .word 0x2ff + .word 0x10084844 + .word 0x2ff + .word 0x50007003 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x420f0113 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x420f00f7 + .word 0x2ff + .word 0x10084844 + .word 0x2ff + .word 0x1008483d + .word 0x2ff + .word 0x100104b2 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x800046fc + .word 0x2ff + .word 0x80090a71 + .word 0x2ff + .word 0x5a003fd9 + .word 0x2ff + .word 0x80073ff2 + .word 0x2ff + .word 0x80000030 + .word 0x400002ff + .word 0x80000030 + .word 0x2ff + .word 0x80012a72 + .word 0x2ff + .word 0x1f82922 + .word 0x2ff + .word 0x1f9293d + .word 0x2ff + .word 0x1e503bf + .word 0x1f841bc + .word 0x800528f2 + .word 0x1f848bd + .word 0xb0103dc + .word 0x2ff + .word 0x80010032 + .word 0x1f850be + .word 0x800d0032 + .word 0x1e05e8b + .word 0x800b0032 + .word 0x1f941bc + .word 0x22000000 + .word 0x1f948bd + .word 0x1fc291f + .word 0x1f950be + .word 0x81c0d73e + .word 0x1e05ecb + .word 0x800e0032 + .word 0x1e0d51b + .word 0x1f6291e + .word 0x2ff + .word 0x800007bf + .word 0x2ff + .word 0x8034067c + .word 0x2ff + .word 0x81c0df3e + .word 0x1e0dd5b + .word 0x1e703be + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x800c0072 + .word 0x25a59b + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x20b597 + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x360707 + .word 0x80000030 + .word 0x25b590 + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2701be + .word 0x80000030 + .word 0x9ce71b + .word 0x1f82922 + .word 0x27b1cc + .word 0x80000030 + .word 0x1fc61bc + .word 0x80000030 + .word 0x1fc68bd + .word 0x80000030 + .word 0x1fc70be + .word 0x80000030 + .word 0x1e07f8b + .word 0x80000030 + .word 0x1f841bc + .word 0x80000030 + .word 0x1f848bd + .word 0x80000030 + .word 0x1f850be + .word 0x80000030 + .word 0x1e05e8b + .word 0x819e1bbc + .word 0x1e1f4aa + .word 0x1f72939 + .word 0x26b59b + .word 0x800007bf + .word 0x1c7b59b + .word 0x8035067c + .word 0x2ff + .word 0x81c0d73e + .word 0x2ff + .word 0x80000030 + .word 0x1d291ff + .word 0x80000030 + .word 0x20f1bf + .word 0x1fd293a + .word 0x25addb + .word 0x80000030 + .word 0x1c0f1fc + .word 0x80000030 + .word 0x1e0140b + .word 0x80000030 + .word 0x1e7b595 + .word 0x80000030 + .word 0x20bdd7 + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x238416 + .word 0x80000030 + .word 0x1f6b17c + .word 0x800007bf + .word 0x370747 + .word 0x40000036 + .word 0x25bdd0 + .word 0x80060232 + .word 0x238411 + .word 0x50000815 + .word 0x2ff + .word 0x1fa2935 + .word 0x2ff + .word 0x52006813 + .word 0x238c43 + .word 0x26fdf7df + .word 0x2ff + .word 0xb0c73dd + .word 0x2ff + .word 0x52000810 + .word 0x2ff + .word 0x26ff7df7 + .word 0x2ff + .word 0xa8573dd + .word 0x2ff + .word 0x5200080d + .word 0x2ff + .word 0x26ffbefb + .word 0x2ff + .word 0x90b03dc + .word 0x2ff + .word 0x5200080a + .word 0x2ff + .word 0x26ffdf7d + .word 0x2ff + .word 0xa4873dd + .word 0x2ff + .word 0x52000807 + .word 0x2ff + .word 0x26ffefbe + .word 0x2ff + .word 0x800b2af1 + .word 0x2ff + .word 0x52000804 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x58005802 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x800e7072 + .word 0x2ff + .word 0x80000030 + .word 0x9ce71b + .word 0x80000030 + .word 0x2701be + .word 0x80000030 + .word 0x27b1cc + .word 0x80000030 + .word 0x1f1897d + .word 0x1f82922 + .word 0x1e0d69c + .word 0x3e8a840 + .word 0x1fc61bc + .word 0x3e8b804 + .word 0x1fc68bd + .word 0x3e88805 + .word 0x1fc70be + .word 0x3e89842 + .word 0x1e07f8b + .word 0x3e8d003 + .word 0x1f841bc + .word 0x80000030 + .word 0x1f848bd + .word 0x80000030 + .word 0x1f850be + .word 0x80000030 + .word 0x1e05e8b + .word 0x819e1bbc + .word 0x1e1f4aa + .word 0x1f72939 + .word 0x1c0dd5b + .word 0x8035067c + .word 0x26b59b + .word 0x81c0d73e + .word 0x1c7b59b + .word 0x800841b2 + .word 0x1d291ff + .word 0x80000030 + .word 0x20f1bf + .word 0x80000030 + .word 0x25addb + .word 0x800c5374 + .word 0x1c0f1fc + .word 0x2403ffff + .word 0x1e0140b + .word 0x800c6330 + .word 0x1e7b595 + .word 0x1fd293a + .word 0x20bdd7 + .word 0x80000030 + .word 0x2ff + .word 0x800d0875 + .word 0x238416 + .word 0x80000030 + .word 0x1f6b17c + .word 0x80000030 + .word 0x370747 + .word 0x80000030 + .word 0x25bdd0 + .word 0x80000030 + .word 0x238411 + .word 0x80000030 + .word 0x2ff + .word 0x50000813 + .word 0x2ff + .word 0x1fb291d + .word 0x2ff + .word 0x52006811 + .word 0x238403 + .word 0x26fdf7df + .word 0x2ff + .word 0xb0073dd + .word 0x2ff + .word 0x5200080e + .word 0x2ff + .word 0x26ff7df7 + .word 0x2ff + .word 0xa8573dd + .word 0x2ff + .word 0x5200080b + .word 0x2ff + .word 0x26ffbefb + .word 0x2ff + .word 0xa4873dd + .word 0x2ff + .word 0x52000808 + .word 0x2ff + .word 0x26ffdf7d + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x52000805 + .word 0x2ff + .word 0x26ffefbe + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x52000802 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x800e7072 + .word 0x2ff + .word 0x80000030 + .word 0x9def5b + .word 0x80000030 + .word 0x2701be + .word 0x80000030 + .word 0x27b9cc + .word 0x80000030 + .word 0x1f0817d + .word 0x1f9293d + .word 0x1e0dedc + .word 0x3e8a03d + .word 0x1fd61bc + .word 0x3e8b001 + .word 0x1fd68bd + .word 0x3e88002 + .word 0x1fd70be + .word 0x3e8903f + .word 0x1e07fcb + .word 0x3e8d800 + .word 0x1f941bc + .word 0x80000030 + .word 0x1f948bd + .word 0x800528f2 + .word 0x1f950be + .word 0x80000030 + .word 0x1e05ecb + .word 0x819f1bbc + .word 0x1e1fcea + .word 0x1f6291e + .word 0x1c0d51b + .word 0x8034067c + .word 0x26bddb + .word 0x81c0df3e + .word 0x1c7bddb + .word 0x80000030 + .word 0x1d399ff + .word 0x80000030 + .word 0x20f9bf + .word 0x80000030 + .word 0x25a59b + .word 0x80000030 + .word 0x1c0f9fc + .word 0x2403ffff + .word 0x1e0144b + .word 0x80000030 + .word 0x1e7bdd5 + .word 0x1fc291f + .word 0x20b597 + .word 0x80000030 + .word 0x2ff + .word 0x800d0875 + .word 0x238c56 + .word 0x80000030 + .word 0x1f7b97c + .word 0x80000030 + .word 0x360707 + .word 0x80000030 + .word 0x25b590 + .word 0x5a003799 + .word 0x238c51 + .word 0x800637f2 + .word 0x2ff + .word 0x50000813 + .word 0x2ff + .word 0x1fa2935 + .word 0x2ff + .word 0x52006811 + .word 0x238c43 + .word 0x26fdf7df + .word 0x2ff + .word 0xb0c73dd + .word 0x2ff + .word 0x5200080e + .word 0x2ff + .word 0x26ff7df7 + .word 0x2ff + .word 0xa8573dd + .word 0x2ff + .word 0x5200080b + .word 0x2ff + .word 0x26ffbefb + .word 0x2ff + .word 0xa4873dd + .word 0x2ff + .word 0x52000808 + .word 0x2ff + .word 0x26ffdf7d + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x52000805 + .word 0x2ff + .word 0x26ffefbe + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x52000802 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x800e7072 + .word 0x2ff + .word 0xa8e03dc + .word 0x1f1897d + .word 0x3e8a840 + .word 0x1e0d69c + .word 0x3e8b804 + .word 0x2ff + .word 0x3e88805 + .word 0x2ff + .word 0x3e89842 + .word 0x2ff + .word 0x3e8d003 + .word 0x2ff + .word 0x48007800 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x1e503bb + .word 0x2ff + .word 0x80060172 + .word 0x2ff + .word 0x1f44000 + .word 0x2ff + .word 0x1f54003 + .word 0x2ff + .word 0x1f24006 + .word 0x2ff + .word 0x1f34009 + .word 0x1e002d3 + .word 0x81f403bc + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x81f503bc + .word 0x180a51c + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x81f203bc + .word 0x180ad5c + .word 0x80000030 + .word 0x1e5a2be + .word 0x80000030 + .word 0x1e0350b + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x1e5aabe + .word 0x80000030 + .word 0x1e0354b + .word 0x80000030 + .word 0x2ff + .word 0x81f303bc + .word 0x180949c + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x3c8a000 + .word 0x1809cdc + .word 0x3c8a803 + .word 0x1e592be + .word 0x80000030 + .word 0x1e0348b + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x1e59abe + .word 0x80084332 + .word 0x1e034cb + .word 0x800637f2 + .word 0x2ff + .word 0x3c897fa + .word 0x2ff + .word 0x5a0037d7 + .word 0x2ff + .word 0x3c89ffd + .word 0x2ff + .word 0x48007800 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80060132 + .word 0x2ff + .word 0x1ec4000 + .word 0x2ff + .word 0x1ed4003 + .word 0x2ff + .word 0x1ee4006 + .word 0x2ff + .word 0x1ef4009 + .word 0x2ff + .word 0x1f847c5 + .word 0x2ff + .word 0x1f947c8 + .word 0x2ff + .word 0x1fa47cb + .word 0x2ff + .word 0x1fb47ce + .word 0x2ff + .word 0x1fc47c3 + .word 0x2ff + .word 0x1fd47c6 + .word 0x2ff + .word 0x1fe47c9 + .word 0x2ff + .word 0x1ff47cc + .word 0x2ff + .word 0x80084332 + .word 0x1fc631a + .word 0x3e8c7f6 + .word 0x1fd6b5a + .word 0x3e8cff9 + .word 0x1fe739a + .word 0x3e8d7fc + .word 0x1ff7bda + .word 0x3e8dfff + .word 0x2ff + .word 0x3e867f4 + .word 0x2ff + .word 0x3e86ff7 + .word 0x2ff + .word 0x3e877fa + .word 0x2ff + .word 0x3e87ffd + .word 0x2ff + .word 0x5a0037ea + .word 0x2ff + .word 0x800637f2 + .word 0x2ff + .word 0x48007800 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x1ff03b8 + .word 0x2ff + .word 0x100a032b + .word 0x2ff + .word 0x800e77f2 + .word 0x2ff + .word 0x800851f2 + .word 0x2ff + .word 0x90c73dd + .word 0x2ff + .word 0x88573dd + .word 0x2ff + .word 0x5200600e + .word 0x2ff + .word 0x84373dd + .word 0x2ff + .word 0x1f4291a + .word 0x2ff + .word 0x1f52935 + .word 0x2ff + .word 0x1f2291d + .word 0x2ff + .word 0x1f61ffb + .word 0x2ff + .word 0x1f71ffe + .word 0x2ff + .word 0x1f01801 + .word 0x2ff + .word 0x1e81837 + .word 0x2ff + .word 0x1e9183a + .word 0x2ff + .word 0x1ea183d + .word 0x2ff + .word 0x1fc1839 + .word 0x2ff + .word 0x1fd183c + .word 0x2ff + .word 0x4000000d + .word 0x2ff + .word 0x1fe183f + .word 0x2ff + .word 0x1f42932 + .word 0x2ff + .word 0x1f5291a + .word 0x2ff + .word 0x1f22935 + .word 0x2ff + .word 0x1f61ffe + .word 0x2ff + .word 0x1f71801 + .word 0x2ff + .word 0x1f01804 + .word 0x2ff + .word 0x1e8183a + .word 0x2ff + .word 0x1e9183d + .word 0x2ff + .word 0x1ea1840 + .word 0x2ff + .word 0x1fc183c + .word 0x2ff + .word 0x1fd183f + .word 0x2ff + .word 0x1fe1842 + .word 0x2ff + .word 0x3e8a000 + .word 0x1f6b13c + .word 0x3e8a803 + .word 0x1f7b93c + .word 0x3e89006 + .word 0x1f0813c + .word 0x3e8a009 + .word 0x2ff + .word 0x3e8b001 + .word 0x2ff + .word 0x3e8b804 + .word 0x2ff + .word 0x3e88007 + .word 0x2ff + .word 0x3e8b00a + .word 0x2ff + .word 0x3e8e002 + .word 0x2ff + .word 0x3e8e805 + .word 0x2ff + .word 0x3e8f008 + .word 0x2ff + .word 0x3e8e00b + .word 0x2ff + .word 0x1f603d1 + .word 0x2ff + .word 0x3e84023 + .word 0x2ff + .word 0x3e84826 + .word 0x2ff + .word 0x3e85029 + .word 0x2ff + .word 0x3e8402c + .word 0x2ff + .word 0x3e8b024 + .word 0x2ff + .word 0x3e8b027 + .word 0x2ff + .word 0x3e8b02a + .word 0x2ff + .word 0x3e8b02d + .word 0x2ff + .word 0x3e8e025 + .word 0x2ff + .word 0x3e8e828 + .word 0x2ff + .word 0x3e8f02b + .word 0x2ff + .word 0x3e8e02e + .word 0x2ff + .word 0x1e703c0 + .word 0x1e0368b + .word 0x800040f5 + .word 0x2ff + .word 0x420d004c + .word 0x2ff + .word 0x800500f2 + .word 0x2ff + .word 0x5000281a + .word 0x2ff + .word 0x11062800 + .word 0x2ff + .word 0x420d001e + .word 0x2ff + .word 0x11063000 + .word 0x2ff + .word 0x100803d2 + .word 0x2ff + .word 0x800056fc + .word 0x2ff + .word 0x1e703c1 + .word 0x2ff + .word 0x800046fc + .word 0x2ff + .word 0x800851b2 + .word 0x2ff + .word 0x3ea3806 + .word 0x2ff + .word 0xb065006 + .word 0x2ff + .word 0x800046fc + .word 0x2ff + .word 0x100803d6 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x800046fc + .word 0x2ff + .word 0x1008502a + .word 0x2ff + .word 0x1003502a + .word 0x2ff + .word 0x800500f2 + .word 0x2ff + .word 0x420d0038 + .word 0x2ff + .word 0x1e703c2 + .word 0x2ff + .word 0x11062800 + .word 0x2ff + .word 0x420d000b + .word 0x2ff + .word 0x11063000 + .word 0x2ff + .word 0x10085023 + .word 0x2ff + .word 0x1001069c + .word 0x2ff + .word 0x800046fc + .word 0x2ff + .word 0x800a0ab1 + .word 0x2ff + .word 0x5a0077a8 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x1e81000 + .word 0x2ff + .word 0x1e91001 + .word 0x2ff + .word 0x48007800 + .word 0x2ff + .word 0x1ea1002 + .word 0x2ff + .word 0x3e83fff + .word 0x2ff + .word 0xb0647ff + .word 0x2ff + .word 0x81f8437c + .word 0x2ff + .word 0x81fb437c + .word 0x2ff + .word 0x81f5437c + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x81f503bc + .word 0x1ffad6a + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x1c0ad5c + .word 0x80000030 + .word 0x1e0c61c + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x1e2ad68 + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x23ad51 + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x23ad56 + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x1fbd97c + .word 0x80000030 + .word 0x1f5a97d + .word 0x80000030 + .word 0x2ff + .word 0x3e8c7fd + .word 0x2ff + .word 0x3e8dffe + .word 0x2ff + .word 0x3e8afff + .word 0x2ff + .word 0x80052ff2 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x52002fdb + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x48006800 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80001935 + .word 0x2ff + .word 0x1f51802 + .word 0x2ff + .word 0x800029b5 + .word 0x2ff + .word 0x1f81800 + .word 0x2ff + .word 0x1fb1801 + .word 0x2ff + .word 0x800318f2 + .word 0x1d5a9ff + .word 0x1f61802 + .word 0x2ff + .word 0x1f91800 + .word 0x2ff + .word 0x1fc1801 + .word 0x2ff + .word 0x800318f2 + .word 0x2ff + .word 0x80000030 + .word 0x1d6b1ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x26fff7df + .word 0x2ff + .word 0x520008b0 + .word 0x2ff + .word 0x24000020 + .word 0x2ff + .word 0x520008b0 + .word 0x2ff + .word 0x24000800 + .word 0x2ff + .word 0x520008c1 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x81e4c37d + .word 0x2ff + .word 0x81e4db7d + .word 0x2ff + .word 0x81e4ab7d + .word 0x2ff + .word 0x81f8cb3c + .word 0x2ff + .word 0x80052ff2 + .word 0x2ff + .word 0x81fbe33c + .word 0x2ff + .word 0x52002fea + .word 0x2ff + .word 0x81f5b33c + .word 0x2ff + .word 0x1f84000 + .word 0x2ff + .word 0x1fb4001 + .word 0x2ff + .word 0x1f54002 + .word 0x2ff + .word 0x800040f5 + .word 0x2ff + .word 0x81e4c37d + .word 0x2ff + .word 0x81e4db7d + .word 0x2ff + .word 0x81e4ab7d + .word 0x2ff + .word 0x50003099 + .word 0x2ff + .word 0x80003175 + .word 0x2ff + .word 0x80001935 + .word 0x2ff + .word 0x1f51802 + .word 0x2ff + .word 0x800029b5 + .word 0x2ff + .word 0x1f81800 + .word 0x2ff + .word 0x1fb1801 + .word 0x2ff + .word 0x800318f2 + .word 0x1d5a9ff + .word 0x1f61802 + .word 0x2ff + .word 0x1f91800 + .word 0x2ff + .word 0x1fc1801 + .word 0x2ff + .word 0x800318f2 + .word 0x2ff + .word 0x80000030 + .word 0x1d6b1ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x26fffdf7 + .word 0x2ff + .word 0x520008b0 + .word 0x2ff + .word 0x24000008 + .word 0x2ff + .word 0x520008b0 + .word 0x2ff + .word 0x24000200 + .word 0x2ff + .word 0x520008c1 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x81e4c37d + .word 0x2ff + .word 0x81e4db7d + .word 0x2ff + .word 0x81e4ab7d + .word 0x2ff + .word 0x81f8cb3c + .word 0x2ff + .word 0x80052ff2 + .word 0x2ff + .word 0x81fbe33c + .word 0x2ff + .word 0x52002fea + .word 0x2ff + .word 0x81f5b33c + .word 0x2ff + .word 0x1f84000 + .word 0x2ff + .word 0x1fb4001 + .word 0x2ff + .word 0x1f54002 + .word 0x2ff + .word 0x800040f5 + .word 0x2ff + .word 0x81e4c37d + .word 0x2ff + .word 0x81e4db7d + .word 0x2ff + .word 0x81e4ab7d + .word 0x2ff + .word 0x50003073 + .word 0x2ff + .word 0x80003175 + .word 0x2ff + .word 0x80001935 + .word 0x2ff + .word 0x1f51802 + .word 0x2ff + .word 0x800029b5 + .word 0x2ff + .word 0x1f81800 + .word 0x2ff + .word 0x1fb1801 + .word 0x2ff + .word 0x800318f2 + .word 0x1d5a9ff + .word 0x1f61802 + .word 0x2ff + .word 0x1f91800 + .word 0x2ff + .word 0x1fc1801 + .word 0x2ff + .word 0x800318f2 + .word 0x2ff + .word 0x80000030 + .word 0x1d6b1ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x26fffefb + .word 0x2ff + .word 0x520008b0 + .word 0x2ff + .word 0x24000004 + .word 0x2ff + .word 0x520008b0 + .word 0x2ff + .word 0x24000100 + .word 0x2ff + .word 0x520008c1 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x81e4c37d + .word 0x2ff + .word 0x81e4db7d + .word 0x2ff + .word 0x81e4ab7d + .word 0x2ff + .word 0x81f8cb3c + .word 0x2ff + .word 0x80052ff2 + .word 0x2ff + .word 0x81fbe33c + .word 0x2ff + .word 0x52002fea + .word 0x2ff + .word 0x81f5b33c + .word 0x2ff + .word 0x1f84000 + .word 0x2ff + .word 0x1fb4001 + .word 0x2ff + .word 0x1f54002 + .word 0x2ff + .word 0x800040f5 + .word 0x2ff + .word 0x81e4c37d + .word 0x2ff + .word 0x81e4db7d + .word 0x2ff + .word 0x81e4ab7d + .word 0x2ff + .word 0x5000304d + .word 0x2ff + .word 0x80003175 + .word 0x2ff + .word 0x80001935 + .word 0x2ff + .word 0x1f51802 + .word 0x2ff + .word 0x800029b5 + .word 0x2ff + .word 0x1f81800 + .word 0x2ff + .word 0x1fb1801 + .word 0x2ff + .word 0x800318f2 + .word 0x1d5a9ff + .word 0x1f61802 + .word 0x2ff + .word 0x1f91800 + .word 0x2ff + .word 0x1fc1801 + .word 0x2ff + .word 0x800318f2 + .word 0x2ff + .word 0x80000030 + .word 0x1d6b1ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x26ffff7d + .word 0x2ff + .word 0x520008b0 + .word 0x2ff + .word 0x24000002 + .word 0x2ff + .word 0x520008b0 + .word 0x2ff + .word 0x24000080 + .word 0x2ff + .word 0x520008c1 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x81e4c37d + .word 0x2ff + .word 0x81e4db7d + .word 0x2ff + .word 0x81e4ab7d + .word 0x2ff + .word 0x81f8cb3c + .word 0x2ff + .word 0x80052ff2 + .word 0x2ff + .word 0x81fbe33c + .word 0x2ff + .word 0x52002fea + .word 0x2ff + .word 0x81f5b33c + .word 0x2ff + .word 0x1f84000 + .word 0x2ff + .word 0x1fb4001 + .word 0x2ff + .word 0x1f54002 + .word 0x2ff + .word 0x800040f5 + .word 0x2ff + .word 0x81e4c37d + .word 0x2ff + .word 0x81e4db7d + .word 0x2ff + .word 0x81e4ab7d + .word 0x2ff + .word 0x50003027 + .word 0x2ff + .word 0x80003175 + .word 0x2ff + .word 0x80001935 + .word 0x2ff + .word 0x1f51802 + .word 0x2ff + .word 0x800029b5 + .word 0x2ff + .word 0x1f81800 + .word 0x2ff + .word 0x1fb1801 + .word 0x2ff + .word 0x800318f2 + .word 0x1d5a9ff + .word 0x1f61802 + .word 0x2ff + .word 0x1f91800 + .word 0x2ff + .word 0x1fc1801 + .word 0x2ff + .word 0x800318f2 + .word 0x2ff + .word 0x80000030 + .word 0x1d6b1ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x26ffffbe + .word 0x2ff + .word 0x520008b0 + .word 0x2ff + .word 0x24000001 + .word 0x2ff + .word 0x520008b0 + .word 0x2ff + .word 0x24000040 + .word 0x2ff + .word 0x520008c1 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x81e4c37d + .word 0x2ff + .word 0x81e4db7d + .word 0x2ff + .word 0x81e4ab7d + .word 0x2ff + .word 0x81f8cb3c + .word 0x2ff + .word 0x80052ff2 + .word 0x2ff + .word 0x81fbe33c + .word 0x2ff + .word 0x52002fea + .word 0x2ff + .word 0x81f5b33c + .word 0x2ff + .word 0x1f84000 + .word 0x2ff + .word 0x1fb4001 + .word 0x2ff + .word 0x1f54002 + .word 0x2ff + .word 0x800040f5 + .word 0x2ff + .word 0x81e4c37d + .word 0x2ff + .word 0x81e4db7d + .word 0x2ff + .word 0x81e4ab7d + .word 0x2ff + .word 0x50003001 + .word 0x2ff + .word 0x80003175 + .word 0x2ff + .word 0x48006800 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x40000757 + .word 0x2ff + .word 0x800637f2 + .word 0x2ff + .word 0x81e4c37d + .word 0x1f5b5ec + .word 0x81e4db7d + .word 0x1f8ceac + .word 0x81e4ab7d + .word 0x1fbe76c + .word 0x50032752 + .word 0x2ff + .word 0x80000030 + .word 0x37bf82 + .word 0x80000030 + .word 0x55af83 + .word 0x81def3bc + .word 0x2ff + .word 0x800003bf + .word 0x2ff + .word 0x80000030 + .word 0x1e0d69c + .word 0x80000030 + .word 0x1e0ef5c + .word 0x80000030 + .word 0x1e0bddc + .word 0x80000030 + .word 0x1fac6ac + .word 0x80000030 + .word 0x1fddf6c + .word 0x80000030 + .word 0x1f7adec + .word 0x80063072 + .word 0x2ff + .word 0x81e4d37d + .word 0x2ff + .word 0x81e4eb7d + .word 0x2ff + .word 0x40000744 + .word 0x2ff + .word 0x81e4bb7d + .word 0x2ff + .word 0x80000030 + .word 0x1f6adec + .word 0x80000030 + .word 0x1f9c6ac + .word 0x80000030 + .word 0x1fcdf6c + .word 0x80000030 + .word 0x37bf82 + .word 0x80000030 + .word 0x56b783 + .word 0x81def3bc + .word 0x2ff + .word 0x800003bf + .word 0x2ff + .word 0x80000030 + .word 0x1e0d69c + .word 0x80000030 + .word 0x1e0ef5c + .word 0x80000030 + .word 0x1e0bddc + .word 0x80000030 + .word 0x1faceac + .word 0x80000030 + .word 0x1fde76c + .word 0x80000030 + .word 0x1f7b5ec + .word 0x81e4d37d + .word 0x2ff + .word 0x81e4eb7d + .word 0x2ff + .word 0x40000733 + .word 0x2ff + .word 0x81e4bb7d + .word 0x2ff + .word 0x40000757 + .word 0x2ff + .word 0x800637f2 + .word 0x2ff + .word 0x81e4c37d + .word 0x1f5b5ec + .word 0x81e4db7d + .word 0x1f8ceac + .word 0x81e4ab7d + .word 0x1fbe76c + .word 0x50032752 + .word 0x2ff + .word 0x80000030 + .word 0x37bf81 + .word 0x80000030 + .word 0x95af83 + .word 0x81bef3bc + .word 0x2ff + .word 0x800003bf + .word 0x2ff + .word 0x80000030 + .word 0x1e0d69c + .word 0x80000030 + .word 0x1e0ef5c + .word 0x80000030 + .word 0x1e0bddc + .word 0x80000030 + .word 0x1fac6ac + .word 0x80000030 + .word 0x1fddf6c + .word 0x80000030 + .word 0x1f7adec + .word 0x80063072 + .word 0x2ff + .word 0x81e4d37d + .word 0x2ff + .word 0x81e4eb7d + .word 0x2ff + .word 0x40000744 + .word 0x2ff + .word 0x81e4bb7d + .word 0x2ff + .word 0x80000030 + .word 0x1f6adec + .word 0x80000030 + .word 0x1f9c6ac + .word 0x80000030 + .word 0x1fcdf6c + .word 0x80000030 + .word 0x37bf81 + .word 0x80000030 + .word 0x96b783 + .word 0x81bef3bc + .word 0x2ff + .word 0x800003bf + .word 0x2ff + .word 0x80000030 + .word 0x1e0d69c + .word 0x80000030 + .word 0x1e0ef5c + .word 0x80000030 + .word 0x1e0bddc + .word 0x80000030 + .word 0x1faceac + .word 0x80000030 + .word 0x1fde76c + .word 0x80000030 + .word 0x1f7b5ec + .word 0x81e4d37d + .word 0x2ff + .word 0x81e4eb7d + .word 0x2ff + .word 0x40000733 + .word 0x2ff + .word 0x81e4bb7d + .word 0x2ff + .word 0x40000757 + .word 0x2ff + .word 0x800637f2 + .word 0x2ff + .word 0x81e4c37d + .word 0x1f5b5ec + .word 0x81e4db7d + .word 0x1f8ceac + .word 0x81e4ab7d + .word 0x1fbe76c + .word 0x50032752 + .word 0x2ff + .word 0x80000030 + .word 0x37bf85 + .word 0x80000030 + .word 0x95af87 + .word 0x81bef3bc + .word 0x2ff + .word 0x800003bf + .word 0x2ff + .word 0x80000030 + .word 0x1e0d69c + .word 0x80000030 + .word 0x1e0ef5c + .word 0x80000030 + .word 0x1e0bddc + .word 0x80000030 + .word 0x1fac6a8 + .word 0x80000030 + .word 0x1fddf68 + .word 0x80000030 + .word 0x1f7ade8 + .word 0x80063072 + .word 0x2ff + .word 0x81e4d37d + .word 0x2ff + .word 0x81e4eb7d + .word 0x2ff + .word 0x40000744 + .word 0x2ff + .word 0x81e4bb7d + .word 0x2ff + .word 0x80000030 + .word 0x1f6adec + .word 0x80000030 + .word 0x1f9c6ac + .word 0x80000030 + .word 0x1fcdf6c + .word 0x80000030 + .word 0x37bf85 + .word 0x80000030 + .word 0x96b787 + .word 0x81bef3bc + .word 0x2ff + .word 0x800003bf + .word 0x2ff + .word 0x80000030 + .word 0x1e0d69c + .word 0x80000030 + .word 0x1e0ef5c + .word 0x80000030 + .word 0x1e0bddc + .word 0x80000030 + .word 0x1facea8 + .word 0x80000030 + .word 0x1fde768 + .word 0x80000030 + .word 0x1f7b5e8 + .word 0x81e4d37d + .word 0x2ff + .word 0x81e4eb7d + .word 0x2ff + .word 0x40000733 + .word 0x2ff + .word 0x81e4bb7d + .word 0x2ff + .word 0x40000757 + .word 0x2ff + .word 0x800637f2 + .word 0x2ff + .word 0x81e4c37d + .word 0x1f5b5ec + .word 0x81e4db7d + .word 0x1f8ceac + .word 0x81e4ab7d + .word 0x1fbe76c + .word 0x50032752 + .word 0x2ff + .word 0x80000030 + .word 0x37bf80 + .word 0x80000030 + .word 0x115af83 + .word 0x819ef3bc + .word 0x2ff + .word 0x800003bf + .word 0x2ff + .word 0x80000030 + .word 0x1e0d69c + .word 0x80000030 + .word 0x1e0ef5c + .word 0x80000030 + .word 0x1e0bddc + .word 0x80000030 + .word 0x1fac6ac + .word 0x80000030 + .word 0x1fddf6c + .word 0x80000030 + .word 0x1f7adec + .word 0x80063072 + .word 0x2ff + .word 0x81e4d37d + .word 0x2ff + .word 0x81e4eb7d + .word 0x2ff + .word 0x40000744 + .word 0x2ff + .word 0x81e4bb7d + .word 0x2ff + .word 0x80000030 + .word 0x1f6adec + .word 0x80000030 + .word 0x1f9c6ac + .word 0x80000030 + .word 0x1fcdf6c + .word 0x80000030 + .word 0x37bf80 + .word 0x80000030 + .word 0x116b783 + .word 0x819ef3bc + .word 0x2ff + .word 0x800003bf + .word 0x2ff + .word 0x80000030 + .word 0x1e0d69c + .word 0x80000030 + .word 0x1e0ef5c + .word 0x80000030 + .word 0x1e0bddc + .word 0x80000030 + .word 0x1faceac + .word 0x80000030 + .word 0x1fde76c + .word 0x80000030 + .word 0x1f7b5ec + .word 0x81e4d37d + .word 0x2ff + .word 0x81e4eb7d + .word 0x2ff + .word 0x40000733 + .word 0x2ff + .word 0x81e4bb7d + .word 0x2ff + .word 0x40000757 + .word 0x2ff + .word 0x800637f2 + .word 0x2ff + .word 0x81e4c37d + .word 0x1f5b5ec + .word 0x81e4db7d + .word 0x1f8ceac + .word 0x81e4ab7d + .word 0x1fbe76c + .word 0x50032752 + .word 0x2ff + .word 0x80000030 + .word 0x37bf84 + .word 0x80000030 + .word 0x115af87 + .word 0x819ef3bc + .word 0x2ff + .word 0x800003bf + .word 0x2ff + .word 0x80000030 + .word 0x1e0d69c + .word 0x80000030 + .word 0x1e0ef5c + .word 0x80000030 + .word 0x1e0bddc + .word 0x80000030 + .word 0x1fac6a8 + .word 0x80000030 + .word 0x1fddf68 + .word 0x80000030 + .word 0x1f7ade8 + .word 0x80063072 + .word 0x2ff + .word 0x81e4d37d + .word 0x2ff + .word 0x81e4eb7d + .word 0x2ff + .word 0x40000744 + .word 0x2ff + .word 0x81e4bb7d + .word 0x2ff + .word 0x80000030 + .word 0x1f6adec + .word 0x80000030 + .word 0x1f9c6ac + .word 0x80000030 + .word 0x1fcdf6c + .word 0x80000030 + .word 0x37bf84 + .word 0x80000030 + .word 0x116b787 + .word 0x819ef3bc + .word 0x2ff + .word 0x800003bf + .word 0x2ff + .word 0x80000030 + .word 0x1e0d69c + .word 0x80000030 + .word 0x1e0ef5c + .word 0x80000030 + .word 0x1e0bddc + .word 0x80000030 + .word 0x1facea8 + .word 0x80000030 + .word 0x1fde768 + .word 0x80000030 + .word 0x1f7b5e8 + .word 0x81e4d37d + .word 0x2ff + .word 0x81e4eb7d + .word 0x2ff + .word 0x40000733 + .word 0x2ff + .word 0x81e4bb7d + .word 0x2ff \ No newline at end of file diff --git a/test/decompiler/vu_reference/jak2/ocean-texture-result.txt b/test/decompiler/vu_reference/jak2/ocean-texture-result.txt new file mode 100644 index 0000000000..d235618c46 --- /dev/null +++ b/test/decompiler/vu_reference/jak2/ocean-texture-result.txt @@ -0,0 +1,132 @@ + lq. vf00, 124(vi00) | addx. vf00, vf00, vf00 + lq. vf00, 62(vi00) | addx. vf00, vf00, vf00 + b L1 | nop + nop | nop + b L2 | nop + nop | nop + nop | nop :e + nop | nop +L1: + lq.xyzw vf14, 988(vi00) | maxw.xyzw vf01, vf00, vf00 + lq.xyzw vf02, 989(vi00) | nop + lq.xyzw vf03, 986(vi00) | nop + lq.xyzw vf04, 987(vi00) | nop + lq.xyzw vf05, 985(vi00) | nop + lq.xyzw vf06, 991(vi00) | nop + lq.xyzw vf07, 990(vi00) | nop + iaddiu vi11, vi00, 0x80 | nop + mtir vi08, vf03.x | nop + mtir vi09, vf03.x | nop + mr32.xyzw vf03, vf03 | nop + xtop vi05 | nop + mtir vi06, vf04.x | nop + bal vi12, L3 | nop + mr32.xyzw vf04, vf04 | nop + mtir vi06, vf04.x | nop + bal vi12, L3 | nop + mr32.xyzw vf04, vf04 | nop + mtir vi03, vf04.x | nop + bal vi12, L5 | nop + mtir vi04, vf04.y | nop + mtir vi06, vf04.x | nop + bal vi12, L3 | nop + mr32.xyzw vf04, vf04 | nop + mtir vi03, vf04.x | nop + bal vi12, L5 | nop + mtir vi04, vf04.y | nop + nop | nop :e + nop | nop +L2: + xtop vi05 | nop + mtir vi06, vf04.x | nop + bal vi12, L3 | nop + mr32.xyzw vf04, vf04 | nop + mtir vi03, vf04.x | nop + bal vi12, L5 | nop + mtir vi04, vf04.y | nop + mtir vi06, vf04.x | nop + bal vi12, L3 | nop + mr32.xyzw vf04, vf04 | nop + mtir vi03, vf04.x | nop + bal vi12, L5 | nop + mtir vi04, vf04.y | nop + mtir vi06, vf04.x | nop + bal vi12, L3 | nop + mr32.xyzw vf04, vf04 | nop + mtir vi03, vf04.x | nop + bal vi12, L5 | nop + mtir vi04, vf04.y | nop + nop | nop :e + nop | nop +L3: + ior vi07, vi06, vi00 | nop + move.xyzw vf15, vf14 | nop + iaddi vi01, vi00, 0x8 | nop + lq.xyzw vf24, 1(vi05) | mulw.xyzw vf20, vf15, vf00 + lq.xyzw vf26, 5(vi05) | mulw.xyzw vf21, vf15, vf00 + nop | mulw.xyzw vf22, vf15, vf00 + nop | mulw.xyzw vf23, vf15, vf00 + nop | addx.x vf21, vf21, vf02 + nop | addy.x vf22, vf22, vf02 +L4: + nop | addz.x vf23, vf23, vf02 + nop | addw.x vf15, vf15, vf02 + sq.xyzw vf20, 2(vi06) | mulx.x vf28, vf01, vf24 + sq.xyzw vf21, 5(vi06) | muly.x vf29, vf01, vf24 + sq.xyzw vf22, 8(vi06) | mulz.x vf30, vf01, vf24 + sq.xyzw vf23, 11(vi06) | mulw.x vf31, vf01, vf24 + lq.xyzw vf16, 0(vi05) | mulx.y vf28, vf01, vf26 + lq.xyzw vf17, 2(vi05) | muly.y vf29, vf01, vf26 + lq.xyzw vf18, 4(vi05) | mulz.y vf30, vf01, vf26 + lq.xyzw vf19, 6(vi05) | mulw.y vf31, vf01, vf26 + iaddi vi05, vi05, 0x8 | ftoi0.xyzw vf16, vf16 + nop | ftoi0.xyzw vf17, vf17 + nop | ftoi0.xyzw vf18, vf18 + iaddi vi01, vi01, -0x1 | ftoi0.xyzw vf19, vf19 + sq.xyzw vf16, 1(vi06) | add.xyzw vf28, vf28, vf07 + sq.xyzw vf17, 4(vi06) | add.xyzw vf29, vf29, vf07 + sq.xyzw vf18, 7(vi06) | add.xyzw vf30, vf30, vf07 + sq.xyzw vf19, 10(vi06) | add.xyzw vf31, vf31, vf07 + lq.xyzw vf24, 1(vi05) | sub.zw vf28, vf01, vf00 + lq.xyzw vf26, 5(vi05) | sub.zw vf29, vf01, vf00 + nop | sub.zw vf30, vf01, vf00 + nop | sub.zw vf31, vf01, vf00 + sq.xyzw vf28, 0(vi06) | mulw.xyzw vf20, vf15, vf00 + sq.xyzw vf29, 3(vi06) | mulw.xyzw vf21, vf15, vf00 + sq.xyzw vf30, 6(vi06) | mulw.xyzw vf22, vf15, vf00 + sq.xyzw vf31, 9(vi06) | mulw.xyzw vf23, vf15, vf00 + ibgtz vi01, L4 | addx.x vf21, vf21, vf02 + iaddi vi06, vi06, 0xc | addy.x vf22, vf22, vf02 + lq.xyzw vf28, 0(vi07) | addx.y vf14, vf14, vf02 + lq.xyzw vf16, 1(vi07) | nop + sq.xyzw vf20, 2(vi06) | nop + sq.xyzw vf28, 0(vi06) | nop + jr vi12 | nop + sq.xyzw vf16, 1(vi06) | nop +L5: + iaddiu vi01, vi00, 0x21 | nop + sq.xyzw vf05, 0(vi08) | nop + iaddi vi08, vi08, 0x1 | nop +L6: + iaddi vi01, vi01, -0x1 | nop + lq.xyzw vf20, 2(vi03) | nop + lq.xyzw vf21, 2(vi04) | nop + lq.xyzw vf28, 0(vi03) | nop + lq.xyzw vf16, 1(vi03) | nop + lq.xyzw vf29, 0(vi04) | ftoi4.xyzw vf20, vf20 + lq.xyzw vf17, 1(vi04) | ftoi4.xyzw vf21, vf21 + sq.xyzw vf28, 0(vi08) | nop + sq.xyzw vf16, 1(vi08) | nop + sq.xyzw vf20, 2(vi08) | nop + sq.xyzw vf29, 3(vi08) | nop + sq.xyzw vf17, 4(vi08) | nop + sq.xyzw vf21, 5(vi08) | nop + iaddi vi03, vi03, 0x3 | nop + iaddi vi04, vi04, 0x3 | nop + ibgtz vi01, L6 | nop + iaddi vi08, vi08, 0x6 | nop + xgkick vi09 | nop + mtir vi08, vf03.x | nop + mtir vi09, vf03.x | nop + jr vi12 | nop + mr32.xyzw vf03, vf03 | nop diff --git a/test/decompiler/vu_reference/jak2/ocean-texture.txt b/test/decompiler/vu_reference/jak2/ocean-texture.txt new file mode 100644 index 0000000000..d6e3a3a34d --- /dev/null +++ b/test/decompiler/vu_reference/jak2/ocean-texture.txt @@ -0,0 +1,252 @@ + .word 0x7c + .word 0x0 + .word 0x3e + .word 0x0 + .word 0x40000005 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x40000020 + .word 0x2ff + .word 0x80000030 + .word 0x2ff + .word 0x80000030 + .word 0x400002ff + .word 0x80000030 + .word 0x2ff + .word 0x1ee03dc + .word 0x1e00053 + .word 0x1e203dd + .word 0x2ff + .word 0x1e303da + .word 0x2ff + .word 0x1e403db + .word 0x2ff + .word 0x1e503d9 + .word 0x2ff + .word 0x1e603df + .word 0x2ff + .word 0x1e703de + .word 0x2ff + .word 0x100b0080 + .word 0x2ff + .word 0x80081bfc + .word 0x2ff + .word 0x80091bfc + .word 0x2ff + .word 0x81e31b3d + .word 0x2ff + .word 0x800506bc + .word 0x2ff + .word 0x800623fc + .word 0x2ff + .word 0x420c0024 + .word 0x2ff + .word 0x81e4233d + .word 0x2ff + .word 0x800623fc + .word 0x2ff + .word 0x420c0021 + .word 0x2ff + .word 0x81e4233d + .word 0x2ff + .word 0x800323fc + .word 0x2ff + .word 0x420c0049 + .word 0x2ff + .word 0x802423fc + .word 0x2ff + .word 0x800623fc + .word 0x2ff + .word 0x420c001b + .word 0x2ff + .word 0x81e4233d + .word 0x2ff + .word 0x800323fc + .word 0x2ff + .word 0x420c0043 + .word 0x2ff + .word 0x802423fc + .word 0x2ff + .word 0x80000030 + .word 0x400002ff + .word 0x80000030 + .word 0x2ff + .word 0x800506bc + .word 0x2ff + .word 0x800623fc + .word 0x2ff + .word 0x420c0012 + .word 0x2ff + .word 0x81e4233d + .word 0x2ff + .word 0x800323fc + .word 0x2ff + .word 0x420c003a + .word 0x2ff + .word 0x802423fc + .word 0x2ff + .word 0x800623fc + .word 0x2ff + .word 0x420c000c + .word 0x2ff + .word 0x81e4233d + .word 0x2ff + .word 0x800323fc + .word 0x2ff + .word 0x420c0034 + .word 0x2ff + .word 0x802423fc + .word 0x2ff + .word 0x800623fc + .word 0x2ff + .word 0x420c0006 + .word 0x2ff + .word 0x81e4233d + .word 0x2ff + .word 0x800323fc + .word 0x2ff + .word 0x420c002e + .word 0x2ff + .word 0x802423fc + .word 0x2ff + .word 0x80000030 + .word 0x400002ff + .word 0x80000030 + .word 0x2ff + .word 0x800031f5 + .word 0x2ff + .word 0x81ef733c + .word 0x2ff + .word 0x80010232 + .word 0x2ff + .word 0x1f82801 + .word 0x1e07d1b + .word 0x1fa2805 + .word 0x1e07d5b + .word 0x80000030 + .word 0x1e07d9b + .word 0x80000030 + .word 0x1e07ddb + .word 0x80000030 + .word 0x102ad40 + .word 0x80000030 + .word 0x102b581 + .word 0x80000030 + .word 0x102bdc2 + .word 0x80000030 + .word 0x1027bc3 + .word 0x3e6a002 + .word 0x1180f18 + .word 0x3e6a805 + .word 0x1180f59 + .word 0x3e6b008 + .word 0x1180f9a + .word 0x3e6b80b + .word 0x1180fdb + .word 0x1f02800 + .word 0x9a0f18 + .word 0x1f12802 + .word 0x9a0f59 + .word 0x1f22804 + .word 0x9a0f9a + .word 0x1f32806 + .word 0x9a0fdb + .word 0x80052a32 + .word 0x1f0817c + .word 0x80000030 + .word 0x1f1897c + .word 0x80000030 + .word 0x1f2917c + .word 0x80010ff2 + .word 0x1f3997c + .word 0x3e68001 + .word 0x1e7e728 + .word 0x3e68804 + .word 0x1e7ef68 + .word 0x3e69007 + .word 0x1e7f7a8 + .word 0x3e6980a + .word 0x1e7ffe8 + .word 0x1f82801 + .word 0x600f2c + .word 0x1fa2805 + .word 0x600f6c + .word 0x80000030 + .word 0x600fac + .word 0x80000030 + .word 0x600fec + .word 0x3e6e000 + .word 0x1e07d1b + .word 0x3e6e803 + .word 0x1e07d5b + .word 0x3e6f006 + .word 0x1e07d9b + .word 0x3e6f809 + .word 0x1e07ddb + .word 0x5a000fe5 + .word 0x102ad40 + .word 0x80063332 + .word 0x102b581 + .word 0x1fc3800 + .word 0x827380 + .word 0x1f03801 + .word 0x2ff + .word 0x3e6a002 + .word 0x2ff + .word 0x3e6e000 + .word 0x2ff + .word 0x48006000 + .word 0x2ff + .word 0x3e68001 + .word 0x2ff + .word 0x10010021 + .word 0x2ff + .word 0x3e82800 + .word 0x2ff + .word 0x80084072 + .word 0x2ff + .word 0x80010ff2 + .word 0x2ff + .word 0x1f41802 + .word 0x2ff + .word 0x1f52002 + .word 0x2ff + .word 0x1fc1800 + .word 0x2ff + .word 0x1f01801 + .word 0x2ff + .word 0x1fd2000 + .word 0x1f4a17d + .word 0x1f12001 + .word 0x1f5a97d + .word 0x3e8e000 + .word 0x2ff + .word 0x3e88001 + .word 0x2ff + .word 0x3e8a002 + .word 0x2ff + .word 0x3e8e803 + .word 0x2ff + .word 0x3e88804 + .word 0x2ff + .word 0x3e8a805 + .word 0x2ff + .word 0x800318f2 + .word 0x2ff + .word 0x800420f2 + .word 0x2ff + .word 0x5a000ff0 + .word 0x2ff + .word 0x800841b2 + .word 0x2ff + .word 0x80004efc + .word 0x2ff + .word 0x80081bfc + .word 0x2ff + .word 0x80091bfc + .word 0x2ff + .word 0x48006000 + .word 0x2ff + .word 0x81e31b3d + .word 0x2ff \ No newline at end of file diff --git a/test/decompiler/vu_reference/jak2/ocean-vu0-result.txt b/test/decompiler/vu_reference/jak2/ocean-vu0-result.txt new file mode 100644 index 0000000000..726b4cdc43 --- /dev/null +++ b/test/decompiler/vu_reference/jak2/ocean-vu0-result.txt @@ -0,0 +1,64 @@ + nop | mulay.x ACC, vf12, vf02 + nop | mulax.z ACC, vf12, vf03 + nop | msubx.xz vf24, vf12, vf02 + nop | mulaz.x ACC, vf12, vf02 + nop | mulay.z ACC, vf12, vf03 + nop | msuby.xz vf25, vf12, vf02 + nop | mulaw.x ACC, vf12, vf02 + nop | mulaz.z ACC, vf12, vf03 + nop | msubz.xz vf26, vf12, vf02 + nop | mulax.x ACC, vf12, vf04 + nop | mulaw.z ACC, vf12, vf03 + nop | msubw.xz vf27, vf12, vf02 + nop | mul.xz vf28, vf24, vf24 + nop | mul.xz vf29, vf25, vf25 + nop | mul.xz vf30, vf26, vf26 + nop | mul.xz vf31, vf27, vf27 + nop | subx.y vf24, vf01, vf28 + nop | subx.y vf25, vf01, vf29 + nop | subx.y vf26, vf01, vf30 + nop | subx.y vf27, vf01, vf31 + nop | subz.y vf24, vf24, vf28 + nop | subz.y vf25, vf25, vf29 + nop | subz.y vf26, vf26, vf30 + nop | subz.y vf27, vf27, vf31 + nop | mulx.w vf24, vf01, vf02 + nop | muly.w vf25, vf01, vf02 + nop | mulz.w vf26, vf01, vf02 + nop | mulw.w vf27, vf01, vf02 + nop | mulax.xyzw ACC, vf05, vf24 + nop | madday.xyzw ACC, vf06, vf24 + nop | maddz.xyz vf16, vf07, vf24 + nop | mulax.xyzw ACC, vf05, vf25 + nop | madday.xyzw ACC, vf06, vf25 + nop | maddz.xyz vf17, vf07, vf25 + nop | mulax.xyzw ACC, vf05, vf26 + nop | madday.xyzw ACC, vf06, vf26 + nop | maddz.xyz vf18, vf07, vf26 + nop | mulax.xyzw ACC, vf05, vf27 + nop | madday.xyzw ACC, vf06, vf27 + nop | maddz.xyz vf19, vf07, vf27 + nop | maxx.xyz vf16, vf16, vf00 + nop | maxx.xyz vf17, vf17, vf00 + nop | maxx.xyz vf18, vf18, vf00 + nop | maxx.xyz vf19, vf19, vf00 + nop | mula.xyzw ACC, vf01, vf11 + nop | maddax.xyzw ACC, vf08, vf16 + nop | madday.xyzw ACC, vf09, vf16 + nop | maddz.xyzw vf20, vf10, vf16 + nop | mula.xyzw ACC, vf01, vf11 + nop | maddax.xyzw ACC, vf08, vf17 + nop | madday.xyzw ACC, vf09, vf17 + nop | maddz.xyzw vf21, vf10, vf17 + nop | mula.xyzw ACC, vf01, vf11 + nop | maddax.xyzw ACC, vf08, vf18 + nop | madday.xyzw ACC, vf09, vf18 + nop | maddz.xyzw vf22, vf10, vf18 + nop | mula.xyzw ACC, vf01, vf11 + nop | maddax.xyzw ACC, vf08, vf19 + nop | madday.xyzw ACC, vf09, vf19 + nop | maddz.xyzw vf23, vf10, vf19 + nop | miniy.xyzw vf20, vf20, vf12 + nop | miniy.xyzw vf21, vf21, vf12 + nop | miniy.xyzw vf22, vf22, vf12 :e + nop | miniy.xyzw vf23, vf23, vf12 diff --git a/test/decompiler/vu_reference/jak2/ocean-vu0.txt b/test/decompiler/vu_reference/jak2/ocean-vu0.txt new file mode 100644 index 0000000000..dc93f8940b --- /dev/null +++ b/test/decompiler/vu_reference/jak2/ocean-vu0.txt @@ -0,0 +1,128 @@ + .word 0x80000030 + .word 0x10261bd + .word 0x80000030 + .word 0x4361bc + .word 0x80000030 + .word 0x142660c + .word 0x80000030 + .word 0x10261be + .word 0x80000030 + .word 0x4361bd + .word 0x80000030 + .word 0x142664d + .word 0x80000030 + .word 0x10261bf + .word 0x80000030 + .word 0x4361be + .word 0x80000030 + .word 0x142668e + .word 0x80000030 + .word 0x10461bc + .word 0x80000030 + .word 0x4361bf + .word 0x80000030 + .word 0x14266cf + .word 0x80000030 + .word 0x158c72a + .word 0x80000030 + .word 0x159cf6a + .word 0x80000030 + .word 0x15ad7aa + .word 0x80000030 + .word 0x15bdfea + .word 0x80000030 + .word 0x9c0e04 + .word 0x80000030 + .word 0x9d0e44 + .word 0x80000030 + .word 0x9e0e84 + .word 0x80000030 + .word 0x9f0ec4 + .word 0x80000030 + .word 0x9cc606 + .word 0x80000030 + .word 0x9dce46 + .word 0x80000030 + .word 0x9ed686 + .word 0x80000030 + .word 0x9fdec6 + .word 0x80000030 + .word 0x220e18 + .word 0x80000030 + .word 0x220e59 + .word 0x80000030 + .word 0x220e9a + .word 0x80000030 + .word 0x220edb + .word 0x80000030 + .word 0x1f829bc + .word 0x80000030 + .word 0x1f830bd + .word 0x80000030 + .word 0x1d83c0a + .word 0x80000030 + .word 0x1f929bc + .word 0x80000030 + .word 0x1f930bd + .word 0x80000030 + .word 0x1d93c4a + .word 0x80000030 + .word 0x1fa29bc + .word 0x80000030 + .word 0x1fa30bd + .word 0x80000030 + .word 0x1da3c8a + .word 0x80000030 + .word 0x1fb29bc + .word 0x80000030 + .word 0x1fb30bd + .word 0x80000030 + .word 0x1db3cca + .word 0x80000030 + .word 0x1c08410 + .word 0x80000030 + .word 0x1c08c50 + .word 0x80000030 + .word 0x1c09490 + .word 0x80000030 + .word 0x1c09cd0 + .word 0x80000030 + .word 0x1eb0abe + .word 0x80000030 + .word 0x1f040bc + .word 0x80000030 + .word 0x1f048bd + .word 0x80000030 + .word 0x1f0550a + .word 0x80000030 + .word 0x1eb0abe + .word 0x80000030 + .word 0x1f140bc + .word 0x80000030 + .word 0x1f148bd + .word 0x80000030 + .word 0x1f1554a + .word 0x80000030 + .word 0x1eb0abe + .word 0x80000030 + .word 0x1f240bc + .word 0x80000030 + .word 0x1f248bd + .word 0x80000030 + .word 0x1f2558a + .word 0x80000030 + .word 0x1eb0abe + .word 0x80000030 + .word 0x1f340bc + .word 0x80000030 + .word 0x1f348bd + .word 0x80000030 + .word 0x1f355ca + .word 0x80000030 + .word 0x1eca515 + .word 0x80000030 + .word 0x1ecad55 + .word 0x80000030 + .word 0x41ecb595 + .word 0x80000030 + .word 0x1ecbdd5 \ No newline at end of file diff --git a/test/offline/config/jak2/config.jsonc b/test/offline/config/jak2/config.jsonc index 93f6d27d82..fbc27f7416 100644 --- a/test/offline/config/jak2/config.jsonc +++ b/test/offline/config/jak2/config.jsonc @@ -168,6 +168,7 @@ "(method 16 level)", "unpack-comp-lzo", // asm mods "update-time-of-day", + "close-sky-buffer", // asm "(method 29 level)", "(method 9 level)", "level-update-after-load", "(method 25 level)", "(method 9 level)", "(method 12 level)", "(method 10 level)", @@ -175,7 +176,20 @@ // collide asm "(method 11 collide-mesh)", "(method 9 collide-mesh-cache)", "(method 13 collide-mesh)", "(method 10 collide-mesh)", - "(method 3 game-save)" + "(method 3 game-save)", + + // unused test/debug functions in ocean + "test-seq-read", + "test-worst-read", + "test-seq-write", + "test-worst-write", + "test-to-spr", + "test-from-spr", + "test-to-from-spr", + "(method 18 ocean)", + "check-normals", // ocean-texture + + "i-hopefully-will-never-exist-dont-add-anything-after-me-please" ], "skip_compile_states": {