decomp: ocean, ocean-mid, ocean-near, ocean-texture, ocean-transition, ocean-vu0 (#1994)

The VU programs for the ocean renderer have changed a bit and
`ocean-texture` has a bunch of new stuff, otherwise things are
relatively similar to Jak 1.

This is the first time I used mips2c and I'm not sure I did it 100%
right, so that should be double-checked.
This commit is contained in:
Hat Kid
2022-10-31 00:09:35 +01:00
committed by GitHub
parent 811b5de6cb
commit 88eb45ab52
45 changed files with 21609 additions and 344 deletions
+106 -103
View File
@@ -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 ;;
+14 -3
View File
@@ -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": {},
+4
View File
@@ -485,5 +485,9 @@
["L1158", "vector"],
["L1222", "uint64", true],
["L1223", "uint64", true]
],
"ocean-texture": [
["L55", "vector4w"],
["L56", "vector"]
]
}
+36 -1
View File
@@ -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": []
}
+444 -1
View File
@@ -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": []
}
+49
View File
@@ -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"]
}
}
+2
View File
@@ -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
+383
View File
@@ -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
+861
View File
@@ -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
+12 -1
View File
@@ -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<std::unordered_map<std::string, std::vector<void (*)()>>> 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) {
@@ -104,7 +104,7 @@
f0-1
)
(else
(ocean-method-11 *ocean* arg0 #t)
(get-height *ocean* arg0 #t)
)
)
)
+2 -2
View File
@@ -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
+5 -5
View File
@@ -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)
)
)
)
@@ -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)
@@ -16394,7 +16394,3 @@
#xd7ee0411
)
)
+91 -91
View File
@@ -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)
File diff suppressed because it is too large Load Diff
@@ -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)
)
File diff suppressed because it is too large Load Diff
@@ -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)
)
@@ -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
File diff suppressed because it is too large Load Diff
@@ -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)
)
+41 -1
View File
@@ -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)
+2 -2
View File
@@ -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
+3 -29
View File
@@ -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))
+1 -1
View File
@@ -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)
+161 -91
View File
@@ -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
File diff suppressed because it is too large Load Diff
+745
View File
@@ -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)
)
File diff suppressed because it is too large Load Diff
+845
View File
@@ -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)
)
+18
View File
@@ -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.
File diff suppressed because it is too large Load Diff
@@ -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)
)
+28
View File
@@ -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);
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -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
@@ -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
@@ -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
@@ -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
+15 -1
View File
@@ -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": {