This commit is contained in:
Hat Kid
2026-04-15 02:29:58 +02:00
parent 21a148f9ea
commit c8653b2d51
256 changed files with 18768 additions and 22290 deletions
+3
View File
@@ -1772,6 +1772,9 @@
)
)
(defmacro square (x)
`(* ,x ,x)
)
(import "goal_src/jak2/engine/data/tpages.gc")
(import "goal_src/jak2/engine/data/textures.gc")
+14 -28
View File
@@ -1029,7 +1029,6 @@
;; WARN: Return type mismatch int vs none.
(defmethod init-enemy-behaviour-and-stats! ((this enemy) (arg0 enemy-info))
"Initializes a bunch of enemy fields related to how they should react, how many hitpoints they should have, etc"
(local-vars (sv-16 res-tag))
(when (coin-flip? this)
(let ((a0-2 (-> this node-list data 2)))
(set! (-> a0-2 param0) (the-as (function cspace transformq none) cspace<-parented-matrix-joint-flip-z!))
@@ -1096,8 +1095,9 @@
)
(reset-to-collide-spec (-> this focus) (the-as collide-spec a1-5))
)
(set! sv-16 (new 'static 'res-tag))
(let ((v1-49 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16))))
(let* ((sv-16 (new 'static 'res-tag))
(v1-49 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))
)
(cond
((and v1-49 (nonzero? (-> sv-16 elt-count)))
(set! (-> this actor-group) (the-as (pointer actor-group) v1-49))
@@ -1606,7 +1606,7 @@
(defmethod general-event-handler ((this enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
"Handles various events for the enemy
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
(local-vars (s5-5 rgbaf) (sv-432 process) (sv-448 event-message-block))
(local-vars (s5-5 rgbaf))
(cond
((= arg2 'track)
(and (nonzero? (-> this hit-points))
@@ -1669,14 +1669,12 @@
((and (logtest? (-> this enemy-flags) (enemy-flag vulnerable))
(not (logtest? (-> this focus-status) (focus-status grabbed)))
)
(let* ((s1-0 this)
(s0-0 (method-of-object s1-0 set-incoming-attack-info))
)
(set! sv-432 arg0)
(set! sv-448 arg3)
(let ((a3-3 (get-penetrate-using-from-attack-event (the-as process-drawable arg0) arg3)))
(s0-0 s1-0 sv-432 sv-448 a3-3 (the-as attack-info s2-0))
)
(set-incoming-attack-info
this
arg0
arg3
(get-penetrate-using-from-attack-event (the-as process-drawable arg0) arg3)
(the-as attack-info s2-0)
)
(send-event (ppointer->process (-> this parent)) 'child-hit)
0
@@ -3067,11 +3065,7 @@
)
(((knocked-type knocked-type-5))
(let* ((f1-2 (vector-vector-xz-distance-squared (target-pos 0) (-> this root trans)))
(f0-26 1.0)
(f2-0 61440.0)
(f1-3 (fmin f1-2 (* f2-0 f2-0)))
(f2-3 61440.0)
(f30-5 (* (- f0-26 (/ f1-3 (* f2-3 f2-3))) (rnd-float-range this 0.8 1.0)))
(f30-5 (* (- 1.0 (/ (fmin f1-2 (square 61440.0)) (square 61440.0))) (rnd-float-range this 0.8 1.0)))
)
(vector-float*! arg0 arg0 (lerp (-> s5-0 knocked-red-vxz-lo) (-> s5-0 knocked-red-vxz-hi) f30-5))
(set! (-> arg0 y) (lerp (-> s5-0 knocked-red-vy-lo) (-> s5-0 knocked-red-vy-hi) f30-5))
@@ -3079,11 +3073,7 @@
)
(((knocked-type knocked-type-6))
(let* ((f1-5 (vector-vector-xz-distance-squared (target-pos 0) (-> this root trans)))
(f0-34 1.0)
(f2-6 122880.0)
(f1-6 (fmin f1-5 (* f2-6 f2-6)))
(f2-9 122880.0)
(f30-7 (* (- f0-34 (/ f1-6 (* f2-9 f2-9))) (rnd-float-range this 0.8 1.0)))
(f30-7 (* (- 1.0 (/ (fmin f1-5 (square 122880.0)) (square 122880.0))) (rnd-float-range this 0.8 1.0)))
)
(vector-float*! arg0 arg0 (lerp (-> s5-0 knocked-blue-vxz-lo) (-> s5-0 knocked-blue-vxz-hi) f30-7))
(cond
@@ -3196,12 +3186,8 @@
(or (>= (-> arg0 on-surface-count) 3)
(and (logtest? (-> gp-0 status) (collide-status on-ground)) (>= 16384.0 (-> gp-0 transv y)))
(and (>= (-> arg0 move-count) 3)
(let ((f0-1 40.96))
(>= (* f0-1 f0-1) (vector-vector-distance-squared (-> gp-0 trans-old) (-> gp-0 trans-old-old)))
)
(let ((f0-4 40.96))
(>= (* f0-4 f0-4) (vector-vector-distance-squared (-> gp-0 trans-old-old) (-> gp-0 trans-old-old-old)))
)
(>= (square 40.96) (vector-vector-distance-squared (-> gp-0 trans-old) (-> gp-0 trans-old-old)))
(>= (square 40.96) (vector-vector-distance-squared (-> gp-0 trans-old-old) (-> gp-0 trans-old-old-old)))
)
)
)
+52 -55
View File
@@ -362,15 +362,6 @@
;; definition for method 28 of type joint-exploder
;; INFO: Used lq/sq
(defmethod adjust-bbox-for-limits-along-axis ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int))
(local-vars
(sv-16 int)
(sv-32 int)
(sv-48 joint-exploder-joint)
(sv-64 int)
(sv-80 joint-exploder-joint)
(sv-96 int)
(sv-112 joint-exploder-joint)
)
(let ((s5-0 (the-as joint-exploder-list #f)))
(let ((v1-0 1))
(until (= v1-0 5)
@@ -394,22 +385,23 @@
)
)
(set! (-> arg0 bbox-valid?) #f)
(let ((s2-0 (-> this joints)))
(set! sv-32 (-> arg0 head))
(let ((s1-0 0)
(s0-0 0)
)
(let ((v1-7 arg1))
(cond
((zero? v1-7)
(let ((f30-0 (* 0.5 (+ (-> arg0 bbox min x) (-> arg0 bbox max x)))))
(while (>= sv-32 0)
(set! sv-48 (-> s2-0 joint sv-32))
(let ((s2-0 (-> this joints))
(sv-32 (-> arg0 head))
(s1-0 0)
(s0-0 0)
)
(let ((v1-7 arg1))
(cond
((zero? v1-7)
(let ((f30-0 (* 0.5 (+ (-> arg0 bbox min x) (-> arg0 bbox max x)))))
(while (>= sv-32 0)
(let ((sv-48 (-> s2-0 joint sv-32)))
(cond
((>= (-> sv-48 mat trans x) f30-0)
(set! sv-16 (remove-joint-from-list this arg0 sv-32))
(add-joint-to-list this s5-0 sv-32)
(set! sv-32 sv-16)
(let ((sv-16 (remove-joint-from-list this arg0 sv-32)))
(add-joint-to-list this s5-0 sv-32)
(set! sv-32 sv-16)
)
(update-bbox-for-joint this s5-0 sv-48)
(+! s0-0 1)
)
@@ -422,15 +414,17 @@
)
)
)
((= v1-7 1)
(let ((f30-1 (* 0.5 (+ (-> arg0 bbox min y) (-> arg0 bbox max y)))))
(while (>= sv-32 0)
(set! sv-80 (-> s2-0 joint sv-32))
)
((= v1-7 1)
(let ((f30-1 (* 0.5 (+ (-> arg0 bbox min y) (-> arg0 bbox max y)))))
(while (>= sv-32 0)
(let ((sv-80 (-> s2-0 joint sv-32)))
(cond
((>= (-> sv-80 mat trans y) f30-1)
(set! sv-64 (remove-joint-from-list this arg0 sv-32))
(add-joint-to-list this s5-0 sv-32)
(set! sv-32 sv-64)
(let ((sv-64 (remove-joint-from-list this arg0 sv-32)))
(add-joint-to-list this s5-0 sv-32)
(set! sv-32 sv-64)
)
(update-bbox-for-joint this s5-0 sv-80)
(+! s0-0 1)
)
@@ -443,15 +437,17 @@
)
)
)
((= v1-7 2)
(let ((f30-2 (* 0.5 (+ (-> arg0 bbox min z) (-> arg0 bbox max z)))))
(while (>= sv-32 0)
(set! sv-112 (-> s2-0 joint sv-32))
)
((= v1-7 2)
(let ((f30-2 (* 0.5 (+ (-> arg0 bbox min z) (-> arg0 bbox max z)))))
(while (>= sv-32 0)
(let ((sv-112 (-> s2-0 joint sv-32)))
(cond
((>= (-> sv-112 mat trans z) f30-2)
(set! sv-96 (remove-joint-from-list this arg0 sv-32))
(add-joint-to-list this s5-0 sv-32)
(set! sv-32 sv-96)
(let ((sv-96 (remove-joint-from-list this arg0 sv-32)))
(add-joint-to-list this s5-0 sv-32)
(set! sv-32 sv-96)
)
(update-bbox-for-joint this s5-0 sv-112)
(+! s0-0 1)
)
@@ -464,19 +460,19 @@
)
)
)
)
)
(cond
((zero? s0-0)
(final-adjust this arg0 arg1)
)
((zero? s1-0)
(if (not (-> s5-0 probeless?))
(final-adjust this s5-0 arg1)
)
)
)
)
(cond
((zero? s0-0)
(final-adjust this arg0 arg1)
)
((zero? s1-0)
(if (not (-> s5-0 probeless?))
(final-adjust this s5-0 arg1)
)
)
)
)
s5-0
)
@@ -486,14 +482,13 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch symbol vs int.
(defmethod final-adjust ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int))
(local-vars (sv-48 int) (sv-64 (inline-array joint-exploder-list)) (sv-80 joint-exploder-joint))
(set! (-> arg0 bbox-valid?) #f)
(let ((s3-0 (-> this joints))
(s2-0 (-> arg0 head))
)
(while (>= s2-0 0)
(set! sv-80 (-> s3-0 joint s2-0))
(let ((s1-0 (new 'stack-no-clear 'bounding-box))
(let ((sv-80 (-> s3-0 joint s2-0))
(s1-0 (new 'stack-no-clear 'bounding-box))
(s0-0 (-> arg0 bbox-valid?))
)
(set! (-> s1-0 min quad) (-> arg0 bbox min quad))
@@ -514,11 +509,13 @@
)
)
(when v1-8
(set! sv-48 (remove-joint-from-list this arg0 s2-0))
(set! sv-64 (-> this lists))
(add-joint-to-list this (-> sv-64 0) s2-0)
(set! s2-0 sv-48)
(update-bbox-for-joint this (-> sv-64 0) sv-80)
(let ((sv-48 (remove-joint-from-list this arg0 s2-0))
(sv-64 (-> this lists))
)
(add-joint-to-list this (-> sv-64 0) s2-0)
(set! s2-0 sv-48)
(update-bbox-for-joint this (-> sv-64 0) sv-80)
)
(set! (-> arg0 bbox-valid?) s0-0)
(set! (-> arg0 bbox min quad) (-> s1-0 min quad))
(set! (-> arg0 bbox max quad) (-> s1-0 max quad))
+351 -410
View File
@@ -9,22 +9,7 @@
;; ERROR: Unsupported inline assembly instruction kind - [madda.s f1, f4]
;; ERROR: Unsupported inline assembly instruction kind - [madd.s f0, f2, f5]
(defbehavior joint-mod-ik-callback process ((arg0 cspace) (arg1 transformq))
(local-vars
(f0-24 float)
(sv-736 vector)
(sv-752 vector)
(sv-768 vector)
(sv-784 vector)
(sv-800 (function quaternion vector vector quaternion))
(sv-816 quaternion)
(sv-832 vector)
(sv-848 vector)
(sv-864 vector)
(sv-880 vector)
(sv-896 vector)
(sv-912 quaternion)
(sv-928 quaternion)
)
(local-vars (f0-24 float))
(rlet ((acc :class vf)
(vf0 :class vf)
(vf4 :class vf)
@@ -88,9 +73,9 @@
(set! (-> a2-1 quad 2) a1-4)
(set! (-> a2-1 trans quad) a3-3)
)
(set! sv-752 (new 'stack-no-clear 'vector))
(set! sv-736 (new 'stack-no-clear 'vector))
(let ((s0-0 (new 'stack-no-clear 'vector))
(let ((sv-752 (new 'stack-no-clear 'vector))
(sv-736 (new 'stack-no-clear 'vector))
(s0-0 (new 'stack-no-clear 'vector))
(s1-0 (new 'stack-no-clear 'vector))
(s3-1 (new 'stack-no-clear 'vector))
)
@@ -136,142 +121,124 @@
)
)
)
(let ((s2-3 (vector-! (new 'stack-no-clear 'vector) sv-736 sv-752)))
(set! sv-784 (new 'stack-no-clear 'vector))
(let ((s2-3 (vector-! (new 'stack-no-clear 'vector) sv-736 sv-752))
(sv-784 (new 'stack-no-clear 'vector))
)
(.lvf vf4 (&-> s0-0 quad))
(.lvf vf5 (&-> sv-736 quad))
(.mov.vf.w vf6 vf0)
(.sub.vf.xyz vf6 vf4 vf5)
(.svf (&-> sv-784 quad) vf6)
(set! sv-832 (new 'stack-no-clear 'vector))
(let ((v1-49 sv-752))
(.lvf vf4 (&-> s0-0 quad))
(.lvf vf5 (&-> v1-49 quad))
)
(.mov.vf.w vf6 vf0)
(.sub.vf.xyz vf6 vf4 vf5)
(.svf (&-> sv-832 quad) vf6)
(let ((s0-1 (new 'stack-no-clear 'vector)))
(.lvf vf4 (&-> s1-0 quad))
(.lvf vf5 (&-> sv-752 quad))
(let ((sv-832 (new 'stack-no-clear 'vector)))
(let ((v1-49 sv-752))
(.lvf vf4 (&-> s0-0 quad))
(.lvf vf5 (&-> v1-49 quad))
)
(.mov.vf.w vf6 vf0)
(.sub.vf.xyz vf6 vf4 vf5)
(.svf (&-> s0-1 quad) vf6)
(set! sv-928 (new 'stack-no-clear 'quaternion))
(let ((s1-1 (new 'stack-no-clear 'quaternion)))
(let ((f26-0 (vector-length s2-3))
(f24-0 (vector-length sv-784))
(f30-1 (vector-length s0-1))
(.svf (&-> sv-832 quad) vf6)
(let ((s0-1 (new 'stack-no-clear 'vector)))
(.lvf vf4 (&-> s1-0 quad))
(.lvf vf5 (&-> sv-752 quad))
(.mov.vf.w vf6 vf0)
(.sub.vf.xyz vf6 vf4 vf5)
(.svf (&-> s0-1 quad) vf6)
(let ((sv-928 (new 'stack-no-clear 'quaternion))
(s1-1 (new 'stack-no-clear 'quaternion))
)
(set! sv-768 (new 'stack-no-clear 'vector))
(let* ((f28-0 (vector-vector-angle-safe s2-3 sv-784))
(f0-17 (fmax -1.0 (fmin 1.0 (/ (- (- (* f30-1 f30-1) (* f26-0 f26-0)) (* f24-0 f24-0)) (* 2.0 f24-0 f26-0)))))
(f26-1 (acos f0-17))
)
(cond
((= f28-0 0.0)
(set! (-> sv-768 quad) (-> s4-1 vector (-> gp-0 elbow-rotation-axis) quad))
(when (logtest? (-> gp-0 flags) (joint-mod-ik-flags elbow-rot-neg))
(vector-negate! sv-768 sv-768)
(set! f26-1 (- f26-1))
)
(set! (-> s3-1 quad) (-> s4-1 vector (-> gp-0 elbow-pole-vector-axis) quad))
(if (logtest? (-> gp-0 flags) (joint-mod-ik-flags elbow-trans-neg))
(vector-negate! s3-1 s3-1)
(let ((f26-0 (vector-length s2-3))
(f24-0 (vector-length sv-784))
(f30-1 (vector-length s0-1))
)
(let* ((sv-768 (new 'stack-no-clear 'vector))
(f28-0 (vector-vector-angle-safe s2-3 sv-784))
(f0-17 (fmax -1.0 (fmin 1.0 (/ (- (- (square f30-1) (square f26-0)) (square f24-0)) (* 2.0 f24-0 f26-0)))))
(f26-1 (acos f0-17))
)
)
(else
(vector-cross! sv-768 s2-3 sv-784)
(vector-!
s3-1
s2-3
(vector-float*! (new 'stack-no-clear 'vector) sv-832 (/ (vector-dot sv-832 s2-3) (vector-dot sv-832 sv-832)))
)
)
)
(vector-normalize! s3-1 1.0)
(vector-normalize! sv-768 1.0)
(let ((t9-14 quaternion-vector-angle!)
(a0-44 sv-928)
(a2-5 (- f26-1 f28-0))
)
(t9-14 a0-44 sv-768 a2-5)
)
)
(vector-orient-by-quat! sv-784 sv-784 sv-928)
(let ((v1-74 sv-832))
(let ((a0-46 s2-3))
(.mov.vf.w vf6 vf0)
(.lvf vf4 (&-> a0-46 quad))
)
(.lvf vf5 (&-> sv-784 quad))
(.add.vf.xyz vf6 vf4 vf5)
(.svf (&-> v1-74 quad) vf6)
)
(set! sv-800 quaternion-from-two-vectors!)
(set! sv-816 s1-1)
(let ((t9-16 vector-normalize-copy!)
(a0-48 (new 'stack-no-clear 'vector))
(a2-7 1.0)
)
(set! sv-848 (t9-16 a0-48 sv-832 a2-7))
)
(let ((a2-9 (vector-normalize-copy! (new 'stack-no-clear 'vector) s0-1 1.0)))
(sv-800 sv-816 sv-848 a2-9)
)
(vector-orient-by-quat! s2-3 s2-3 s1-1)
(set! sv-864 (vector-normalize-copy! (new 'stack-no-clear 'vector) s2-3 1.0))
(let* ((v1-76 (vector-normalize-copy! (new 'stack-no-clear 'vector) s0-1 1.0))
(f0-23 (-> sv-864 x))
(f1-16 (-> sv-864 y))
(f2-6 (-> sv-864 z))
(f3-5 (-> v1-76 x))
(f4-0 (-> v1-76 y))
(f5-0 (-> v1-76 z))
(cond
((= f28-0 0.0)
(set! (-> sv-768 quad) (-> s4-1 vector (-> gp-0 elbow-rotation-axis) quad))
(when (logtest? (-> gp-0 flags) (joint-mod-ik-flags elbow-rot-neg))
(vector-negate! sv-768 sv-768)
(set! f26-1 (- f26-1))
)
(set! (-> s3-1 quad) (-> s4-1 vector (-> gp-0 elbow-pole-vector-axis) quad))
(if (logtest? (-> gp-0 flags) (joint-mod-ik-flags elbow-trans-neg))
(vector-negate! s3-1 s3-1)
)
)
(.mula.s f0-23 f3-5)
(.madda.s f1-16 f4-0)
(.madd.s f0-24 f2-6 f5-0)
)
(let ((f0-26 (fabs f0-24)))
(if (< 0.98 f0-26)
(vector-orient-by-quat! s2-3 s3-1 s1-1)
(else
(vector-cross! sv-768 s2-3 sv-784)
(vector-!
s3-1
s2-3
(vector-float*! (new 'stack-no-clear 'vector) sv-832 (/ (vector-dot sv-832 s2-3) (vector-dot sv-832 sv-832)))
)
)
)
(vector-normalize! s3-1 1.0)
(vector-normalize! sv-768 1.0)
(quaternion-vector-angle! sv-928 sv-768 (- f26-1 f28-0))
)
(vector-orient-by-quat! sv-784 sv-784 sv-928)
(let ((v1-74 sv-832))
(let ((a0-46 s2-3))
(.mov.vf.w vf6 vf0)
(.lvf vf4 (&-> a0-46 quad))
)
(.lvf vf5 (&-> sv-784 quad))
(.add.vf.xyz vf6 vf4 vf5)
(.svf (&-> v1-74 quad) vf6)
)
(quaternion-from-two-vectors!
s1-1
(vector-normalize-copy! (new 'stack-no-clear 'vector) sv-832 1.0)
(vector-normalize-copy! (new 'stack-no-clear 'vector) s0-1 1.0)
)
(vector-orient-by-quat! s2-3 s2-3 s1-1)
(let* ((sv-864 (vector-normalize-copy! (new 'stack-no-clear 'vector) s2-3 1.0))
(v1-76 (vector-normalize-copy! (new 'stack-no-clear 'vector) s0-1 1.0))
)
(set! f0-24 (vector-dot sv-864 v1-76))
)
(let ((f0-26 (fabs f0-24)))
(if (< 0.98 f0-26)
(vector-orient-by-quat! s2-3 s3-1 s1-1)
)
)
(let ((sv-880 (new 'stack-no-clear 'vector))
(sv-896 (new 'stack-no-clear 'vector))
)
(new 'stack-no-clear 'vector)
(square f30-1)
(let ((sv-912 (new 'stack-no-clear 'quaternion)))
(vector-flatten! sv-880 s2-3 s0-1)
(vector-flatten! sv-896 s3-1 s0-1)
(vector-normalize! sv-880 1.0)
(vector-normalize! sv-896 1.0)
(quaternion-from-two-vectors! sv-912 sv-880 sv-896)
(quaternion*! s1-1 sv-912 s1-1)
)
)
)
(quaternion-pseudo-slerp! sv-928 *unity-quaternion* sv-928 (-> gp-0 blend))
(quaternion-pseudo-slerp! s1-1 *unity-quaternion* s1-1 (-> gp-0 blend))
(let ((a2-20 (quaternion->matrix (new 'stack-no-clear 'matrix) sv-928))
(gp-1 (new 'stack-no-clear 'vector))
)
(set! (-> gp-1 quad) (-> s4-1 trans quad))
(matrix*! s4-1 s4-1 a2-20)
(set! (-> s4-1 trans quad) (-> gp-1 quad))
)
(let ((s3-2 (quaternion->matrix (new 'stack-no-clear 'matrix) s1-1))
(a2-21 (matrix-4x4-inverse! (new 'stack-no-clear 'matrix) s5-0))
(gp-2 (new 'stack-no-clear 'matrix))
)
(set! (-> gp-2 quad 0) (-> s5-0 trans quad))
(matrix*! s4-1 s4-1 a2-21)
(matrix*! s5-0 s5-0 s3-2)
(set! (-> s5-0 trans quad) (-> gp-2 quad 0))
)
(set! sv-880 (new 'stack-no-clear 'vector))
(set! sv-896 (new 'stack-no-clear 'vector))
(new 'stack-no-clear 'vector)
(* f30-1 f30-1)
)
(set! sv-912 (new 'stack-no-clear 'quaternion))
(vector-flatten! sv-880 s2-3 s0-1)
(vector-flatten! sv-896 s3-1 s0-1)
(vector-normalize! sv-880 1.0)
(vector-normalize! sv-896 1.0)
(quaternion-from-two-vectors! sv-912 sv-880 sv-896)
(let ((t9-28 quaternion*!)
(a0-63 s1-1)
(a2-17 s1-1)
)
(t9-28 a0-63 sv-912 a2-17)
)
(quaternion-pseudo-slerp! sv-928 *unity-quaternion* sv-928 (-> gp-0 blend))
(quaternion-pseudo-slerp! s1-1 *unity-quaternion* s1-1 (-> gp-0 blend))
(let ((a2-20 (quaternion->matrix (new 'stack-no-clear 'matrix) sv-928))
(gp-1 (new 'stack-no-clear 'vector))
)
(set! (-> gp-1 quad) (-> s4-1 trans quad))
(matrix*! s4-1 s4-1 a2-20)
(set! (-> s4-1 trans quad) (-> gp-1 quad))
)
(let ((s3-2 (quaternion->matrix (new 'stack-no-clear 'matrix) s1-1))
(a2-21 (matrix-4x4-inverse! (new 'stack-no-clear 'matrix) s5-0))
(gp-2 (new 'stack-no-clear 'matrix))
)
(set! (-> gp-2 quad 0) (-> s5-0 trans quad))
(matrix*! s4-1 s4-1 a2-21)
(matrix*! s5-0 s5-0 s3-2)
(set! (-> s5-0 trans quad) (-> gp-2 quad 0))
)
)
)
@@ -328,149 +295,145 @@
;; definition for function real-joint-mod-gun-look-at-handler
;; WARN: Return type mismatch int vs none.
(defbehavior real-joint-mod-gun-look-at-handler process ((arg0 cspace) (arg1 transformq))
(local-vars
(sv-16 joint-mod)
(sv-64 vector)
(sv-96 quaternion)
(sv-160 vector)
(sv-164 vector)
(sv-168 vector)
(sv-172 symbol)
)
(set! sv-16 (the-as joint-mod (-> arg0 param1)))
(vector*! (-> arg1 scale) (-> arg1 scale) (-> sv-16 scale))
(cspace<-parented-transformq-joint! arg0 arg1)
(let ((s5-0 (-> arg0 bone transform)))
(let ((s4-0 (matrix->quat s5-0 (new 'stack-no-clear 'quaternion))))
(set! sv-64 (matrix->trans s5-0 (new 'stack-no-clear 'vector)))
(quaternion-rotate-y! s4-0 s4-0 (-> sv-16 twist z))
(set! sv-96 (quaternion-copy! (new 'stack-no-clear 'quaternion) s4-0))
(when (!= (-> sv-16 flex-blend) 0.0)
(set! sv-160 (vector-y-quaternion! (new 'stack-no-clear 'vector) sv-96))
(set! sv-164 (vector-z-quaternion! (new 'stack-no-clear 'vector) sv-96))
(set! sv-168 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> sv-16 target) sv-64) 1.0))
(set! sv-172 (the-as symbol #f))
(let* ((f30-0 (vector-y-angle sv-164))
(a0-14 (vector-flatten! (new 'stack-no-clear 'vector) sv-168 sv-160))
(f0-2 (vector-y-angle a0-14))
(f0-3 (deg-diff f30-0 f0-2))
(f30-1 (* f0-3 (-> sv-16 blend)))
)
(let ((f28-0 (fmax (fmin f30-1 (-> sv-16 twist-max y)) (- (-> sv-16 twist-max y)))))
(if (or (!= f30-1 f28-0) (= (-> sv-16 blend) 0.0))
(logclear! (-> sv-16 track-mode) (track-mode lock-on))
)
(cond
((or (< (-> sv-16 ignore-angle) (fabs f0-3))
(< (-> sv-16 twist-max w) (vector-vector-distance (-> sv-16 target) sv-64))
)
(set! f30-1 0.0)
(set! f28-0 0.0)
(set! sv-172 #t)
)
((< 5461.3335 (fabs (deg-diff f30-1 f28-0)))
(set! (-> sv-16 blend) 0.0001)
)
((< 182.04445 (fabs (deg-diff f30-1 f28-0)))
(logclear! (-> sv-16 track-mode) (track-mode track-x))
)
)
(if (or (and (logtest? (-> sv-16 track-mode) (track-mode track-y)) (= f30-1 f28-0))
(< (-> sv-16 twist-max y) (fabs (-> sv-16 twist y)))
)
(set! (-> sv-16 twist y)
(deg-seek (-> sv-16 twist y) f28-0 (* (fabs (deg-diff f28-0 (-> sv-16 twist y)))
(if (logtest? (-> sv-16 track-mode) (track-mode lock-on))
1.0
(-> sv-16 twist-speed-y)
)
(-> self clock time-adjust-ratio)
)
)
)
)
(let ((sv-16 (the-as joint-mod (-> arg0 param1))))
(vector*! (-> arg1 scale) (-> arg1 scale) (-> sv-16 scale))
(cspace<-parented-transformq-joint! arg0 arg1)
(let ((s5-0 (-> arg0 bone transform)))
(let ((s4-0 (matrix->quat s5-0 (new 'stack-no-clear 'quaternion)))
(sv-64 (matrix->trans s5-0 (new 'stack-no-clear 'vector)))
)
(if (and (< (fabs (deg-diff f30-1 (-> sv-16 twist y))) 728.1778) (and (not sv-172) (!= (-> sv-16 blend) 0.0)))
(logior! (-> sv-16 track-mode) (track-mode lock-on))
)
)
(quaternion-rotate-local-y! sv-96 sv-96 (-> sv-16 twist y))
(let* ((s3-1 (vector-x-quaternion! (new 'stack-no-clear 'vector) sv-96))
(f30-2 (vector-x-angle sv-164))
(s3-2 (vector-flatten! (new 'stack-no-clear 'vector) sv-168 s3-1))
(f0-24 (vector-x-angle s3-2))
(f30-3 (fmax
(fmin (* (- (deg-diff f30-2 f0-24)) (-> sv-16 blend)) (-> sv-16 twist-max x))
(- (-> sv-16 twist-max x))
)
(quaternion-rotate-y! s4-0 s4-0 (-> sv-16 twist z))
(let ((sv-96 (quaternion-copy! (new 'stack-no-clear 'quaternion) s4-0)))
(when (!= (-> sv-16 flex-blend) 0.0)
(let ((sv-160 (vector-y-quaternion! (new 'stack-no-clear 'vector) sv-96))
(sv-164 (vector-z-quaternion! (new 'stack-no-clear 'vector) sv-96))
(sv-168 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> sv-16 target) sv-64) 1.0))
)
(let* ((sv-172 (the-as symbol #f))
(f30-0 (vector-y-angle sv-164))
(a0-14 (vector-flatten! (new 'stack-no-clear 'vector) sv-168 sv-160))
(f0-2 (vector-y-angle a0-14))
(f0-3 (deg-diff f30-0 f0-2))
(f30-1 (* f0-3 (-> sv-16 blend)))
)
(let ((f28-0 (fmax (fmin f30-1 (-> sv-16 twist-max y)) (- (-> sv-16 twist-max y)))))
(if (or (!= f30-1 f28-0) (= (-> sv-16 blend) 0.0))
(logclear! (-> sv-16 track-mode) (track-mode lock-on))
)
(cond
((or (< (-> sv-16 ignore-angle) (fabs f0-3))
(< (-> sv-16 twist-max w) (vector-vector-distance (-> sv-16 target) sv-64))
)
(set! f30-1 0.0)
(set! f28-0 0.0)
(set! sv-172 #t)
)
((< 5461.3335 (fabs (deg-diff f30-1 f28-0)))
(set! (-> sv-16 blend) 0.0001)
)
((< 182.04445 (fabs (deg-diff f30-1 f28-0)))
(logclear! (-> sv-16 track-mode) (track-mode track-x))
)
)
(if (or (and (logtest? (-> sv-16 track-mode) (track-mode track-y)) (= f30-1 f28-0))
(< (-> sv-16 twist-max y) (fabs (-> sv-16 twist y)))
)
(set! (-> sv-16 twist y)
(deg-seek (-> sv-16 twist y) f28-0 (* (fabs (deg-diff f28-0 (-> sv-16 twist y)))
(if (logtest? (-> sv-16 track-mode) (track-mode lock-on))
1.0
(-> sv-16 twist-speed-y)
)
(-> self clock time-adjust-ratio)
)
)
)
)
)
(if (or (< (vector-dot s3-2 sv-164) 0.1)
(< (-> sv-16 twist-max z) (vector-vector-distance (-> sv-16 target) sv-64))
)
(set! f30-3 0.0)
)
(if (or (logtest? (-> sv-16 track-mode) (track-mode track-x))
(< (-> sv-16 twist-max x) (fabs (-> sv-16 twist x)))
)
(set! (-> sv-16 twist x)
(deg-seek (-> sv-16 twist x) f30-3 (* (fabs (deg-diff f30-3 (-> sv-16 twist x)))
(if (logtest? (-> sv-16 track-mode) (track-mode lock-on))
1.0
(-> sv-16 twist-speed-x)
)
(-> self clock time-adjust-ratio)
)
(if (and (< (fabs (deg-diff f30-1 (-> sv-16 twist y))) 728.1778) (and (not sv-172) (!= (-> sv-16 blend) 0.0)))
(logior! (-> sv-16 track-mode) (track-mode lock-on))
)
)
(quaternion-rotate-local-y! sv-96 sv-96 (-> sv-16 twist y))
(let* ((s3-1 (vector-x-quaternion! (new 'stack-no-clear 'vector) sv-96))
(f30-2 (vector-x-angle sv-164))
(s3-2 (vector-flatten! (new 'stack-no-clear 'vector) sv-168 s3-1))
(f0-24 (vector-x-angle s3-2))
(f30-3 (fmax
(fmin (* (- (deg-diff f30-2 f0-24)) (-> sv-16 blend)) (-> sv-16 twist-max x))
(- (-> sv-16 twist-max x))
)
)
)
(if (or (< (vector-dot s3-2 sv-164) 0.1)
(< (-> sv-16 twist-max z) (vector-vector-distance (-> sv-16 target) sv-64))
)
(set! f30-3 0.0)
)
(if (or (logtest? (-> sv-16 track-mode) (track-mode track-x))
(< (-> sv-16 twist-max x) (fabs (-> sv-16 twist x)))
)
(set! (-> sv-16 twist x)
(deg-seek (-> sv-16 twist x) f30-3 (* (fabs (deg-diff f30-3 (-> sv-16 twist x)))
(if (logtest? (-> sv-16 track-mode) (track-mode lock-on))
1.0
(-> sv-16 twist-speed-x)
)
(-> self clock time-adjust-ratio)
)
)
)
)
)
)
(quaternion-rotate-x! sv-96 sv-96 (-> sv-16 twist x))
(quaternion-normalize! (quaternion*! sv-96 sv-96 (-> sv-16 quat)))
)
(let ((a1-27 (quaternion-slerp! (new 'stack-no-clear 'quaternion) s4-0 sv-96 (-> sv-16 flex-blend))))
(matrix<-quat s5-0 a1-27)
)
)
)
(let ((f30-4 (-> sv-16 trans x))
(s4-1 (-> s5-0 vector 1))
(v1-97 (vector<-matrix! (new 'stack-no-clear 'vector) s5-0))
)
(let ((f0-43 (- f30-4 (-> v1-97 y))))
(if (< 614.4 (fabs f0-43))
(+! (-> sv-16 trans z) (* 8.0 f0-43))
)
)
(quaternion-rotate-x! sv-96 sv-96 (-> sv-16 twist x))
(quaternion-normalize! (quaternion*! sv-96 sv-96 (-> sv-16 quat)))
)
(let ((a1-27 (quaternion-slerp! (new 'stack-no-clear 'quaternion) s4-0 sv-96 (-> sv-16 flex-blend))))
(matrix<-quat s5-0 a1-27)
)
)
(let ((f30-4 (-> sv-16 trans x))
(s4-1 (-> s5-0 vector 1))
(v1-97 (vector<-matrix! (new 'stack-no-clear 'vector) s5-0))
)
(let ((f0-43 (- f30-4 (-> v1-97 y))))
(if (< 614.4 (fabs f0-43))
(+! (-> sv-16 trans z) (* 8.0 f0-43))
(+! (-> sv-16 trans z) (* -260.0 (seconds-per-frame) (-> sv-16 trans y)))
(let ((f0-48 (-> sv-16 trans y)))
(+! (-> sv-16 trans y) (* (-> sv-16 trans z) (seconds-per-frame)))
(set! (-> sv-16 trans y) (* 0.95 (-> sv-16 trans y)))
(when (< (* f0-48 (-> sv-16 trans y)) 0.0)
(set! (-> sv-16 trans y) 0.0)
(set! (-> sv-16 trans z) 0.0)
)
)
(+! (-> sv-16 trans z) (* -260.0 (seconds-per-frame) (-> sv-16 trans y)))
(let ((f0-48 (-> sv-16 trans y)))
(+! (-> sv-16 trans y) (* (-> sv-16 trans z) (seconds-per-frame)))
(set! (-> sv-16 trans y) (* 0.95 (-> sv-16 trans y)))
(when (< (* f0-48 (-> sv-16 trans y)) 0.0)
(set! (-> sv-16 trans y) 0.0)
(set! (-> sv-16 trans z) 0.0)
)
(cond
((< 409.6 (-> sv-16 trans y))
(set! (-> sv-16 trans y) 409.6)
(set! (-> sv-16 trans z) 0.0)
)
((< (-> sv-16 trans y) -409.6)
(set! (-> sv-16 trans y) -409.6)
(set! (-> sv-16 trans z) 0.0)
)
)
(set! (-> sv-16 trans x) (-> v1-97 y))
(let ((f0-60 (* (-> sv-16 trans y) (-> sv-16 flex-blend))))
(if (!= f0-60 0.0)
(vector+float*! (-> s5-0 trans) v1-97 s4-1 f0-60)
)
)
)
(cond
((< 409.6 (-> sv-16 trans y))
(set! (-> sv-16 trans y) 409.6)
(set! (-> sv-16 trans z) 0.0)
)
((< (-> sv-16 trans y) -409.6)
(set! (-> sv-16 trans y) -409.6)
(set! (-> sv-16 trans z) 0.0)
)
)
(set! (-> sv-16 trans x) (-> v1-97 y))
(let ((f0-60 (* (-> sv-16 trans y) (-> sv-16 flex-blend))))
(if (!= f0-60 0.0)
(vector+float*! (-> s5-0 trans) v1-97 s4-1 f0-60)
)
)
)
(if (-> sv-16 parented-scale?)
(set-vector! (-> arg0 bone scale) 1.0 1.0 1.0 1.0)
)
)
(if (-> sv-16 parented-scale?)
(set-vector! (-> arg0 bone scale) 1.0 1.0 1.0 1.0)
)
0
(none)
)
@@ -791,20 +754,19 @@
;; ERROR: Unsupported inline assembly instruction kind - [madda.s f1, f4]
;; ERROR: Unsupported inline assembly instruction kind - [madd.s f0, f2, f5]
(defbehavior joint-mod-look-at-handler process ((arg0 cspace) (arg1 transformq))
(local-vars (f0-1 float) (sv-80 symbol) (sv-144 vector) (sv-160 vector) (sv-176 float))
(local-vars (f0-1 float))
(let ((gp-0 (the-as joint-mod (-> arg0 param1))))
(cspace<-parented-transformq-joint! arg0 arg1)
(let ((s1-0 (vector-normalize-copy!
(new 'stack-no-clear 'vector)
(-> gp-0 process node-list data 0 bone transform vector 1)
1.0
)
)
(s2-0 (matrix->trans (-> arg0 bone transform) (new 'stack-no-clear 'vector)))
(s3-0 (vector-normalize! (-> arg0 bone transform vector (-> gp-0 nose)) 1.0))
(s0-0 (vector-normalize! (-> arg0 bone transform vector (-> gp-0 ear)) 1.0))
)
(set! sv-144 (vector-normalize!
(let* ((s1-0 (vector-normalize-copy!
(new 'stack-no-clear 'vector)
(-> gp-0 process node-list data 0 bone transform vector 1)
1.0
)
)
(s2-0 (matrix->trans (-> arg0 bone transform) (new 'stack-no-clear 'vector)))
(s3-0 (vector-normalize! (-> arg0 bone transform vector (-> gp-0 nose)) 1.0))
(s0-0 (vector-normalize! (-> arg0 bone transform vector (-> gp-0 ear)) 1.0))
(sv-144 (vector-normalize!
(vector-cross!
(new 'stack-no-clear 'vector)
(-> arg0 bone transform vector (-> gp-0 up))
@@ -812,21 +774,13 @@
)
1.0
)
)
(s2-1 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> gp-0 target) s2-0) 1.0))
)
(let ((sv-160 (-> gp-0 process node-list data (-> gp-0 base-joint) bone transform vector (-> gp-0 base-nose)))
(sv-80 (the-as symbol #f))
)
(let ((s2-1 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> gp-0 target) s2-0) 1.0)))
(set! sv-160 (-> gp-0 process node-list data (-> gp-0 base-joint) bone transform vector (-> gp-0 base-nose)))
(set! sv-80 (the-as symbol #f))
(let ((f0-0 (-> sv-144 x))
(f1-0 (-> sv-144 y))
(f2-0 (-> sv-144 z))
(f3-0 (-> s0-0 x))
(f4-0 (-> s0-0 y))
(f5-0 (-> s0-0 z))
)
(.mula.s f0-0 f3-0)
(.madda.s f1-0 f4-0)
(.madd.s f0-1 f2-0 f5-0)
)
(set! f0-1 (vector-dot sv-144 s0-0))
(if (< f0-1 0.0)
(set! sv-80 #t)
)
@@ -856,15 +810,13 @@
(mode-set! gp-0 (joint-mod-mode rotate2))
)
)
(let ((s1-2 deg-seek)
(s0-2 (-> gp-0 twist y))
)
(set! sv-176 f30-2)
(let ((a2-3 (* (fabs (deg-diff f30-2 (-> gp-0 twist y))) (-> gp-0 twist-speed-y) (-> self clock time-adjust-ratio)))
(set! (-> gp-0 twist y)
(deg-seek
(-> gp-0 twist y)
f30-2
(* (fabs (deg-diff f30-2 (-> gp-0 twist y))) (-> gp-0 twist-speed-y) (-> self clock time-adjust-ratio))
)
(set! (-> gp-0 twist y) (s1-2 s0-2 sv-176 a2-3))
)
)
)
)
)
0.0
@@ -887,34 +839,34 @@
)
)
)
(let* ((s1-3
(vector-normalize-copy!
(new 'stack-no-clear 'vector)
(the-as vector (-> gp-0 process node-list data 0 bone transform))
1.0
)
)
(f30-3 (vector-x-angle s3-0))
(s2-2 (vector-flatten! (new-stack-vector0) s2-1 s1-3))
(f0-26 (vector-x-angle s2-2))
(f0-32
(fmax
(fmin (* (- (deg-diff f30-3 f0-26)) (-> gp-0 blend) (-> gp-0 flex-blend)) (-> gp-0 twist-max x))
(- (-> gp-0 twist-max x))
)
)
(let* ((s1-3
(vector-normalize-copy!
(new 'stack-no-clear 'vector)
(the-as vector (-> gp-0 process node-list data 0 bone transform))
1.0
)
)
(if (< (vector-dot s2-2 s3-0) 0.1)
(set! f0-32 0.0)
)
(set! (-> gp-0 twist x)
(deg-seek
(-> gp-0 twist x)
f0-32
(* (fabs (deg-diff f0-32 (-> gp-0 twist x))) (-> gp-0 twist-speed-x) (-> self clock time-adjust-ratio))
)
(f30-3 (vector-x-angle s3-0))
(s2-2 (vector-flatten! (new-stack-vector0) s2-1 s1-3))
(f0-26 (vector-x-angle s2-2))
(f0-32
(fmax
(fmin (* (- (deg-diff f30-3 f0-26)) (-> gp-0 blend) (-> gp-0 flex-blend)) (-> gp-0 twist-max x))
(- (-> gp-0 twist-max x))
)
)
)
(if (< (vector-dot s2-2 s3-0) 0.1)
(set! f0-32 0.0)
)
(set! (-> gp-0 twist x)
(deg-seek
(-> gp-0 twist x)
f0-32
(* (fabs (deg-diff f0-32 (-> gp-0 twist x))) (-> gp-0 twist-speed-x) (-> self clock time-adjust-ratio))
)
)
)
)
)
(let ((v1-60 (-> gp-0 ear)))
@@ -974,13 +926,9 @@
(matrix-transpose! s4-0 s4-0)
(set-vector! (-> s4-0 trans) 0.0 0.0 0.0 1.0)
(vector-matrix*! s2-0 s1-0 s4-0)
(let* ((t9-8 asin)
(f0-8 (-> s2-0 x))
(f0-10 (* f0-8 f0-8))
(f1-0 (-> s2-0 y))
(f28-0 (t9-8 (sqrtf (+ f0-10 (* f1-0 f1-0)))))
(f30-0 (atan (-> s2-0 y) (-> s2-0 x)))
)
(let ((f28-0 (asin (sqrtf (+ (square (-> s2-0 x)) (square (-> s2-0 y))))))
(f30-0 (atan (-> s2-0 y) (-> s2-0 x)))
)
(if (< (-> s2-0 z) 0.0)
(set! f28-0 (- 32768.0 f28-0))
)
@@ -1011,11 +959,9 @@
)
)
)
(let* ((f0-38 (sin f30-0))
(f26-0 (* f0-38 f0-38))
(f0-40 (cos f30-0))
(f0-42 (* f0-40 f0-40))
)
(let ((f26-0 (square (sin f30-0)))
(f0-42 (square (cos f30-0)))
)
32768.0
(let ((f0-44 (cond
((< 16384.0 f30-0)
@@ -1040,13 +986,7 @@
)
(let ((f28-1 (cos f28-0)))
(set-vector! s2-0 (cos f30-0) (sin f30-0) 0.0 1.0)
(let ((t9-15 vector-normalize!)
(a0-19 s2-0)
(f0-52 1.0)
(f1-22 f28-1)
)
(t9-15 a0-19 (sqrtf (- f0-52 (* f1-22 f1-22))))
)
(vector-normalize! s2-0 (sqrtf (- 1.0 (square f28-1))))
(set! (-> s2-0 z) f28-1)
)
)
@@ -1089,75 +1029,76 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defbehavior joint-mod-world-look-at-handler process ((arg0 cspace) (arg1 transformq))
(local-vars (sv-48 vector) (sv-52 vector) (sv-56 vector))
(let ((gp-0 (the-as joint-mod (-> arg0 param1))))
(let ((s5-0 (-> arg0 bone transform)))
(cspace<-parented-transformq-joint! arg0 arg1)
(set! sv-48 (vector-normalize-copy!
(new 'stack-no-clear 'vector)
(-> gp-0 process node-list data 0 bone transform vector 1)
1.0
)
(let ((sv-48 (vector-normalize-copy!
(new 'stack-no-clear 'vector)
(-> gp-0 process node-list data 0 bone transform vector 1)
1.0
)
)
(sv-52 (vector-normalize! (-> s5-0 vector (-> gp-0 nose)) 1.0))
(sv-56 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> gp-0 target) (-> s5-0 trans)) 1.0))
)
(set! sv-52 (vector-normalize! (-> s5-0 vector (-> gp-0 nose)) 1.0))
(set! sv-56 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> gp-0 target) (-> s5-0 trans)) 1.0))
(let* ((f30-0 (vector-y-angle sv-52))
(a0-7 (vector-flatten! (new-stack-vector0) sv-56 sv-48))
(f0-0 (vector-y-angle a0-7))
(f0-1 (deg-diff f30-0 f0-0))
)
(if (< (-> gp-0 ignore-angle) (fabs f0-1))
(set! f0-1 0.0)
)
(let ((f0-5
(fmax (fmin (* f0-1 (-> gp-0 blend) (-> gp-0 flex-blend)) (-> gp-0 twist-max y)) (- (-> gp-0 twist-max y)))
)
(let* ((f30-0 (vector-y-angle sv-52))
(a0-7 (vector-flatten! (new-stack-vector0) sv-56 sv-48))
(f0-0 (vector-y-angle a0-7))
(f0-1 (deg-diff f30-0 f0-0))
)
(if (< (-> gp-0 ignore-angle) (fabs f0-1))
(set! f0-1 0.0)
)
(set! (-> gp-0 twist y) (deg-seek
(-> gp-0 twist y)
f0-5
(* (fmax 1.0 (* (fabs (deg-diff f0-5 (-> gp-0 twist y))) (-> gp-0 twist-speed-y)))
(let ((f0-5
(fmax (fmin (* f0-1 (-> gp-0 blend) (-> gp-0 flex-blend)) (-> gp-0 twist-max y)) (- (-> gp-0 twist-max y)))
)
)
(set! (-> gp-0 twist y) (deg-seek
(-> gp-0 twist y)
f0-5
(* (fmax 1.0 (* (fabs (deg-diff f0-5 (-> gp-0 twist y))) (-> gp-0 twist-speed-y)))
(-> self clock time-adjust-ratio)
)
)
)
)
)
(when (!= (-> gp-0 twist y) 0.0)
(let ((a2-3 (matrix-rotate-y! (new 'stack-no-clear 'matrix) (-> gp-0 twist y)))
(s4-2 (-> s5-0 trans quad))
)
(matrix*! s5-0 s5-0 a2-3)
(set! (-> s5-0 trans quad) s4-2)
)
)
(let* ((s4-3 (vector-normalize-copy!
(new 'stack-no-clear 'vector)
(the-as vector (-> gp-0 process node-list data 0 bone transform))
1.0
)
)
(f30-2 (vector-x-angle sv-52))
(s4-4 (vector-flatten! (new-stack-vector0) sv-56 s4-3))
(f0-15 (vector-x-angle s4-4))
(f0-21 (fmax
(fmin (* (- (deg-diff f30-2 f0-15)) (-> gp-0 blend) (-> gp-0 flex-blend)) (-> gp-0 twist-max x))
(- (-> gp-0 twist-max x))
)
)
)
(if (< (vector-dot s4-4 sv-52) 0.1)
(set! f0-21 0.0)
)
(set! (-> gp-0 twist x) (deg-seek
(-> gp-0 twist x)
f0-21
(* (fmax 1.0 (* (fabs (deg-diff f0-21 (-> gp-0 twist x))) (-> gp-0 twist-speed-x)))
(-> self clock time-adjust-ratio)
)
)
)
)
)
(when (!= (-> gp-0 twist y) 0.0)
(let ((a2-3 (matrix-rotate-y! (new 'stack-no-clear 'matrix) (-> gp-0 twist y)))
(s4-2 (-> s5-0 trans quad))
)
(matrix*! s5-0 s5-0 a2-3)
(set! (-> s5-0 trans quad) s4-2)
)
)
(let* ((s4-3 (vector-normalize-copy!
(new 'stack-no-clear 'vector)
(the-as vector (-> gp-0 process node-list data 0 bone transform))
1.0
)
)
(f30-2 (vector-x-angle sv-52))
(s4-4 (vector-flatten! (new-stack-vector0) sv-56 s4-3))
(f0-15 (vector-x-angle s4-4))
(f0-21 (fmax
(fmin (* (- (deg-diff f30-2 f0-15)) (-> gp-0 blend) (-> gp-0 flex-blend)) (-> gp-0 twist-max x))
(- (-> gp-0 twist-max x))
)
)
)
(if (< (vector-dot s4-4 sv-52) 0.1)
(set! f0-21 0.0)
)
(set! (-> gp-0 twist x) (deg-seek
(-> gp-0 twist x)
f0-21
(* (fmax 1.0 (* (fabs (deg-diff f0-21 (-> gp-0 twist x))) (-> gp-0 twist-speed-x)))
(-> self clock time-adjust-ratio)
)
)
)
)
(when (!= (-> gp-0 twist x) 0.0)
(let* ((v1-25 (-> gp-0 ear))
(a1-17 ((cond
+64 -72
View File
@@ -733,84 +733,76 @@
(seed int)
(prefix string)
)
(local-vars
(sv-16 int)
(sv-24 symbol)
(sv-32 int)
(sv-40 int)
(sv-48 joint-control-channel)
(sv-52 basic)
(sv-56 object)
(sv-60 basic)
(sv-64 art-joint-anim)
(sv-80 string)
)
(set! sv-16 (+ (length (-> parent-art-group name)) 1))
(set! sv-24 #t)
(set! sv-32 seed)
(set! sv-40 2)
(while (and (< sv-40 (-> dst-art-group length))
(or (not (-> dst-art-group data sv-40)) (!= (-> dst-art-group data sv-40 type) art-joint-anim))
)
(set! sv-40 (+ sv-40 1))
)
(dotimes (s2-1 (the-as int (+ (-> jc active-channels) (-> jc float-channels))))
(set! sv-48 (-> jc channel s2-1))
(set! sv-52 (the-as basic #f))
(when (-> sv-48 frame-group)
(format (clear *temp-string*) "~S~G" prefix (&+ (-> sv-48 frame-group name data) sv-16))
(when (not (null? remap-list))
(set! sv-56 (nassoc *temp-string* remap-list))
(when sv-56
(let* ((s1-1 sv-32)
(a0-8 sv-56)
(v1-36 (mod s1-1 (+ ((method-of-type (rtype-of a0-8) length) a0-8) -1)))
)
(set! sv-60 (the-as basic (ref sv-56 (+ v1-36 1))))
)
(cond
((= (-> sv-60 type) string)
(format (clear *temp-string*) "~S" sv-60)
)
((= (-> sv-60 type) function)
(set! sv-52 sv-60)
(let ((s1-3 format)
(s0-0 (clear *temp-string*))
)
(set! sv-80 "~S")
(let ((a2-4 ((the-as (function joint-control joint-control-channel int object) sv-52) jc sv-48 0)))
(s1-3 s0-0 sv-80 a2-4)
)
)
)
)
)
(let ((sv-16 (+ (length (-> parent-art-group name)) 1))
(sv-24 #t)
)
(set! sv-64 (get-art-by-name dst-art-group *temp-string* art-joint-anim))
(cond
(sv-64
(let* ((v1-46 (-> sv-48 frame-group))
(f0-2 (+ (* (-> sv-48 frame-num) (-> v1-46 artist-step)) (-> v1-46 artist-base)))
)
(set! (-> sv-48 frame-group) sv-64)
(set! (-> sv-48 frame-num) (/ (- f0-2 (-> sv-64 artist-base)) (-> sv-64 artist-step)))
)
(set! (-> sv-48 frame-num)
(fmax 0.0 (fmin (-> sv-48 frame-num) (the float (+ (-> sv-64 frames num-frames) -1))))
)
(if sv-52
((the-as (function joint-control joint-control-channel int object) sv-52) jc sv-48 1)
)
(let ((sv-32 seed)
(sv-40 2)
)
(else
(set! (-> sv-48 frame-group) (the-as art-joint-anim (-> dst-art-group data sv-40)))
(set! (-> sv-48 frame-num) 0.0)
(set! sv-24 (the-as symbol #f))
(while (and (< sv-40 (-> dst-art-group length))
(or (not (-> dst-art-group data sv-40)) (!= (-> dst-art-group data sv-40 type) art-joint-anim))
)
(+! sv-40 1)
)
(dotimes (s2-1 (the-as int (+ (-> jc active-channels) (-> jc float-channels))))
(let ((sv-48 (-> jc channel s2-1))
(sv-52 (the-as basic #f))
)
(when (-> sv-48 frame-group)
(format (clear *temp-string*) "~S~G" prefix (&+ (-> sv-48 frame-group name data) sv-16))
(when (not (null? remap-list))
(let ((sv-56 (nassoc *temp-string* remap-list)))
(when sv-56
(let* ((a0-8 sv-56)
(v1-36 (mod sv-32 (+ ((method-of-type (rtype-of a0-8) length) a0-8) -1)))
(sv-60 (the-as basic (ref sv-56 (+ v1-36 1))))
)
(cond
((= (-> sv-60 type) string)
(format (clear *temp-string*) "~S" sv-60)
)
((= (-> sv-60 type) function)
(set! sv-52 sv-60)
(format
(clear *temp-string*)
"~S"
((the-as (function joint-control joint-control-channel int object) sv-52) jc sv-48 0)
)
)
)
)
)
)
)
(let ((sv-64 (get-art-by-name dst-art-group *temp-string* art-joint-anim)))
(cond
(sv-64
(let* ((v1-46 (-> sv-48 frame-group))
(f0-2 (+ (* (-> sv-48 frame-num) (-> v1-46 artist-step)) (-> v1-46 artist-base)))
)
(set! (-> sv-48 frame-group) sv-64)
(set! (-> sv-48 frame-num) (/ (- f0-2 (-> sv-64 artist-base)) (-> sv-64 artist-step)))
)
(set! (-> sv-48 frame-num)
(fmax 0.0 (fmin (-> sv-48 frame-num) (the float (+ (-> sv-64 frames num-frames) -1))))
)
(if sv-52
((the-as (function joint-control joint-control-channel int object) sv-52) jc sv-48 1)
)
)
(else
(set! (-> sv-48 frame-group) (the-as art-joint-anim (-> dst-art-group data sv-40)))
(set! (-> sv-48 frame-num) 0.0)
(set! sv-24 (the-as symbol #f))
)
)
)
)
)
)
)
sv-24
)
sv-24
)
;; definition for function flatten-joint-control-to-spr
+2 -3
View File
@@ -4,9 +4,8 @@
;; definition for function cam-helper-temp
;; INFO: Used lq/sq
(defbehavior cam-helper-temp camera-combiner ((arg0 (pointer camera-slave)) (arg1 (pointer camera-slave)) (arg2 float))
(local-vars (sv-144 cam-rotation-tracker))
(set! sv-144 (-> arg0 0 tracking))
(let ((s1-0 (-> arg0 0 trans))
(let ((sv-144 (-> arg0 0 tracking))
(s1-0 (-> arg0 0 trans))
(gp-0 (-> arg1 0 tracking))
(s0-0 (-> arg1 0 trans))
)
+166 -163
View File
@@ -328,35 +328,21 @@
;; WARN: Stack slot offset 164 signed mismatch
;; WARN: new jak 2 until loop case, check carefully
(defbehavior cam-layout-entity-volume-info-create cam-layout ((arg0 entity-camera) (arg1 symbol))
(local-vars
(sv-16 res-tag)
(sv-160 vector)
(sv-164 number)
(sv-168 int)
(sv-176 vector)
(sv-192 vector)
(sv-208 vector)
(sv-224 vector)
(sv-240 vector)
(sv-256 int)
(sv-272 int)
(sv-288 int)
)
(let ((s4-0 0))
(until #f
(set! sv-16 (new 'static 'res-tag))
(let ((s3-0 (the-as (inline-array vector) ((method-of-type res-lump get-property-data)
arg0
arg1
'exact
(the float s4-0)
(the-as pointer #f)
(& sv-16)
*res-static-buf*
)
)
)
)
(let* ((sv-16 (new 'static 'res-tag))
(s3-0 (the-as (inline-array vector) ((method-of-type res-lump get-property-data)
arg0
arg1
'exact
(the float s4-0)
(the-as pointer #f)
(& sv-16)
*res-static-buf*
)
)
)
)
(cond
(s3-0
(when (>= *volume-descriptor-current* 100)
@@ -372,121 +358,137 @@
(set! *volume-descriptor-current* (+ *volume-descriptor-current* 1))
(+! (-> self num-volumes) 1)
(dotimes (s1-0 (the-as int (-> sv-16 elt-count)))
(set! sv-192 (new 'stack-no-clear 'vector))
(set! (-> sv-192 quad) (the-as uint128 0))
(set! sv-208 (new 'stack-no-clear 'vector))
(set! (-> sv-208 quad) (the-as uint128 0))
(set! sv-224 (new 'stack-no-clear 'vector))
(set! (-> sv-224 quad) (the-as uint128 0))
(set! sv-240 (new 'stack-no-clear 'vector))
(set! (-> sv-240 quad) (the-as uint128 0))
0.0
0.0
0.0
(set! (-> (new 'stack-no-clear 'vector) quad) (the-as uint128 0))
(let ((s0-0 (new-stack-vector0)))
(set! sv-256 0)
(set! sv-272 0)
(while (< sv-272 (the-as int (-> sv-16 elt-count)))
(when (!= s1-0 sv-272)
(vector-float*! sv-192 (-> s3-0 sv-272) (-> s3-0 sv-272 w))
(vector-cross! sv-208 (-> s3-0 sv-272) (-> s3-0 s1-0))
(vector-normalize! sv-208 1.0)
(vector-cross! sv-224 sv-208 (-> s3-0 sv-272))
(vector-normalize! sv-224 1.0)
(let ((f0-6 (cam-layout-intersect-dist (-> s3-0 s1-0) sv-192 sv-224)))
(when (!= f0-6 409600000.0)
(vector+float*! sv-240 sv-192 sv-224 f0-6)
(set! sv-160 (new-stack-vector0))
(set! sv-164 0.0)
(set! sv-168 0)
(set! sv-176 (new-stack-vector0))
(set! (-> sv-160 quad) (-> sv-240 quad))
(set! sv-288 0)
(while (< sv-288 (the-as int (-> sv-16 elt-count)))
(when (and (!= sv-288 s1-0) (!= sv-288 sv-272))
(let ((f0-8 (cam-layout-intersect-dist (-> s3-0 sv-288) sv-160 sv-208)))
(cond
((= f0-8 409600000.0)
)
((zero? sv-168)
(vector+float*! sv-160 sv-160 sv-208 f0-8)
(set! (-> sv-176 quad) (-> s3-0 sv-288 quad))
(set! sv-164 8192000.0)
(set! sv-168 1)
)
((begin (vector-float*! sv-240 sv-208 f0-8) (>= (vector-dot sv-240 sv-176) 0.0))
)
((>= (vector-dot sv-240 (-> s3-0 sv-288)) 0.0)
(when (< (fabs f0-8) (fabs (the-as float sv-164)))
(set! sv-164 f0-8)
(set! sv-168 (+ sv-168 1))
)
)
(else
(vector+float*! sv-160 sv-160 sv-208 f0-8)
(set! (-> sv-176 quad) (-> s3-0 sv-288 quad))
(set! sv-168 (+ sv-168 1))
(if (< (fabs f0-8) (fabs (the-as float sv-164)))
(set! sv-164 (- (the-as float sv-164) f0-8))
(set! sv-164 0.0)
(let ((sv-192 (new 'stack-no-clear 'vector)))
(set! (-> sv-192 quad) (the-as uint128 0))
(let ((sv-208 (new 'stack-no-clear 'vector)))
(set! (-> sv-208 quad) (the-as uint128 0))
(let ((sv-224 (new 'stack-no-clear 'vector)))
(set! (-> sv-224 quad) (the-as uint128 0))
(let ((sv-240 (new 'stack-no-clear 'vector)))
(set! (-> sv-240 quad) (the-as uint128 0))
0.0
0.0
0.0
(set! (-> (new 'stack-no-clear 'vector) quad) (the-as uint128 0))
(let ((s0-0 (new-stack-vector0))
(sv-256 0)
)
(let ((sv-272 0))
(while (< sv-272 (the-as int (-> sv-16 elt-count)))
(when (!= s1-0 sv-272)
(vector-float*! sv-192 (-> s3-0 sv-272) (-> s3-0 sv-272 w))
(vector-cross! sv-208 (-> s3-0 sv-272) (-> s3-0 s1-0))
(vector-normalize! sv-208 1.0)
(vector-cross! sv-224 sv-208 (-> s3-0 sv-272))
(vector-normalize! sv-224 1.0)
(let ((f0-6 (cam-layout-intersect-dist (-> s3-0 s1-0) sv-192 sv-224)))
(when (!= f0-6 409600000.0)
(vector+float*! sv-240 sv-192 sv-224 f0-6)
(let ((sv-160 (new-stack-vector0))
(sv-164 0.0)
(sv-168 0)
)
(let ((sv-176 (new-stack-vector0)))
(set! (-> sv-160 quad) (-> sv-240 quad))
(let ((sv-288 0))
(while (< sv-288 (the-as int (-> sv-16 elt-count)))
(when (and (!= sv-288 s1-0) (!= sv-288 sv-272))
(let ((f0-8 (cam-layout-intersect-dist (-> s3-0 sv-288) sv-160 sv-208)))
(cond
((= f0-8 409600000.0)
)
((zero? sv-168)
(vector+float*! sv-160 sv-160 sv-208 f0-8)
(set! (-> sv-176 quad) (-> s3-0 sv-288 quad))
(set! sv-164 8192000.0)
(set! sv-168 1)
)
((begin (vector-float*! sv-240 sv-208 f0-8) (>= (vector-dot sv-240 sv-176) 0.0))
)
((>= (vector-dot sv-240 (-> s3-0 sv-288)) 0.0)
(when (< (fabs f0-8) (fabs (the-as float sv-164)))
(set! sv-164 f0-8)
(+! sv-168 1)
)
)
(else
(vector+float*! sv-160 sv-160 sv-208 f0-8)
(set! (-> sv-176 quad) (-> s3-0 sv-288 quad))
(+! sv-168 1)
(set! sv-164 (cond
((< (fabs f0-8) (fabs (the-as float sv-164)))
(set! sv-164 (- (the-as float sv-164) f0-8))
sv-164
)
(else
0.0
)
)
)
)
)
)
)
(+! sv-288 1)
)
)
)
(cond
((zero? sv-168)
)
((= (the-as float sv-164) 0.0)
)
(else
(dotimes (v1-91 (the-as int (-> sv-16 elt-count)))
(when (and (!= v1-91 s1-0) (!= v1-91 sv-272))
(if (< 4096.0 (- (vector-dot sv-160 (-> s3-0 v1-91)) (-> s3-0 v1-91 w)))
(goto cfg-47)
)
)
)
(vector+float*! sv-240 sv-160 sv-208 (the-as float sv-164))
(cond
((>= *volume-point-current* 999)
(format 0 "ERROR <GMJ>: camera editing out of volume points~%")
)
(else
(set! (-> *volume-point* data *volume-point-current* quad) (-> sv-160 quad))
(set! (-> *volume-point* data (+ *volume-point-current* 1) quad) (-> sv-240 quad))
(set! *volume-point-current* (+ *volume-point-current* 2))
(+! (-> s2-0 point-count) 2)
)
)
(vector+! s0-0 s0-0 sv-160)
(vector+! s0-0 s0-0 sv-240)
(+! sv-256 2)
sv-256
)
)
)
)
)
)
(label cfg-47)
(+! sv-272 1)
)
(set! sv-288 (+ sv-288 1))
)
(cond
((zero? sv-168)
)
((= (the-as float sv-164) 0.0)
)
(else
(dotimes (v1-91 (the-as int (-> sv-16 elt-count)))
(when (and (!= v1-91 s1-0) (!= v1-91 sv-272))
(if (< 4096.0 (- (vector-dot sv-160 (-> s3-0 v1-91)) (-> s3-0 v1-91 w)))
(goto cfg-47)
)
)
(when (nonzero? sv-256)
(vector-float*! s0-0 s0-0 (/ 1.0 (the float sv-256)))
(cond
((>= *volume-normal-current* 599)
(format 0 "ERROR <GMJ>: camera editing out of volume normals~%")
)
(else
(set! (-> *volume-normal* data *volume-normal-current* quad) (-> s0-0 quad))
(set! (-> *volume-normal* data (+ *volume-normal-current* 1) quad) (-> s3-0 s1-0 quad))
(set! *volume-normal-current* (+ *volume-normal-current* 2))
(set! (-> s2-0 normal-count) (+ (-> s2-0 normal-count) 2))
)
(vector+float*! sv-240 sv-160 sv-208 (the-as float sv-164))
(cond
((>= *volume-point-current* 999)
(format 0 "ERROR <GMJ>: camera editing out of volume points~%")
)
(else
(set! (-> *volume-point* data *volume-point-current* quad) (-> sv-160 quad))
(set! (-> *volume-point* data (+ *volume-point-current* 1) quad) (-> sv-240 quad))
(set! *volume-point-current* (+ *volume-point-current* 2))
(+! (-> s2-0 point-count) 2)
)
)
(vector+! s0-0 s0-0 sv-160)
(vector+! s0-0 s0-0 sv-240)
(set! sv-256 (+ sv-256 2))
sv-256
)
)
)
)
)
(label cfg-47)
(set! sv-272 (+ sv-272 1))
)
(when (nonzero? sv-256)
(vector-float*! s0-0 s0-0 (/ 1.0 (the float sv-256)))
(cond
((>= *volume-normal-current* 599)
(format 0 "ERROR <GMJ>: camera editing out of volume normals~%")
)
(else
(set! (-> *volume-normal* data *volume-normal-current* quad) (-> s0-0 quad))
(set! (-> *volume-normal* data (+ *volume-normal-current* 1) quad) (-> s3-0 s1-0 quad))
(set! *volume-normal-current* (+ *volume-normal-current* 2))
(set! (-> s2-0 normal-count) (+ (-> s2-0 normal-count) 2))
)
)
)
)
)
@@ -995,7 +997,7 @@
;; definition for function clmf-pos-rot
;; INFO: Used lq/sq
(defbehavior clmf-pos-rot cam-layout ((arg0 symbol) (arg1 symbol))
(local-vars (s2-0 structure) (s3-1 vector) (sv-192 matrix))
(local-vars (s2-0 structure) (s3-1 vector))
(cam-layout-print 16 *camera-layout-message-ypos* "x/z pos: left stick, down: l1, up: r1")
(set! *camera-layout-message-ypos* (+ *camera-layout-message-ypos* 14))
(when (and arg1 (nonzero? arg1))
@@ -1065,35 +1067,35 @@
)
)
)
(let ((s1-1 (new 'stack-no-clear 'matrix)))
(set! sv-192 (new 'stack-no-clear 'matrix))
(let ((s0-1 (new 'stack-no-clear 'vector)))
(if (not s3-1)
(return #f)
)
(clmf-input s5-0 s4-0 0)
(vector+float*! s3-1 s3-1 s4-0 409.6)
(cond
((not arg1)
(the-as quaternion #f)
)
((zero? arg1)
(the-as quaternion #f)
)
(else
(cam-slave-get-rot (the-as entity-actor (-> self cam-entity)) sv-192)
(vector-float*! s5-0 s5-0 100.0)
(matrix-rotate-x! s1-1 (- (-> s5-0 x)))
(matrix*! sv-192 s1-1 sv-192)
(matrix-rotate-y! s1-1 (-> s5-0 y))
(matrix*! sv-192 sv-192 s1-1)
(matrix-rotate-z! s1-1 (- (-> s5-0 z)))
(matrix*! sv-192 s1-1 sv-192)
(matrix->quaternion (the-as quaternion s0-1) sv-192)
(quaternion-inverse! (the-as quaternion s2-0) (the-as quaternion (-> self cam-entity connect)))
(quaternion*! (the-as quaternion s2-0) (the-as quaternion s0-1) (the-as quaternion s2-0))
(quaternion-normalize! (the-as quaternion s2-0))
)
(let ((s1-1 (new 'stack-no-clear 'matrix))
(sv-192 (new 'stack-no-clear 'matrix))
(s0-1 (new 'stack-no-clear 'vector))
)
(if (not s3-1)
(return #f)
)
(clmf-input s5-0 s4-0 0)
(vector+float*! s3-1 s3-1 s4-0 409.6)
(cond
((not arg1)
(the-as quaternion #f)
)
((zero? arg1)
(the-as quaternion #f)
)
(else
(cam-slave-get-rot (the-as entity-actor (-> self cam-entity)) sv-192)
(vector-float*! s5-0 s5-0 100.0)
(matrix-rotate-x! s1-1 (- (-> s5-0 x)))
(matrix*! sv-192 s1-1 sv-192)
(matrix-rotate-y! s1-1 (-> s5-0 y))
(matrix*! sv-192 sv-192 s1-1)
(matrix-rotate-z! s1-1 (- (-> s5-0 z)))
(matrix*! sv-192 s1-1 sv-192)
(matrix->quaternion (the-as quaternion s0-1) sv-192)
(quaternion-inverse! (the-as quaternion s2-0) (the-as quaternion (-> self cam-entity connect)))
(quaternion*! (the-as quaternion s2-0) (the-as quaternion s0-1) (the-as quaternion s2-0))
(quaternion-normalize! (the-as quaternion s2-0))
)
)
)
@@ -2526,10 +2528,11 @@
;; definition for function clmf-cam-string
;; INFO: Used lq/sq
(defbehavior clmf-cam-string cam-layout ((arg0 string) (arg1 symbol))
(local-vars (r0-0 uint128) (v1-5 uint128) (sv-16 int))
(local-vars (r0-0 uint128) (v1-5 uint128))
(format arg0 ":")
(set! sv-16 0)
(let ((s5-1 (res-lump-data (-> self cam-entity) arg1 pointer :tag-ptr (the-as (pointer res-tag) (& sv-16)))))
(let* ((sv-16 0)
(s5-1 (res-lump-data (-> self cam-entity) arg1 pointer :tag-ptr (the-as (pointer res-tag) (& sv-16))))
)
(when s5-1
(let ((s4-0 0))
(while (begin
+27 -41
View File
@@ -347,16 +347,7 @@
;; definition for function master-choose-entity
;; INFO: Used lq/sq
(defbehavior master-choose-entity camera-master ((arg0 cam-setting-data))
(local-vars
(v1-22 symbol)
(sv-96 res-tag)
(sv-112 process)
(sv-128 (pointer process))
(sv-144 int)
(sv-160 string)
(sv-176 string)
(sv-192 uint)
)
(local-vars (v1-22 symbol) (sv-128 (pointer process)))
(let ((s5-0 (entity-by-name (-> arg0 entity-name))))
(set! (-> arg0 real-entity-name) #f)
(when s5-0
@@ -373,8 +364,9 @@
(format 0 "ERROR <GMJ>: camera entity '~S' didn't produce a state~%" (res-lump-struct s5-0 'name structure))
)
)
(set! sv-96 (new 'static 'res-tag))
(let ((s4-1 (res-lump-data s5-0 'alternates pointer :tag-ptr (& sv-96))))
(let* ((sv-96 (new 'static 'res-tag))
(s4-1 (res-lump-data s5-0 'alternates pointer :tag-ptr (& sv-96)))
)
(when s4-1
(let* ((s1-1 (get-process *camera-dead-pool* camera-slave #x4000))
(s3-1 (when s1-1
@@ -402,22 +394,21 @@
(let ((s1-2 (cam-state-from-entity s0-0)))
(cond
(s1-2
(set! sv-112 (get-process *camera-dead-pool* camera-slave #x4000))
(set! v1-22 (when sv-112
(set! sv-128 (the-as (pointer process) v1-22))
(let ((t9-14 (method-of-type camera-slave activate)))
(t9-14
(the-as camera-slave sv-112)
*camera*
(symbol->string (-> camera-slave symbol))
(the-as pointer #x70004000)
)
(let ((sv-112 (get-process *camera-dead-pool* camera-slave #x4000)))
(set! v1-22 (when sv-112
(set! sv-128 (the-as (pointer process) v1-22))
((method-of-type camera-slave activate)
(the-as camera-slave sv-112)
*camera*
(symbol->string (-> camera-slave symbol))
(the-as pointer #x70004000)
)
(run-now-in-process sv-112 cam-slave-init s1-2 s0-0)
(set! sv-128 (-> sv-112 ppointer))
v1-22
)
(run-now-in-process sv-112 cam-slave-init s1-2 s0-0)
(set! sv-128 (-> sv-112 ppointer))
v1-22
)
)
)
)
(cond
(sv-128
(setup-slave-for-hopefull (the-as camera-slave (ppointer->process sv-128)))
@@ -444,26 +435,21 @@
)
)
(else
(let ((s1-5 format))
(set! sv-144 0)
(set! sv-160 "ERROR <GMJ>: alternate camera region '~S' didn't produce a state~%")
(let ((a2-14 (res-lump-struct s0-0 'name structure)))
(s1-5 sv-144 sv-160 a2-14)
)
(format
0
"ERROR <GMJ>: alternate camera region '~S' didn't produce a state~%"
(res-lump-struct s0-0 'name structure)
)
)
)
)
)
(else
(let ((s1-7 format)
(s0-1 0)
)
(set! sv-176 "ERROR <GMJ>: alternate '~S' not found for '~S'~%")
(set! sv-192 (-> (the-as (pointer uint32) (&+ s4-1 (* s2-1 4)))))
(let ((a3-8 (res-lump-struct s5-0 'name structure)))
(s1-7 s0-1 sv-176 sv-192 a3-8)
)
(format
0
"ERROR <GMJ>: alternate '~S' not found for '~S'~%"
(-> (the-as (pointer uint32) (&+ s4-1 (* s2-1 4))))
(res-lump-struct s5-0 'name structure)
)
)
)
+1 -6
View File
@@ -130,12 +130,7 @@
(#f
(let* ((f28-0 (* (/ f30-0 100) (-> v1-0 x)))
(f26-0 (* (/ f30-0 100) (-> v1-0 y)))
(f0-5 f28-0)
(f0-7 (* f0-5 f0-5))
(f1-2 f26-0)
(f0-8 (+ f0-7 (* f1-2 f1-2)))
(f1-5 f30-0)
(f22-0 (- (sqrtf (+ f0-8 (* f1-5 f1-5))) f30-0))
(f22-0 (- (sqrtf (+ (square f28-0) (square f26-0) (square f30-0))) f30-0))
(f24-0 (atan f26-0 f30-0))
(f0-12 (atan (- f28-0) f30-0))
)
+190 -215
View File
@@ -1510,86 +1510,83 @@
(arg5 vector)
(arg6 float)
)
(local-vars (sv-128 float) (sv-144 vector) (sv-160 vector) (sv-176 vector) (sv-192 vector) (sv-208 int))
(set! sv-128 arg3)
(let ((gp-0 arg4))
(set! sv-144 arg5)
(let ((s4-0 arg6))
(set! sv-160 (new 'stack-no-clear 'vector))
(set! sv-176 (new 'stack-no-clear 'vector))
(let ((s5-0 (new 'stack-no-clear 'matrix)))
(set! sv-192 (new 'stack-no-clear 'vector))
(let ((f30-0 0.0)
(s0-0 #f)
)
(set! sv-208 0)
(while (< sv-208 4)
(cond
((= sv-208 3)
(vector-! sv-160 sv-144 (-> self string-trans))
(set! (-> s5-0 vector sv-208 z) 0.0)
)
(else
(vector-! sv-160 sv-144 (-> arg0 0 vertex sv-208))
(set! (-> s5-0 vector sv-208 z) (vector-dot sv-160 (-> *camera* local-down)))
(vector-! sv-160 (-> arg0 0 vertex sv-208) (-> self string-trans))
)
)
(vector-flatten! sv-160 sv-160 (-> *camera* local-down))
(vector-cross! sv-176 sv-160 arg2)
(let ((f28-0 (vector-dot sv-176 (-> *camera* local-down))))
(cond
((< (* f28-0 f30-0) 0.0)
(set! s0-0 #t)
)
((!= f28-0 0.0)
(set! f30-0 f28-0)
)
)
(set! (-> s5-0 vector sv-208 x) (vector-dot sv-160 arg2))
(cond
((= sv-208 3)
(vector-! sv-192 sv-144 (-> self string-trans))
(vector-flatten! sv-192 sv-192 arg1)
)
(else
(vector--float*! sv-192 sv-160 arg2 (-> s5-0 vector sv-208 x))
)
)
(if (< f28-0 0.0)
(set! (-> s5-0 vector sv-208 y) (- (vector-length sv-192)))
(set! (-> s5-0 vector sv-208 y) (vector-length sv-192))
)
)
(set! (-> s5-0 vector sv-208 x) (- sv-128 (-> s5-0 vector sv-208 x)))
(set! sv-208 (+ sv-208 1))
)
(cond
((and s0-0 (!= (the-as int s4-0) -859915232))
(dotimes (s4-1 4)
(dist-info-append (-> gp-0 straddle) (the-as vector (+ (the-as uint s5-0) (* s4-1 16))))
)
#f
)
((< (-> s5-0 trans y) 0.0)
(dotimes (s4-2 4)
(when (>= (-> s5-0 trans y) (-> s5-0 vector s4-2 y))
(set! (-> s5-0 vector s4-2 y) (- (-> s5-0 vector s4-2 y)))
(dist-info-append (-> gp-0 ccw) (the-as vector (+ (the-as uint s5-0) (* s4-2 16))))
)
)
#f
)
(else
(dotimes (s4-3 4)
(if (>= (-> s5-0 vector s4-3 y) (-> s5-0 trans y))
(dist-info-append (-> gp-0 cw) (the-as vector (+ (the-as uint s5-0) (* s4-3 16))))
)
)
#f
)
(let ((sv-128 arg3)
(gp-0 arg4)
(sv-144 arg5)
(s4-0 arg6)
(sv-160 (new 'stack-no-clear 'vector))
(sv-176 (new 'stack-no-clear 'vector))
(s5-0 (new 'stack-no-clear 'matrix))
(sv-192 (new 'stack-no-clear 'vector))
(f30-0 0.0)
(s0-0 #f)
)
(let ((sv-208 0))
(while (< sv-208 4)
(cond
((= sv-208 3)
(vector-! sv-160 sv-144 (-> self string-trans))
(set! (-> s5-0 vector sv-208 z) 0.0)
)
(else
(vector-! sv-160 sv-144 (-> arg0 0 vertex sv-208))
(set! (-> s5-0 vector sv-208 z) (vector-dot sv-160 (-> *camera* local-down)))
(vector-! sv-160 (-> arg0 0 vertex sv-208) (-> self string-trans))
)
)
(vector-flatten! sv-160 sv-160 (-> *camera* local-down))
(vector-cross! sv-176 sv-160 arg2)
(let ((f28-0 (vector-dot sv-176 (-> *camera* local-down))))
(cond
((< (* f28-0 f30-0) 0.0)
(set! s0-0 #t)
)
((!= f28-0 0.0)
(set! f30-0 f28-0)
)
)
(set! (-> s5-0 vector sv-208 x) (vector-dot sv-160 arg2))
(cond
((= sv-208 3)
(vector-! sv-192 sv-144 (-> self string-trans))
(vector-flatten! sv-192 sv-192 arg1)
)
(else
(vector--float*! sv-192 sv-160 arg2 (-> s5-0 vector sv-208 x))
)
)
(if (< f28-0 0.0)
(set! (-> s5-0 vector sv-208 y) (- (vector-length sv-192)))
(set! (-> s5-0 vector sv-208 y) (vector-length sv-192))
)
)
(set! (-> s5-0 vector sv-208 x) (- sv-128 (-> s5-0 vector sv-208 x)))
(+! sv-208 1)
)
)
(cond
((and s0-0 (!= (the-as int s4-0) -859915232))
(dotimes (s4-1 4)
(dist-info-append (-> gp-0 straddle) (the-as vector (+ (the-as uint s5-0) (* s4-1 16))))
)
#f
)
((< (-> s5-0 trans y) 0.0)
(dotimes (s4-2 4)
(when (>= (-> s5-0 trans y) (-> s5-0 vector s4-2 y))
(set! (-> s5-0 vector s4-2 y) (- (-> s5-0 vector s4-2 y)))
(dist-info-append (-> gp-0 ccw) (the-as vector (+ (the-as uint s5-0) (* s4-2 16))))
)
)
#f
)
(else
(dotimes (s4-3 4)
(if (>= (-> s5-0 vector s4-3 y) (-> s5-0 trans y))
(dist-info-append (-> gp-0 cw) (the-as vector (+ (the-as uint s5-0) (* s4-3 16))))
)
)
#f
)
)
)
@@ -1805,151 +1802,129 @@
;; ERROR: Unsupported inline assembly instruction kind - [madda.s f3, f6]
;; ERROR: Unsupported inline assembly instruction kind - [madd.s f2, f4, f7]
(defbehavior cam-los-collide camera-slave ((arg0 vector) (arg1 vector) (arg2 collide-los-result) (arg3 pat-surface))
(local-vars
(s1-3 int)
(s2-2 int)
(f2-1 float)
(sv-768 pat-surface)
(sv-784 vector)
(sv-800 vector)
(sv-816 tracking-point)
(sv-832 vector)
)
(set! sv-768 arg3)
(dist-info-init (-> arg2 cw))
(dist-info-init (-> arg2 ccw))
(dist-info-init (-> arg2 straddle))
(let ((s1-0 (new 'stack-no-clear 'collide-query))
(s4-0 (new 'stack-no-clear 'vector))
(s2-0 (new 'stack-no-clear 'vector))
)
(vector-normalize-copy! s2-0 arg1 1.0)
(vector-flatten! s4-0 arg1 (-> *camera* local-down))
(let ((s0-0 *collide-cache*)
(f26-0 (vector-length arg1))
(f30-0 (vector-normalize-ret-len! s4-0 1.0))
(local-vars (s1-3 int) (s2-2 int) (f2-1 float))
(let ((sv-768 arg3))
(dist-info-init (-> arg2 cw))
(dist-info-init (-> arg2 ccw))
(dist-info-init (-> arg2 straddle))
(let ((s1-0 (new 'stack-no-clear 'collide-query))
(s4-0 (new 'stack-no-clear 'vector))
(s2-0 (new 'stack-no-clear 'vector))
)
(set! (-> s1-0 start-pos quad) (-> arg0 quad))
(set! (-> s1-0 move-dist quad) (-> arg1 quad))
(let ((v1-5 s1-0))
(set! (-> v1-5 radius) (-> *CAM_STRING-bank* los-coll-rad))
(set! (-> v1-5 collide-with) (collide-spec backgnd obstacle hit-by-others-list camera-blocker pusher))
(set! (-> v1-5 ignore-process0) #f)
(set! (-> v1-5 ignore-process1) #f)
(set! (-> v1-5 ignore-pat) sv-768)
(set! (-> v1-5 action-mask) (collide-action solid))
)
(fill-using-line-sphere s0-0 s1-0)
(let ((s1-1 (the-as object (-> s0-0 tris)))
(f28-0 (/ 2048.0 f26-0))
(f26-1 (/ (+ -8192.0 f26-0) f26-0))
(vector-normalize-copy! s2-0 arg1 1.0)
(vector-flatten! s4-0 arg1 (-> *camera* local-down))
(let ((s0-0 *collide-cache*)
(f26-0 (vector-length arg1))
(f30-0 (vector-normalize-ret-len! s4-0 1.0))
)
(if (< f26-1 0.0)
(set! f26-1 0.0)
)
(if (< 1.0 f28-0)
(set! f28-0 1.0)
)
(countdown (s0-1 (-> s0-0 num-tris))
(set! sv-800 (new 'stack-no-clear 'vector))
(set! sv-784 (new 'stack-no-clear 'vector))
(let ((f0-7 (moving-sphere-triangle-intersect
arg0
arg1
(-> *CAM_STRING-bank* los-coll-rad)
(-> (the-as (inline-array collide-cache-tri) s1-1) 0)
sv-800
sv-784
)
)
)
(cond
((or (< f0-7 0.0) (< 1.0 f0-7))
)
((let ((f1-2 0.0))
(let* ((v1-23 arg1)
(f2-0 (-> v1-23 x))
(f3-0 (-> v1-23 y))
(f4-0 (-> v1-23 z))
(f5-0 (-> sv-784 x))
(f6-0 (-> sv-784 y))
(f7-0 (-> sv-784 z))
)
(.mula.s f2-0 f5-0)
(.madda.s f3-0 f6-0)
(.madd.s f2-1 f4-0 f7-0)
)
(< f1-2 f2-1)
)
(when (< f28-0 f0-7)
(let* ((t1-1 (new 'stack-no-clear 'vector))
(t0-1 (new 'stack-no-clear 'vector))
(f24-0 (moving-sphere-triangle-intersect
arg0
arg1
(-> *CAM_STRING-bank* los-coll-rad2)
(-> (the-as (inline-array collide-cache-tri) s1-1) 0)
t0-1
t1-1
)
)
)
(los-cw-ccw (the-as (inline-array collide-cache-tri) s1-1) s2-0 s4-0 f30-0 arg2 sv-800 f24-0)
(when *debug-segment*
(cond
((= (the-as int f24-0) -859915232)
(let ((t9-10 cam-debug-add-los-tri)
(a0-20 s1-1)
(a2-6 (new 'static 'vector :x (the-as float #x80) :w (the-as float #x80)))
)
(t9-10 (the-as (inline-array collide-cache-tri) a0-20) sv-800 a2-6)
)
)
(else
(cam-debug-add-los-tri
(the-as (inline-array collide-cache-tri) s1-1)
(set! (-> s1-0 start-pos quad) (-> arg0 quad))
(set! (-> s1-0 move-dist quad) (-> arg1 quad))
(let ((v1-5 s1-0))
(set! (-> v1-5 radius) (-> *CAM_STRING-bank* los-coll-rad))
(set! (-> v1-5 collide-with) (collide-spec backgnd obstacle hit-by-others-list camera-blocker pusher))
(set! (-> v1-5 ignore-process0) #f)
(set! (-> v1-5 ignore-process1) #f)
(set! (-> v1-5 ignore-pat) sv-768)
(set! (-> v1-5 action-mask) (collide-action solid))
)
(fill-using-line-sphere s0-0 s1-0)
(let ((s1-1 (the-as object (-> s0-0 tris)))
(f28-0 (/ 2048.0 f26-0))
(f26-1 (/ (+ -8192.0 f26-0) f26-0))
)
(if (< f26-1 0.0)
(set! f26-1 0.0)
)
(if (< 1.0 f28-0)
(set! f28-0 1.0)
)
(countdown (s0-1 (-> s0-0 num-tris))
(let* ((sv-800 (new 'stack-no-clear 'vector))
(sv-784 (new 'stack-no-clear 'vector))
(f0-7 (moving-sphere-triangle-intersect
arg0
arg1
(-> *CAM_STRING-bank* los-coll-rad)
(-> (the-as (inline-array collide-cache-tri) s1-1) 0)
sv-800
(new 'static 'vector :x (the-as float #x80) :y (the-as float #x80) :w (the-as float #x80))
sv-784
)
)
)
(cond
((or (< f0-7 0.0) (< 1.0 f0-7))
)
((let ((f1-2 0.0))
(let* ((v1-23 arg1))
(set! f2-1 (vector-dot v1-23 sv-784))
)
(< f1-2 f2-1)
)
(when (< f28-0 f0-7)
(let* ((t1-1 (new 'stack-no-clear 'vector))
(t0-1 (new 'stack-no-clear 'vector))
(f24-0 (moving-sphere-triangle-intersect
arg0
arg1
(-> *CAM_STRING-bank* los-coll-rad2)
(-> (the-as (inline-array collide-cache-tri) s1-1) 0)
t0-1
t1-1
)
)
)
(los-cw-ccw (the-as (inline-array collide-cache-tri) s1-1) s2-0 s4-0 f30-0 arg2 sv-800 f24-0)
(when *debug-segment*
(if (= (the-as int f24-0) -859915232)
(cam-debug-add-los-tri
(the-as (inline-array collide-cache-tri) s1-1)
sv-800
(new 'static 'vector :x (the-as float #x80) :w (the-as float #x80))
)
(cam-debug-add-los-tri
(the-as (inline-array collide-cache-tri) s1-1)
sv-800
(new 'static 'vector :x (the-as float #x80) :y (the-as float #x80) :w (the-as float #x80))
)
)
)
)
)
)
)
((< f0-7 f26-1)
(let* ((t1-3 (new 'stack-no-clear 'vector))
(t0-3 (new 'stack-no-clear 'vector))
(f24-1 (moving-sphere-triangle-intersect
arg0
arg1
(-> *CAM_STRING-bank* los-coll-rad2)
(-> (the-as (inline-array collide-cache-tri) s1-1) 0)
t0-3
t1-3
((< f0-7 f26-1)
(let* ((t1-3 (new 'stack-no-clear 'vector))
(t0-3 (new 'stack-no-clear 'vector))
(f24-1 (moving-sphere-triangle-intersect
arg0
arg1
(-> *CAM_STRING-bank* los-coll-rad2)
(-> (the-as (inline-array collide-cache-tri) s1-1) 0)
t0-3
t1-3
)
)
)
)
(los-cw-ccw (the-as (inline-array collide-cache-tri) s1-1) s2-0 s4-0 f30-0 arg2 sv-800 f24-1)
(when *debug-segment*
(if (= (the-as int f24-1) -859915232)
(cam-debug-add-los-tri
(the-as (inline-array collide-cache-tri) s1-1)
sv-800
(new 'static 'vector :y (the-as float #x80) :w (the-as float #x80))
)
(los-cw-ccw (the-as (inline-array collide-cache-tri) s1-1) s2-0 s4-0 f30-0 arg2 sv-800 f24-1)
(when *debug-segment*
(if (= (the-as int f24-1) -859915232)
(cam-debug-add-los-tri
(the-as (inline-array collide-cache-tri) s1-1)
sv-800
(new 'static 'vector :y (the-as float #x80) :w (the-as float #x80))
)
(cam-debug-add-los-tri
(the-as (inline-array collide-cache-tri) s1-1)
sv-800
(new 'static 'vector :z (the-as float #x80) :w (the-as float #x80))
)
)
(cam-debug-add-los-tri
(the-as (inline-array collide-cache-tri) s1-1)
sv-800
(new 'static 'vector :z (the-as float #x80) :w (the-as float #x80))
)
)
)
)
)
)
)
)
(set! s1-1 (-> (the-as (inline-array collide-cache-tri) s1-1) 1))
)
(set! s1-1 (-> (the-as (inline-array collide-cache-tri) s1-1) 1))
)
)
)
@@ -2025,13 +2000,13 @@
(set! s1-3 -134250495)
(while (and (!= s2-2 -134250495)
(begin
(let ((s0-3 cam-los-spline-collide))
(set! sv-816 (-> (the-as (inline-array tracking-spline) (-> *camera* target-spline)) 0 point s2-2))
(set! sv-832 arg0)
(let ((a2-21 (camera-master-method-16 *camera* #t)))
(set! f30-1 (s0-3 (-> sv-816 position) sv-832 (the-as pat-surface a2-21)))
)
)
(set! f30-1
(cam-los-spline-collide
(-> (the-as (inline-array tracking-spline) (-> *camera* target-spline)) 0 point s2-2 position)
arg0
(the-as pat-surface (camera-master-method-16 *camera* #t))
)
)
(< f30-1 0.0)
)
)
+11 -17
View File
@@ -25,7 +25,6 @@
;; definition for function update-view-planes
;; INFO: Used lq/sq
(defun update-view-planes ((arg0 math-camera) (arg1 (inline-array plane)) (arg2 float) (arg3 matrix))
(local-vars (sv-240 vector))
(when (not *artist-fix-frustum*)
(let ((s5-0 (new 'stack 'view-frustum)))
(let ((f30-0 (* arg2 (-> arg0 x-ratio) (-> arg0 d)))
@@ -62,22 +61,17 @@
(s0-0 (new-stack-vector0))
)
(set! (-> (new 'stack-no-clear 'vector) quad) (the-as uint128 0))
(set! sv-240 (new 'stack-no-clear 'vector))
(set! (-> sv-240 quad) (the-as uint128 0))
(let ((v1-15 (-> arg3 trans quad)))
(set! (-> sv-240 quad) v1-15)
)
(vector-! s2-1 (-> s5-0 yon-top-left) sv-240)
(vector-! s3-1 (-> s5-0 yon-top-right) sv-240)
(vector-! s1-0 (-> s5-0 yon-bottom-left) sv-240)
(vector-! s0-0 (-> s5-0 yon-bottom-right) sv-240)
(plane-from-points arg1 s2-1 s1-0 sv-240 0)
(plane-from-points arg1 s0-0 s3-1 sv-240 1)
(plane-from-points arg1 s3-1 s2-1 sv-240 2)
(let ((t9-20 plane-from-points)
(t0-3 3)
)
(t9-20 arg1 s1-0 s0-0 sv-240 t0-3)
(let ((sv-240 (new 'stack-no-clear 'vector)))
(set! (-> sv-240 quad) (the-as uint128 0))
(set! (-> sv-240 quad) (-> arg3 trans quad))
(vector-! s2-1 (-> s5-0 yon-top-left) sv-240)
(vector-! s3-1 (-> s5-0 yon-top-right) sv-240)
(vector-! s1-0 (-> s5-0 yon-bottom-left) sv-240)
(vector-! s0-0 (-> s5-0 yon-bottom-right) sv-240)
(plane-from-points arg1 s2-1 s1-0 sv-240 0)
(plane-from-points arg1 s0-0 s3-1 sv-240 1)
(plane-from-points arg1 s3-1 s2-1 sv-240 2)
(plane-from-points arg1 s1-0 s0-0 sv-240 3)
)
)
)
+143 -229
View File
@@ -303,9 +303,7 @@
;; definition for function fourth-power
(defun fourth-power ((arg0 float))
(let ((f0-2 (* arg0 arg0)))
(* f0-2 f0-2)
)
(square (square arg0))
)
;; definition for function third-power
@@ -323,19 +321,10 @@
0.0
)
((>= 0.5 arg0)
(let ((f0-3 0.5)
(f1-4 (* 2.0 arg0))
)
(* f0-3 (* f1-4 f1-4))
)
(* 0.5 (square (* 2.0 arg0)))
)
(else
(let ((f0-5 1.0)
(f1-7 0.5)
(f2-2 (* 2.0 (- 1.0 arg0)))
)
(- f0-5 (* f1-7 (* f2-2 f2-2)))
)
(- 1.0 (* 0.5 (square (* 2.0 (- 1.0 arg0)))))
)
)
)
@@ -376,19 +365,12 @@
;; definition for method 9 of type cam-index
;; INFO: Used lq/sq
(defmethod cam-index-method-9 ((this cam-index) (arg0 symbol) (arg1 entity) (arg2 vector) (arg3 curve))
(local-vars (sv-32 (function _varargs_ object)))
(format (clear *cam-res-string*) "~S-flags" arg0)
(set! (-> this flags) (the-as cam-index-options (cam-slave-get-flags arg1 (string->symbol *cam-res-string*))))
(let ((s3-2 (res-lump-data arg1 arg0 pointer))
(s0-1 (method-of-type res-lump get-property-struct))
)
(set! sv-32 format)
(let ((a0-7 (clear *res-key-string*))
(a1-4 "~S~S")
(a3-2 '-offset)
)
(sv-32 a0-7 a1-4 arg0 a3-2)
)
(format (clear *res-key-string*) "~S~S" arg0 '-offset)
(let ((v0-8 (s0-1
arg1
(string->symbol *res-key-string*)
@@ -1201,7 +1183,6 @@
;; ERROR: Stack slot load at 144 mismatch: defined as size 4, got size 16
;; ERROR: Stack slot load at 160 mismatch: defined as size 4, got size 16
(defun cam-calc-follow! ((arg0 cam-rotation-tracker) (arg1 vector) (arg2 symbol))
(local-vars (sv-128 (function float float float float)) (sv-144 float) (sv-160 float))
(with-pp
(cond
(arg2
@@ -1232,11 +1213,13 @@
(vector-flatten! s0-0 s0-0 (-> *camera* local-down))
(vector-normalize! s0-0 1.0)
(vector-float*! s2-0 (-> *camera* tgt-face-mat vector 2) 32768.0)
(set! sv-128 lerp-clamp)
(set! sv-144 (the-as float 0.7))
(set! sv-160 (the-as float 0.4))
(let* ((a2-3 (parameter-ease-sin-clamp (* 0.00081380206 (+ -409.6 f30-0))))
(f30-1 (sv-128 sv-144 sv-160 a2-3))
(let* ((f30-1
(lerp-clamp
(the-as float 0.7)
(the-as float 0.4)
(parameter-ease-sin-clamp (* 0.00081380206 (+ -409.6 f30-0)))
)
)
(f0-7 (acos (vector-dot s0-0 s1-0)))
(f28-0 (fmax 1820.4445 f0-7))
)
@@ -1254,10 +1237,7 @@
((< (-> *camera* ease-t) 1.0)
)
((< (-> arg0 follow-blend) 1.0)
(let* ((f0-21 (-> arg0 follow-blend))
(f0-22 (* f0-21 f0-21))
(f0-23 (* f0-22 f0-22))
)
(let ((f0-23 (square (square (-> arg0 follow-blend)))))
(vector-! s2-0 s2-0 (-> arg0 follow-off))
(vector-float*! s2-0 s2-0 f0-23)
)
@@ -1305,10 +1285,10 @@
1.0
)
(else
(let* ((f0-33 (* f0-32 f0-32))
(let* ((f0-33 (square f0-32))
(f0-34 (- 1.0 f0-33))
)
(* f0-34 (* f0-34 f0-34))
(* f0-34 (square f0-34))
)
)
)
@@ -1470,7 +1450,6 @@
;; definition for function vector-into-frustum-nosmooth!
;; INFO: Used lq/sq
(defun vector-into-frustum-nosmooth! ((arg0 matrix) (arg1 vector) (arg2 float))
(local-vars (sv-112 (inline-array vector)) (sv-128 vector) (sv-144 vector) (sv-160 vector) (sv-176 vector))
(rlet ((vf0 :class vf)
(vf1 :class vf)
(vf2 :class vf)
@@ -1491,17 +1470,19 @@
(vector-flatten! s3-0 s3-0 (-> arg0 vector 1))
(vector-normalize! s3-0 1.0)
(let ((f28-0 (vector-dot s3-0 (-> arg0 vector 0))))
(set! sv-128 s2-0)
(set! sv-112 (-> arg0 vector))
(let ((f0-7 (* 0.8 (tan (/ arg2 2)))))
(.lvf vf1 (&-> sv-112 0 quad))
(let ((v1-11 f0-7))
(.mov vf2 v1-11)
(let ((sv-128 s2-0))
(let ((sv-112 (-> arg0 vector))
(f0-7 (* 0.8 (tan (/ arg2 2))))
)
(.lvf vf1 (&-> sv-112 0 quad))
(let ((v1-11 f0-7))
(.mov vf2 v1-11)
)
)
(.add.x.vf.w vf1 vf0 vf0)
(.mul.x.vf.xyz vf1 vf1 vf2)
(.svf (&-> sv-128 quad) vf1)
)
(.add.x.vf.w vf1 vf0 vf0)
(.mul.x.vf.xyz vf1 vf1 vf2)
(.svf (&-> sv-128 quad) vf1)
(vector+! s2-0 s2-0 (-> arg0 vector 2))
(vector-normalize! s2-0 f26-0)
(vector--float*! s2-0 s2-0 (-> arg0 vector 0) 6144.0)
@@ -1524,17 +1505,19 @@
(vector-flatten! s3-0 s3-0 (-> arg0 vector 0))
(vector-normalize! s3-0 1.0)
(let ((f28-1 (vector-dot s3-0 (-> arg0 vector 1))))
(set! sv-160 s2-0)
(set! sv-144 (-> arg0 vector 1))
(let ((f0-16 (* 0.525 (tan (/ arg2 2)))))
(.lvf vf1 (&-> sv-144 quad))
(let ((v1-32 f0-16))
(.mov vf2 v1-32)
(let ((sv-160 s2-0))
(let ((sv-144 (-> arg0 vector 1))
(f0-16 (* 0.525 (tan (/ arg2 2))))
)
(.lvf vf1 (&-> sv-144 quad))
(let ((v1-32 f0-16))
(.mov vf2 v1-32)
)
)
(.add.x.vf.w vf1 vf0 vf0)
(.mul.x.vf.xyz vf1 vf1 vf2)
(.svf (&-> sv-160 quad) vf1)
)
(.add.x.vf.w vf1 vf0 vf0)
(.mul.x.vf.xyz vf1 vf1 vf2)
(.svf (&-> sv-160 quad) vf1)
(vector+! s2-0 s2-0 (-> arg0 vector 2))
(vector-normalize! s2-0 1.0)
(let ((f0-18 (vector-dot s2-0 (-> arg0 vector 1))))
@@ -1550,12 +1533,7 @@
(vector-flatten! s3-0 s3-0 (-> arg0 vector 0))
(vector-normalize! s3-0 1.0)
(let ((f28-2 (vector-dot s3-0 (-> arg0 vector 1))))
(let ((s0-1 s2-0))
(set! sv-176 (-> arg0 vector 1))
(let ((f0-26 (* 0.525 (tan (/ arg2 2)))))
(vector-float*! s0-1 sv-176 f0-26)
)
)
(vector-float*! s2-0 (-> arg0 vector 1) (* 0.525 (tan (/ arg2 2))))
(vector+! s2-0 s2-0 (-> arg0 vector 2))
(vector-normalize! s2-0 1.0)
(let ((f0-28 (vector-dot s2-0 (-> arg0 vector 1))))
@@ -1597,15 +1575,7 @@
;; ERROR: Unsupported inline assembly instruction kind - [madda.s f1, f4]
;; ERROR: Unsupported inline assembly instruction kind - [madd.s f0, f2, f5]
(defun slave-set-rotation! ((arg0 cam-rotation-tracker) (arg1 vector) (arg2 cam-slave-options-u32) (arg3 float) (arg4 symbol))
(local-vars
(f0-9 float)
(sv-208 vector)
(sv-224 vector)
(sv-240 matrix)
(sv-256 (function matrix vector float vector))
(sv-272 matrix)
(sv-288 vector)
)
(local-vars (f0-9 float))
(rlet ((vf0 :class vf)
(vf4 :class vf)
(vf5 :class vf)
@@ -1621,22 +1591,23 @@
(let ((f30-0 (-> arg0 tilt-adjust value)))
(cond
((< 0.0001 (-> arg0 point-of-interest-blend value))
(set! sv-208 (new 'stack-no-clear 'vector))
0.0
(vector-! s0-0 (-> arg0 follow-pt) arg1)
(let ((f28-0 (vector-length s0-0)))
(vector-! sv-208 (-> *camera* settings point-of-interest) arg1)
(vector-normalize! sv-208 (* f28-0 (-> arg0 point-of-interest-blend value)))
(let ((v1-12 s0-0))
(let ((a0-10 s0-0))
(.mov.vf.w vf6 vf0)
(.lvf vf4 (&-> a0-10 quad))
(let ((sv-208 (new 'stack-no-clear 'vector)))
0.0
(vector-! s0-0 (-> arg0 follow-pt) arg1)
(let ((f28-0 (vector-length s0-0)))
(vector-! sv-208 (-> *camera* settings point-of-interest) arg1)
(vector-normalize! sv-208 (* f28-0 (-> arg0 point-of-interest-blend value)))
(let ((v1-12 s0-0))
(let ((a0-10 s0-0))
(.mov.vf.w vf6 vf0)
(.lvf vf4 (&-> a0-10 quad))
)
(.lvf vf5 (&-> sv-208 quad))
(.add.vf.xyz vf6 vf4 vf5)
(.svf (&-> v1-12 quad) vf6)
)
(.lvf vf5 (&-> sv-208 quad))
(.add.vf.xyz vf6 vf4 vf5)
(.svf (&-> v1-12 quad) vf6)
(vector-normalize! s0-0 f28-0)
)
(vector-normalize! s0-0 f28-0)
)
(vector-! (-> arg0 looking-interesting) (-> *camera* settings point-of-interest) (-> arg0 follow-pt))
(vector+float*!
@@ -1656,47 +1627,35 @@
(when (!= f30-0 0.0)
0.0
0.0
(set! sv-240 (new 'stack-no-clear 'matrix))
(set! sv-224 (new 'stack-no-clear 'vector))
(vector-normalize-copy! sv-224 s0-0 1.0)
(let* ((v1-25 (-> *camera* local-down))
(f0-8 (-> sv-224 x))
(f1-1 (-> sv-224 y))
(f2-0 (-> sv-224 z))
(f3-0 (-> v1-25 x))
(f4-0 (-> v1-25 y))
(f5-0 (-> v1-25 z))
)
(.mula.s f0-8 f3-0)
(.madda.s f1-1 f4-0)
(.madd.s f0-9 f2-0 f5-0)
)
(let* ((f28-1 f0-9)
(f0-11 (acos (fabs f28-1)))
)
(cond
((< 0.0 f30-0)
(set! f30-0 (if (< 0.0 f28-1)
(fmin f30-0 (fmax 0.0 (+ -2730.6667 f0-11)))
(fmin f30-0 (fmax 0.0 (- 32768.0 (+ 2730.6667 f0-11))))
)
)
)
((< f30-0 0.0)
(set! f30-0 (if (< 0.0 f28-1)
(fmax f30-0 (- (fmax 0.0 (- 32768.0 (+ 2730.6667 f0-11)))))
(fmax f30-0 (- (fmax 0.0 (+ -2730.6667 f0-11))))
)
)
)
)
)
(matrix-rotate-x! sv-240 f30-0)
(let ((t9-6 matrix*!)
(a0-28 s1-0)
(a2-3 s1-0)
(let ((sv-240 (new 'stack-no-clear 'matrix)))
(let ((sv-224 (new 'stack-no-clear 'vector)))
(vector-normalize-copy! sv-224 s0-0 1.0)
(let* ((v1-25 (-> *camera* local-down)))
(set! f0-9 (vector-dot sv-224 v1-25))
)
(t9-6 a0-28 sv-240 a2-3)
)
(let* ((f28-1 f0-9)
(f0-11 (acos (fabs f28-1)))
)
(cond
((< 0.0 f30-0)
(set! f30-0 (if (< 0.0 f28-1)
(fmin f30-0 (fmax 0.0 (+ -2730.6667 f0-11)))
(fmin f30-0 (fmax 0.0 (- 32768.0 (+ 2730.6667 f0-11))))
)
)
)
((< f30-0 0.0)
(set! f30-0 (if (< 0.0 f28-1)
(fmax f30-0 (- (fmax 0.0 (- 32768.0 (+ 2730.6667 f0-11)))))
(fmax f30-0 (- (fmax 0.0 (+ -2730.6667 f0-11))))
)
)
)
)
)
(matrix-rotate-x! sv-240 f30-0)
(matrix*! s1-0 sv-240 s1-0)
)
)
)
@@ -1709,12 +1668,7 @@
(set! (-> arg0 underwater-blend target) 0.0)
)
)
(set! sv-256 vector-into-frustum-nosmooth!)
(set! sv-272 s1-0)
(set! sv-288 arg1)
(let ((a2-5 (lerp-clamp arg3 (/ arg3 4) (-> arg0 underwater-blend value))))
(sv-256 sv-272 sv-288 a2-5)
)
(vector-into-frustum-nosmooth! s1-0 arg1 (lerp-clamp arg3 (/ arg3 4) (-> arg0 underwater-blend value)))
(cond
(arg4
(slave-matrix-blend-2 (-> arg0 inv-mat) arg2 s0-0 s1-0)
@@ -1782,97 +1736,71 @@
;; ERROR: Unsupported inline assembly instruction kind - [madda.s f1, f4]
;; ERROR: Unsupported inline assembly instruction kind - [madd.s f0, f2, f5]
(defun v-slrp2! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float) (arg4 vector) (arg5 float))
(local-vars
(f0-10 float)
(f28-0 float)
(f30-0 float)
(sv-144 float)
(sv-160 vector)
(sv-176 matrix)
(sv-192 vector)
)
(set! sv-144 arg5)
(let ((s0-0 (new-stack-vector0)))
(set! sv-160 (new 'stack-no-clear 'vector))
(local-vars (f0-10 float) (f28-0 float) (f30-0 float))
(let ((sv-144 arg5)
(s0-0 (new-stack-vector0))
(sv-160 (new 'stack-no-clear 'vector))
)
(set! (-> sv-160 quad) (the-as uint128 0))
1.0
1.0
(let ((s3-0 (new-stack-vector0)))
0.0
1.0
(set! sv-176 (new 'stack-no-clear 'matrix))
(set! (-> sv-176 quad 0) (the-as uint128 0))
(set! (-> sv-176 quad 1) (the-as uint128 0))
(set! (-> sv-176 quad 2) (the-as uint128 0))
(set! (-> sv-176 trans quad) (the-as uint128 0))
(cond
((< 1.0 arg3)
(set! arg3 1.0)
)
((< arg3 0.0)
(set! arg3 0.0)
)
)
(cond
(arg4
(vector-flatten! s0-0 arg1 arg4)
(vector-flatten! sv-160 arg2 arg4)
(set! f30-0 (vector-normalize-ret-len! s0-0 1.0))
(set! f28-0 (vector-normalize-ret-len! sv-160 1.0))
(vector-normalize! (vector-cross! s3-0 sv-160 s0-0) 1.0)
(let ((f26-0 (vector-dot arg4 s3-0)))
(vector-normalize-copy! s3-0 arg4 1.0)
(if (< f26-0 0.0)
(vector-negate! s3-0 s3-0)
)
(let ((sv-176 (new 'stack-no-clear 'matrix)))
(set! (-> sv-176 quad 0) (the-as uint128 0))
(set! (-> sv-176 quad 1) (the-as uint128 0))
(set! (-> sv-176 quad 2) (the-as uint128 0))
(set! (-> sv-176 trans quad) (the-as uint128 0))
(cond
((< 1.0 arg3)
(set! arg3 1.0)
)
((< arg3 0.0)
(set! arg3 0.0)
)
)
(cond
(arg4
(vector-flatten! s0-0 arg1 arg4)
(vector-flatten! sv-160 arg2 arg4)
(set! f30-0 (vector-normalize-ret-len! s0-0 1.0))
(set! f28-0 (vector-normalize-ret-len! sv-160 1.0))
(vector-normalize! (vector-cross! s3-0 sv-160 s0-0) 1.0)
(let ((f26-0 (vector-dot arg4 s3-0)))
(vector-normalize-copy! s3-0 arg4 1.0)
(if (< f26-0 0.0)
(vector-negate! s3-0 s3-0)
)
)
)
(else
(set! (-> s0-0 quad) (-> arg1 quad))
(set! (-> sv-160 quad) (-> arg2 quad))
(set! f30-0 (vector-normalize-ret-len! s0-0 1.0))
(set! f28-0 (vector-normalize-ret-len! sv-160 1.0))
(vector-normalize! (vector-cross! s3-0 arg2 arg1) 1.0)
)
)
(else
(set! (-> s0-0 quad) (-> arg1 quad))
(set! (-> sv-160 quad) (-> arg2 quad))
(set! f30-0 (vector-normalize-ret-len! s0-0 1.0))
(set! f28-0 (vector-normalize-ret-len! sv-160 1.0))
(vector-normalize! (vector-cross! s3-0 arg2 arg1) 1.0)
)
)
(let ((t9-10 acos))
(let* ((v1-22 s0-0)
(f0-9 (-> v1-22 x))
(f1-2 (-> v1-22 y))
(f2-0 (-> v1-22 z))
(f3-0 (-> sv-160 x))
(f4-0 (-> sv-160 y))
(f5-0 (-> sv-160 z))
)
(.mula.s f0-9 f3-0)
(.madda.s f1-2 f4-0)
(.madd.s f0-10 f2-0 f5-0)
)
(let* ((f1-3 (t9-10 f0-10))
(f0-12 (* arg3 f1-3))
)
(when (< sv-144 f0-12)
(set! f0-12 sv-144)
(set! arg3 (/ sv-144 f1-3))
(let ((t9-10 acos))
(let* ((v1-22 s0-0))
(set! f0-10 (vector-dot v1-22 sv-160))
)
(let* ((f0-13 (cos f0-12))
(t9-12 matrix-axis-sin-cos!)
(a0-20 sv-176)
(a1-13 s3-0)
(f1-5 1.0)
(f2-3 f0-13)
(let* ((f1-3 (t9-10 f0-10))
(f0-12 (* arg3 f1-3))
)
(t9-12 a0-20 a1-13 (sqrtf (- f1-5 (* f2-3 f2-3))) f0-13)
(when (< sv-144 f0-12)
(set! f0-12 sv-144)
(set! arg3 (/ sv-144 f1-3))
)
(let ((f0-13 (cos f0-12)))
(matrix-axis-sin-cos! sv-176 s3-0 (sqrtf (- 1.0 (square f0-13))) f0-13)
)
)
)
(vector-matrix*! arg0 s0-0 sv-176)
)
(vector-matrix*! arg0 s0-0 sv-176)
(let ((s0-1 vector-normalize!))
(set! sv-192 arg0)
(let ((a1-16 (lerp f30-0 f28-0 arg3)))
(s0-1 sv-192 a1-16)
)
)
(vector-normalize! arg0 (lerp f30-0 f28-0 arg3))
(when arg4
(vector+float*! arg0 arg0 s3-0 (vector-dot arg1 s3-0))
(vector+float*! arg0 arg0 s3-0 (* arg3 (vector-dot (vector-! (new-stack-vector0) arg2 arg1) s3-0)))
@@ -1901,10 +1829,11 @@
;; ERROR: Unsupported inline assembly instruction kind - [madda.s f1, f4]
;; ERROR: Unsupported inline assembly instruction kind - [madd.s f0, f2, f5]
(defun v-slrp3! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 float))
(local-vars (f0-7 float) (f26-0 float) (f28-0 float) (sv-144 float) (sv-160 vector))
(set! sv-144 arg4)
(let ((s1-0 (new-stack-vector0)))
(set! sv-160 (new 'stack-no-clear 'vector))
(local-vars (f0-7 float) (f26-0 float) (f28-0 float))
(let ((sv-144 arg4)
(s1-0 (new-stack-vector0))
(sv-160 (new 'stack-no-clear 'vector))
)
(set! (-> sv-160 quad) (the-as uint128 0))
0.0
0.0
@@ -1936,31 +1865,16 @@
)
)
(let ((t9-10 acos))
(let* ((v1-10 s1-0)
(f0-6 (-> v1-10 x))
(f1-0 (-> v1-10 y))
(f2-0 (-> v1-10 z))
(f3-0 (-> sv-160 x))
(f4-0 (-> sv-160 y))
(f5-0 (-> sv-160 z))
)
(.mula.s f0-6 f3-0)
(.madda.s f1-0 f4-0)
(.madd.s f0-7 f2-0 f5-0)
(let* ((v1-10 s1-0))
(set! f0-7 (vector-dot v1-10 sv-160))
)
(let ((f0-8 (t9-10 f0-7)))
(when (< sv-144 f0-8)
(set! f30-0 (/ sv-144 f0-8))
(set! f0-8 sv-144)
)
(let* ((f0-9 (cos f0-8))
(t9-12 matrix-axis-sin-cos!)
(a0-20 s0-0)
(a1-13 s3-0)
(f1-3 1.0)
(f2-1 f0-9)
)
(t9-12 a0-20 a1-13 (sqrtf (- f1-3 (* f2-1 f2-1))) f0-9)
(let ((f0-9 (cos f0-8)))
(matrix-axis-sin-cos! s0-0 s3-0 (sqrtf (- 1.0 (square f0-9))) f0-9)
)
)
)
+12 -16
View File
@@ -653,14 +653,12 @@
)
(vector+float*! (-> s3-0 vector 0) (-> arg0 start-pos) (-> arg0 move-dist) f0-6)
)
(let ((f0-7 (vector-vector-distance-squared (-> s3-0 vector 0) (-> s0-0 world-sphere)))
(f1-5 (+ (-> arg0 radius) (-> s0-0 world-sphere w)))
)
(when (< f0-7 (* f1-5 f1-5))
(when (< *actor-list-length* 256)
(set! (-> *actor-list* *actor-list-length*) (the-as collide-shape s1-0))
(set! *actor-list-length* (+ *actor-list-length* 1))
)
(when (< (vector-vector-distance-squared (-> s3-0 vector 0) (-> s0-0 world-sphere))
(square (+ (-> arg0 radius) (-> s0-0 world-sphere w)))
)
(when (< *actor-list-length* 256)
(set! (-> *actor-list* *actor-list-length*) (the-as collide-shape s1-0))
(set! *actor-list-length* (+ *actor-list-length* 1))
)
)
)
@@ -689,14 +687,12 @@
)
(vector+float*! (-> s3-0 vector 0) (-> arg0 start-pos) (-> arg0 move-dist) f0-11)
)
(let ((f0-12 (vector-vector-distance-squared (-> s3-0 vector 0) (-> s0-1 world-sphere)))
(f1-11 (+ (-> arg0 radius) (-> s0-1 world-sphere w)))
)
(when (< f0-12 (* f1-11 f1-11))
(when (< *actor-list-length* 256)
(set! (-> *actor-list* *actor-list-length*) (the-as collide-shape s1-1))
(set! *actor-list-length* (+ *actor-list-length* 1))
)
(when (< (vector-vector-distance-squared (-> s3-0 vector 0) (-> s0-1 world-sphere))
(square (+ (-> arg0 radius) (-> s0-1 world-sphere w)))
)
(when (< *actor-list-length* 256)
(set! (-> *actor-list* *actor-list-length*) (the-as collide-shape s1-1))
(set! *actor-list-length* (+ *actor-list-length* 1))
)
)
)
+14 -20
View File
@@ -150,7 +150,6 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs symbol.
(defmethod check-grab-for-collisions ((this collide-edge-work) (arg0 collide-edge-hold-item) (arg1 edge-grab-info))
(local-vars (sv-656 vector) (sv-672 vector))
(rlet ((acc :class vf)
(vf0 :class vf)
(vf4 :class vf)
@@ -184,19 +183,21 @@
(return (the-as symbol #f))
)
)
(set! sv-672 s0-0)
(set! sv-656 (-> arg0 center-pt))
(let ((v0-2 (vector-negate! (new 'stack-no-clear 'vector) (-> s2-0 edge-vec-norm))))
(let ((v1-8 1105.92))
(.mov vf7 v1-8)
(let ((sv-672 s0-0))
(let ((sv-656 (-> arg0 center-pt)))
(let ((v0-2 (vector-negate! (new 'stack-no-clear 'vector) (-> s2-0 edge-vec-norm))))
(let ((v1-8 1105.92))
(.mov vf7 v1-8)
)
(.lvf vf5 (&-> v0-2 quad))
)
(.lvf vf4 (&-> sv-656 quad))
)
(.lvf vf5 (&-> v0-2 quad))
(.add.x.vf.w vf6 vf0 vf0)
(.mul.x.vf.xyz acc vf5 vf7)
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
(.svf (&-> sv-672 quad) vf6)
)
(.lvf vf4 (&-> sv-656 quad))
(.add.x.vf.w vf6 vf0 vf0)
(.mul.x.vf.xyz acc vf5 vf7)
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
(.svf (&-> sv-672 quad) vf6)
(let ((f0-3 (get-best-hand-point this (-> arg1 left-hand-hold) s0-0 (the-as int s4-0))))
(if (< 491.52 f0-3)
(return (the-as symbol #f))
@@ -599,7 +600,6 @@
;; definition for method 10 of type collide-edge-work
;; INFO: Used lq/sq
(defmethod debug-draw-edges ((this collide-edge-work))
(local-vars (sv-32 (function _varargs_ object)))
(let ((gp-0 0))
(dotimes (s4-0 (the-as int (-> this num-edges)))
(let* ((v1-3 (-> this edges s4-0))
@@ -636,13 +636,7 @@
(s1-0 #t)
(s0-0 318)
)
(set! sv-32 format)
(let ((a0-10 (clear *temp-string*))
(a1-4 "~D")
(a2-2 s4-0)
)
(sv-32 a0-10 a1-4 a2-2)
)
(format (clear *temp-string*) "~D" s4-0)
(s2-0 s1-0 (the-as bucket-id s0-0) *temp-string* s3-0 (font-color white) (the-as vector2h #f))
)
)
+8 -16
View File
@@ -190,14 +190,10 @@
(.add.y.vf.x vf1 vf1 vf1)
(.add.z.vf.x vf1 vf1 vf1)
(.mov a2-5 vf1)
(let ((f0-0 a2-5)
(f1-1 (+ (-> a1-2 world-sphere w) (-> s4-0 prim-core world-sphere w)))
)
(when (< f0-0 (* f1-1 f1-1))
(when (< *actor-list-length* 256)
(set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-3))
(set! *actor-list-length* (+ *actor-list-length* 1))
)
(when (< a2-5 (square (+ (-> a1-2 world-sphere w) (-> s4-0 prim-core world-sphere w))))
(when (< *actor-list-length* 256)
(set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-3))
(set! *actor-list-length* (+ *actor-list-length* 1))
)
)
)
@@ -231,14 +227,10 @@
(.add.y.vf.x vf1 vf1 vf1)
(.add.z.vf.x vf1 vf1 vf1)
(.mov a2-12 vf1)
(let ((f0-1 a2-12)
(f1-5 (+ (-> a1-14 world-sphere w) (-> s4-0 prim-core world-sphere w)))
)
(when (< f0-1 (* f1-5 f1-5))
(when (< *actor-list-length* 256)
(set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-6))
(set! *actor-list-length* (+ *actor-list-length* 1))
)
(when (< a2-12 (square (+ (-> a1-14 world-sphere w) (-> s4-0 prim-core world-sphere w))))
(when (< *actor-list-length* 256)
(set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-6))
(set! *actor-list-length* (+ *actor-list-length* 1))
)
)
)
+157 -179
View File
@@ -597,7 +597,6 @@
;; definition for function find-ground-point
;; INFO: Used lq/sq
(defun find-ground-point ((arg0 control-info) (arg1 vector) (arg2 float) (arg3 float))
(local-vars (sv-560 int))
(let* ((f0-0 819.2)
(v1-1 (-> arg0 transv))
(f30-0 (if (< f0-0 (sqrtf (+ (* (-> v1-1 x) (-> v1-1 x)) (* (-> v1-1 z) (-> v1-1 z)))))
@@ -637,51 +636,50 @@
)
)
)
(sv-560 0)
(f26-0 arg3)
)
(set! sv-560 0)
(let ((f26-0 arg3))
(set-vector! (-> s1-0 move-dist) 0.0 0.0 arg3 1.0)
(vector-rotate-y! (-> s1-0 move-dist) (-> s1-0 move-dist) f28-0)
(if (>= (probe-using-line-sphere *collide-cache* s1-0) 0.0)
(set! f26-0 (+ -6144.0 (vector-vector-xz-distance s2-0 (-> s1-0 best-other-tri intersect))))
(set-vector! (-> s1-0 move-dist) 0.0 0.0 arg3 1.0)
(vector-rotate-y! (-> s1-0 move-dist) (-> s1-0 move-dist) f28-0)
(if (>= (probe-using-line-sphere *collide-cache* s1-0) 0.0)
(set! f26-0 (+ -6144.0 (vector-vector-xz-distance s2-0 (-> s1-0 best-other-tri intersect))))
)
(let ((f24-0 arg2))
(while (>= f26-0 f24-0)
(set-vector! (-> s1-0 start-pos) 0.0 0.0 f24-0 1.0)
(vector-rotate-y! (-> s1-0 start-pos) (-> s1-0 start-pos) f28-0)
(vector+! (-> s1-0 start-pos) s2-0 (-> s1-0 start-pos))
(set! (-> s1-0 start-pos y) (+ 20480.0 (-> s2-0 y)))
(set-vector! (-> s1-0 move-dist) 0.0 -61440.0 0.0 1.0)
(let ((v1-33 s1-0))
(set! (-> v1-33 radius) 10240.0)
(set! (-> v1-33 collide-with) (-> arg0 root-prim prim-core collide-with))
(set! (-> v1-33 ignore-process0) (-> arg0 process))
(set! (-> v1-33 ignore-process1) #f)
(set! (-> v1-33 ignore-pat) (-> arg0 pat-ignore-mask))
(set! (-> v1-33 action-mask) (collide-action solid))
)
(let ((f24-0 arg2))
(while (>= f26-0 f24-0)
(set-vector! (-> s1-0 start-pos) 0.0 0.0 f24-0 1.0)
(vector-rotate-y! (-> s1-0 start-pos) (-> s1-0 start-pos) f28-0)
(vector+! (-> s1-0 start-pos) s2-0 (-> s1-0 start-pos))
(set! (-> s1-0 start-pos y) (+ 20480.0 (-> s2-0 y)))
(set-vector! (-> s1-0 move-dist) 0.0 -61440.0 0.0 1.0)
(let ((v1-33 s1-0))
(set! (-> v1-33 radius) 10240.0)
(set! (-> v1-33 collide-with) (-> arg0 root-prim prim-core collide-with))
(set! (-> v1-33 ignore-process0) (-> arg0 process))
(set! (-> v1-33 ignore-process1) #f)
(set! (-> v1-33 ignore-pat) (-> arg0 pat-ignore-mask))
(set! (-> v1-33 action-mask) (collide-action solid))
(when (>= (probe-using-line-sphere *collide-cache* s1-0) 0.0)
(cond
((and (or (= (-> s1-0 best-other-tri pat mode) (pat-mode ground))
(= (-> s1-0 best-other-tri pat mode) (pat-mode halfpipe))
)
(and (= (-> s1-0 best-other-tri pat event) (pat-event none)) (< 0.7 (-> s1-0 best-other-tri normal y)))
)
(set! (-> arg1 quad) (-> s1-0 best-other-tri intersect quad))
(+! sv-560 1)
(if (>= sv-560 2)
(return arg1)
)
)
((and (= (-> s1-0 best-other-tri pat mode) (pat-mode wall))
(< (+ 4096.0 (-> s2-0 y)) (-> s1-0 best-other-tri intersect y))
)
(goto cfg-38)
)
)
(when (>= (probe-using-line-sphere *collide-cache* s1-0) 0.0)
(cond
((and (or (= (-> s1-0 best-other-tri pat mode) (pat-mode ground))
(= (-> s1-0 best-other-tri pat mode) (pat-mode halfpipe))
)
(and (= (-> s1-0 best-other-tri pat event) (pat-event none)) (< 0.7 (-> s1-0 best-other-tri normal y)))
)
(set! (-> arg1 quad) (-> s1-0 best-other-tri intersect quad))
(set! sv-560 (+ sv-560 1))
(if (>= sv-560 2)
(return arg1)
)
)
((and (= (-> s1-0 best-other-tri pat mode) (pat-mode wall))
(< (+ 4096.0 (-> s2-0 y)) (-> s1-0 best-other-tri intersect y))
)
(goto cfg-38)
)
)
)
(set! f24-0 (+ 4096.0 f24-0))
)
(set! f24-0 (+ 4096.0 f24-0))
)
)
)
@@ -877,73 +875,73 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defun cshape-reaction-update-state ((arg0 control-info) (arg1 collide-query) (arg2 vector))
(local-vars (sv-48 vector) (sv-52 vector) (sv-56 collide-status) (sv-96 symbol))
(set! sv-48 (new-stack-vector0))
(set! sv-52 (new-stack-vector0))
(set! sv-56 (collide-status))
(let ((a1-1 (new 'stack-no-clear 'vector)))
(vector-float*! a1-1 (-> arg1 move-dist) (-> arg1 best-dist))
(move-by-vector! arg0 a1-1)
)
(react-to-pat! arg0 (-> arg1 best-other-tri pat))
(vector-! sv-48 (-> arg1 best-my-prim prim-core world-sphere) (-> arg1 best-other-tri intersect))
(cond
((and (= (-> arg1 best-dist) 0.0)
(< (vector-length sv-48) (+ -40.96 (-> arg1 best-my-prim prim-core world-sphere w)))
)
(set! (-> sv-48 quad) (-> arg1 best-other-tri normal quad))
(set! (-> arg0 coverage) 0.0)
)
(else
(set! (-> sv-48 w) 1.0)
(vector-normalize! sv-48 1.0)
(set! (-> arg0 coverage) (vector-dot sv-48 (-> arg1 best-other-tri normal)))
(when (< (-> arg0 coverage) 0.0)
(set! (-> arg0 coverage) 0.0)
(vector-flatten! sv-48 sv-48 (-> arg1 best-other-tri normal))
(let ((sv-48 (new-stack-vector0))
(sv-52 (new-stack-vector0))
(sv-56 (collide-status))
)
(let ((a1-1 (new 'stack-no-clear 'vector)))
(vector-float*! a1-1 (-> arg1 move-dist) (-> arg1 best-dist))
(move-by-vector! arg0 a1-1)
)
(react-to-pat! arg0 (-> arg1 best-other-tri pat))
(vector-! sv-48 (-> arg1 best-my-prim prim-core world-sphere) (-> arg1 best-other-tri intersect))
(cond
((and (= (-> arg1 best-dist) 0.0)
(< (vector-length sv-48) (+ -40.96 (-> arg1 best-my-prim prim-core world-sphere w)))
)
(set! (-> sv-48 quad) (-> arg1 best-other-tri normal quad))
(set! (-> arg0 coverage) 0.0)
)
(else
(set! (-> sv-48 w) 1.0)
(vector-normalize! sv-48 1.0)
(set! (-> arg0 coverage) (vector-dot sv-48 (-> arg1 best-other-tri normal)))
(when (< (-> arg0 coverage) 0.0)
(set! (-> arg0 coverage) 0.0)
(vector-flatten! sv-48 sv-48 (-> arg1 best-other-tri normal))
(vector-normalize! sv-48 1.0)
)
)
)
(set! (-> sv-52 quad) (-> sv-48 quad))
(if (= (-> arg1 best-dist) 0.0)
(move-by-vector! arg0 (vector-normalize-copy! (new-stack-vector0) sv-52 6.0))
)
(set! (-> arg0 poly-normal quad) (-> arg1 best-other-tri normal quad))
(collide-shape-moving-angle-set! arg0 sv-52 arg2)
(if (< (-> arg0 poly-angle) -0.2)
(logior! sv-56 (collide-status touch-ceiling))
)
(let ((sv-96 (< (fabs (-> arg0 surface-angle)) (-> *pat-mode-info* (-> arg0 cur-pat mode) wall-angle))))
(logior! sv-56 (collide-status touch-surface))
(if (-> arg1 num-spheres)
(logior! sv-56 (collide-status touch-actor))
)
(cond
(sv-96
(logior! sv-56 (collide-status touch-wall))
(set! (-> arg0 cur-pat mode) 1)
)
(else
(logior! sv-56 (collide-status on-surface))
(set! (-> arg0 local-normal quad) (-> sv-52 quad))
)
)
(when (and (not sv-96) (>= (-> arg0 coverage) 0.9))
(logior! sv-56 (collide-status on-ground))
(set! (-> arg0 ground-poly-normal quad) (-> arg0 poly-normal quad))
(when (!= (-> arg0 poly-pat mode) (pat-mode wall))
(set! (-> arg0 ground-pat) (-> arg0 poly-pat))
(set! (-> arg0 grount-touch-point quad) (-> arg1 best-other-tri intersect quad))
)
)
)
(when (not (logtest? (-> arg0 prev-status) (collide-status on-surface)))
(logior! sv-56 (collide-status impact-surface))
(set! (-> arg0 ground-impact-vel) (- (vector-dot (-> arg0 transv) (-> arg0 dynam gravity-normal))))
)
(logior! (-> arg0 status) sv-56)
)
(let ((v1-25 (-> sv-48 quad)))
(set! (-> sv-52 quad) v1-25)
)
(if (= (-> arg1 best-dist) 0.0)
(move-by-vector! arg0 (vector-normalize-copy! (new-stack-vector0) sv-52 6.0))
)
(set! (-> arg0 poly-normal quad) (-> arg1 best-other-tri normal quad))
(collide-shape-moving-angle-set! arg0 sv-52 arg2)
(if (< (-> arg0 poly-angle) -0.2)
(set! sv-56 (logior sv-56 (collide-status touch-ceiling)))
)
(set! sv-96 (< (fabs (-> arg0 surface-angle)) (-> *pat-mode-info* (-> arg0 cur-pat mode) wall-angle)))
(set! sv-56 (logior sv-56 (collide-status touch-surface)))
(if (-> arg1 num-spheres)
(set! sv-56 (logior sv-56 (collide-status touch-actor)))
)
(cond
(sv-96
(set! sv-56 (logior sv-56 (collide-status touch-wall)))
(set! (-> arg0 cur-pat mode) 1)
)
(else
(set! sv-56 (logior sv-56 (collide-status on-surface)))
(set! (-> arg0 local-normal quad) (-> sv-52 quad))
)
)
(when (and (not sv-96) (>= (-> arg0 coverage) 0.9))
(set! sv-56 (logior sv-56 (collide-status on-ground)))
(set! (-> arg0 ground-poly-normal quad) (-> arg0 poly-normal quad))
(when (!= (-> arg0 poly-pat mode) (pat-mode wall))
(set! (-> arg0 ground-pat) (-> arg0 poly-pat))
(set! (-> arg0 grount-touch-point quad) (-> arg1 best-other-tri intersect quad))
)
)
(when (not (logtest? (-> arg0 prev-status) (collide-status on-surface)))
(set! sv-56 (logior sv-56 (collide-status impact-surface)))
(set! (-> arg0 ground-impact-vel) (- (vector-dot (-> arg0 transv) (-> arg0 dynam gravity-normal))))
)
(logior! (-> arg0 status) sv-56)
0
(none)
)
@@ -1006,7 +1004,6 @@
;; definition for method 66 of type collide-shape-moving
;; INFO: Used lq/sq
(defmethod step-collison! ((this collide-shape-moving) (arg0 vector) (arg1 vector) (arg2 float) (arg3 int))
(local-vars (sv-592 int))
(let ((s5-0 (new 'stack 'collide-query))
(s2-0 (new 'stack-no-clear 'vector))
)
@@ -1018,10 +1015,10 @@
(let* ((s1-1 (-> this root-prim))
(v1-5 *collide-cache*)
(s0-0 (the-as collide-cache-prim (-> v1-5 prims)))
(sv-592 (-> v1-5 num-prims))
)
(set! sv-592 (-> v1-5 num-prims))
(while (nonzero? sv-592)
(set! sv-592 (+ sv-592 -1))
(+! sv-592 -1)
(when (logtest? (-> s1-1 prim-core collide-with) (-> s0-0 prim-core collide-as))
(if (>= (the-as int (-> s0-0 prim-core prim-type)) 0)
(collide-with-collide-cache-prim-mesh s1-1 s5-0 s0-0)
@@ -1701,22 +1698,23 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod move-to-ground ((this collide-shape-moving) (arg0 float) (arg1 float) (arg2 symbol) (arg3 collide-spec))
(local-vars (sv-576 profile-segment) (sv-592 int))
(when *debug-segment*
(let ((s1-0 (-> *display* frames (-> *display* on-screen) profile-array data 0))
(v1-7 'collide)
(s0-0 *profile-collide-color*)
)
(when (and *dproc* *debug-segment*)
(set! sv-576 (-> s1-0 data (-> s1-0 count)))
(set! sv-592 (-> s1-0 base-time))
(set! (-> sv-576 name) v1-7)
(set! (-> sv-576 start-time)
(the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint sv-592)))
)
(set! (-> sv-576 depth) (the-as uint (-> s1-0 depth)))
(set! (-> sv-576 color) s0-0)
(set! (-> s1-0 segment (-> s1-0 depth)) sv-576)
(let ((sv-576 (-> s1-0 data (-> s1-0 count))))
(let ((sv-592 (-> s1-0 base-time)))
(set! (-> sv-576 name) v1-7)
(set! (-> sv-576 start-time)
(the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint sv-592)))
)
)
(set! (-> sv-576 depth) (the-as uint (-> s1-0 depth)))
(set! (-> sv-576 color) s0-0)
(set! (-> s1-0 segment (-> s1-0 depth)) sv-576)
)
(+! (-> s1-0 count) 1)
(+! (-> s1-0 depth) 1)
(set! (-> s1-0 max-depth) (max (-> s1-0 max-depth) (-> s1-0 depth)))
@@ -2386,14 +2384,10 @@
(.add.y.vf.x vf1 vf1 vf1)
(.add.z.vf.x vf1 vf1 vf1)
(.mov a2-5 vf1)
(let ((f0-0 a2-5)
(f1-1 (+ (-> a1-2 world-sphere w) (-> this root-prim prim-core world-sphere w)))
)
(when (< f0-0 (* f1-1 f1-1))
(when (< *actor-list-length* 256)
(set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-3))
(set! *actor-list-length* (+ *actor-list-length* 1))
)
(when (< a2-5 (square (+ (-> a1-2 world-sphere w) (-> this root-prim prim-core world-sphere w))))
(when (< *actor-list-length* 256)
(set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-3))
(set! *actor-list-length* (+ *actor-list-length* 1))
)
)
)
@@ -2427,14 +2421,10 @@
(.add.y.vf.x vf1 vf1 vf1)
(.add.z.vf.x vf1 vf1 vf1)
(.mov a2-12 vf1)
(let ((f0-1 a2-12)
(f1-5 (+ (-> a1-15 world-sphere w) (-> this root-prim prim-core world-sphere w)))
)
(when (< f0-1 (* f1-5 f1-5))
(when (< *actor-list-length* 256)
(set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-6))
(set! *actor-list-length* (+ *actor-list-length* 1))
)
(when (< a2-12 (square (+ (-> a1-15 world-sphere w) (-> this root-prim prim-core world-sphere w))))
(when (< *actor-list-length* 256)
(set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-6))
(set! *actor-list-length* (+ *actor-list-length* 1))
)
)
)
@@ -2568,11 +2558,7 @@
(.add.y.vf.x vf1 vf1 vf1)
(.add.z.vf.x vf1 vf1 vf1)
(.mov a2-5 vf1)
(let ((f0-0 a2-5)
(f1-1 (+ (-> a1-3 world-sphere w) (-> s3-0 prim-core world-sphere w)))
)
(b! (>= f0-0 (* f1-1 f1-1)) cfg-8 :delay #f)
)
(b! (>= a2-5 (square (+ (-> a1-3 world-sphere w) (-> s3-0 prim-core world-sphere w)))) cfg-8 :delay #f)
)
)
(b! (>= *actor-list-length* 256) cfg-8 :delay #f)
@@ -2609,11 +2595,7 @@
(.add.y.vf.x vf1 vf1 vf1)
(.add.z.vf.x vf1 vf1 vf1)
(.mov a2-12 vf1)
(let ((f0-1 a2-12)
(f1-5 (+ (-> a1-15 world-sphere w) (-> s3-0 prim-core world-sphere w)))
)
(b! (>= f0-1 (* f1-5 f1-5)) cfg-17 :delay #f)
)
(b! (>= a2-12 (square (+ (-> a1-15 world-sphere w) (-> s3-0 prim-core world-sphere w)))) cfg-17 :delay #f)
)
)
(b! (>= *actor-list-length* 256) cfg-17 :delay #f)
@@ -2925,7 +2907,6 @@
;; definition for method 50 of type collide-shape
;; INFO: Used lq/sq
(defmethod send-shoves ((this collide-shape) (arg0 process) (arg1 touching-shapes-entry) (arg2 float) (arg3 float) (arg4 float))
(local-vars (sv-144 process) (sv-160 collide-shape-prim) (sv-176 vector))
(rlet ((vf0 :class vf)
(vf4 :class vf)
(vf5 :class vf)
@@ -2933,51 +2914,48 @@
)
(init-vf0-vector)
(when arg1
(let ((s0-0 (-> arg1 head)))
(set! sv-144 arg0)
(let ((gp-0 (if (type? sv-144 process-focusable)
sv-144
)
)
)
(when (and s0-0 gp-0)
(while s0-0
(set! sv-160 (get-touched-prim s0-0 this arg1))
(let ((s0-0 (-> arg1 head))
(gp-0 (the-as process (as-type arg0 process-focusable)))
)
(when (and s0-0 gp-0)
(while s0-0
(let ((sv-160 (get-touched-prim s0-0 this arg1)))
(get-touched-prim s0-0 (-> (the-as process-focusable gp-0) root) arg1)
(when (logtest? (-> sv-160 prim-core action) (collide-action no-standon))
(let ((v1-12 (get-middle-of-bsphere-overlap s0-0 (new 'stack-no-clear 'vector))))
(set! sv-176 (new 'stack-no-clear 'vector))
(let ((v1-12 (get-middle-of-bsphere-overlap s0-0 (new 'stack-no-clear 'vector)))
(sv-176 (new 'stack-no-clear 'vector))
)
(let ((a0-7 (-> sv-160 prim-core)))
(.lvf vf4 (&-> v1-12 quad))
(.lvf vf5 (&-> a0-7 world-sphere quad))
)
)
(.mov.vf.w vf6 vf0)
(.sub.vf.xyz vf6 vf4 vf5)
(.svf (&-> sv-176 quad) vf6)
(vector-normalize! sv-176 1.0)
(when (and (< arg2 (-> sv-176 y)) (and (not (focus-test? (the-as process-focusable gp-0) dead hit board mech))
(< (-> (the-as process-focusable gp-0) root transv y) 4.096)
)
)
(let ((s2-1 (new 'stack-no-clear 'vector)))
(set! (-> s2-1 quad) (-> (the-as process-focusable gp-0) root transv quad))
(let* ((v1-26 (-> (the-as process-focusable gp-0) root transv))
(f30-0 (sqrtf (+ (* (-> v1-26 x) (-> v1-26 x)) (* (-> v1-26 z) (-> v1-26 z)))))
)
(if (= f30-0 0.0)
(set! (-> s2-1 quad) (-> (vector-z-quaternion! s2-1 (-> (the-as process-focusable gp-0) root quat)) quad))
)
(vector-xz-normalize! s2-1 (fmax f30-0 arg4))
(.mov.vf.w vf6 vf0)
(.sub.vf.xyz vf6 vf4 vf5)
(.svf (&-> sv-176 quad) vf6)
(vector-normalize! sv-176 1.0)
(when (and (< arg2 (-> sv-176 y)) (and (not (focus-test? (the-as process-focusable gp-0) dead hit board mech))
(< (-> (the-as process-focusable gp-0) root transv y) 4.096)
)
)
(let ((s2-1 (new 'stack-no-clear 'vector)))
(set! (-> s2-1 quad) (-> (the-as process-focusable gp-0) root transv quad))
(let* ((v1-26 (-> (the-as process-focusable gp-0) root transv))
(f30-0 (sqrtf (+ (* (-> v1-26 x) (-> v1-26 x)) (* (-> v1-26 z) (-> v1-26 z)))))
)
(if (= f30-0 0.0)
(set! (-> s2-1 quad) (-> (vector-z-quaternion! s2-1 (-> (the-as process-focusable gp-0) root quat)) quad))
)
(vector-xz-normalize! s2-1 (fmax f30-0 arg4))
)
(set! (-> s2-1 y) arg3)
(send-event gp-0 'shove arg1 (static-attack-info ((id (new-attack-id)) (vector s2-1) (angle 'jump))))
)
(set! (-> s2-1 y) arg3)
(send-event gp-0 'shove arg1 (static-attack-info ((id (new-attack-id)) (vector s2-1) (angle 'jump))))
(return #t)
)
(return #t)
)
)
(set! s0-0 (-> s0-0 next))
)
(set! s0-0 (-> s0-0 next))
)
)
)
+3 -19
View File
@@ -358,12 +358,6 @@
(arg6 vector)
(arg7 float)
)
(local-vars
(sv-704 (function float float float))
(sv-720 float)
(sv-736 (function float float float))
(sv-752 float)
)
(with-pp
(let ((gp-0 *search-info*))
(set! (-> gp-0 match) #f)
@@ -409,11 +403,7 @@
(let* ((s0-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s2-1 (-> gp-0 point)) 1.0))
(f28-0 (cond
((logtest? (-> gp-0 mask) (search-info-flag prefer-xz))
(set! sv-704 deg-diff)
(set! sv-720 (vector-y-angle (-> gp-0 rot-base)))
(let ((a1-7 (vector-y-angle s0-0)))
(fabs (sv-704 sv-720 a1-7))
)
(fabs (deg-diff (vector-y-angle (-> gp-0 rot-base)) (vector-y-angle s0-0)))
)
((logtest? (-> gp-0 mask) (search-info-flag prefer-angle))
(- -9999.0 (vector-dot s0-0 (-> gp-0 rot-base)))
@@ -447,15 +437,9 @@
)
)
((logtest? (-> gp-0 mask) (search-info-flag cull-xz))
(let ((f26-3 (-> gp-0 rot-range)))
(set! sv-736 deg-diff)
(set! sv-752 (vector-y-angle (-> gp-0 rot-base)))
(let ((a1-10 (vector-y-angle s0-0)))
(if (< f26-3 (fabs (sv-736 sv-752 a1-10)))
(goto cfg-89)
)
(if (< (-> gp-0 rot-range) (fabs (deg-diff (vector-y-angle (-> gp-0 rot-base)) (vector-y-angle s0-0))))
(goto cfg-89)
)
)
)
)
(when (logtest? (-> gp-0 mask) (search-info-flag back-point))
+3 -3
View File
@@ -432,7 +432,6 @@
- collision information
- loading the skeleton group / bones
- sounds"
(local-vars (sv-16 res-tag))
(reset! this)
(set! (-> this button-id) -1)
(let ((v1-4 (res-lump-value (-> this entity) 'extra-id uint128 :default (the-as uint128 -1) :time -1000000000.0)))
@@ -447,8 +446,9 @@
(logclear! (-> this button-status) (button-status pressed))
)
(set! (-> this notify-actor) (entity-actor-lookup arg0 'alt-actor 0))
(set! sv-16 (new 'static 'res-tag))
(let ((v1-15 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16))))
(let* ((sv-16 (new 'static 'res-tag))
(v1-15 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))
)
(cond
((and v1-15 (nonzero? (-> sv-16 elt-count)))
(set! (-> this actor-group) (the-as (pointer actor-group) v1-15))
+6 -10
View File
@@ -134,16 +134,12 @@
(vector-cross! (-> s1-0 vector 2) (-> s1-0 vector 0) (-> s1-0 vector 1))
(vector-normalize! (-> s1-0 vector 2) 1.0)
(matrix->quaternion (-> s2-1 quat) s1-0)
(let ((v1-20 (-> this root root-prim local-sphere)))
(set! (-> v1-20 x) 0.0)
(set! (-> v1-20 y) (* 0.00024414062 (/ height 2)))
(set! (-> v1-20 z) 0.0)
(let ((f0-17 0.5)
(f1-7 (* f30-1 f30-1))
(f2-2 height)
)
(set! (-> v1-20 w) (* f0-17 (sqrtf (+ f1-7 (* f2-2 f2-2)))))
)
(set-vector!
(-> this root root-prim local-sphere)
0.0
(* 0.00024414062 (/ height 2))
0.0
(* 0.5 (sqrtf (+ (square f30-1) (square height))))
)
)
)
+253 -166
View File
@@ -2695,182 +2695,269 @@
;; WARN: Stack slot offset 36 signed mismatch
;; WARN: Stack slot offset 36 signed mismatch
(defbehavior birth-pickup-at-point process ((arg0 vector) (arg1 pickup-type) (arg2 float) (arg3 symbol) (arg4 process-tree) (arg5 fact-info))
(local-vars (sv-32 vector) (sv-36 float) (sv-40 (pointer process)) (sv-48 int) (sv-56 fact-info) (sv-64 int))
(set! sv-32 (new-stack-vector0))
(set! sv-36 (res-lump-float
(if (and arg5 (nonzero? (-> arg5 process)))
(-> arg5 process entity)
(let ((sv-32 (new-stack-vector0))
(sv-36 (res-lump-float
(if (and arg5 (nonzero? (-> arg5 process)))
(-> arg5 process entity)
)
'pickup-radius
:default (cond
((= arg1 (pickup-type buzzer))
0.0
)
'pickup-radius
:default (cond
((= arg1 (pickup-type buzzer))
0.0
((= arg2 1.0)
409.6
)
(else
8192.0
)
)
((= arg2 1.0)
409.6
)
)
(sv-40 (the-as (pointer process) #f))
)
(let ((sv-48 (the int arg2))
(sv-56 (new 'static 'fact-info))
)
(set! (-> sv-56 options) (actor-option))
(if arg5
(mem-copy! (&-> sv-56 type) (&-> arg5 type) 40)
)
(set! (-> sv-56 pickup-type) arg1)
(set! (-> sv-56 pickup-spawn-amount) 1.0)
(while (> sv-48 0)
(+! sv-48 -1)
(when arg3
(set-vector! sv-32 0.0 57001.605 sv-36 1.0)
(vector-rotate-around-y! sv-32 sv-32 (/ (* 65536.0 (the float sv-48)) arg2))
)
(let ((v1-23 arg1))
(set! sv-40
(cond
((= v1-23 (pickup-type eco-yellow))
(process-spawn eco-yellow :init initialize-eco-by-other arg0 sv-32 sv-56 :from *pickup-dead-pool* :to arg4)
)
(else
8192.0
(cond
((= v1-23 (pickup-type eco-red))
(let ((s1-2 (get-process *pickup-dead-pool* eco-red #x4000)))
(set! sv-40
(when s1-2
(let ((t9-7 (method-of-type eco-red activate)))
(t9-7 (the-as eco-red s1-2) arg4 (symbol->string (-> eco-red symbol)) (the-as pointer #x70004000))
)
(run-now-in-process s1-2 initialize-eco-by-other arg0 sv-32 sv-56)
(-> s1-2 ppointer)
)
)
)
)
((= v1-23 (pickup-type eco-blue))
(let ((s1-3 (get-process *pickup-dead-pool* eco-blue #x4000)))
(set! sv-40
(when s1-3
(let ((t9-10 (method-of-type eco-blue activate)))
(t9-10 (the-as eco-blue s1-3) arg4 (symbol->string (-> eco-blue symbol)) (the-as pointer #x70004000))
)
(run-now-in-process s1-3 initialize-eco-by-other arg0 sv-32 sv-56)
(-> s1-3 ppointer)
)
)
)
)
((= v1-23 (pickup-type eco-green))
(let ((s1-4 (get-process *pickup-dead-pool* eco-green #x4000)))
(set! sv-40
(when s1-4
(let ((t9-13 (method-of-type eco-green activate)))
(t9-13 (the-as eco-green s1-4) arg4 (symbol->string (-> eco-green symbol)) (the-as pointer #x70004000))
)
(run-now-in-process s1-4 initialize-eco-by-other arg0 sv-32 sv-56)
(-> s1-4 ppointer)
)
)
)
)
((= v1-23 (pickup-type health))
(set! (-> sv-56 pickup-spawn-amount) arg2)
(let ((s1-5 (get-process *pickup-dead-pool* health #x4000)))
(set! sv-40
(when s1-5
(let ((t9-16 (method-of-type health activate)))
(t9-16 (the-as health s1-5) arg4 (symbol->string (-> health symbol)) (the-as pointer #x70004000))
)
(run-now-in-process s1-5 initialize-eco-by-other arg0 sv-32 sv-56)
(-> s1-5 ppointer)
)
)
)
(set! sv-48 0)
0
)
((or (= v1-23 (pickup-type eco-pill-green)) (= v1-23 (pickup-type eco-pill-dark)))
(let ((s1-6 (get-process *pickup-dead-pool* eco-pill #x4000)))
(set! sv-40
(when s1-6
(let ((t9-19 (method-of-type eco-pill activate)))
(t9-19 (the-as eco-pill s1-6) arg4 (symbol->string (-> eco-pill symbol)) (the-as pointer #x70004000))
)
(run-now-in-process s1-6 initialize-eco-by-other arg0 sv-32 sv-56)
(-> s1-6 ppointer)
)
)
)
)
((or (= v1-23 (pickup-type ammo-yellow))
(= v1-23 (pickup-type ammo-red))
(= v1-23 (pickup-type ammo-blue))
(= v1-23 (pickup-type ammo-dark))
(= v1-23 (pickup-type shield))
)
(let* ((v1-56 arg1)
(sv-64 (cond
((= v1-56 (pickup-type ammo-red))
5
)
((= v1-56 (pickup-type ammo-dark))
1
)
(else
10
)
)
)
)
(set! (-> sv-56 pickup-spawn-amount) (the float sv-64))
(let ((s1-7 (get-process *pickup-dead-pool* ammo-collectable #x4000)))
(set! sv-40 (when s1-7
(let ((t9-22 (method-of-type ammo-collectable activate)))
(t9-22
(the-as ammo-collectable s1-7)
arg4
(symbol->string (-> ammo-collectable symbol))
(the-as pointer #x70004000)
)
)
(run-now-in-process s1-7 initialize-ammo-by-other arg0 sv-32 sv-56)
(-> s1-7 ppointer)
)
)
)
(set! sv-48 (- sv-48 (+ sv-64 -1)))
)
)
((or (= v1-23 (pickup-type gun-yellow))
(= v1-23 (pickup-type gun-red))
(= v1-23 (pickup-type gun-blue))
(= v1-23 (pickup-type gun-dark))
(= v1-23 (pickup-type board))
)
(let ((s1-8 (get-process *pickup-dead-pool* upgrade-collectable #x4000)))
(set! sv-40 (when s1-8
(let ((t9-25 (method-of-type upgrade-collectable activate)))
(t9-25
(the-as upgrade-collectable s1-8)
arg4
(symbol->string (-> upgrade-collectable symbol))
(the-as pointer #x70004000)
)
)
(run-now-in-process s1-8 initialize-upgrade-by-other arg0 sv-32 sv-56 (-> self entity))
(-> s1-8 ppointer)
)
)
)
(set! sv-48 0)
0
)
((= v1-23 (pickup-type trick-point))
(set! (-> sv-56 pickup-spawn-amount) arg2)
(let ((s1-9 (get-process *pickup-dead-pool* trick-point #x4000)))
(set! sv-40
(when s1-9
(let ((t9-28 (method-of-type trick-point activate)))
(t9-28 (the-as trick-point s1-9) arg4 (symbol->string (-> trick-point symbol)) (the-as pointer #x70004000))
)
(run-now-in-process s1-9 initialize-ammo-by-other arg0 sv-32 sv-56)
(-> s1-9 ppointer)
)
)
)
(set! sv-48 0)
0
)
((= v1-23 (pickup-type money))
(let ((s1-10 (get-process *pickup-dead-pool* money #x4000)))
(set! sv-40
(when s1-10
(let ((t9-31 (method-of-type money activate)))
(t9-31 (the-as money s1-10) arg4 (symbol->string (-> money symbol)) (the-as pointer #x70004000))
)
(run-now-in-process s1-10 money-init-by-other arg0 sv-32 sv-56 (-> self entity))
(-> s1-10 ppointer)
)
)
)
)
((= v1-23 (pickup-type trick-point))
(let ((s1-11 (get-process *pickup-dead-pool* money #x4000)))
(set! sv-40
(when s1-11
(let ((t9-34 (method-of-type money activate)))
(t9-34 (the-as money s1-11) arg4 (symbol->string (-> money symbol)) (the-as pointer #x70004000))
)
(run-now-in-process s1-11 money-init-by-other arg0 sv-32 sv-56 (-> self entity))
(-> s1-11 ppointer)
)
)
)
)
((= v1-23 (pickup-type gem))
(if (>= (-> *game-info* live-gem-count) 20)
(return (the-as (pointer process) #f))
)
(let ((s1-12 (get-process *pickup-dead-pool* gem #x4000)))
(set! sv-40 (when s1-12
(let ((t9-37 (method-of-type gem activate)))
(t9-37 (the-as gem s1-12) arg4 (symbol->string (-> gem symbol)) (the-as pointer #x70004000))
)
(run-now-in-process s1-12 money-init-by-other arg0 sv-32 sv-56 (-> self entity))
(-> s1-12 ppointer)
)
)
)
)
((= v1-23 (pickup-type skill))
(when (>= arg2 (-> *FACT-bank* super-skill-inc))
(set! (-> sv-56 pickup-spawn-amount) arg2)
(set! sv-48 0)
0
)
(let ((s1-13 (get-process *pickup-dead-pool* skill #x4000)))
(set! sv-40
(when s1-13
(let ((t9-40 (method-of-type skill activate)))
(t9-40 (the-as skill s1-13) arg4 (symbol->string (-> skill symbol)) (the-as pointer #x70004000))
)
(run-now-in-process s1-13 money-init-by-other arg0 sv-32 sv-56 (-> self entity))
(-> s1-13 ppointer)
)
)
)
)
(else
(format 0 "ERROR: unknown type of eco ~d~%" arg1)
)
)
sv-40
)
)
)
)
(set! sv-40 (the-as (pointer process) #f))
(set! sv-48 (the int arg2))
(set! sv-56 (new 'static 'fact-info))
(set! (-> sv-56 options) (actor-option))
(if arg5
(mem-copy! (&-> sv-56 type) (&-> arg5 type) 40)
)
(set! (-> sv-56 pickup-type) arg1)
(set! (-> sv-56 pickup-spawn-amount) 1.0)
(while (> sv-48 0)
(set! sv-48 (+ sv-48 -1))
(when arg3
(set-vector! sv-32 0.0 57001.605 sv-36 1.0)
(vector-rotate-around-y! sv-32 sv-32 (/ (* 65536.0 (the float sv-48)) arg2))
)
(case arg1
(((pickup-type eco-yellow))
(set! sv-40
(process-spawn eco-yellow :init initialize-eco-by-other arg0 sv-32 sv-56 :from *pickup-dead-pool* :to arg4)
)
)
(((pickup-type eco-red))
(set! sv-40
(process-spawn eco-red :init initialize-eco-by-other arg0 sv-32 sv-56 :from *pickup-dead-pool* :to arg4)
)
)
(((pickup-type eco-blue))
(set! sv-40
(process-spawn eco-blue :init initialize-eco-by-other arg0 sv-32 sv-56 :from *pickup-dead-pool* :to arg4)
)
)
(((pickup-type eco-green))
(set! sv-40
(process-spawn eco-green :init initialize-eco-by-other arg0 sv-32 sv-56 :from *pickup-dead-pool* :to arg4)
)
)
(((pickup-type health))
(set! (-> sv-56 pickup-spawn-amount) arg2)
(set! sv-40
(process-spawn health :init initialize-eco-by-other arg0 sv-32 sv-56 :from *pickup-dead-pool* :to arg4)
)
(set! sv-48 0)
0
)
(((pickup-type eco-pill-green) (pickup-type eco-pill-dark))
(set! sv-40
(process-spawn eco-pill :init initialize-eco-by-other arg0 sv-32 sv-56 :from *pickup-dead-pool* :to arg4)
)
)
(((pickup-type ammo-yellow)
(pickup-type ammo-red)
(pickup-type ammo-blue)
(pickup-type ammo-dark)
(pickup-type shield)
)
(let ((v1-56 arg1))
(set! sv-64 (cond
((= v1-56 (pickup-type ammo-red))
5
)
((= v1-56 (pickup-type ammo-dark))
1
)
(else
10
)
)
)
)
(set! (-> sv-56 pickup-spawn-amount) (the float sv-64))
(set! sv-40 (process-spawn
ammo-collectable
:init initialize-ammo-by-other
arg0
sv-32
sv-56
:from *pickup-dead-pool*
:to arg4
)
)
(set! sv-48 (- sv-48 (+ sv-64 -1)))
)
(((pickup-type gun-yellow)
(pickup-type gun-red)
(pickup-type gun-blue)
(pickup-type gun-dark)
(pickup-type board)
)
(set! sv-40 (process-spawn
upgrade-collectable
:init initialize-upgrade-by-other
arg0
sv-32
sv-56
(-> self entity)
:from *pickup-dead-pool*
:to arg4
)
)
(set! sv-48 0)
0
)
(((pickup-type trick-point))
(set! (-> sv-56 pickup-spawn-amount) arg2)
(set! sv-40
(process-spawn trick-point :init initialize-ammo-by-other arg0 sv-32 sv-56 :from *pickup-dead-pool* :to arg4)
)
(set! sv-48 0)
0
)
(((pickup-type money))
(set! sv-40 (process-spawn money arg0 sv-32 sv-56 (-> self entity) :from *pickup-dead-pool* :to arg4))
)
(((pickup-type trick-point))
(set! sv-40 (process-spawn money arg0 sv-32 sv-56 (-> self entity) :from *pickup-dead-pool* :to arg4))
)
(((pickup-type gem))
(if (>= (-> *game-info* live-gem-count) 20)
(return (the-as (pointer process) #f))
)
(set! sv-40 (process-spawn
gem
:init money-init-by-other
arg0
sv-32
sv-56
(-> self entity)
:from *pickup-dead-pool*
:to arg4
)
)
)
(((pickup-type skill))
(when (>= arg2 (-> *FACT-bank* super-skill-inc))
(set! (-> sv-56 pickup-spawn-amount) arg2)
(set! sv-48 0)
0
)
(set! sv-40 (process-spawn
skill
:init money-init-by-other
arg0
sv-32
sv-56
(-> self entity)
:from *pickup-dead-pool*
:to arg4
)
)
)
(else
(format 0 "ERROR: unknown type of eco ~d~%" arg1)
)
)
)
sv-40
)
sv-40
)
;; definition for method 9 of type fact-info
+30 -38
View File
@@ -122,19 +122,18 @@
;; WARN: Return type mismatch int vs none.
(defmethod init! ((this conveyor))
"Initializes defaults for things like the `speed` and `belt-radius`"
(local-vars (tag res-tag))
(set! (-> this speed) 24576.0)
(set! (-> this belt-radius) 11878.4)
(set! (-> this pull-y-threshold) 10240.0)
(set! (-> this speed-mult-array) #f)
(set! (-> this speed-mult-array-len) 0)
(let ((entity (-> this entity)))
(set! tag (new 'static 'res-tag))
(let ((scale-factor (res-lump-data entity 'scale-factor pointer :tag-ptr (& tag))))
(when scale-factor
(set! (-> this speed-mult-array) (the-as (array float) scale-factor))
(set! (-> this speed-mult-array-len) (the-as int (-> tag elt-count)))
)
(let* ((entity (-> this entity))
(tag (new 'static 'res-tag))
(scale-factor (res-lump-data entity 'scale-factor pointer :tag-ptr (& tag)))
)
(when scale-factor
(set! (-> this speed-mult-array) (the-as (array float) scale-factor))
(set! (-> this speed-mult-array-len) (the-as int (-> tag elt-count)))
)
)
0
@@ -251,11 +250,7 @@
(.add.y.vf.x vf1 vf1 vf1)
(.add.z.vf.x vf1 vf1 vf1)
(.mov a2-5 vf1)
(let ((f0-0 a2-5)
(f1-1 (+ (-> a1-2 world-sphere w) (-> this collide-bounds r)))
)
(b! (>= f0-0 (* f1-1 f1-1)) cfg-8 :delay #f)
)
(b! (>= a2-5 (square (+ (-> a1-2 world-sphere w) (-> this collide-bounds r)))) cfg-8 :delay #f)
)
(when (< *actor-list-length* 256)
(set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-3))
@@ -292,11 +287,7 @@
(.add.y.vf.x vf1 vf1 vf1)
(.add.z.vf.x vf1 vf1 vf1)
(.mov a2-12 vf1)
(let ((f0-1 a2-12)
(f1-5 (+ (-> a1-14 world-sphere w) (-> this collide-bounds r)))
)
(b! (>= f0-1 (* f1-5 f1-5)) cfg-17 :delay #f)
)
(b! (>= a2-12 (square (+ (-> a1-14 world-sphere w) (-> this collide-bounds r)))) cfg-17 :delay #f)
)
(when (< *actor-list-length* 256)
(set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-6))
@@ -352,7 +343,6 @@
;; INFO: Used lq/sq
(defmethod conveyor-method-21 ((this conveyor))
"TODO - quite dense, has to do with the conveyor sections and the path they are associated with"
(local-vars (sv-32 conveyor-section) (sv-48 conveyor-section))
(let* ((s5-0 (-> this path))
(s4-0 (-> s5-0 curve num-cverts))
(s3-0 (new 'stack-no-clear 'vector))
@@ -362,26 +352,28 @@
(set! (-> this collide-bounds quad) (the-as uint128 0))
(get-point-in-path! s5-0 s3-0 0.0 'exact)
(vector+! (the-as vector (-> this collide-bounds)) (the-as vector (-> this collide-bounds)) s3-0)
(let ((s1-0 (+ s4-0 -1)))
(set! sv-32 (the-as conveyor-section #f))
(dotimes (s0-0 s1-0)
(set! sv-48 (-> s2-0 data s0-0))
(set! (-> sv-48 start quad) (-> s3-0 quad))
(get-point-in-path! s5-0 s3-0 (the float (+ s0-0 1)) 'exact)
(vector+! (the-as vector (-> this collide-bounds)) (the-as vector (-> this collide-bounds)) s3-0)
(vector-! (-> sv-48 pull-dir) s3-0 (-> sv-48 start))
(vector-normalize! (-> sv-48 pull-dir) 1.0)
(set! (-> sv-48 trailing quad) (-> sv-48 pull-dir quad))
(set! (-> sv-48 trailing y) 0.0)
(vector-normalize! (-> sv-48 trailing) 1.0)
(set-vector! (-> sv-48 radial-dir) (- (-> sv-48 trailing z)) 0.0 (-> sv-48 trailing x) 1.0)
(set! (-> sv-48 trailing w) (- (vector-dot s3-0 (the-as vector (-> sv-48 trailing)))))
(when (the-as vector sv-32)
(vector+! (&+ (the-as vector sv-32) 16) (&+ (the-as vector sv-32) 16) (the-as vector (-> sv-48 trailing)))
(vector-normalize! (&+ (the-as vector sv-32) 16) 1.0)
(set! (-> sv-32 trailing w) (- (vector-dot (-> sv-48 start) (&+ (the-as vector sv-32) 16))))
(let ((s1-0 (+ s4-0 -1))
(sv-32 (the-as conveyor-section #f))
)
(dotimes (s0-0 s1-0)
(let ((sv-48 (-> s2-0 data s0-0)))
(set! (-> sv-48 start quad) (-> s3-0 quad))
(get-point-in-path! s5-0 s3-0 (the float (+ s0-0 1)) 'exact)
(vector+! (the-as vector (-> this collide-bounds)) (the-as vector (-> this collide-bounds)) s3-0)
(vector-! (-> sv-48 pull-dir) s3-0 (-> sv-48 start))
(vector-normalize! (-> sv-48 pull-dir) 1.0)
(set! (-> sv-48 trailing quad) (-> sv-48 pull-dir quad))
(set! (-> sv-48 trailing y) 0.0)
(vector-normalize! (-> sv-48 trailing) 1.0)
(set-vector! (-> sv-48 radial-dir) (- (-> sv-48 trailing z)) 0.0 (-> sv-48 trailing x) 1.0)
(set! (-> sv-48 trailing w) (- (vector-dot s3-0 (the-as vector (-> sv-48 trailing)))))
(when (the-as vector sv-32)
(vector+! (&+ (the-as vector sv-32) 16) (&+ (the-as vector sv-32) 16) (the-as vector (-> sv-48 trailing)))
(vector-normalize! (&+ (the-as vector sv-32) 16) 1.0)
(set! (-> sv-32 trailing w) (- (vector-dot (-> sv-48 start) (&+ (the-as vector sv-32) 16))))
)
(set! sv-32 sv-48)
)
(set! sv-32 sv-48)
sv-32
)
)
+1 -2
View File
@@ -319,8 +319,7 @@
)
(let* ((gp-0 (-> self draw ripple))
(f0-1 (the float (logand (current-time) #xffff)))
(f0-6 (cos (the float (sar (shl (the int (* 5.0 f0-1)) 48) 48))))
(f0-7 (* f0-6 f0-6))
(f0-7 (square (cos (the float (sar (shl (the int (* 5.0 f0-1)) 48) 48)))))
(f0-9 (fmax -1.0 (fmin 1.0 f0-7)))
)
(set! (-> gp-0 global-scale) (* 4096.0 (* 3.0 (+ 1.0 f0-9))))
+39 -41
View File
@@ -257,7 +257,7 @@
(let* ((step step-amount)
(f4-0 (- 1.0 step-amount))
(f3-0 (/ step (- 1.0 f4-0)))
(f2-1 (* step step))
(f2-1 (square step))
(f1-6 (+ (* 2.0 step (- f4-0 step)) f2-1))
(f1-7 (+ (* (- 1.0 f4-0) (- 1.0 f4-0) f3-0) f1-6))
)
@@ -269,9 +269,7 @@
(+ (* 2.0 step (- value step)) f2-1)
)
(else
(let ((f0-7 (- 1.0 value)))
(- f1-7 (* f0-7 f0-7 f3-0))
)
(- f1-7 (* (square (- 1.0 value)) f3-0))
)
)
f1-7
@@ -418,29 +416,27 @@
@param arg2 TODO
@param arg3 TODO
@returns [[#t]] if a point in the path was found"
(local-vars (path-point vector))
(let ((elev-params (-> this params))
(smallest-dist 0.0)
(point-idx-tracker -1.0)
)
(dotimes (path-vertex-idx (-> this path curve num-cverts))
(set! path-point
(get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) (the float path-vertex-idx) 'interp)
(let ((path-point
(get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) (the float path-vertex-idx) 'interp)
)
)
(when (and (or (not arg2) (< (vector-vector-xz-distance path-point arg0) (-> elev-params xz-threshold)))
(or (not arg3)
(< (fabs (- (-> path-point y) (-> arg0 y))) (-> elev-params y-threshold))
(and (= path-vertex-idx (the int (-> this bottom-top 0))) (< (-> arg0 y) (-> path-point y)))
(and (= path-vertex-idx (the int (-> this bottom-top 1))) (< (-> path-point y) (-> arg0 y)))
)
)
(let* ((t9-2 vector-vector-distance)
(a1-3 arg0)
(dist (t9-2 path-point a1-3))
)
(when (or (= point-idx-tracker -1.0) (< dist smallest-dist))
(set! smallest-dist dist)
(set! point-idx-tracker (the float path-vertex-idx))
(when (and (or (not arg2) (< (vector-vector-xz-distance path-point arg0) (-> elev-params xz-threshold)))
(or (not arg3)
(< (fabs (- (-> path-point y) (-> arg0 y))) (-> elev-params y-threshold))
(and (= path-vertex-idx (the int (-> this bottom-top 0))) (< (-> arg0 y) (-> path-point y)))
(and (= path-vertex-idx (the int (-> this bottom-top 1))) (< (-> path-point y) (-> arg0 y)))
)
)
(let ((dist (vector-vector-distance path-point arg0)))
(when (or (= point-idx-tracker -1.0) (< dist smallest-dist))
(set! smallest-dist dist)
(set! point-idx-tracker (the float path-vertex-idx))
)
)
)
)
@@ -481,7 +477,6 @@
"If the [[*target*]] is in a valid state and there is a point to transition to in the elevator's path
do so.
@see [[elevator::47]]"
(local-vars (zero float))
(let ((target *target*))
(when (and target
(not (logtest? (focus-status dead inactive in-air grabbed edge-grab pole pilot-riding pilot teleporting)
@@ -489,12 +484,13 @@
)
)
)
(set! zero (the-as float 0.0))
(when (and (find-closest-point-in-path! this (get-trans target 0) (& zero) #t #t) (!= (-> this move-pos 1) zero))
(set! (-> this move-pos 0) (-> this move-pos 1))
(set! (-> this move-pos 1) zero)
(logior! (-> this elevator-status) (elevator-status moving))
(go (method-of-object this running))
(let ((zero (the-as float 0.0)))
(when (and (find-closest-point-in-path! this (get-trans target 0) (& zero) #t #t) (!= (-> this move-pos 1) zero))
(set! (-> this move-pos 0) (-> this move-pos 1))
(set! (-> this move-pos 1) zero)
(logior! (-> this elevator-status) (elevator-status moving))
(go (method-of-object this running))
)
)
)
)
@@ -822,7 +818,6 @@
- collision information
- loading the skeleton group / bones
- sounds"
(local-vars (sv-32 float) (sv-36 path-control) (sv-40 target))
(init-plat-collision! this)
(process-drawable-from-entity! this entity)
(initialize-skeleton this (the-as skeleton-group (get-art-group this)) (the-as pair 0))
@@ -860,19 +855,22 @@
)
)
)
(set! sv-32 (the-as float 0.0))
(set! sv-36 (-> this path))
(set! sv-40 (the-as target (as-type *target* process-focusable)))
(if (not (and sv-40
(logtest? (-> this params flags) (elevator-flags elevator-flags-4))
(find-closest-point-in-path! this (get-trans sv-40 0) (& sv-32) #f #t)
)
)
(set! sv-32 (-> this params start-pos))
(let ((sv-32 (the-as float 0.0))
(sv-36 (-> this path))
)
(let ((sv-40 (the-as target (as-type *target* process-focusable))))
(if (not (and sv-40
(logtest? (-> this params flags) (elevator-flags elevator-flags-4))
(find-closest-point-in-path! this (get-trans sv-40 0) (& sv-32) #f #t)
)
)
(set! sv-32 (-> this params start-pos))
)
)
(set! (-> this move-pos 0) sv-32)
(set! (-> this move-pos 1) sv-32)
(get-point-in-path! sv-36 (-> this basetrans) sv-32 'interp)
(set! (-> this move-pos 0) sv-32)
(set! (-> this move-pos 1) sv-32)
(get-point-in-path! sv-36 (-> this basetrans) sv-32 'interp)
)
(set! (-> this root pause-adjust-distance)
(+ 122880.0 (-> this params xz-threshold) (total-distance (-> this path)))
)
+31 -31
View File
@@ -12,10 +12,10 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch object vs (pointer sparticle-launch-group).
(defun entity-lookup-part-group ((arg0 entity-actor) (arg1 (pointer string)) (arg2 symbol))
(local-vars (sv-16 res-tag))
(let ((gp-0 (the-as object #f)))
(set! sv-16 (new 'static 'res-tag))
(let ((s4-0 (res-lump-data arg0 arg2 pointer :tag-ptr (& sv-16))))
(let* ((sv-16 (new 'static 'res-tag))
(s4-0 (res-lump-data arg0 arg2 pointer :tag-ptr (& sv-16)))
)
(if (not s4-0)
(go process-drawable-art-error (the-as string #f))
)
@@ -2048,7 +2048,6 @@
- collision information
- loading the skeleton group / bones
- sounds"
(local-vars (sv-16 string))
(stack-size-set! (-> this main-thread) 128)
(logior! (-> this mask) (process-mask ambient))
(set! (-> this clock) (-> *display* part-clock))
@@ -2062,44 +2061,45 @@
)
)
(set! (-> this sound) (new 'process 'ambient-sound (-> this entity) (-> this root trans)))
(set! sv-16 "#f")
(set! (-> this mode) (entity-lookup-part-group arg0 (& sv-16) 'art-name))
(when (-> this mode)
(let ((a0-15 (-> this mode 0)))
(when (and (nonzero? a0-15) (= (-> a0-15 type) sparticle-launch-group))
(cond
((logtest? (-> a0-15 flags) (sp-group-flag unk-8))
(countdown (v1-27 (-> a0-15 length))
(let* ((a1-8 (-> a0-15 launcher v1-27))
(a3-2 (-> *part-id-table* (-> a1-8 launcher)))
)
(when (nonzero? a3-2)
(let ((a2-7 (-> this level part-engine)))
(when (and a2-7 (< (-> a2-7 length) (-> a2-7 allocated-length)))
(let ((t0-7 (-> a2-7 data (-> a2-7 length))))
(set! (-> t0-7 next1) (the-as connectable a3-2))
(set! (-> t0-7 prev1) (the-as connectable (-> a1-8 hour-mask)))
(set! (-> (the-as vector (&-> t0-7 param0)) quad) (-> this root trans quad))
(set! (-> t0-7 param3) (the-as int (-> a1-8 fade-after)))
(let ((sv-16 "#f"))
(set! (-> this mode) (entity-lookup-part-group arg0 (& sv-16) 'art-name))
(when (-> this mode)
(let ((a0-15 (-> this mode 0)))
(when (and (nonzero? a0-15) (= (-> a0-15 type) sparticle-launch-group))
(cond
((logtest? (-> a0-15 flags) (sp-group-flag unk-8))
(countdown (v1-27 (-> a0-15 length))
(let* ((a1-8 (-> a0-15 launcher v1-27))
(a3-2 (-> *part-id-table* (-> a1-8 launcher)))
)
(when (nonzero? a3-2)
(let ((a2-7 (-> this level part-engine)))
(when (and a2-7 (< (-> a2-7 length) (-> a2-7 allocated-length)))
(let ((t0-7 (-> a2-7 data (-> a2-7 length))))
(set! (-> t0-7 next1) (the-as connectable a3-2))
(set! (-> t0-7 prev1) (the-as connectable (-> a1-8 hour-mask)))
(set! (-> (the-as vector (&-> t0-7 param0)) quad) (-> this root trans quad))
(set! (-> t0-7 param3) (the-as int (-> a1-8 fade-after)))
)
(+! (-> a2-7 length) 1)
)
(+! (-> a2-7 length) 1)
)
)
)
)
(process-entity-status! this (entity-perm-status dead) #t)
(deactivate this)
)
(process-entity-status! this (entity-perm-status dead) #t)
(deactivate this)
)
(else
(set! (-> this part) (create-launch-control a0-15 this))
(go (method-of-object this active))
(else
(set! (-> this part) (create-launch-control a0-15 this))
(go (method-of-object this active))
)
)
)
)
)
(go process-drawable-art-error sv-16)
)
(go process-drawable-art-error sv-16)
(none)
)
+16 -17
View File
@@ -525,14 +525,14 @@
;; WARN: Return type mismatch quaternion vs none.
(defmethod offset! ((this water-anim))
"Offset a [[water-anim]]'s `trans` and `quat` by the lump data in `entity`."
(local-vars (sv-16 res-tag))
(set! (-> this play-ambient-sound?) #t)
(set! (-> this visible) #t)
(set! (-> this look)
(res-lump-value (-> this entity) 'look int :default (the-as uint128 -1) :time -1000000000.0)
)
(set! sv-16 (new 'static 'res-tag))
(let ((v1-4 (res-lump-data (-> this entity) 'trans-offset vector :tag-ptr (& sv-16))))
(let* ((sv-16 (new 'static 'res-tag))
(v1-4 (res-lump-data (-> this entity) 'trans-offset vector :tag-ptr (& sv-16)))
)
(when v1-4
(+! (-> this root trans x) (-> v1-4 x))
(+! (-> this root trans y) (-> v1-4 y))
@@ -593,7 +593,6 @@
;; WARN: Return type mismatch water-flags vs none.
(defmethod water-anim-init! ((this water-anim))
"Initialize a [[water-anim]]."
(local-vars (sv-16 res-tag))
(set! (-> this attack-event) (the-as symbol ((method-of-type res-lump get-property-struct)
(-> this entity)
'attack-event
@@ -617,19 +616,19 @@
(set! (-> this attack-id) a0-7)
)
(set! (-> this target) (the-as handle #f))
(set! sv-16 (new 'static 'res-tag))
(let ((v1-10 (the-as (pointer float) ((method-of-type res-lump get-property-data)
(-> this entity)
'water-height
'exact
-1000000000.0
(the-as pointer #f)
(& sv-16)
*res-static-buf*
)
)
)
)
(let* ((sv-16 (new 'static 'res-tag))
(v1-10 (the-as (pointer float) ((method-of-type res-lump get-property-data)
(-> this entity)
'water-height
'exact
-1000000000.0
(the-as pointer #f)
(& sv-16)
*res-static-buf*
)
)
)
)
(when v1-10
(set! (-> this water-height) (-> v1-10 0))
(set! (-> this wade-height) (-> v1-10 1))
+30 -37
View File
@@ -247,14 +247,10 @@
(.add.y.vf.x vf1 vf1 vf1)
(.add.z.vf.x vf1 vf1 vf1)
(.mov a2-5 vf1)
(let ((f0-0 a2-5)
(f1-1 (+ (-> a1-2 world-sphere w) (-> this collide-bounds r)))
)
(when (< f0-0 (* f1-1 f1-1))
(when (< *actor-list-length* 256)
(set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-3))
(set! *actor-list-length* (+ *actor-list-length* 1))
)
(when (< a2-5 (square (+ (-> a1-2 world-sphere w) (-> this collide-bounds r))))
(when (< *actor-list-length* 256)
(set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-3))
(set! *actor-list-length* (+ *actor-list-length* 1))
)
)
)
@@ -292,11 +288,7 @@
(.add.y.vf.x vf1 vf1 vf1)
(.add.z.vf.x vf1 vf1 vf1)
(.mov a2-12 vf1)
(let ((f0-1 a2-12)
(f1-5 (+ (-> a1-14 world-sphere w) (-> this collide-bounds r)))
)
(b! (>= f0-1 (* f1-5 f1-5)) cfg-17 :delay #f)
)
(b! (>= a2-12 (square (+ (-> a1-14 world-sphere w) (-> this collide-bounds r)))) cfg-17 :delay #f)
)
)
(b! (>= *actor-list-length* 256) cfg-17 :delay #f)
@@ -358,7 +350,6 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod setup ((this flow-control))
(local-vars (sv-32 flow-section) (sv-48 flow-section))
(let* ((s5-0 (-> this path))
(s4-0 (-> s5-0 curve num-cverts))
(s3-0 (new 'stack-no-clear 'vector))
@@ -368,30 +359,32 @@
(set! (-> this collide-bounds quad) (the-as uint128 0))
(get-point-in-path! s5-0 s3-0 0.0 'interp)
(vector+! (the-as vector (-> this collide-bounds)) (the-as vector (-> this collide-bounds)) s3-0)
(let ((s1-0 (+ s4-0 -1)))
(set! sv-32 (the-as flow-section #f))
(dotimes (s0-0 s1-0)
(set! sv-48 (-> s2-0 data s0-0))
(set! (-> sv-48 start quad) (-> s3-0 quad))
(get-point-in-path! s5-0 s3-0 (the float (+ s0-0 1)) 'interp)
(vector+! (the-as vector (-> this collide-bounds)) (the-as vector (-> this collide-bounds)) s3-0)
(vector-! (-> sv-48 pull-dir) s3-0 (-> sv-48 start))
(vector-normalize! (-> sv-48 pull-dir) 1.0)
(set! (-> sv-48 trailing quad) (-> sv-48 pull-dir quad))
(set! (-> sv-48 trailing y) 0.0)
(vector-normalize! (-> sv-48 trailing) 1.0)
(set-vector! (-> sv-48 radial-dir) (- (-> sv-48 trailing z)) 0.0 (-> sv-48 trailing x) 1.0)
(set! (-> sv-48 trailing w) (- (vector-dot s3-0 (the-as vector (-> sv-48 trailing)))))
(when sv-32
(vector+!
(the-as vector (-> sv-32 trailing))
(the-as vector (-> sv-32 trailing))
(the-as vector (-> sv-48 trailing))
)
(vector-normalize! (-> sv-32 trailing) 1.0)
(set! (-> sv-32 trailing w) (- (vector-dot (-> sv-48 start) (the-as vector (-> sv-32 trailing)))))
(let ((s1-0 (+ s4-0 -1))
(sv-32 (the-as flow-section #f))
)
(dotimes (s0-0 s1-0)
(let ((sv-48 (-> s2-0 data s0-0)))
(set! (-> sv-48 start quad) (-> s3-0 quad))
(get-point-in-path! s5-0 s3-0 (the float (+ s0-0 1)) 'interp)
(vector+! (the-as vector (-> this collide-bounds)) (the-as vector (-> this collide-bounds)) s3-0)
(vector-! (-> sv-48 pull-dir) s3-0 (-> sv-48 start))
(vector-normalize! (-> sv-48 pull-dir) 1.0)
(set! (-> sv-48 trailing quad) (-> sv-48 pull-dir quad))
(set! (-> sv-48 trailing y) 0.0)
(vector-normalize! (-> sv-48 trailing) 1.0)
(set-vector! (-> sv-48 radial-dir) (- (-> sv-48 trailing z)) 0.0 (-> sv-48 trailing x) 1.0)
(set! (-> sv-48 trailing w) (- (vector-dot s3-0 (the-as vector (-> sv-48 trailing)))))
(when sv-32
(vector+!
(the-as vector (-> sv-32 trailing))
(the-as vector (-> sv-32 trailing))
(the-as vector (-> sv-48 trailing))
)
(vector-normalize! (-> sv-32 trailing) 1.0)
(set! (-> sv-32 trailing w) (- (vector-dot (-> sv-48 start) (the-as vector (-> sv-32 trailing)))))
)
(set! sv-32 sv-48)
)
(set! sv-32 sv-48)
sv-32
)
)
+26 -51
View File
@@ -699,11 +699,6 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod water-control-method-10 ((this water-control))
(local-vars
(sv-272 (function vector entity-actor skeleton-group vector object none :behavior manipy))
(sv-288 vector)
(sv-304 entity-actor)
)
(with-pp
(let ((s4-0 (-> this flags))
(s5-0 (new 'stack-no-clear 'water-info))
@@ -805,37 +800,18 @@
(when (and (not (handle->process (-> this ripple)))
(>= (+ (current-time) (seconds -1.5)) (-> this enter-water-time))
)
(let* ((s1-0 (get-process *default-dead-pool* manipy #x4000))
(s2-0
(when s1-0
(let ((t9-6 (method-of-type manipy activate)))
(t9-6 (the-as manipy s1-0) (-> this process) (symbol->string (-> manipy symbol)) (the-as pointer #x70004000))
)
(let ((s2-1 run-function-in-process)
(s0-0 s1-0)
)
(set! sv-272 manipy-init)
(set! sv-288 s3-0)
(set! sv-304 (-> this process entity))
(let ((t0-0 (art-group-get-by-name *level* "skel-generic-ripples" (the-as (pointer uint32) #f)))
(t1-0 #f)
(t2-0 0)
)
((the-as (function object object object object object object object none) s2-1)
s0-0
sv-272
sv-288
sv-304
t0-0
t1-0
t2-0
)
)
)
(-> s1-0 ppointer)
)
)
)
(let ((s2-0 (process-spawn
manipy
:init manipy-init
s3-0
(-> this process entity)
(art-group-get-by-name *level* "skel-generic-ripples" (the-as (pointer uint32) #f))
#f
0
:to (-> this process)
)
)
)
(set! (-> this ripple) (ppointer->handle s2-0))
(when s2-0
(send-event (ppointer->process s2-0) 'anim-mode 'loop)
@@ -1548,7 +1524,6 @@
;; INFO: Used lq/sq
(defmethod water-info-init! ((this collide-shape) (arg0 water-info) (arg1 collide-action))
"Initialize a [[water-info]] with the currently loaded regions."
(local-vars (sv-80 int))
(let ((s3-0 (new 'stack 'water-info)))
(set! (-> s3-0 flags) (water-flags))
(set! (-> s3-0 handle) (the-as handle #f))
@@ -1563,21 +1538,21 @@
(when (= (-> v1-8 status) 'active)
(let ((s1-0 (-> v1-8 bsp region-trees)))
(when (nonzero? s1-0)
(let ((s0-0 (-> s1-0 length)))
(set! sv-80 0)
(let ((a0-10 (-> s1-0 sv-80)))
(while (< sv-80 s0-0)
(if (= (-> a0-10 name) 'water)
(collect-regions
a0-10
(the-as sphere (-> (the-as region-prim-area #x70000000) pos))
0
(-> (the-as region-prim-area #x70000000) region-prim-list)
)
(let* ((s0-0 (-> s1-0 length))
(sv-80 0)
(a0-10 (-> s1-0 sv-80))
)
(while (< sv-80 s0-0)
(if (= (-> a0-10 name) 'water)
(collect-regions
a0-10
(the-as sphere (-> (the-as region-prim-area #x70000000) pos))
0
(-> (the-as region-prim-area #x70000000) region-prim-list)
)
(set! sv-80 (+ sv-80 1))
(set! a0-10 (-> s1-0 sv-80))
)
)
(+! sv-80 1)
(set! a0-10 (-> s1-0 sv-80))
)
)
)
+27 -27
View File
@@ -4,7 +4,6 @@
;; definition for function make-debug-sphere-table
;; INFO: Used lq/sq
(defun make-debug-sphere-table ((points vector-array) (h-lines float) (v-lines float))
(local-vars (next-hz vector) (next-vt vector) (h-line int))
(let ((offset (new-stack-vector0))
(scale 1.0)
(num-points 0)
@@ -14,27 +13,29 @@
(let ((f28-0 (* scale (sin (* (the float v-line) (/ 32768.0 v-lines)))))
(f26-0 (* scale (sin (* (the float (+ v-line 1)) (/ 32768.0 v-lines)))))
(current (new-stack-vector0))
(next-hz (new 'stack-no-clear 'vector))
)
(set! next-hz (new 'stack-no-clear 'vector))
(set! (-> next-hz quad) (the-as uint128 0))
(set! next-vt (new 'stack-no-clear 'vector))
(set! (-> next-vt quad) (the-as uint128 0))
(set! (-> current y) (+ (-> offset y) (* (cos (* (the float v-line) (/ 32768.0 v-lines))) scale)))
(set! (-> next-hz y) (-> current y))
(set! (-> next-vt y) (+ (-> offset y) (* (cos (* (the float (+ v-line 1)) (/ 32768.0 v-lines))) scale)))
(set! h-line 0)
(while (< h-line (the int h-lines))
(set! (-> current x) (+ (-> offset x) (* (cos (* (the float h-line) (/ 65536.0 h-lines))) f28-0)))
(set! (-> current z) (+ (-> offset z) (* (sin (* (the float h-line) (/ 65536.0 h-lines))) f28-0)))
(set! (-> next-hz x) (+ (-> offset x) (* (cos (* (the float (+ h-line 1)) (/ 65536.0 h-lines))) f28-0)))
(set! (-> next-hz z) (+ (-> offset z) (* (sin (* (the float (+ h-line 1)) (/ 65536.0 h-lines))) f28-0)))
(set! (-> next-vt x) (+ (-> offset x) (* (cos (* (the float h-line) (/ 65536.0 h-lines))) f26-0)))
(set! (-> next-vt z) (+ (-> offset z) (* (sin (* (the float h-line) (/ 65536.0 h-lines))) f26-0)))
(set! (-> points data num-points quad) (-> current quad))
(set! (-> points data (+ num-points 1) quad) (-> next-hz quad))
(set! (-> points data (+ num-points 2) quad) (-> next-vt quad))
(+! num-points 3)
(set! h-line (+ h-line 1))
(let ((next-vt (new 'stack-no-clear 'vector)))
(set! (-> next-vt quad) (the-as uint128 0))
(set! (-> current y) (+ (-> offset y) (* (cos (* (the float v-line) (/ 32768.0 v-lines))) scale)))
(set! (-> next-hz y) (-> current y))
(set! (-> next-vt y) (+ (-> offset y) (* (cos (* (the float (+ v-line 1)) (/ 32768.0 v-lines))) scale)))
(let ((h-line 0))
(while (< h-line (the int h-lines))
(set! (-> current x) (+ (-> offset x) (* (cos (* (the float h-line) (/ 65536.0 h-lines))) f28-0)))
(set! (-> current z) (+ (-> offset z) (* (sin (* (the float h-line) (/ 65536.0 h-lines))) f28-0)))
(set! (-> next-hz x) (+ (-> offset x) (* (cos (* (the float (+ h-line 1)) (/ 65536.0 h-lines))) f28-0)))
(set! (-> next-hz z) (+ (-> offset z) (* (sin (* (the float (+ h-line 1)) (/ 65536.0 h-lines))) f28-0)))
(set! (-> next-vt x) (+ (-> offset x) (* (cos (* (the float h-line) (/ 65536.0 h-lines))) f26-0)))
(set! (-> next-vt z) (+ (-> offset z) (* (sin (* (the float h-line) (/ 65536.0 h-lines))) f26-0)))
(set! (-> points data num-points quad) (-> current quad))
(set! (-> points data (+ num-points 1) quad) (-> next-hz quad))
(set! (-> points data (+ num-points 2) quad) (-> next-vt quad))
(+! num-points 3)
(+! h-line 1)
)
)
)
)
)
@@ -53,7 +54,6 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defun add-debug-sphere-from-table ((bucket bucket-id) (position vector) (radius meters) (color rgba) (table-idx int))
(local-vars (sphere-points vector-array) (point-3 vector))
(rlet ((vf1 :class vf)
(vf2 :class vf)
(vf3 :class vf)
@@ -68,12 +68,12 @@
)
)
)
(set! sphere-points (-> *debug-sphere-table* table-idx))
(set! point-3 (the-as vector (new-stack-vector0)))
(let ((point-1 (new-stack-vector0))
(point-2 (new-stack-vector0))
(points (-> sphere-points data))
)
(let* ((sphere-points (-> *debug-sphere-table* table-idx))
(point-3 (the-as vector (new-stack-vector0)))
(point-1 (new-stack-vector0))
(point-2 (new-stack-vector0))
(points (-> sphere-points data))
)
(.lvf vf1 (&-> position quad))
(.mov vf2 radius)
(countdown (s4-1 (/ (-> sphere-points length) 3))
+183 -207
View File
@@ -156,9 +156,8 @@
;; definition (debug) for function internal-draw-debug-line
;; INFO: Used lq/sq
(defun-debug internal-draw-debug-line ((bucket bucket-id) (start vector) (end vector) (start-color rgba) (mode symbol) (end-color rgba))
(local-vars (var-end vector) (sv-128 vector) (sv-144 vector))
(set! var-end end)
(let ((var-start-color start-color)
(let ((var-end end)
(var-start-color start-color)
(var-mode mode)
(var-end-color end-color)
)
@@ -183,9 +182,9 @@
)
(let ((s4-0 (new 'stack 'vector4w-2))
(s3-0 (new 'stack 'vector4w-2))
(sv-128 (new 'stack-no-clear 'vector))
(sv-144 (new 'stack-no-clear 'vector))
)
(set! sv-128 (new 'stack-no-clear 'vector))
(set! sv-144 (new 'stack-no-clear 'vector))
(when (debug-line-clip? sv-128 sv-144 start var-end)
(set! (-> sv-128 w) 1.0)
(set! (-> sv-144 w) 1.0)
@@ -345,10 +344,9 @@
;; definition (debug) for function add-debug-flat-triangle
;; INFO: Used lq/sq
(defun-debug add-debug-flat-triangle ((enable symbol) (bucket bucket-id) (p0 vector) (p1 vector) (p2 vector) (color rgba))
(local-vars (sv-160 vector) (sv-176 vector))
(set! sv-160 p0)
(set! sv-176 p1)
(let ((s0-0 p2)
(let ((sv-160 p0)
(sv-176 p1)
(s0-0 p2)
(s3-0 color)
)
(if (not enable)
@@ -1039,73 +1037,61 @@
;; WARN: Stack slot offset 32 signed mismatch
;; WARN: Return type mismatch int vs none.
(defun-debug add-debug-line-sphere ((enable symbol) (bucket bucket-id) (position vector) (forward vector) (arg4 float) (color rgba))
(local-vars
(var-bucket bucket-id)
(var-position vector)
(var-forward vector)
(var-arg4 float)
(var-color rgba)
(mat matrix)
(forward-length float)
)
(b! (not enable) cfg-8 :delay (nop!))
(set! var-bucket bucket)
(set! var-position position)
(set! var-forward forward)
(set! var-arg4 arg4)
(set! var-color color)
(set! mat (new 'stack-no-clear 'matrix))
(set! forward-length (vector-length var-forward))
(let ((mat-forward (new 'stack-no-clear 'vector))
(mat-down (new 'stack-no-clear 'vector))
)
(vector-normalize-copy! mat-forward var-forward 1.0)
(vector-reset! mat-down)
(let* ((f0-2 (-> mat-forward y))
(f0-4 (* f0-2 f0-2))
(f1-0 (-> mat-forward z))
)
(if (< f0-4 (* f1-0 f1-0))
(let* ((var-bucket bucket)
(var-position position)
(var-forward forward)
(var-arg4 arg4)
(var-color color)
(mat (new 'stack-no-clear 'matrix))
(forward-length (vector-length var-forward))
)
(let ((mat-forward (new 'stack-no-clear 'vector))
(mat-down (new 'stack-no-clear 'vector))
)
(vector-normalize-copy! mat-forward var-forward 1.0)
(vector-reset! mat-down)
(if (< (square (-> mat-forward y)) (square (-> mat-forward z)))
(set! (-> mat-down y) -1.0)
(set! (-> mat-down z) -1.0)
)
(forward-down->inv-matrix mat mat-forward mat-down)
)
(forward-down->inv-matrix mat mat-forward mat-down)
)
(set! (-> mat trans quad) (-> var-position quad))
(set! (-> mat trans w) 1.0)
(let ((gp-1 (new 'static 'inline-array vector 3
(new 'static 'vector :y 0.5877 :z 0.951 :w 0.951)
(new 'static 'vector :x 0.5877 :z -0.5877 :w -0.951)
(new 'static 'vector :x -0.951 :y -0.5878)
(set! (-> mat trans quad) (-> var-position quad))
(set! (-> mat trans w) 1.0)
(let ((gp-1 (new 'static 'inline-array vector 3
(new 'static 'vector :y 0.5877 :z 0.951 :w 0.951)
(new 'static 'vector :x 0.5877 :z -0.5877 :w -0.951)
(new 'static 'vector :x -0.951 :y -0.5878)
)
)
)
(s5-1 (new 'static 'inline-array vector 3
(new 'static 'vector :x 1.0 :y 0.809 :z 0.3089 :w -0.3088)
(new 'static 'vector :x -0.809 :y -1.0 :z -0.809 :w -0.309)
(new 'static 'vector :x 0.3089 :y 0.8089)
(s5-1 (new 'static 'inline-array vector 3
(new 'static 'vector :x 1.0 :y 0.809 :z 0.3089 :w -0.3088)
(new 'static 'vector :x -0.809 :y -1.0 :z -0.809 :w -0.309)
(new 'static 'vector :x 0.3089 :y 0.8089)
)
)
)
(s4-0 (new 'stack-no-clear 'vector))
(s3-0 (new 'stack-no-clear 'vector))
(s2-0 (new 'stack-no-clear 'vector))
(s1-0 (new 'stack-no-clear 'vector))
)
(set! (-> s1-0 z) 0.0)
(set! (-> s1-0 w) 1.0)
(set! (-> s1-0 x) (* var-arg4 (-> s5-1 2 y)))
(set! (-> s1-0 y) (* var-arg4 (-> gp-1 2 y)))
(vector-matrix*! s3-0 s1-0 mat)
(dotimes (i 10)
(set! (-> s4-0 quad) (-> s3-0 quad))
(set! (-> s1-0 x) (* var-arg4 (-> (&-> s5-1 0 data i) 0)))
(set! (-> s1-0 y) (* var-arg4 (-> (&-> gp-1 0 data i) 0)))
(s4-0 (new 'stack-no-clear 'vector))
(s3-0 (new 'stack-no-clear 'vector))
(s2-0 (new 'stack-no-clear 'vector))
(s1-0 (new 'stack-no-clear 'vector))
)
(set! (-> s1-0 z) 0.0)
(set! (-> s1-0 w) 1.0)
(set! (-> s1-0 x) (* var-arg4 (-> s5-1 2 y)))
(set! (-> s1-0 y) (* var-arg4 (-> gp-1 2 y)))
(vector-matrix*! s3-0 s1-0 mat)
(add-debug-line #t var-bucket s4-0 s3-0 var-color #f (the-as rgba -1))
(vector+float*! s2-0 s3-0 (-> mat vector 2) forward-length)
(add-debug-line #t var-bucket s3-0 s2-0 var-color #f (the-as rgba -1))
(vector+float*! s4-0 s4-0 (-> mat vector 2) forward-length)
(add-debug-line #t var-bucket s4-0 s2-0 var-color #f (the-as rgba -1))
(dotimes (i 10)
(set! (-> s4-0 quad) (-> s3-0 quad))
(set! (-> s1-0 x) (* var-arg4 (-> (&-> s5-1 0 data i) 0)))
(set! (-> s1-0 y) (* var-arg4 (-> (&-> gp-1 0 data i) 0)))
(vector-matrix*! s3-0 s1-0 mat)
(add-debug-line #t var-bucket s4-0 s3-0 var-color #f (the-as rgba -1))
(vector+float*! s2-0 s3-0 (-> mat vector 2) forward-length)
(add-debug-line #t var-bucket s3-0 s2-0 var-color #f (the-as rgba -1))
(vector+float*! s4-0 s4-0 (-> mat vector 2) forward-length)
(add-debug-line #t var-bucket s4-0 s2-0 var-color #f (the-as rgba -1))
)
)
)
(label cfg-8)
@@ -1117,27 +1103,28 @@
;; INFO: Used lq/sq
(defun-debug add-debug-circle ((enable symbol) (bucket bucket-id) (position vector) (radius float) (color rgba) (orientation matrix))
"note: you may pass #f for orientation"
(local-vars (i int) (sv-64 vector) (sv-80 vector))
(if (not enable)
(return #f)
)
(let ((angle 0.0)
(line-start (new-stack-vector0))
(line-end (new-stack-vector0))
(i 0)
)
(set! i 0)
(while (< i 12)
(set! sv-64 line-start)
(set! (-> sv-64 x) (* radius (cos angle)))
(set! (-> sv-64 y) 0.0)
(set! (-> sv-64 z) (* radius (sin angle)))
(set! (-> sv-64 w) 1.0)
(let ((sv-64 line-start))
(set! (-> sv-64 x) (* radius (cos angle)))
(set! (-> sv-64 y) 0.0)
(set! (-> sv-64 z) (* radius (sin angle)))
(set! (-> sv-64 w) 1.0)
)
(set! angle (+ 5461.3335 angle))
(set! sv-80 line-end)
(set! (-> sv-80 x) (* radius (cos angle)))
(set! (-> sv-80 y) 0.0)
(set! (-> sv-80 z) (* radius (sin angle)))
(set! (-> sv-80 w) 1.0)
(let ((sv-80 line-end))
(set! (-> sv-80 x) (* radius (cos angle)))
(set! (-> sv-80 y) 0.0)
(set! (-> sv-80 z) (* radius (sin angle)))
(set! (-> sv-80 w) 1.0)
)
(when orientation
(vector-matrix*! line-start line-start orientation)
(vector-matrix*! line-end line-end orientation)
@@ -1145,7 +1132,7 @@
(vector+! line-start line-start position)
(vector+! line-end line-end position)
(add-debug-line #t bucket line-start line-end color #f (the-as rgba -1))
(set! i (+ i 1))
(+! i 1)
)
)
#f
@@ -1230,9 +1217,8 @@
;; WARN: Stack slot offset 32 signed mismatch
;; ERROR: Stack slot load at 32 mismatch: defined as size 4, got size 16
(defun-debug add-debug-yrot-vector ((enable symbol) (bucket bucket-id) (position vector) (angle float) (line-length float) (color rgba))
(local-vars (var-angle float))
(set! var-angle angle)
(let ((var-line-length line-length)
(let ((var-angle angle)
(var-line-length line-length)
(var-color color)
)
(if (not enable)
@@ -1264,44 +1250,48 @@
(orientation matrix)
)
"note: you may pass #f for orientation"
(local-vars (line-start vector) (line-end vector) (i int) (sv-96 vector) (sv-112 vector))
(if (not enable)
(return #f)
)
(let ((angle start-angle))
(set! line-start (new 'stack-no-clear 'vector))
(let ((angle start-angle)
(line-start (new 'stack-no-clear 'vector))
)
(set! (-> line-start quad) (the-as uint128 0))
(set! line-end (new 'stack-no-clear 'vector))
(set! (-> line-end quad) (the-as uint128 0))
(set! i 0)
(while (< i 12)
(set! sv-96 line-start)
(set! (-> sv-96 x) (* radius (sin angle)))
(set! (-> sv-96 y) 0.0)
(set! (-> sv-96 z) (* radius (cos angle)))
(set! (-> sv-96 w) 1.0)
(+! angle (the float (/ (the int (- end-angle start-angle)) 12)))
(set! sv-112 line-end)
(set! (-> sv-112 x) (* radius (sin angle)))
(set! (-> sv-112 y) 0.0)
(set! (-> sv-112 z) (* radius (cos angle)))
(set! (-> sv-112 w) 1.0)
(when orientation
(vector-matrix*! line-start line-start orientation)
(vector-matrix*! line-end line-end orientation)
(let ((line-end (new 'stack-no-clear 'vector)))
(set! (-> line-end quad) (the-as uint128 0))
(let ((i 0))
(while (< i 12)
(let ((sv-96 line-start))
(set! (-> sv-96 x) (* radius (sin angle)))
(set! (-> sv-96 y) 0.0)
(set! (-> sv-96 z) (* radius (cos angle)))
(set! (-> sv-96 w) 1.0)
)
(+! angle (the float (/ (the int (- end-angle start-angle)) 12)))
(let ((sv-112 line-end))
(set! (-> sv-112 x) (* radius (sin angle)))
(set! (-> sv-112 y) 0.0)
(set! (-> sv-112 z) (* radius (cos angle)))
(set! (-> sv-112 w) 1.0)
)
(when orientation
(vector-matrix*! line-start line-start orientation)
(vector-matrix*! line-end line-end orientation)
)
(vector+! line-start line-start position)
(vector+! line-end line-end position)
(add-debug-line #t bucket line-start line-end color #f (the-as rgba -1))
(cond
((zero? i)
(add-debug-line #t bucket line-start position color #f (the-as rgba -1))
)
((= i 11)
(add-debug-line #t bucket line-end position color #f (the-as rgba -1))
)
)
(+! i 1)
)
)
(vector+! line-start line-start position)
(vector+! line-end line-end position)
(add-debug-line #t bucket line-start line-end color #f (the-as rgba -1))
(cond
((zero? i)
(add-debug-line #t bucket line-start position color #f (the-as rgba -1))
)
((= i 11)
(add-debug-line #t bucket line-end position color #f (the-as rgba -1))
)
)
(set! i (+ i 1))
)
)
#f
@@ -1317,21 +1307,23 @@
(num-knots int)
(color rgba)
)
(local-vars (p1 vector) (iterations int) (i int))
(if (not enable)
(return #f)
)
(let ((p0 (new-stack-vector0)))
(set! p1 (new 'stack-no-clear 'vector))
(let ((p0 (new-stack-vector0))
(p1 (new 'stack-no-clear 'vector))
)
(set! (-> p1 quad) (the-as uint128 0))
(set! iterations (* num-cverts 4))
(curve-evaluate! p1 (-> knots 0) cverts num-cverts knots num-knots)
(set! i 0)
(while (< i iterations)
(set! (-> p0 quad) (-> p1 quad))
(curve-evaluate! p1 (/ (the float (+ i 1)) (the float iterations)) cverts num-cverts knots num-knots)
(add-debug-line #t bucket p0 p1 color #f (the-as rgba -1))
(set! i (+ i 1))
(let ((iterations (* num-cverts 4)))
(curve-evaluate! p1 (-> knots 0) cverts num-cverts knots num-knots)
(let ((i 0))
(while (< i iterations)
(set! (-> p0 quad) (-> p1 quad))
(curve-evaluate! p1 (/ (the float (+ i 1)) (the float iterations)) cverts num-cverts knots num-knots)
(add-debug-line #t bucket p0 p1 color #f (the-as rgba -1))
(+! i 1)
)
)
)
)
#f
@@ -1363,48 +1355,26 @@
(y-override float)
(highlight int)
)
(local-vars
(sv-32 (function symbol bucket-id string vector font-color vector2h symbol))
(sv-48 symbol)
(sv-64 bucket-id)
(sv-80 (function _varargs_ object))
(position vector)
)
(when enable
(dotimes (i num-points)
(set! position (new 'stack-no-clear 'vector))
(set! (-> position quad) (the-as uint128 0))
(set! (-> position quad) (-> points i quad))
(if (!= y-override 0.0)
(set! (-> position y) y-override)
(let ((position (new 'stack-no-clear 'vector)))
(set! (-> position quad) (the-as uint128 0))
(set! (-> position quad) (-> points i quad))
(if (!= y-override 0.0)
(set! (-> position y) y-override)
)
(let ((sv-32 add-debug-text-3d)
(sv-48 #t)
(sv-64 bucket)
)
(format (clear *temp-string*) "~d" i)
(sv-32 sv-48 sv-64 *temp-string* position (font-color white) (the-as vector2h #f))
)
(set! sv-32 add-debug-text-3d)
(set! sv-48 #t)
(set! sv-64 bucket)
(set! sv-80 format)
(let ((a0-5 (clear *temp-string*))
(a1-1 "~d")
(a2-1 i)
)
(sv-80 a0-5 a1-1 a2-1)
)
(let ((a2-2 *temp-string*)
(a3-1 position)
(t0-1 1)
(t1-1 #f)
)
(sv-32 sv-48 sv-64 a2-2 a3-1 (the-as font-color t0-1) (the-as vector2h t1-1))
)
(let ((t9-3 add-debug-x)
(a0-7 #t)
(a1-3 bucket)
(a3-2 (if (= i highlight)
(new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)
color
)
)
)
(t9-3 a0-7 a1-3 position a3-2)
(add-debug-x #t bucket position (if (= i highlight)
(the-as rgba (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80))
(the-as rgba color)
)
)
)
)
)
@@ -1416,10 +1386,9 @@
;; WARN: Stack slot offset 32 signed mismatch
;; WARN: Stack slot offset 32 signed mismatch
(defun-debug debug-percent-bar ((enable symbol) (bucket bucket-id) (x int) (y int) (percentage float) (color rgba) (width int) (height int))
(local-vars (sv-16 int) (sv-32 float))
(set! sv-16 y)
(set! sv-32 percentage)
(let ((s2-0 color)
(let ((sv-16 y)
(sv-32 percentage)
(s2-0 color)
(s1-0 width)
(s3-0 height)
)
@@ -1867,44 +1836,51 @@
;; WARN: Return type mismatch int vs none.
;; WARN: Function add-debug-bound has a return type of none, but the expression builder found a return statement.
(defun-debug add-debug-bound ((buf bucket-id) (pts (inline-array vector)) (c0 int) (c1 rgba) (flash rgba) (arg5 int))
(local-vars (sv-16 pointer) (sv-32 int))
(set! sv-32 arg5)
(if (< c0 3)
(return 0)
(let ((sv-32 arg5))
(if (< c0 3)
(return 0)
)
(case sv-32
((1)
(set! sv-32 (cond
((logtest? (-> *display* real-frame-clock integral-frame-counter) 4)
(set! sv-32 1)
sv-32
)
(else
0
)
)
)
sv-32
)
)
(case sv-32
((1)
(if (logtest? (-> *display* real-frame-clock integral-frame-counter) 4)
(set! sv-32 1)
(set! sv-32 0)
)
sv-32
)
)
(with-dma-buffer-add-bucket ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf))
buf
)
(dma-buffer-add-gs-set s4-0
(zbuf-1 (new 'static 'gs-zbuf :zbp #x130 :psm (gs-psm ct24)))
(test-1 (new 'static 'gs-test
:ate #x1
:atst (gs-atest greater-equal)
:aref #x26
:zte #x1
:ztst (gs-ztest greater-equal)
(with-dma-buffer-add-bucket ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf))
buf
)
(dma-buffer-add-gs-set s4-0
(zbuf-1 (new 'static 'gs-zbuf :zbp #x130 :psm (gs-psm ct24)))
(test-1 (new 'static 'gs-test
:ate #x1
:atst (gs-atest greater-equal)
:aref #x26
:zte #x1
:ztst (gs-ztest greater-equal)
)
)
)
(alpha-1 (new 'static 'gs-alpha :b #x1 :d #x1))
)
(set! sv-16 (-> s4-0 base))
(&+! (-> s4-0 base) 16)
(add-boundary-shader (new 'static 'texture-id :index #x3 :page #x70c) s4-0)
(add-debug-bound-internal s4-0 pts c0 c1 flash sv-32)
(close-sky-buffer s4-0)
(let ((v1-25 (/ (the-as int (+ (- -16 (the-as int sv-16)) (the-as int (-> s4-0 base)))) 16)))
(set! (-> (the-as dma-packet sv-16) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc v1-25))
(set! (-> (the-as dma-packet sv-16) vif0) (new 'static 'vif-tag))
(set! (-> (the-as dma-packet sv-16) vif1) (new 'static 'vif-tag :cmd (vif-cmd direct) :msk #x1 :imm v1-25))
(alpha-1 (new 'static 'gs-alpha :b #x1 :d #x1))
)
(let ((sv-16 (-> s4-0 base)))
(&+! (-> s4-0 base) 16)
(add-boundary-shader (new 'static 'texture-id :index #x3 :page #x70c) s4-0)
(add-debug-bound-internal s4-0 pts c0 c1 flash sv-32)
(close-sky-buffer s4-0)
(let ((v1-25 (/ (the-as int (+ (- -16 (the-as int sv-16)) (the-as int (-> s4-0 base)))) 16)))
(set! (-> (the-as dma-packet sv-16) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc v1-25))
(set! (-> (the-as dma-packet sv-16) vif0) (new 'static 'vif-tag))
(set! (-> (the-as dma-packet sv-16) vif1) (new 'static 'vif-tag :cmd (vif-cmd direct) :msk #x1 :imm v1-25))
)
)
)
)
0
+24 -133
View File
@@ -2732,20 +2732,6 @@
;; definition for function debug-menu-make-continue-sub-menu
;; INFO: Used lq/sq
(defun debug-menu-make-continue-sub-menu ((arg0 game-info) (arg1 symbol))
(local-vars
(sv-16 (function symbol type object object pair))
(sv-32 symbol)
(sv-48 type)
(sv-64 symbol)
(sv-80 (function symbol type object object pair))
(sv-96 symbol)
(sv-112 type)
(sv-128 string)
(sv-144 (function symbol type object object pair))
(sv-160 symbol)
(sv-176 type)
(sv-192 string)
)
(let ((s4-0 *level-load-list*)
(s5-0 '())
)
@@ -2757,34 +2743,20 @@
(let ((v1-2 (car s3-0))
(a0-5 arg1)
)
(when (if (= a0-5 'test)
(logtest? (continue-flags test) (-> (the-as continue-point v1-2) flags))
#t
)
(let ((s2-0 (method-of-type pair new))
(s1-0 'global)
(s0-0 pair)
(if (if (= a0-5 'test)
(logtest? (continue-flags test) (-> (the-as continue-point v1-2) flags))
#t
)
(set! sv-16 (method-of-type pair new))
(set! sv-32 'global)
(set! sv-48 pair)
(set! sv-64 'flag)
(set! sv-80 (method-of-type pair new))
(set! sv-96 'global)
(set! sv-112 pair)
(set! sv-128 (-> (the-as continue-point v1-2) name))
(set! sv-144 (method-of-type pair new))
(set! sv-160 'global)
(set! sv-176 pair)
(set! sv-192 (-> (the-as continue-point v1-2) name))
(let* ((a3-1 (cons 'dm-current-continue '()))
(a3-2 (sv-144 sv-160 sv-176 sv-192 a3-1))
(a3-3 (sv-80 sv-96 sv-112 sv-128 a3-2))
)
(set! s5-0 (s2-0 s1-0 s0-0 (sv-16 sv-32 sv-48 sv-64 a3-3) s5-0))
)
(set! s5-0 (cons
(cons 'flag (cons
(-> (the-as continue-point v1-2) name)
(cons (-> (the-as continue-point v1-2) name) (cons 'dm-current-continue '()))
)
)
s5-0
)
)
)
)
)
(set! s3-0 (cdr s3-0))
)
@@ -2810,50 +2782,16 @@
;; INFO: Used lq/sq
(defun debug-menu-make-task-sub-menu ((arg0 symbol))
"TODO - need to know more about game-info"
(local-vars
(sv-16 (function symbol type object object pair))
(sv-32 symbol)
(sv-48 type)
(sv-64 symbol)
(sv-80 (function symbol type object object pair))
(sv-96 symbol)
(sv-112 type)
(sv-128 string)
(sv-144 (function symbol type object object pair))
(sv-160 symbol)
(sv-176 type)
(sv-192 int)
)
(let ((gp-0 '()))
(let ((s4-0 (-> *game-info* sub-task-list)))
(countdown (s3-0 (-> s4-0 length))
(when (nonzero? s3-0)
(let ((v1-4 (-> s4-0 s3-0)))
(when (= (-> v1-4 level) arg0)
(let ((s2-0 (method-of-type pair new))
(s1-0 'global)
(s0-0 pair)
)
(set! sv-16 (method-of-type pair new))
(set! sv-32 'global)
(set! sv-48 pair)
(set! sv-64 'flag)
(set! sv-80 (method-of-type pair new))
(set! sv-96 'global)
(set! sv-112 pair)
(set! sv-128 (-> v1-4 name))
(set! sv-144 (method-of-type pair new))
(set! sv-160 'global)
(set! sv-176 pair)
(set! sv-192 (* s3-0 8))
(let* ((a3-1 (cons 'dm-task-menu-pick-func '()))
(a3-2 (sv-144 sv-160 sv-176 sv-192 a3-1))
(a3-3 (sv-80 sv-96 sv-112 sv-128 a3-2))
)
(set! gp-0 (s2-0 s1-0 s0-0 (sv-16 sv-32 sv-48 sv-64 a3-3) gp-0))
)
(if (= (-> v1-4 level) arg0)
(set! gp-0
(cons (cons 'flag (cons (-> v1-4 name) (cons (* s3-0 8) (cons 'dm-task-menu-pick-func '())))) gp-0)
)
)
)
)
)
)
@@ -2865,7 +2803,6 @@
;; definition for function debug-menu-make-task-menu
;; INFO: Used lq/sq
(defun debug-menu-make-task-menu ((arg0 debug-menu-context))
(local-vars (sv-16 debug-menu-context))
(let* ((s5-0 (new 'debug 'debug-menu arg0 "Task menu"))
(s4-0 (new 'debug 'debug-menu-item-submenu "Task" s5-0))
)
@@ -2894,14 +2831,9 @@
(a0-3 (car s3-0))
)
(while (not (null? s3-0))
(let ((s2-0 debug-menu-append-item)
(s1-0 s5-0)
(s0-0 debug-menu-make-from-template)
)
(set! sv-16 arg0)
(let ((a1-2 (debug-menu-make-task-sub-menu (the-as symbol a0-3))))
(s2-0 s1-0 (s0-0 sv-16 a1-2))
)
(debug-menu-append-item
s5-0
(debug-menu-make-from-template arg0 (debug-menu-make-task-sub-menu (the-as symbol a0-3)))
)
(set! s3-0 (cdr s3-0))
(set! a0-3 (car s3-0))
@@ -3012,47 +2944,12 @@
;; definition for function debug-menu-make-play-menu
;; INFO: Used lq/sq
(defun debug-menu-make-play-menu ((arg0 debug-menu-context))
(local-vars
(sv-16 symbol)
(sv-32 type)
(sv-48 symbol)
(sv-64 (function symbol type object object pair))
(sv-80 symbol)
(sv-96 type)
(sv-112 string)
(sv-128 (function symbol type object object pair))
(sv-144 symbol)
(sv-160 type)
(sv-176 int)
)
(let ((gp-0 '()))
(countdown (s4-0 (-> *game-info* play-list length))
(let ((v1-4 (-> *game-info* play-list s4-0)))
(when (-> v1-4 play-continue)
(let ((s3-0 (method-of-type pair new))
(s2-0 'global)
(s1-0 pair)
(s0-0 (method-of-type pair new))
)
(set! sv-16 'global)
(set! sv-32 pair)
(set! sv-48 'function)
(set! sv-64 (method-of-type pair new))
(set! sv-80 'global)
(set! sv-96 pair)
(set! sv-112 (-> v1-4 name))
(set! sv-128 (method-of-type pair new))
(set! sv-144 'global)
(set! sv-160 pair)
(set! sv-176 (* s4-0 8))
(let* ((a3-1 (cons 'dm-play-task '()))
(a3-2 (sv-128 sv-144 sv-160 sv-176 a3-1))
(a3-3 (sv-64 sv-80 sv-96 sv-112 a3-2))
)
(set! gp-0 (s3-0 s2-0 s1-0 (s0-0 sv-16 sv-32 sv-48 a3-3) gp-0))
)
(if (-> v1-4 play-continue)
(set! gp-0 (cons (cons 'function (cons (-> v1-4 name) (cons (* s4-0 8) (cons 'dm-play-task '())))) gp-0))
)
)
)
)
(debug-menu-make-from-template arg0 (cons 'menu (cons "Play" gp-0)))
@@ -3137,7 +3034,6 @@
;; definition for function debug-menu-context-make-default-menus
;; INFO: Used lq/sq
(defun debug-menu-context-make-default-menus ((arg0 debug-menu-context))
(local-vars (sv-16 debug-menu-context))
(let ((s5-0 (new 'debug 'debug-menu arg0 "Main menu")))
(debug-menu-context-set-root-menu arg0 s5-0)
(debug-menu-append-item
@@ -3555,14 +3451,9 @@
(a1-7 (car s3-2))
)
(while (not (null? s3-2))
(let ((s2-0 debug-menu-append-item)
(s1-0 s4-2)
(s0-0 debug-menu-make-from-template)
)
(set! sv-16 arg0)
(let ((a1-8 (debug-menu-make-continue-sub-menu *game-info* (the-as symbol a1-7))))
(s2-0 s1-0 (s0-0 sv-16 a1-8))
)
(debug-menu-append-item
s4-2
(debug-menu-make-from-template arg0 (debug-menu-make-continue-sub-menu *game-info* (the-as symbol a1-7)))
)
(set! s3-2 (cdr s3-2))
(set! a1-7 (car s3-2))
File diff suppressed because it is too large Load Diff
+222 -228
View File
@@ -462,150 +462,143 @@
;; WARN: Return type mismatch int vs none.
;; WARN: new jak 2 until loop case, check carefully
(defun history-print ((arg0 history-iterator))
(local-vars
(sv-16 object)
(sv-24 int)
(sv-32 int)
(sv-40 history-elt)
(sv-48 time-frame)
(sv-56 uint)
(sv-64 collide-status)
(sv-72 float)
(sv-80 string)
(sv-96 string)
)
(set! sv-16 (-> arg0 out))
(set! sv-24 -1)
(set! sv-32 0)
(until #f
(set! sv-40 (update-entries! arg0))
(if (not sv-40)
(goto cfg-71)
(let ((sv-16 (-> arg0 out))
(sv-24 -1)
(sv-32 0)
)
(when (logtest? (-> arg0 channel-mask) (ash 1 (-> sv-40 channel)))
(set! sv-48 (frame-counter-delta arg0 sv-40))
(set! sv-56 (-> sv-40 record-id))
(cond
((!= sv-24 sv-48)
(set! sv-24 (the-as int sv-48))
(set! sv-32 (the-as int sv-56))
(format sv-16 "~3D ~4X " sv-48 (-> sv-40 record-id))
)
((!= sv-32 sv-56)
(set! sv-32 (the-as int sv-56))
(format sv-16 " ~4X " (-> sv-40 record-id))
)
(else
(format sv-16 " ")
)
)
(let ((v1-22 (-> sv-40 channel)))
(cond
((or (= v1-22 (history-channel trans))
(or (= v1-22 (history-channel transv))
(= v1-22 (history-channel transv-in))
(= v1-22 (history-channel transv-out))
(= v1-22 (history-channel intersect))
(until #f
(let ((sv-40 (update-entries! arg0)))
(if (not sv-40)
(goto cfg-71)
)
(when (logtest? (-> arg0 channel-mask) (ash 1 (-> sv-40 channel)))
(let ((sv-48 (frame-counter-delta arg0 sv-40))
(sv-56 (-> sv-40 record-id))
)
(cond
((!= sv-24 sv-48)
(set! sv-24 (the-as int sv-48))
(set! sv-32 (the-as int sv-56))
(format sv-16 "~3D ~4X " sv-48 (-> sv-40 record-id))
)
((!= sv-32 sv-56)
(set! sv-32 (the-as int sv-56))
(format sv-16 " ~4X " (-> sv-40 record-id))
)
(else
(format sv-16 " ")
)
)
)
(let ((v1-22 (-> sv-40 channel)))
(cond
((or (= v1-22 (history-channel trans))
(or (= v1-22 (history-channel transv))
(= v1-22 (history-channel transv-in))
(= v1-22 (history-channel transv-out))
(= v1-22 (history-channel intersect))
)
)
(format
sv-16
"~-15S: ~14Mm ~14Mm ~14Mm~%"
(history-channel->string (-> sv-40 channel))
(-> sv-40 vector x)
(-> sv-40 vector y)
(-> sv-40 vector z)
)
)
(format
sv-16
"~-15S: ~14Mm ~14Mm ~14Mm~%"
(history-channel->string (-> sv-40 channel))
(-> sv-40 vector x)
(-> sv-40 vector y)
(-> sv-40 vector z)
)
)
((or (= v1-22 (history-channel local-normal)) (= v1-22 (history-channel surface-normal)))
(format
sv-16
"~-15S: ~14f ~14f ~14f~%"
(history-channel->string (-> sv-40 channel))
(-> sv-40 vector x)
(-> sv-40 vector y)
(-> sv-40 vector z)
)
)
((= v1-22 (history-channel pat))
(let* ((s2-0 (-> sv-40 vector x))
(s5-2 format)
(s4-2 sv-16)
(s3-2 "~-15S: #x~6X mode:~-8S material:~-10S event:~S~%")
(s1-0 (history-channel->string (-> sv-40 channel)))
(s0-0 s2-0)
)
(set! sv-80 (pat-mode->string (the-as pat-surface s2-0)))
(set! sv-96 (pat-material->string (the-as pat-surface s2-0)))
(let ((t2-0 (pat-event->string (the-as pat-surface s2-0))))
(s5-2 s4-2 s3-2 s1-0 s0-0 sv-80 sv-96 t2-0)
((or (= v1-22 (history-channel local-normal)) (= v1-22 (history-channel surface-normal)))
(format
sv-16
"~-15S: ~14f ~14f ~14f~%"
(history-channel->string (-> sv-40 channel))
(-> sv-40 vector x)
(-> sv-40 vector y)
(-> sv-40 vector z)
)
)
)
)
((= v1-22 (history-channel collide-status))
(set! sv-64 (-> sv-40 collide-status))
(set! sv-72 (-> sv-40 vector z))
(format sv-16 "~-15S: #x~6X " (history-channel->string (-> sv-40 channel)) sv-64)
(let ((s5-4 sv-64))
(if (= (logand s5-4 (collide-status touch-background)) (collide-status touch-background))
(format sv-16 "touch-background ")
((= v1-22 (history-channel pat))
(let ((s2-0 (-> sv-40 vector x)))
(format
sv-16
"~-15S: #x~6X mode:~-8S material:~-10S event:~S~%"
(history-channel->string (-> sv-40 channel))
s2-0
(pat-mode->string (the-as pat-surface s2-0))
(pat-material->string (the-as pat-surface s2-0))
(pat-event->string (the-as pat-surface s2-0))
)
)
(if (= (logand s5-4 (collide-status on-special-surface)) (collide-status on-special-surface))
(format sv-16 "on-special-surface ")
)
((= v1-22 (history-channel collide-status))
(let ((sv-64 (-> sv-40 collide-status))
(sv-72 (-> sv-40 vector z))
)
(format sv-16 "~-15S: #x~6X " (history-channel->string (-> sv-40 channel)) sv-64)
(let ((s5-4 sv-64))
(if (= (logand s5-4 (collide-status touch-background)) (collide-status touch-background))
(format sv-16 "touch-background ")
)
(if (= (logand s5-4 (collide-status on-special-surface)) (collide-status on-special-surface))
(format sv-16 "on-special-surface ")
)
(if (= (logand s5-4 (collide-status touch-wall)) (collide-status touch-wall))
(format sv-16 "touch-wall ")
)
(if (= (logand s5-4 (collide-status on-surface)) (collide-status on-surface))
(format sv-16 "on-surface ")
)
(if (= (logand s5-4 (collide-status impact-surface)) (collide-status impact-surface))
(format sv-16 "impact-surface ")
)
(if (= (logand s5-4 (collide-status touch-ceiling)) (collide-status touch-ceiling))
(format sv-16 "touch-ceiling ")
)
(if (= (logand s5-4 (collide-status on-ground)) (collide-status on-ground))
(format sv-16 "on-ground ")
)
(if (= (logand s5-4 (collide-status glance)) (collide-status glance))
(format sv-16 "glance ")
)
(if (= (logand s5-4 (collide-status blocked)) (collide-status blocked))
(format sv-16 "blocked ")
)
(if (= (logand s5-4 (collide-status touch-edge)) (collide-status touch-edge))
(format sv-16 "touch-edge ")
)
(if (= (logand s5-4 (collide-status touch-ceiling-sticky)) (collide-status touch-ceiling-sticky))
(format sv-16 "touch-ceiling-sticky ")
)
(if (= (logand s5-4 (collide-status on-water)) (collide-status on-water))
(format sv-16 "on-water ")
)
(if (= (logand s5-4 (collide-status touch-actor)) (collide-status touch-actor))
(format sv-16 "touch-actor ")
)
(if (= (logand (collide-status probe-hit) s5-4) (collide-status probe-hit))
(format sv-16 "probe-hit ")
)
(if (= (logand s5-4 (collide-status stuck)) (collide-status stuck))
(format sv-16 "stuck ")
)
(if (= (logand s5-4 (collide-status no-touch)) (collide-status no-touch))
(format sv-16 "no-touch ")
)
(if (= (logand s5-4 (collide-status touch-surface)) (collide-status touch-surface))
(format sv-16 "touch-surface ")
)
)
(format sv-16 " #x~6X~%" sv-72)
)
(if (= (logand s5-4 (collide-status touch-wall)) (collide-status touch-wall))
(format sv-16 "touch-wall ")
)
((= v1-22 (history-channel friction))
(let ((f30-0 (-> sv-40 vector x)))
(format sv-16 "~-15S: ~f~%" (history-channel->string (-> sv-40 channel)) f30-0)
)
(if (= (logand s5-4 (collide-status on-surface)) (collide-status on-surface))
(format sv-16 "on-surface ")
)
(if (= (logand s5-4 (collide-status impact-surface)) (collide-status impact-surface))
(format sv-16 "impact-surface ")
)
(if (= (logand s5-4 (collide-status touch-ceiling)) (collide-status touch-ceiling))
(format sv-16 "touch-ceiling ")
)
(if (= (logand s5-4 (collide-status on-ground)) (collide-status on-ground))
(format sv-16 "on-ground ")
)
(if (= (logand s5-4 (collide-status glance)) (collide-status glance))
(format sv-16 "glance ")
)
(if (= (logand s5-4 (collide-status blocked)) (collide-status blocked))
(format sv-16 "blocked ")
)
(if (= (logand s5-4 (collide-status touch-edge)) (collide-status touch-edge))
(format sv-16 "touch-edge ")
)
(if (= (logand s5-4 (collide-status touch-ceiling-sticky)) (collide-status touch-ceiling-sticky))
(format sv-16 "touch-ceiling-sticky ")
)
(if (= (logand s5-4 (collide-status on-water)) (collide-status on-water))
(format sv-16 "on-water ")
)
(if (= (logand s5-4 (collide-status touch-actor)) (collide-status touch-actor))
(format sv-16 "touch-actor ")
)
(if (= (logand (collide-status probe-hit) s5-4) (collide-status probe-hit))
(format sv-16 "probe-hit ")
)
(if (= (logand s5-4 (collide-status stuck)) (collide-status stuck))
(format sv-16 "stuck ")
)
(if (= (logand s5-4 (collide-status no-touch)) (collide-status no-touch))
(format sv-16 "no-touch ")
)
(if (= (logand s5-4 (collide-status touch-surface)) (collide-status touch-surface))
(format sv-16 "touch-surface ")
)
)
(format sv-16 " #x~6X~%" sv-72)
)
((= v1-22 (history-channel friction))
(let ((f30-0 (-> sv-40 vector x)))
(format sv-16 "~-15S: ~f~%" (history-channel->string (-> sv-40 channel)) f30-0)
)
)
)
)
)
)
)
)
@@ -620,113 +613,114 @@
;; WARN: Return type mismatch int vs none.
;; WARN: new jak 2 until loop case, check carefully
(defun history-draw ((arg0 history-iterator))
(local-vars (sv-16 vector) (sv-20 vector) (sv-24 pat-surface))
(set! sv-16 (the-as vector #f))
(set! sv-20 (the-as vector #f))
(set! sv-24 (new 'static 'pat-surface))
(until #f
(let ((s5-0 (update-entries! arg0)))
(if (not s5-0)
(goto cfg-34)
)
(when (logtest? (-> arg0 channel-mask) (ash 1 (-> s5-0 channel)))
(let* ((f0-0 (get-age arg0 s5-0))
(v1-8 (the int (lerp 4.0 128.0 f0-0)))
)
(case (-> s5-0 channel)
(((history-channel trans))
(if sv-16
(add-debug-line
#t
(bucket-id debug-no-zbuf1)
sv-16
(-> s5-0 vector)
(the-as rgba (logior #xffff00 (shl v1-8 24)))
#f
(the-as rgba -1)
)
(add-debug-x #t (bucket-id debug-no-zbuf1) (-> s5-0 vector) (the-as rgba (logior #xffff00 (shl v1-8 24))))
(let ((sv-16 (the-as vector #f))
(sv-20 (the-as vector #f))
(sv-24 (new 'static 'pat-surface))
)
(until #f
(let ((s5-0 (update-entries! arg0)))
(if (not s5-0)
(goto cfg-34)
)
(when (logtest? (-> arg0 channel-mask) (ash 1 (-> s5-0 channel)))
(let* ((f0-0 (get-age arg0 s5-0))
(v1-8 (the int (lerp 4.0 128.0 f0-0)))
)
(set! sv-16 (-> s5-0 vector))
)
(((history-channel intersect))
(if sv-20
(add-debug-line
#t
(bucket-id debug-no-zbuf1)
sv-20
(-> s5-0 vector)
(the-as rgba (logior #xffffff (shl v1-8 24)))
#f
(the-as rgba -1)
)
(add-debug-x #t (bucket-id debug-no-zbuf1) (-> s5-0 vector) (the-as rgba (logior #xffffff (shl v1-8 24))))
)
(set! sv-20 (-> s5-0 vector))
)
(((history-channel transv))
(add-debug-vector
#t
(bucket-id debug-no-zbuf1)
(-> s5-0 origin)
(-> s5-0 vector)
(meters 0.000024414063)
(the-as rgba (logior (shl v1-8 24) #xff00))
)
)
(((history-channel transv-in))
(add-debug-vector
#t
(bucket-id debug-no-zbuf1)
(-> s5-0 origin)
(-> s5-0 vector)
(meters 0.000024414063)
(the-as rgba (logior #x408040 (shl v1-8 24)))
)
)
(((history-channel transv-out))
(add-debug-vector
#t
(bucket-id debug-no-zbuf1)
(-> s5-0 origin)
(-> s5-0 vector)
(meters 0.000024414063)
(the-as rgba (logior #x404080 (shl v1-8 24)))
)
)
(((history-channel local-normal) (history-channel surface-normal))
(let ((t1-7
(logand (the-as uint (-> *pat-mode-info* (-> sv-24 mode) hilite-color)) (the-as uint #xffffffff00ffffff))
(case (-> s5-0 channel)
(((history-channel trans))
(if sv-16
(add-debug-line
#t
(bucket-id debug-no-zbuf1)
sv-16
(-> s5-0 vector)
(the-as rgba (logior #xffff00 (shl v1-8 24)))
#f
(the-as rgba -1)
)
(add-debug-x #t (bucket-id debug-no-zbuf1) (-> s5-0 vector) (the-as rgba (logior #xffff00 (shl v1-8 24))))
)
(set! sv-16 (-> s5-0 vector))
)
(((history-channel intersect))
(if sv-20
(add-debug-line
#t
(bucket-id debug-no-zbuf1)
sv-20
(-> s5-0 vector)
(the-as rgba (logior #xffffff (shl v1-8 24)))
#f
(the-as rgba -1)
)
(add-debug-x #t (bucket-id debug-no-zbuf1) (-> s5-0 vector) (the-as rgba (logior #xffffff (shl v1-8 24))))
)
(set! sv-20 (-> s5-0 vector))
)
(((history-channel transv))
(add-debug-vector
#t
(bucket-id debug-no-zbuf1)
(-> s5-0 origin)
(-> s5-0 vector)
(meters 1)
(the-as rgba (logior t1-7 (shl v1-8 24)))
(meters 0.000024414063)
(the-as rgba (logior (shl v1-8 24) #xff00))
)
)
)
(((history-channel pat))
(set! sv-24 (the-as pat-surface (-> s5-0 vector x)))
)
(((history-channel friction))
(let ((f0-3 (-> s5-0 vector x))
(a3-10 (new 'stack-no-clear 'vector))
)
(set-vector! a3-10 0.0 (* -8192.0 f0-3) 0.0 1.0)
(((history-channel transv-in))
(add-debug-vector
#t
(bucket-id debug-no-zbuf1)
(-> s5-0 origin)
a3-10
(meters 0.00024414062)
(the-as rgba (logior #xffffff (shl v1-8 24)))
(-> s5-0 vector)
(meters 0.000024414063)
(the-as rgba (logior #x408040 (shl v1-8 24)))
)
)
)
(((history-channel transv-out))
(add-debug-vector
#t
(bucket-id debug-no-zbuf1)
(-> s5-0 origin)
(-> s5-0 vector)
(meters 0.000024414063)
(the-as rgba (logior #x404080 (shl v1-8 24)))
)
)
(((history-channel local-normal) (history-channel surface-normal))
(let ((t1-7
(logand (the-as uint (-> *pat-mode-info* (-> sv-24 mode) hilite-color)) (the-as uint #xffffffff00ffffff))
)
)
(add-debug-vector
#t
(bucket-id debug-no-zbuf1)
(-> s5-0 origin)
(-> s5-0 vector)
(meters 1)
(the-as rgba (logior t1-7 (shl v1-8 24)))
)
)
)
(((history-channel pat))
(set! sv-24 (the-as pat-surface (-> s5-0 vector x)))
)
(((history-channel friction))
(let ((f0-3 (-> s5-0 vector x))
(a3-10 (new 'stack-no-clear 'vector))
)
(set-vector! a3-10 0.0 (* -8192.0 f0-3) 0.0 1.0)
(add-debug-vector
#t
(bucket-id debug-no-zbuf1)
(-> s5-0 origin)
a3-10
(meters 0.00024414062)
(the-as rgba (logior #xffffff (shl v1-8 24)))
)
)
)
)
)
)
)
+200 -209
View File
@@ -314,7 +314,6 @@
;; definition for method 11 of type memory-usage-block
;; INFO: Used lq/sq
(defmethod print-mem-usage ((this memory-usage-block) (level level) (fmt-dest object))
(local-vars (sv-16 object) (sv-32 string) (sv-48 int))
(let ((s3-0 (&- (-> level heap current) (the-as uint (-> level heap base)))))
(let ((v1-2 (+ (-> this data 61 total) (-> this data 62 total))))
(< #x10000 v1-2)
@@ -351,218 +350,210 @@
(if (< (the-as int s2-0) s3-0)
(format fmt-dest "~3L")
)
(let ((s0-0 format))
(set! sv-16 fmt-dest)
(set! sv-32 "~0K~10,'-S--~5,'-DK-of-~5,'-DK--~5,'-DK-of-~5,'-DK--")
(let ((s4-1 (-> level name))
(s3-1 (sar s3-0 10))
(s2-1 (shr s2-0 10))
)
(set! sv-48 (sar (memory-used *nk-dead-pool*) 10))
(let ((t2-0 (sar (memory-total *nk-dead-pool*) 10))
(t9-4 s0-0)
(a0-22 sv-16)
(a1-8 sv-32)
(a2-1 s4-1)
(a3-0 s3-1)
(t0-0 s2-1)
(t1-0 sv-48)
)
(t9-4 a0-22 a1-8 a2-1 a3-0 t0-0 t1-0 t2-0)
(format fmt-dest "~5,'-DK/~5,'-DK--~%" (shr s1-0 10) (sar *max-dma* 10))
(when *stats-memory-short*
(let ((s3-2 (if (cpad-hold? 1 l3)
#t
fmt-dest
)
(let* ((s0-0 format)
(sv-16 fmt-dest)
(sv-32 "~0K~10,'-S--~5,'-DK-of-~5,'-DK--~5,'-DK-of-~5,'-DK--")
(s4-1 (-> level name))
(s3-1 (sar s3-0 10))
(s2-1 (shr s2-0 10))
(sv-48 (sar (memory-used *nk-dead-pool*) 10))
(t2-0 (sar (memory-total *nk-dead-pool*) 10))
(t0-0 s2-1)
(t1-0 sv-48)
)
(s0-0 sv-16 sv-32 s4-1 s3-1 t0-0 t1-0 t2-0)
(format fmt-dest "~5,'-DK/~5,'-DK--~%" (shr s1-0 10) (sar *max-dma* 10))
(when *stats-memory-short*
(let ((s3-2 (if (cpad-hold? 1 l3)
#t
fmt-dest
)
(s4-2 format)
(s2-2 "heap-~5,'-DK/~5,'-DK----~D---~D/~D~%")
(s1-1 (sar (memory-used *nk-dead-pool*) 10))
(s0-1 (sar (memory-total *nk-dead-pool*) 10))
)
(set! t0-0 (compact-time *nk-dead-pool*))
(set! t1-0 (the-as int (-> *nk-dead-pool* compact-count)))
(set! t2-0 (the-as int (-> *nk-dead-pool* compact-count-targ)))
(s4-2 s3-2 s2-2 s1-1 s0-1 t0-0 (the-as uint t1-0) (the-as uint t2-0))
)
)
(when (not *stats-memory-short*)
(set! (-> *dma-mem-usage* data 87 total)
(* (dma-buffer-length (-> *display* frames (-> *display* last-screen) debug-buf)) 16)
)
(let ((t9-11 format)
(a0-31 fmt-dest)
(a1-11 " bsp ~192H~5DK ~280Hdebug~456H~5DK~%")
(a2-6 (sar (+ (-> this data 58 total) (-> this data 59 total) (-> this data 60 total)) 10))
(a3-3 (sar (-> *dma-mem-usage* data 87 total) 10))
)
(t9-11 a0-31 a1-11 a2-6 a3-3 (the-as none t0-0) (the-as none t1-0) (the-as none t2-0))
(format
fmt-dest
" bsp-leaf-vis ~192H~5DK~%"
(sar (+ (-> this data 61 total) (-> this data 62 total)) 10)
(the-as none a3-3)
)
(format fmt-dest " level-code ~192H~5DK~%" (sar (-> this data 65 total) 10) (the-as none a3-3))
)
(format
fmt-dest
" tfrag ~192H~5DK ~280Htfragment~456H~5DK~%"
(sar
(+ (-> this data 1 total)
(-> this data 2 total)
(-> this data 3 total)
(-> this data 4 total)
(-> this data 5 total)
(-> this data 6 total)
(-> this data 7 total)
(-> this data 8 total)
)
10
)
(sar (-> *dma-mem-usage* data 1 total) 10)
)
(format
fmt-dest
" tie-proto ~192H~5DK ~280Hsky~456H~5DK~%"
(sar
(+ (-> this data 9 total)
(-> this data 10 total)
(-> this data 11 total)
(-> this data 12 total)
(-> this data 13 total)
(-> this data 14 total)
(-> this data 16 total)
(-> this data 17 total)
)
10
)
(sar (-> *dma-mem-usage* data 88 total) 10)
)
(format
fmt-dest
" tie-instance ~192H~5DK ~280Htie-fragment~456H~5DK~%"
(sar (+ (-> this data 18 total) (-> this data 20 total) (-> this data 21 total) (-> this data 22 total)) 10)
(sar (-> *dma-mem-usage* data 9 total) 10)
)
(format
fmt-dest
" shrub-proto ~192H~5DK ~280Htie-scissor~456H~5DK~%"
(sar
(+ (-> this data 25 total)
(-> this data 26 total)
(-> this data 27 total)
(-> this data 28 total)
(-> this data 29 total)
(-> this data 30 total)
(-> this data 31 total)
(-> this data 32 total)
(-> this data 33 total)
)
10
)
(sar (-> *dma-mem-usage* data 15 total) 10)
)
(format
fmt-dest
" shrub-instance ~192H~5DK ~280Hshrubbery~456H~5DK~%"
(sar (-> this data 34 total) 10)
(sar (-> *dma-mem-usage* data 27 total) 10)
)
(format
fmt-dest
" collision ~192H~5DK ~280Htie-generic~456H~5DK~%"
(sar
(+ (-> this data 50 total)
(-> this data 51 total)
(-> this data 52 total)
(-> this data 53 total)
(-> this data 54 total)
(-> this data 55 total)
(-> this data 56 total)
(-> this data 57 total)
)
10
)
(sar (-> *dma-mem-usage* data 17 total) 10)
)
(format
fmt-dest
" pris-geo ~192H~5DK ~280Hpris-fragment~456H~5DK~%"
(sar
(+ (-> this data 35 total)
(-> this data 36 total)
(-> this data 37 total)
(-> this data 38 total)
(-> this data 39 total)
(-> this data 40 total)
(-> this data 41 total)
(-> this data 42 total)
(-> this data 73 total)
(-> this data 74 total)
(-> this data 75 total)
(-> this data 76 total)
(-> this data 78 total)
(-> this data 81 total)
(-> this data 80 total)
(-> this data 111 total)
)
10
)
(sar (-> *dma-mem-usage* data 35 total) 10)
)
(format
fmt-dest
" pris-anim ~192H~5DK ~280Hpris-generic~456H~5DK~%"
(sar
(+ (-> this data 67 total)
(-> this data 68 total)
(-> this data 69 total)
(-> this data 70 total)
(-> this data 71 total)
(-> this data 77 total)
(-> this data 79 total)
(-> this data 72 total)
)
10
)
(sar (-> *dma-mem-usage* data 89 total) 10)
)
(format
fmt-dest
" textures ~192H~5DK ~280Htextures~456H~5DK~%"
(sar (-> this data 82 total) 10)
(sar (-> *dma-mem-usage* data 82 total) 10)
)
(format fmt-dest " entity ~192H~5DK~%" (sar
(+ (-> this data 66 total)
(-> this data 43 total)
(-> this data 44 total)
(-> this data 45 total)
(-> this data 49 total)
(-> this data 48 total)
(-> this data 46 total)
(-> this data 47 total)
)
10
)
)
(format
fmt-dest
" misc ~192H~5DK ~280Hsprite~456H~5DK~%"
(sar
(+ (-> this data 0 total)
(-> this data 63 total)
(-> this data 64 total)
(-> this data 83 total)
(-> this data 84 total)
)
10
)
(sar (-> *dma-mem-usage* data 85 total) 10)
(s4-2 format)
(s2-2 "heap-~5,'-DK/~5,'-DK----~D---~D/~D~%")
(s1-1 (sar (memory-used *nk-dead-pool*) 10))
(s0-1 (sar (memory-total *nk-dead-pool*) 10))
)
(set! t0-0 (compact-time *nk-dead-pool*))
(set! t1-0 (the-as int (-> *nk-dead-pool* compact-count)))
(set! t2-0 (the-as int (-> *nk-dead-pool* compact-count-targ)))
(s4-2 s3-2 s2-2 s1-1 s0-1 t0-0 (the-as uint t1-0) (the-as uint t2-0))
)
)
(when (not *stats-memory-short*)
(set! (-> *dma-mem-usage* data 87 total)
(* (dma-buffer-length (-> *display* frames (-> *display* last-screen) debug-buf)) 16)
)
(let ((t9-11 format)
(a0-31 fmt-dest)
(a1-11 " bsp ~192H~5DK ~280Hdebug~456H~5DK~%")
(a2-6 (sar (+ (-> this data 58 total) (-> this data 59 total) (-> this data 60 total)) 10))
(a3-3 (sar (-> *dma-mem-usage* data 87 total) 10))
)
(t9-11 a0-31 a1-11 a2-6 a3-3 (the-as none t0-0) (the-as none t1-0) (the-as none t2-0))
(format
fmt-dest
" bsp-leaf-vis ~192H~5DK~%"
(sar (+ (-> this data 61 total) (-> this data 62 total)) 10)
(the-as none a3-3)
)
(format fmt-dest " level-code ~192H~5DK~%" (sar (-> this data 65 total) 10) (the-as none a3-3))
)
(format
fmt-dest
" tfrag ~192H~5DK ~280Htfragment~456H~5DK~%"
(sar
(+ (-> this data 1 total)
(-> this data 2 total)
(-> this data 3 total)
(-> this data 4 total)
(-> this data 5 total)
(-> this data 6 total)
(-> this data 7 total)
(-> this data 8 total)
)
10
)
(sar (-> *dma-mem-usage* data 1 total) 10)
)
(format
fmt-dest
" tie-proto ~192H~5DK ~280Hsky~456H~5DK~%"
(sar
(+ (-> this data 9 total)
(-> this data 10 total)
(-> this data 11 total)
(-> this data 12 total)
(-> this data 13 total)
(-> this data 14 total)
(-> this data 16 total)
(-> this data 17 total)
)
10
)
(sar (-> *dma-mem-usage* data 88 total) 10)
)
(format
fmt-dest
" tie-instance ~192H~5DK ~280Htie-fragment~456H~5DK~%"
(sar (+ (-> this data 18 total) (-> this data 20 total) (-> this data 21 total) (-> this data 22 total)) 10)
(sar (-> *dma-mem-usage* data 9 total) 10)
)
(format
fmt-dest
" shrub-proto ~192H~5DK ~280Htie-scissor~456H~5DK~%"
(sar
(+ (-> this data 25 total)
(-> this data 26 total)
(-> this data 27 total)
(-> this data 28 total)
(-> this data 29 total)
(-> this data 30 total)
(-> this data 31 total)
(-> this data 32 total)
(-> this data 33 total)
)
10
)
(sar (-> *dma-mem-usage* data 15 total) 10)
)
(format
fmt-dest
" shrub-instance ~192H~5DK ~280Hshrubbery~456H~5DK~%"
(sar (-> this data 34 total) 10)
(sar (-> *dma-mem-usage* data 27 total) 10)
)
(format
fmt-dest
" collision ~192H~5DK ~280Htie-generic~456H~5DK~%"
(sar
(+ (-> this data 50 total)
(-> this data 51 total)
(-> this data 52 total)
(-> this data 53 total)
(-> this data 54 total)
(-> this data 55 total)
(-> this data 56 total)
(-> this data 57 total)
)
10
)
(sar (-> *dma-mem-usage* data 17 total) 10)
)
(format
fmt-dest
" pris-geo ~192H~5DK ~280Hpris-fragment~456H~5DK~%"
(sar
(+ (-> this data 35 total)
(-> this data 36 total)
(-> this data 37 total)
(-> this data 38 total)
(-> this data 39 total)
(-> this data 40 total)
(-> this data 41 total)
(-> this data 42 total)
(-> this data 73 total)
(-> this data 74 total)
(-> this data 75 total)
(-> this data 76 total)
(-> this data 78 total)
(-> this data 81 total)
(-> this data 80 total)
(-> this data 111 total)
)
10
)
(sar (-> *dma-mem-usage* data 35 total) 10)
)
(format
fmt-dest
" pris-anim ~192H~5DK ~280Hpris-generic~456H~5DK~%"
(sar
(+ (-> this data 67 total)
(-> this data 68 total)
(-> this data 69 total)
(-> this data 70 total)
(-> this data 71 total)
(-> this data 77 total)
(-> this data 79 total)
(-> this data 72 total)
)
10
)
(sar (-> *dma-mem-usage* data 89 total) 10)
)
(format
fmt-dest
" textures ~192H~5DK ~280Htextures~456H~5DK~%"
(sar (-> this data 82 total) 10)
(sar (-> *dma-mem-usage* data 82 total) 10)
)
(format fmt-dest " entity ~192H~5DK~%" (sar
(+ (-> this data 66 total)
(-> this data 43 total)
(-> this data 44 total)
(-> this data 45 total)
(-> this data 49 total)
(-> this data 48 total)
(-> this data 46 total)
(-> this data 47 total)
)
10
)
)
(format
fmt-dest
" misc ~192H~5DK ~280Hsprite~456H~5DK~%"
(sar
(+ (-> this data 0 total)
(-> this data 63 total)
(-> this data 64 total)
(-> this data 83 total)
(-> this data 84 total)
)
10
)
(sar (-> *dma-mem-usage* data 85 total) 10)
)
)
)
+49 -94
View File
@@ -682,18 +682,7 @@
;; ERROR: Stack slot load at 96 mismatch: defined as size 4, got size 16
;; ERROR: Stack slot load at 128 mismatch: defined as size 4, got size 16
(defun debug-menu-make-from-template ((arg0 debug-menu-context) (arg1 pair))
(local-vars
(s4-0 debug-menu-node)
(sv-16 object)
(sv-32 (function object int int))
(sv-48 int)
(sv-64 (function object int int))
(sv-80 (function object float float))
(sv-96 float)
(sv-112 (function object float float))
(sv-128 float)
(sv-144 (function object int int))
)
(local-vars (s4-0 debug-menu-node))
(when (or (not arg1) (null? arg1))
(set! s4-0 (the-as debug-menu-node #f))
(goto cfg-39)
@@ -768,79 +757,44 @@
)
)
((or (= s5-0 'int-var) (= s5-0 'int-var-gat1) (= s5-0 'hex-var))
(set! s4-0 (new
'debug
'debug-menu-item-var
(the-as string s4-1)
(the-as int (car (cdr (cdr arg1))))
(the-as int (ref arg1 4))
)
)
(let ((s3-4 debug-menu-item-var-make-int)
(s2-3 (the-as debug-menu-item-var s4-0))
(s1-3 (debug-menu-func-decode (car (cdr (cdr (cdr arg1))))))
(s0-2 (command-get-int (ref arg1 5) 0))
)
(set! sv-16 (ref arg1 6))
(set! sv-32 command-get-int)
(let ((a0-24 (ref arg1 7))
(a1-18 0)
(set! s4-0
(new
'debug
'debug-menu-item-var
(the-as string s4-1)
(the-as int (car (cdr (cdr arg1))))
(the-as int (ref arg1 4))
)
(set! sv-48 (sv-32 a0-24 a1-18))
)
(set! sv-64 command-get-int)
(let* ((a0-26 (ref arg1 8))
(a1-20 0)
(t1-0 (sv-64 a0-26 a1-20))
(t2-0 (= s5-0 'hex-var))
)
(s3-4 s2-3 (the-as (function int debug-menu-msg int int int) s1-3) s0-2 (the-as symbol sv-16) sv-48 t1-0 t2-0)
)
)
(debug-menu-item-var-make-int
(the-as debug-menu-item-var s4-0)
(the-as (function int debug-menu-msg int int int) (debug-menu-func-decode (car (cdr (cdr (cdr arg1))))))
(command-get-int (ref arg1 5) 0)
(the-as symbol (ref arg1 6))
(command-get-int (ref arg1 7) 0)
(command-get-int (ref arg1 8) 0)
(= s5-0 'hex-var)
)
s4-0
)
((= s5-0 'float-var)
(set! s4-0 (new
'debug
'debug-menu-item-var
(the-as string s4-1)
(the-as int (car (cdr (cdr arg1))))
(the-as int (ref arg1 4))
)
)
(let ((s5-5 debug-menu-item-var-make-float)
(s3-6 (the-as debug-menu-item-var s4-0))
(s2-5 (debug-menu-func-decode (car (cdr (cdr (cdr arg1))))))
(s1-6 (command-get-float (ref arg1 5) 0.0))
(s0-3 (ref arg1 6))
)
(set! sv-80 command-get-float)
(let ((a0-35 (ref arg1 7))
(a1-28 0.0)
(set! s4-0
(new
'debug
'debug-menu-item-var
(the-as string s4-1)
(the-as int (car (cdr (cdr arg1))))
(the-as int (ref arg1 4))
)
(set! sv-96 (sv-80 a0-35 a1-28))
)
(set! sv-112 command-get-float)
(let ((a0-37 (ref arg1 8))
(a1-30 0.0)
)
(set! sv-128 (sv-112 a0-37 a1-30))
)
(set! sv-144 command-get-int)
(let* ((a0-39 (ref arg1 9))
(a1-32 0)
(t2-1 (sv-144 a0-39 a1-32))
)
(s5-5
s3-6
(the-as (function int debug-menu-msg float float float) s2-5)
s1-6
(the-as symbol s0-3)
sv-96
sv-128
t2-1
)
)
(debug-menu-item-var-make-float
(the-as debug-menu-item-var s4-0)
(the-as (function int debug-menu-msg float float float) (debug-menu-func-decode (car (cdr (cdr (cdr arg1))))))
(command-get-float (ref arg1 5) 0.0)
(the-as symbol (ref arg1 6))
(command-get-float (ref arg1 7) 0.0)
(command-get-float (ref arg1 8) 0.0)
(command-get-int (ref arg1 9) 0)
)
s4-0
)
@@ -1071,7 +1025,6 @@
;; definition for function debug-menu-render
;; INFO: Used lq/sq
(defun debug-menu-render ((arg0 debug-menu) (arg1 int) (arg2 int) (arg3 debug-menu-node) (arg4 int))
(local-vars (sv-16 dma-buffer) (sv-32 pointer))
(let ((v1-0 0))
(let* ((a0-1 (-> arg0 items))
(a1-1 (car a0-1))
@@ -1108,21 +1061,23 @@
)
)
(set-origin! (-> arg0 context font) s3-1 s2-1)
(set! sv-16 (-> *display* frames (-> *display* on-screen) debug-buf))
(set! sv-32 (-> sv-16 base))
(draw-string ">" sv-16 (-> arg0 context font))
(let ((a3-3 (-> sv-16 base)))
(let ((v1-32 (the-as object (-> sv-16 base))))
(set! (-> (the-as dma-packet v1-32) dma) (new 'static 'dma-tag :id (dma-tag-id next)))
(set! (-> (the-as dma-packet v1-32) vif0) (new 'static 'vif-tag))
(set! (-> (the-as dma-packet v1-32) vif1) (new 'static 'vif-tag))
(set! (-> sv-16 base) (&+ (the-as pointer v1-32) 16))
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id debug3)
sv-32
(the-as (pointer dma-tag) a3-3)
(let* ((sv-16 (-> *display* frames (-> *display* on-screen) debug-buf))
(sv-32 (-> sv-16 base))
)
(draw-string ">" sv-16 (-> arg0 context font))
(let ((a3-3 (-> sv-16 base)))
(let ((v1-32 (the-as object (-> sv-16 base))))
(set! (-> (the-as dma-packet v1-32) dma) (new 'static 'dma-tag :id (dma-tag-id next)))
(set! (-> (the-as dma-packet v1-32) vif0) (new 'static 'vif-tag))
(set! (-> (the-as dma-packet v1-32) vif1) (new 'static 'vif-tag))
(set! (-> sv-16 base) (&+ (the-as pointer v1-32) 16))
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id debug3)
sv-32
(the-as (pointer dma-tag) a3-3)
)
)
)
)
+176 -176
View File
@@ -809,7 +809,6 @@
;; WARN: new jak 2 until loop case, check carefully
(defmethod init-from-sql! ((this mysql-nav-graph) (arg0 string) (arg1 string))
"Query the database and initialize the [[mysql-nav-graph]] and all it's related components"
(local-vars (sv-16 string) (sv-32 int) (sv-48 int) (sv-64 int))
(set! (-> this node-array length) 0)
(set! (-> this edge-array length) 0)
(set! (-> this visnode-array length) 0)
@@ -857,35 +856,36 @@
(set! (-> nav-node angle) (* 182.04445 (string->float (-> s2-1 data (+ s1-0 5)))))
(set! (-> nav-node radius) (* 4096.0 (string->float (-> s2-1 data (+ s1-0 6)))))
(set! (-> nav-node nav_node_flag) (nav-node-flag))
(set! sv-16 (new 'global 'string 0 (-> s2-1 data (+ s1-0 7))))
(copy-string<-string sv-16 (-> s2-1 data (+ s1-0 7)))
(until #f
(cond
((string-prefix= "visited" sv-16)
(logior! (-> nav-node nav_node_flag) (nav-node-flag visited))
)
((string-prefix= "blocked" sv-16)
(logior! (-> nav-node nav_node_flag) (nav-node-flag blocked))
)
((string-prefix= "pedestrian" sv-16)
(logior! (-> nav-node nav_node_flag) (nav-node-flag pedestrian))
)
((string-prefix= "selected" sv-16)
(logior! (-> nav-node nav_node_flag) (nav-node-flag selected))
)
((string-prefix= "hidden" sv-16)
(logior! (-> nav-node nav_node_flag) (nav-node-flag hidden))
)
(else
#t
(goto cfg-27)
)
)
(let ((a1-16 (string-skip-to-char (-> sv-16 data) (the-as uint 44))))
(if (= (-> a1-16 0) 44)
(set! a1-16 (&-> a1-16 1))
(let ((sv-16 (new 'global 'string 0 (-> s2-1 data (+ s1-0 7)))))
(copy-string<-string sv-16 (-> s2-1 data (+ s1-0 7)))
(until #f
(cond
((string-prefix= "visited" sv-16)
(logior! (-> nav-node nav_node_flag) (nav-node-flag visited))
)
((string-prefix= "blocked" sv-16)
(logior! (-> nav-node nav_node_flag) (nav-node-flag blocked))
)
((string-prefix= "pedestrian" sv-16)
(logior! (-> nav-node nav_node_flag) (nav-node-flag pedestrian))
)
((string-prefix= "selected" sv-16)
(logior! (-> nav-node nav_node_flag) (nav-node-flag selected))
)
((string-prefix= "hidden" sv-16)
(logior! (-> nav-node nav_node_flag) (nav-node-flag hidden))
)
(else
#t
(goto cfg-27)
)
(string-suck-up! sv-16 a1-16)
)
(let ((a1-16 (string-skip-to-char (-> sv-16 data) (the-as uint 44))))
(if (= (-> a1-16 0) 44)
(set! a1-16 (&-> a1-16 1))
)
(string-suck-up! sv-16 a1-16)
)
)
)
#f
@@ -929,155 +929,155 @@
(let ((s2-2 0))
(while (< s2-2 (-> s3-3 len))
(when (= (string->int (-> s3-3 data (+ s2-2 11))) (-> this nav_graph_id))
(let ((s0-2 (string->int (-> s3-3 data (+ s2-2 1)))))
(set! sv-32 (string->int (-> s3-3 data (+ s2-2 2))))
(set! sv-48 (indexof-nav-node this s0-2))
(set! sv-64 (indexof-nav-node this sv-32))
(let ((nav-edge (-> this edge-array data (-> this edge-array length))))
(when (and (!= sv-48 -1) (!= sv-64 -1))
(set! (-> nav-edge nav_graph_id) (-> this nav_graph_id))
(set! (-> nav-edge nav_edge_id) (the-as uint (string->int (-> s3-3 data s2-2))))
(set! (-> nav-edge nav_node_id_1) (the-as uint s0-2))
(set! (-> nav-edge nav_node_id_2) (the-as uint sv-32))
(set! (-> nav-edge mysql-save-flag) (mysql-save-flag))
(set! (-> nav-edge runtime-id) (the-as uint (-> this edge-array length)))
(set! (-> nav-edge runtime-node-id-1) sv-48)
(set! (-> nav-edge runtime-node-id-2) sv-64)
(let ((s0-3 (-> s3-3 data (+ s2-2 3))))
(cond
((string= "default" s0-3)
(set! (-> nav-edge directionality) (nav-directionality default))
0
)
((string= "directed" s0-3)
(set! (-> nav-edge directionality) (nav-directionality directed))
)
((string= "bi_directional" s0-3)
(set! (-> nav-edge directionality) (nav-directionality bi_directional))
)
)
(let* ((s0-2 (string->int (-> s3-3 data (+ s2-2 1))))
(sv-32 (string->int (-> s3-3 data (+ s2-2 2))))
(sv-48 (indexof-nav-node this s0-2))
(sv-64 (indexof-nav-node this sv-32))
(nav-edge (-> this edge-array data (-> this edge-array length)))
)
(when (and (!= sv-48 -1) (!= sv-64 -1))
(set! (-> nav-edge nav_graph_id) (-> this nav_graph_id))
(set! (-> nav-edge nav_edge_id) (the-as uint (string->int (-> s3-3 data s2-2))))
(set! (-> nav-edge nav_node_id_1) (the-as uint s0-2))
(set! (-> nav-edge nav_node_id_2) (the-as uint sv-32))
(set! (-> nav-edge mysql-save-flag) (mysql-save-flag))
(set! (-> nav-edge runtime-id) (the-as uint (-> this edge-array length)))
(set! (-> nav-edge runtime-node-id-1) sv-48)
(set! (-> nav-edge runtime-node-id-2) sv-64)
(let ((s0-3 (-> s3-3 data (+ s2-2 3))))
(cond
((string= "default" s0-3)
(set! (-> nav-edge directionality) (nav-directionality default))
0
)
((string= "directed" s0-3)
(set! (-> nav-edge directionality) (nav-directionality directed))
)
((string= "bi_directional" s0-3)
(set! (-> nav-edge directionality) (nav-directionality bi_directional))
)
)
(set! (-> nav-edge speed_limit) (* 4096.0 (string->float (-> s3-3 data (+ s2-2 4)))))
(set! (-> nav-edge density) (string->float (-> s3-3 data (+ s2-2 5))))
(set! (-> nav-edge traffic_edge_flag) 0)
(let ((s0-4 (new 'global 'string 0 (-> s3-3 data (+ s2-2 6)))))
(copy-string<-string s0-4 (-> s3-3 data (+ s2-2 6)))
(until #f
(cond
((string-prefix= "pedestrian" s0-4)
(logior! (-> nav-edge traffic_edge_flag) 1)
)
(else
#t
(goto cfg-58)
)
)
(let ((a1-30 (string-skip-to-char (-> s0-4 data) (the-as uint 44))))
(if (= (-> a1-30 0) 44)
(set! a1-30 (&-> a1-30 1))
)
(string-suck-up! s0-4 a1-30)
)
)
)
#f
(label cfg-58)
(set! (-> nav-edge nav_clock_mask) (nav-clock-mask))
(let ((s0-5 (new 'global 'string 0 (-> s3-3 data (+ s2-2 7)))))
(copy-string<-string s0-5 (-> s3-3 data (+ s2-2 7)))
(until #f
(cond
((string-prefix= "phase-1a" s0-5)
(logior! (-> nav-edge nav_clock_mask) (nav-clock-mask phase-1a))
)
((string-prefix= "phase-1" s0-5)
(logior! (-> nav-edge nav_clock_mask) (nav-clock-mask phase-1))
)
((string-prefix= "phase-2a" s0-5)
(logior! (-> nav-edge nav_clock_mask) (nav-clock-mask phase-2a))
)
((string-prefix= "phase-2" s0-5)
(logior! (-> nav-edge nav_clock_mask) (nav-clock-mask phase-2))
)
((string-prefix= "phase-3a" s0-5)
(logior! (-> nav-edge nav_clock_mask) (nav-clock-mask phase-3a))
)
((string-prefix= "phase-3" s0-5)
(logior! (-> nav-edge nav_clock_mask) (nav-clock-mask phase-3))
)
((string-prefix= "phase-4a" s0-5)
(logior! (-> nav-edge nav_clock_mask) (nav-clock-mask phase-4a))
)
((string-prefix= "phase-4" s0-5)
(logior! (-> nav-edge nav_clock_mask) (nav-clock-mask phase-4))
)
(else
#t
(goto cfg-80)
)
)
(let ((a1-42 (string-skip-to-char (-> s0-5 data) (the-as uint 44))))
(if (= (-> a1-42 0) 44)
(set! a1-42 (&-> a1-42 1))
)
(string-suck-up! s0-5 a1-42)
)
)
)
#f
(label cfg-80)
(let ((s0-6 (-> s3-3 data (+ s2-2 8))))
(cond
((string= "no-clock" s0-6)
(set! (-> nav-edge nav_clock_type) (nav-clock-type no-clock))
0
)
((string= "clock2" s0-6)
(set! (-> nav-edge nav_clock_type) (nav-clock-type clock2))
)
((string= "clock3" s0-6)
(set! (-> nav-edge nav_clock_type) (nav-clock-type clock3))
)
((string= "clock4" s0-6)
(set! (-> nav-edge nav_clock_type) (nav-clock-type clock4))
)
)
)
(set! (-> nav-edge width) (* 4096.0 (string->float (-> s3-3 data (+ s2-2 9)))))
(set! (-> nav-edge minimap_edge_flag) (nav-minimap-edge-flag))
(let ((s0-7 (new 'global 'string 0 (-> s3-3 data (+ s2-2 10)))))
(copy-string<-string s0-7 (-> s3-3 data (+ s2-2 10)))
(until #f
(cond
((string-prefix= "pass-red" s0-7)
(logior! (-> nav-edge minimap_edge_flag) (nav-minimap-edge-flag pass-red))
)
((string-prefix= "pass-green" s0-7)
(logior! (-> nav-edge minimap_edge_flag) (nav-minimap-edge-flag pass-green))
)
((string-prefix= "pass-yellow" s0-7)
(logior! (-> nav-edge minimap_edge_flag) (nav-minimap-edge-flag pass-yellow))
)
((string-prefix= "pass-blue" s0-7)
(logior! (-> nav-edge minimap_edge_flag) (nav-minimap-edge-flag pass-blue))
)
(else
#t
(goto cfg-102)
)
)
(let ((a1-54 (string-skip-to-char (-> s0-7 data) (the-as uint 44))))
(if (= (-> a1-54 0) 44)
(set! a1-54 (&-> a1-54 1))
)
(string-suck-up! s0-7 a1-54)
)
)
)
#f
(label cfg-102)
(+! (-> this edge-array length) 1)
)
(set! (-> nav-edge speed_limit) (* 4096.0 (string->float (-> s3-3 data (+ s2-2 4)))))
(set! (-> nav-edge density) (string->float (-> s3-3 data (+ s2-2 5))))
(set! (-> nav-edge traffic_edge_flag) 0)
(let ((s0-4 (new 'global 'string 0 (-> s3-3 data (+ s2-2 6)))))
(copy-string<-string s0-4 (-> s3-3 data (+ s2-2 6)))
(until #f
(cond
((string-prefix= "pedestrian" s0-4)
(logior! (-> nav-edge traffic_edge_flag) 1)
)
(else
#t
(goto cfg-58)
)
)
(let ((a1-30 (string-skip-to-char (-> s0-4 data) (the-as uint 44))))
(if (= (-> a1-30 0) 44)
(set! a1-30 (&-> a1-30 1))
)
(string-suck-up! s0-4 a1-30)
)
)
)
#f
(label cfg-58)
(set! (-> nav-edge nav_clock_mask) (nav-clock-mask))
(let ((s0-5 (new 'global 'string 0 (-> s3-3 data (+ s2-2 7)))))
(copy-string<-string s0-5 (-> s3-3 data (+ s2-2 7)))
(until #f
(cond
((string-prefix= "phase-1a" s0-5)
(logior! (-> nav-edge nav_clock_mask) (nav-clock-mask phase-1a))
)
((string-prefix= "phase-1" s0-5)
(logior! (-> nav-edge nav_clock_mask) (nav-clock-mask phase-1))
)
((string-prefix= "phase-2a" s0-5)
(logior! (-> nav-edge nav_clock_mask) (nav-clock-mask phase-2a))
)
((string-prefix= "phase-2" s0-5)
(logior! (-> nav-edge nav_clock_mask) (nav-clock-mask phase-2))
)
((string-prefix= "phase-3a" s0-5)
(logior! (-> nav-edge nav_clock_mask) (nav-clock-mask phase-3a))
)
((string-prefix= "phase-3" s0-5)
(logior! (-> nav-edge nav_clock_mask) (nav-clock-mask phase-3))
)
((string-prefix= "phase-4a" s0-5)
(logior! (-> nav-edge nav_clock_mask) (nav-clock-mask phase-4a))
)
((string-prefix= "phase-4" s0-5)
(logior! (-> nav-edge nav_clock_mask) (nav-clock-mask phase-4))
)
(else
#t
(goto cfg-80)
)
)
(let ((a1-42 (string-skip-to-char (-> s0-5 data) (the-as uint 44))))
(if (= (-> a1-42 0) 44)
(set! a1-42 (&-> a1-42 1))
)
(string-suck-up! s0-5 a1-42)
)
)
)
#f
(label cfg-80)
(let ((s0-6 (-> s3-3 data (+ s2-2 8))))
(cond
((string= "no-clock" s0-6)
(set! (-> nav-edge nav_clock_type) (nav-clock-type no-clock))
0
)
((string= "clock2" s0-6)
(set! (-> nav-edge nav_clock_type) (nav-clock-type clock2))
)
((string= "clock3" s0-6)
(set! (-> nav-edge nav_clock_type) (nav-clock-type clock3))
)
((string= "clock4" s0-6)
(set! (-> nav-edge nav_clock_type) (nav-clock-type clock4))
)
)
)
(set! (-> nav-edge width) (* 4096.0 (string->float (-> s3-3 data (+ s2-2 9)))))
(set! (-> nav-edge minimap_edge_flag) (nav-minimap-edge-flag))
(let ((s0-7 (new 'global 'string 0 (-> s3-3 data (+ s2-2 10)))))
(copy-string<-string s0-7 (-> s3-3 data (+ s2-2 10)))
(until #f
(cond
((string-prefix= "pass-red" s0-7)
(logior! (-> nav-edge minimap_edge_flag) (nav-minimap-edge-flag pass-red))
)
((string-prefix= "pass-green" s0-7)
(logior! (-> nav-edge minimap_edge_flag) (nav-minimap-edge-flag pass-green))
)
((string-prefix= "pass-yellow" s0-7)
(logior! (-> nav-edge minimap_edge_flag) (nav-minimap-edge-flag pass-yellow))
)
((string-prefix= "pass-blue" s0-7)
(logior! (-> nav-edge minimap_edge_flag) (nav-minimap-edge-flag pass-blue))
)
(else
#t
(goto cfg-102)
)
)
(let ((a1-54 (string-skip-to-char (-> s0-7 data) (the-as uint 44))))
(if (= (-> a1-54 0) 44)
(set! a1-54 (&-> a1-54 1))
)
(string-suck-up! s0-7 a1-54)
)
)
)
#f
(label cfg-102)
(+! (-> this edge-array length) 1)
)
)
)
+116 -131
View File
@@ -499,7 +499,6 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod nav-graph-editor-method-28 ((this nav-graph-editor))
(local-vars (sv-144 int) (sv-160 (function _varargs_ object)))
(rlet ((vf0 :class vf)
(vf4 :class vf)
(vf5 :class vf)
@@ -520,11 +519,7 @@
(set! (-> v1-8 w) (-> s2-0 radius))
)
(set! (-> s2-0 cam-dist) (vector-vector-distance-squared s3-0 (camera-pos)))
(let ((f0-6 (-> s2-0 cam-dist))
(f1-0 (-> this clipping-dist))
)
(set! (-> s2-0 visible) (< f0-6 (* f1-0 f1-0)))
)
(set! (-> s2-0 visible) (< (-> s2-0 cam-dist) (square (-> this clipping-dist))))
(if (or (and (-> this vehicle-edit-mode) (logtest? (-> s2-0 nav_node_flag) (nav-node-flag pedestrian)))
(and (not (-> this vehicle-edit-mode)) (not (logtest? (-> s2-0 nav_node_flag) (nav-node-flag pedestrian))))
)
@@ -559,48 +554,46 @@
(add-debug-x #t (bucket-id debug2) s3-0 *color-red*)
(let ((s1-1 add-debug-text-3d)
(s0-1 #t)
(sv-144 324)
)
(set! sv-144 324)
(set! sv-160 format)
(let ((a0-16 (clear *temp-string*))
(a1-8 "~D")
(a2-6 (-> s2-0 nav_mesh_id))
(format (clear *temp-string*) "~D" (-> s2-0 nav_mesh_id))
(let ((a2-7 *temp-string*)
(a3-2 s3-0)
(v1-24 (-> s2-0 level_name))
)
(sv-160 a0-16 a1-8 a2-6)
)
(let* ((a2-7 *temp-string*)
(a3-2 s3-0)
(v1-24 (-> s2-0 level_name))
(t0-1 (cond
((= v1-24 'ctyport)
3
)
((= v1-24 'ctyinda)
4
)
((= v1-24 'ctyindb)
5
)
((= v1-24 'ctypal)
6
)
((= v1-24 'ctysluma)
7
)
((= v1-24 'ctyslumb)
8
)
((= v1-24 'ctyslumc)
9
)
(else
1
)
)
)
(t1-0 #f)
(s1-1
s0-1
(the-as bucket-id sv-144)
a2-7
a3-2
(cond
((= v1-24 'ctyport)
(font-color red)
)
(s1-1 s0-1 (the-as bucket-id sv-144) a2-7 a3-2 (the-as font-color t0-1) (the-as vector2h t1-0))
((= v1-24 'ctyinda)
(font-color orange)
)
((= v1-24 'ctyindb)
(font-color yellow)
)
((= v1-24 'ctypal)
(font-color green)
)
((= v1-24 'ctysluma)
(font-color blue)
)
((= v1-24 'ctyslumb)
(font-color cyan)
)
((= v1-24 'ctyslumc)
(font-color pink)
)
(else
(font-color white)
)
)
(the-as vector2h #f)
)
)
)
(let ((s1-2 (new 'stack-no-clear 'vector)))
@@ -1077,7 +1070,6 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch symbol vs none.
(defmethod nav-graph-editor-method-43 ((this nav-graph-editor))
(local-vars (sv-128 vector) (sv-144 vector))
(rlet ((vf0 :class vf)
(vf4 :class vf)
(vf5 :class vf)
@@ -1111,9 +1103,9 @@
)
(let ((f30-0 0.0)
(s0-1 ray-cylinder-intersect)
(sv-128 (-> this mouse-pos))
(sv-144 (new 'stack-no-clear 'vector))
)
(set! sv-128 (-> this mouse-pos))
(set! sv-144 (new 'stack-no-clear 'vector))
(let ((v1-18 (-> this mouse-hit-pick))
(a0-13 (-> this mouse-pos))
)
@@ -1123,18 +1115,21 @@
(.mov.vf.w vf6 vf0)
(.sub.vf.xyz vf6 vf4 vf5)
(.svf (&-> sv-144 quad) vf6)
(let ((a3-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) s2-0 1.0))
(t0-0 1024.0)
(t1-0 (vector-length s2-0))
(t2-0 s3-0)
)
(when (< f30-0 (s0-1 sv-128 sv-144 s1-0 a3-3 t0-0 t1-0 t2-0))
(let ((f0-1 (vector-vector-distance s3-0 (-> this mouse-pos))))
(when (or (= (-> this selected-index) -1) (< f0-1 (-> this selected-dist)))
(set! (-> this selected-index) s4-0)
(set! (-> this selected-dist) f0-1)
(set! (-> this selected-node-edge?) #f)
)
(when (< f30-0 (s0-1
sv-128
sv-144
s1-0
(vector-normalize-copy! (new 'stack-no-clear 'vector) s2-0 1.0)
1024.0
(vector-length s2-0)
s3-0
)
)
(let ((f0-1 (vector-vector-distance s3-0 (-> this mouse-pos))))
(when (or (= (-> this selected-index) -1) (< f0-1 (-> this selected-dist)))
(set! (-> this selected-index) s4-0)
(set! (-> this selected-dist) f0-1)
(set! (-> this selected-node-edge?) #f)
)
)
)
@@ -2235,16 +2230,6 @@
;; definition for function smooth-nav-graph
;; INFO: Used lq/sq
(defun smooth-nav-graph ((arg0 string))
(local-vars
(sv-96 int)
(sv-112 int)
(sv-128 int)
(sv-144 mysql-nav-edge)
(sv-160 vector)
(sv-176 vector)
(sv-192 vector)
(sv-208 vector)
)
(rlet ((vf0 :class vf)
(vf4 :class vf)
(vf5 :class vf)
@@ -2257,52 +2242,54 @@
(s2-0 (new-stack-vector0))
(s0-0 (new-stack-vector0))
(s1-0 (new-stack-vector0))
(sv-96 0)
(sv-112 0)
)
(set! sv-96 0)
(set! sv-112 0)
(when (and (not (logtest? (-> s3-0 mysql-save-flag) (mysql-save-flag delete))) (= (-> s3-0 level_name) arg0))
(set! sv-128 0)
(while (< sv-128 (-> s5-0 edge-array length))
(set! sv-144 (-> s5-0 edge-array data sv-128))
(when (not (logtest? (-> sv-144 mysql-save-flag) (mysql-save-flag delete)))
(when (= (-> sv-144 runtime-node-id-1) s4-0)
(let ((v1-27 (-> s5-0 node-array data (-> sv-144 runtime-node-id-1)))
(a1-3 (-> s5-0 node-array data (-> sv-144 runtime-node-id-2)))
)
(set! sv-176 s1-0)
(set! sv-160 s1-0)
(let ((v0-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> a1-3 position) (-> v1-27 position)) 1.0))
(let ((sv-128 0))
(while (< sv-128 (-> s5-0 edge-array length))
(let ((sv-144 (-> s5-0 edge-array data sv-128)))
(when (not (logtest? (-> sv-144 mysql-save-flag) (mysql-save-flag delete)))
(when (= (-> sv-144 runtime-node-id-1) s4-0)
(let ((v1-27 (-> s5-0 node-array data (-> sv-144 runtime-node-id-1)))
(a1-3 (-> s5-0 node-array data (-> sv-144 runtime-node-id-2)))
(sv-176 s1-0)
)
(let ((sv-160 s1-0)
(v0-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> a1-3 position) (-> v1-27 position)) 1.0))
)
(.mov.vf.w vf6 vf0)
(.lvf vf4 (&-> sv-160 quad))
(.lvf vf5 (&-> v0-0 quad))
)
(.mov.vf.w vf6 vf0)
(.lvf vf4 (&-> sv-160 quad))
(.lvf vf5 (&-> v0-0 quad))
(.add.vf.xyz vf6 vf4 vf5)
(.svf (&-> sv-176 quad) vf6)
)
(+! sv-112 1)
sv-112
)
(when (= (-> sv-144 runtime-node-id-2) s4-0)
(let ((v1-40 (-> s5-0 node-array data (-> sv-144 runtime-node-id-1)))
(a1-9 (-> s5-0 node-array data (-> sv-144 runtime-node-id-2)))
(sv-208 s0-0)
)
(let ((sv-192 s0-0)
(v0-1 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> a1-9 position) (-> v1-40 position)) 1.0))
)
(.mov.vf.w vf6 vf0)
(.lvf vf4 (&-> sv-192 quad))
(.lvf vf5 (&-> v0-1 quad))
)
(.add.vf.xyz vf6 vf4 vf5)
(.svf (&-> sv-208 quad) vf6)
)
(+! sv-96 1)
sv-96
)
)
(.add.vf.xyz vf6 vf4 vf5)
(.svf (&-> sv-176 quad) vf6)
(set! sv-112 (+ sv-112 1))
sv-112
)
(when (= (-> sv-144 runtime-node-id-2) s4-0)
(let ((v1-40 (-> s5-0 node-array data (-> sv-144 runtime-node-id-1)))
(a1-9 (-> s5-0 node-array data (-> sv-144 runtime-node-id-2)))
)
(set! sv-208 s0-0)
(set! sv-192 s0-0)
(let ((v0-1 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> a1-9 position) (-> v1-40 position)) 1.0))
)
(.mov.vf.w vf6 vf0)
(.lvf vf4 (&-> sv-192 quad))
(.lvf vf5 (&-> v0-1 quad))
)
)
(.add.vf.xyz vf6 vf4 vf5)
(.svf (&-> sv-208 quad) vf6)
(set! sv-96 (+ sv-96 1))
sv-96
)
(+! sv-128 1)
)
(set! sv-128 (+ sv-128 1))
)
(cond
((and (>= sv-112 2) (= sv-96 1))
@@ -2350,7 +2337,6 @@
;; definition for function update-width
;; INFO: Used lq/sq
(defun update-width ((arg0 string))
(local-vars (sv-16 (array entity-nav-mesh)) (sv-32 int) (sv-48 uint) (sv-64 entity-nav-mesh))
(let ((s5-0 (-> (ppointer->process *nav-graph-editor*) nav-graph)))
(dotimes (s4-0 (-> s5-0 edge-array length))
(let ((s3-0 (-> s5-0 edge-array data s4-0)))
@@ -2368,32 +2354,31 @@
(dotimes (s0-0 (-> *level* length))
(let ((v1-25 (-> *level* level s0-0)))
(when (= (-> v1-25 status) 'active)
(set! sv-16 (-> v1-25 bsp nav-meshes))
(when (nonzero? sv-16)
(set! sv-32 0)
(while (< sv-32 (-> sv-16 length))
(set! sv-64 (-> sv-16 sv-32))
(set! sv-48 (-> sv-64 aid))
(let ((v1-36 (if (type? sv-64 entity-nav-mesh)
sv-64
)
)
)
(when (and v1-36 (= sv-48 (-> s2-0 nav_mesh_id)))
(let* ((f0-0 (nav-mesh-method-35 (-> v1-36 nav-mesh) (-> s2-0 position) (-> s1-0 position) 16384.0))
(f0-1 (+ -409.6 f0-0))
(let ((sv-16 (-> v1-25 bsp nav-meshes)))
(when (nonzero? sv-16)
(let ((sv-32 0))
(while (< sv-32 (-> sv-16 length))
(let* ((sv-64 (-> sv-16 sv-32))
(sv-48 (-> sv-64 aid))
(v1-36 (as-type sv-64 entity-nav-mesh))
)
(when (and (< 0.0 f0-1) (!= f0-1 (-> s3-0 width)))
(set! (-> s3-0 width) f0-1)
(logior! (-> s3-0 mysql-save-flag) (mysql-save-flag update))
)
(if (>= 0.0 f0-1)
(format #t "!!!! edge ~D ~D outside nav-mesh~%" (-> s2-0 nav_node_id) (-> s1-0 nav_node_id))
(when (and v1-36 (= sv-48 (-> s2-0 nav_mesh_id)))
(let* ((f0-0 (nav-mesh-method-35 (-> v1-36 nav-mesh) (-> s2-0 position) (-> s1-0 position) 16384.0))
(f0-1 (+ -409.6 f0-0))
)
(when (and (< 0.0 f0-1) (!= f0-1 (-> s3-0 width)))
(set! (-> s3-0 width) f0-1)
(logior! (-> s3-0 mysql-save-flag) (mysql-save-flag update))
)
(if (>= 0.0 f0-1)
(format #t "!!!! edge ~D ~D outside nav-mesh~%" (-> s2-0 nav_node_id) (-> s1-0 nav_node_id))
)
)
)
)
(+! sv-32 1)
)
)
(set! sv-32 (+ sv-32 1))
)
)
)
+19 -21
View File
@@ -251,31 +251,29 @@
;; definition for function add-a-bunch
;; INFO: Used lq/sq
(defun add-a-bunch ((arg0 string) (arg1 int) (arg2 int) (arg3 float) (arg4 process-tree) (arg5 entity-actor))
(local-vars (sv-32 int) (sv-48 process) (sv-64 vector))
(dotimes (s0-0 arg1)
(set! sv-32 0)
(while (< sv-32 arg2)
(set! sv-64 (new 'stack-no-clear 'vector))
(set! (-> sv-64 quad) (the-as uint128 0))
(position-in-front-of-camera! sv-64 40960.0 4096.0)
(+! (-> sv-64 x) (the float (* (- s0-0 (/ arg1 2)) (the int arg3))))
(+! (-> sv-64 z) (the float (* (- sv-32 (/ arg2 2)) (the int arg3))))
(set! sv-48 (get-process *default-dead-pool* viewer #x4000))
(when sv-48
(let ((t9-2 (method-of-type viewer activate)))
(t9-2 (the-as viewer sv-48) arg4 (symbol->string (-> viewer symbol)) (the-as pointer #x70004000))
)
(let ((t9-3 run-function-in-process)
(a0-7 sv-48)
(a1-4 init-viewer-for-other)
(a2-6 arg0)
(t0-1 arg5)
(let ((sv-32 0))
(while (< sv-32 arg2)
(let ((sv-64 (new 'stack-no-clear 'vector)))
(set! (-> sv-64 quad) (the-as uint128 0))
(position-in-front-of-camera! sv-64 40960.0 4096.0)
(+! (-> sv-64 x) (the float (* (- s0-0 (/ arg1 2)) (the int arg3))))
(+! (-> sv-64 z) (the float (* (- sv-32 (/ arg2 2)) (the int arg3))))
(let ((sv-48 (get-process *default-dead-pool* viewer #x4000)))
(when sv-48
((method-of-type viewer activate)
(the-as viewer sv-48)
arg4
(symbol->string (-> viewer symbol))
(the-as pointer #x70004000)
)
(run-now-in-process sv-48 init-viewer-for-other arg0 sv-64 arg5)
(-> sv-48 ppointer)
)
((the-as (function object object object object object none) t9-3) a0-7 a1-4 a2-6 sv-64 t0-1)
)
)
(-> sv-48 ppointer)
(+! sv-32 1)
)
(set! sv-32 (+ sv-32 1))
)
)
#f
+280 -284
View File
@@ -310,130 +310,133 @@
;; INFO: Used lq/sq
(defun disasm-vif-tag ((arg0 (pointer vif-tag)) (arg1 int) (arg2 symbol) (arg3 symbol))
"Disassemble vif tag, and possibly the associated data."
(local-vars (sv-16 vif-cmd) (sv-32 (pointer vif-tag)) (sv-48 int) (sv-64 vif-unpack-imm))
(let ((gp-0 0))
(while (< gp-0 (* arg1 4))
(let ((s0-0 4))
(let ((s1-0 (-> arg0 0)))
(format arg2 " #x~X:" arg0)
(dotimes (v1-0 (-> *vif-disasm-table* length))
(set! sv-16 (-> s1-0 cmd))
(when (= (logand sv-16 (-> *vif-disasm-table* v1-0 mask)) (-> *vif-disasm-table* v1-0 tag))
(let ((a0-12 (-> *vif-disasm-table* v1-0 print)))
(cond
((zero? a0-12)
(format arg2 " (~s :irq ~D)~%" (-> *vif-disasm-table* v1-0 string1) (-> s1-0 irq))
)
((= a0-12 1)
(format
arg2
" (~s :irq ~D :~s #x~X)~%"
(-> *vif-disasm-table* v1-0 string1)
(-> s1-0 irq)
(-> *vif-disasm-table* v1-0 string2)
(-> s1-0 imm)
(let ((sv-16 (-> s1-0 cmd)))
(when (= (logand sv-16 (-> *vif-disasm-table* v1-0 mask)) (-> *vif-disasm-table* v1-0 tag))
(let ((a0-12 (-> *vif-disasm-table* v1-0 print)))
(cond
((zero? a0-12)
(format arg2 " (~s :irq ~D)~%" (-> *vif-disasm-table* v1-0 string1) (-> s1-0 irq))
)
)
((= a0-12 2)
(let ((t1-1 (-> s1-0 imm)))
((= a0-12 1)
(format
arg2
" (~s :irq ~D :wl ~D :cl ~D)~%"
" (~s :irq ~D :~s #x~X)~%"
(-> *vif-disasm-table* v1-0 string1)
(-> s1-0 irq)
(shr (shl (the-as int t1-1) 48) 56)
(shr (shl (the-as int t1-1) 56) 56)
(-> *vif-disasm-table* v1-0 string2)
(-> s1-0 imm)
)
)
)
((= a0-12 3)
(set! s0-0 8)
(format
arg2
" (~s :irq ~D :~s #x~X)~%"
(-> *vif-disasm-table* v1-0 string1)
(-> s1-0 irq)
(-> *vif-disasm-table* v1-0 string2)
(-> arg0 1)
)
)
((= a0-12 4)
(set! s0-0 20)
(format
arg2
" (~s :irq ~D :~s "
(-> *vif-disasm-table* v1-0 string1)
(-> s1-0 irq)
(-> *vif-disasm-table* v1-0 string2)
)
(format arg2 "#x~X #x~X #x~X #x~X)~%" (-> arg0 1) (-> arg0 2) (-> arg0 3) (-> arg0 4))
)
((= a0-12 5)
(format
arg2
" (~s :irq ~D :instructions #x~D :addr #x~X)~%"
(-> *vif-disasm-table* v1-0 string1)
(-> s1-0 irq)
(-> s1-0 num)
(-> s1-0 imm)
)
)
((= a0-12 6)
(if (-> s1-0 imm)
(set! s0-0 #x100000)
(set! s0-0 (the-as int (* (-> s1-0 imm) 16)))
)
(format arg2 " (~s :irq ~D :qwc #x~D)~%" (-> *vif-disasm-table* v1-0 string1) (-> s1-0 irq) (-> s1-0 imm))
(set! sv-32 (&-> arg0 1))
(set! sv-48 0)
(while (< sv-48 (the-as int (-> s1-0 imm)))
(format
arg2
" #x~X: #x~8x #x~8x #x~8x #x~8x~%"
(+ (+ (* sv-48 16) 4) (the-as int arg0))
(-> sv-32 (* sv-48 4))
(-> sv-32 (+ (* sv-48 4) 1))
(-> sv-32 (+ (* sv-48 4) 2))
(-> sv-32 (+ (* sv-48 4) 3))
)
(set! sv-48 (+ sv-48 1))
)
#f
)
((= a0-12 7)
(set! s0-0 (the-as int (+ (logand -4 (+ (* (-> *vif-disasm-table* v1-0 val) (-> s1-0 num)) 3)) 4)))
(set! sv-64 (the-as vif-unpack-imm (-> s1-0 imm)))
(format
arg2
" (~s :irq ~D :num ~D :addr #x~X "
(-> *vif-disasm-table* v1-0 string1)
(-> s1-0 irq)
(-> s1-0 num)
(-> sv-64 addr)
)
(format
arg2
":msk ~D :flg ~D :usn ~D [skip ~d])~%"
(-> s1-0 msk)
(-> sv-64 flg)
(-> sv-64 usn)
(the-as uint s0-0)
)
(if arg3
(disasm-vif-details
((= a0-12 2)
(let ((t1-1 (-> s1-0 imm)))
(format
arg2
(the-as (pointer uint8) arg0)
(logand sv-16 (vif-cmd cmd-mask))
(the-as int (-> s1-0 num))
" (~s :irq ~D :wl ~D :cl ~D)~%"
(-> *vif-disasm-table* v1-0 string1)
(-> s1-0 irq)
(shr (shl (the-as int t1-1) 48) 56)
(shr (shl (the-as int t1-1) 56) 56)
)
)
)
((= a0-12 8)
(format arg2 " (*unknown* vif-tag #x~X)~%" (-> s1-0 cmd))
)
)
((= a0-12 3)
(set! s0-0 8)
(format
arg2
" (~s :irq ~D :~s #x~X)~%"
(-> *vif-disasm-table* v1-0 string1)
(-> s1-0 irq)
(-> *vif-disasm-table* v1-0 string2)
(-> arg0 1)
)
)
((= a0-12 4)
(set! s0-0 20)
(format
arg2
" (~s :irq ~D :~s "
(-> *vif-disasm-table* v1-0 string1)
(-> s1-0 irq)
(-> *vif-disasm-table* v1-0 string2)
)
(format arg2 "#x~X #x~X #x~X #x~X)~%" (-> arg0 1) (-> arg0 2) (-> arg0 3) (-> arg0 4))
)
((= a0-12 5)
(format
arg2
" (~s :irq ~D :instructions #x~D :addr #x~X)~%"
(-> *vif-disasm-table* v1-0 string1)
(-> s1-0 irq)
(-> s1-0 num)
(-> s1-0 imm)
)
)
((= a0-12 6)
(if (-> s1-0 imm)
(set! s0-0 #x100000)
(set! s0-0 (the-as int (* (-> s1-0 imm) 16)))
)
(format arg2 " (~s :irq ~D :qwc #x~D)~%" (-> *vif-disasm-table* v1-0 string1) (-> s1-0 irq) (-> s1-0 imm))
(let ((sv-32 (&-> arg0 1))
(sv-48 0)
)
(while (< sv-48 (the-as int (-> s1-0 imm)))
(format
arg2
" #x~X: #x~8x #x~8x #x~8x #x~8x~%"
(+ (+ (* sv-48 16) 4) (the-as int arg0))
(-> sv-32 (* sv-48 4))
(-> sv-32 (+ (* sv-48 4) 1))
(-> sv-32 (+ (* sv-48 4) 2))
(-> sv-32 (+ (* sv-48 4) 3))
)
(+! sv-48 1)
)
)
#f
)
((= a0-12 7)
(set! s0-0 (the-as int (+ (logand -4 (+ (* (-> *vif-disasm-table* v1-0 val) (-> s1-0 num)) 3)) 4)))
(let ((sv-64 (the-as vif-unpack-imm (-> s1-0 imm))))
(format
arg2
" (~s :irq ~D :num ~D :addr #x~X "
(-> *vif-disasm-table* v1-0 string1)
(-> s1-0 irq)
(-> s1-0 num)
(-> sv-64 addr)
)
(format
arg2
":msk ~D :flg ~D :usn ~D [skip ~d])~%"
(-> s1-0 msk)
(-> sv-64 flg)
(-> sv-64 usn)
(the-as uint s0-0)
)
)
(if arg3
(disasm-vif-details
arg2
(the-as (pointer uint8) arg0)
(logand sv-16 (vif-cmd cmd-mask))
(the-as int (-> s1-0 num))
)
)
)
((= a0-12 8)
(format arg2 " (*unknown* vif-tag #x~X)~%" (-> s1-0 cmd))
)
)
)
(set! v1-0 (-> *vif-disasm-table* length))
)
(set! v1-0 (-> *vif-disasm-table* length))
)
)
)
@@ -516,17 +519,8 @@
If mode is #t, print vif tags too. If mode is 'details, also print data unpacked by vif-tags.
If verbose is #t, print out the addresses of each tag, and total size statistics.
If expected size is negative, it is ignored. Otherwise, only disassemble this much dma data."
(local-vars
(sv-16 object)
(sv-32 dma-packet)
(sv-48 int)
(sv-64 object)
(sv-80 object)
(sv-96 int)
(sv-112 dma-tag)
)
(set! sv-32 arg0)
(let ((s2-0 arg1)
(let ((sv-32 arg0)
(s2-0 arg1)
(s3-0 arg2)
(gp-0 arg3)
(s1-0 arg4)
@@ -538,185 +532,187 @@
(let ((s4-0 0)
(s5-0 0)
)
(set! sv-16 0)
(set! sv-48 0)
(set! sv-64 0)
(set! sv-80 1)
(set! sv-96 -1)
(set! sv-112 (new 'static 'dma-tag))
(while (not s0-0)
(let ((t9-1 valid?)
(a0-2 sv-32)
(a1-2 #f)
(a2-2 "dma-list tag pointer")
(let ((sv-16 0)
(sv-48 0)
(sv-64 0)
(sv-80 1)
(sv-96 -1)
(sv-112 (new 'static 'dma-tag))
)
(while (not s0-0)
(let ((t9-1 valid?)
(a0-2 sv-32)
(a1-2 #f)
(a2-2 "dma-list tag pointer")
)
(cond
((not (t9-1 a0-2 (the-as type a1-2) a2-2 #t gp-0))
(format gp-0 "ERROR: dma-list tag pointer invalid~%")
(set! s0-0 'error)
)
(else
(set! sv-112 (-> sv-32 dma))
(when (not (or (zero? s5-0) (let ((t9-3 valid?)
(a0-4 sv-16)
(a1-4 #f)
)
(set! a2-2 "dma-list data pointer")
(t9-3 a0-4 (the-as type a1-4) a2-2 #t gp-0)
)
)
)
(format gp-0 "ERROR: dma-list data pointer invalid~%")
(set! s0-0 'error)
)
(when (logtest? (the-as dma-tag #x3ff0000) sv-112)
(format gp-0 "ERROR: dma tag has data in reserved bits ~X~%" (the-as none a2-2))
(set! s0-0 'error)
)
)
)
)
(when (or s3-0 (= s0-0 'error))
(format gp-0 "#x~8x: " sv-32)
(cond
((zero? sv-96)
(format gp-0 " ")
)
((= sv-96 1)
(format gp-0 " ")
)
)
(disasm-dma-tag sv-112 gp-0)
)
(cond
((not (t9-1 a0-2 (the-as type a1-2) a2-2 #t gp-0))
(format gp-0 "ERROR: dma-list tag pointer invalid~%")
(set! s0-0 'error)
)
(else
(set! sv-112 (-> sv-32 dma))
(when (not (or (zero? s5-0) (let ((t9-3 valid?)
(a0-4 sv-16)
(a1-4 #f)
)
(set! a2-2 "dma-list data pointer")
(t9-3 a0-4 (the-as type a1-4) a2-2 #t gp-0)
)
)
)
(format gp-0 "ERROR: dma-list data pointer invalid~%")
(set! s0-0 'error)
)
(when (logtest? (the-as dma-tag #x3ff0000) sv-112)
(format gp-0 "ERROR: dma tag has data in reserved bits ~X~%" (the-as none a2-2))
(set! s0-0 'error)
)
(s0-0
)
)
)
(when (or s3-0 (= s0-0 'error))
(format gp-0 "#x~8x: " sv-32)
(cond
((zero? sv-96)
(format gp-0 " ")
)
((= sv-96 1)
(format gp-0 " ")
)
)
(disasm-dma-tag sv-112 gp-0)
)
(cond
(s0-0
)
((or (= (-> sv-112 id) (dma-tag-id ref)) (= (-> sv-112 id) (dma-tag-id refs)) (zero? (-> sv-112 id)))
(set! sv-16 (-> sv-112 addr))
(set! sv-48 (the-as int (-> sv-112 qwc)))
(when s2-0
(let ((v0-10 (disasm-vif-tag (&-> sv-32 vif0) 2 gp-0 (= s2-0 'details))))
(disasm-vif-tag
(the-as (pointer vif-tag) (+ sv-16 v0-10))
(the-as int (- (* sv-48 4) (the-as uint (/ v0-10 4))))
gp-0
(= s2-0 'details)
((or (= (-> sv-112 id) (dma-tag-id ref)) (= (-> sv-112 id) (dma-tag-id refs)) (zero? (-> sv-112 id)))
(set! sv-16 (-> sv-112 addr))
(set! sv-48 (the-as int (-> sv-112 qwc)))
(when s2-0
(let ((v0-10 (disasm-vif-tag (&-> sv-32 vif0) 2 gp-0 (= s2-0 'details))))
(disasm-vif-tag
(the-as (pointer vif-tag) (+ (the-as uint sv-16) v0-10))
(the-as int (- (* (the-as uint sv-48) 4) (the-as uint (/ v0-10 4))))
gp-0
(= s2-0 'details)
)
)
)
)
(set! sv-32 (the-as dma-packet (&-> (the-as (pointer uint64) sv-32) 2)))
(if (= (-> sv-112 id) (dma-tag-id refe))
(set! s0-0 #t)
)
)
((= (-> sv-112 id) (dma-tag-id cnt))
(set! sv-16 (&-> (the-as (pointer uint64) sv-32) 2))
(set! sv-48 (the-as int (-> sv-112 qwc)))
(if s2-0
(disasm-vif-tag
(the-as (pointer vif-tag) (&-> (the-as (pointer uint64) sv-32) 1))
(the-as int (+ (* sv-48 4) 2))
gp-0
(= s2-0 'details)
)
)
(set! sv-32 (the-as dma-packet (+ (the-as uint sv-32) (* (+ sv-48 1) 16))))
sv-32
)
((= (-> sv-112 id) (dma-tag-id next))
(set! sv-16 (&-> (the-as (pointer uint64) sv-32) 2))
(set! sv-48 (the-as int (-> sv-112 qwc)))
(if s2-0
(disasm-vif-tag
(the-as (pointer vif-tag) (&-> (the-as (pointer uint64) sv-32) 1))
(the-as int (+ (* sv-48 4) 2))
gp-0
(= s2-0 'details)
)
)
(when (= sv-32 (-> sv-112 addr))
(format gp-0 "ERROR: next tag creates infinite loop.~%")
(set! s0-0 'error)
)
(set! sv-32 (the-as dma-packet (-> sv-112 addr)))
sv-32
)
((= (-> sv-112 id) (dma-tag-id call))
(set! sv-16 (&-> (the-as (pointer uint64) sv-32) 2))
(set! sv-48 (the-as int (-> sv-112 qwc)))
(if s2-0
(disasm-vif-tag
(the-as (pointer vif-tag) (&-> (the-as (pointer uint64) sv-32) 1))
(the-as int (+ (* sv-48 4) 2))
gp-0
(= s2-0 'details)
)
)
(set! sv-32 (the-as dma-packet (-> sv-112 addr)))
(set! sv-96 (+ sv-96 1))
(cond
((zero? sv-96)
(set! sv-64 (&+ sv-16 sv-48))
(the-as (pointer uint64) sv-64)
)
(else
(set! sv-80 (&+ sv-16 sv-48))
(the-as (pointer uint64) sv-80)
)
)
)
((= (-> sv-112 id) (dma-tag-id ret))
(set! sv-16 (&-> (the-as (pointer uint64) sv-32) 2))
(set! sv-48 (the-as int (-> sv-112 qwc)))
(if s2-0
(disasm-vif-tag
(the-as (pointer vif-tag) (&-> (the-as (pointer uint64) sv-32) 1))
(the-as int (+ (* sv-48 4) 2))
gp-0
(= s2-0 'details)
)
)
(let ((v1-123 sv-96))
(cond
((zero? v1-123)
(set! sv-32 (the-as dma-packet sv-64))
sv-32
)
((= v1-123 1)
(set! sv-32 (the-as dma-packet sv-80))
sv-32
)
(else
(set! sv-32 (the-as dma-packet (&-> (the-as (pointer uint64) sv-32) 2)))
(if (= (-> sv-112 id) (dma-tag-id refe))
(set! s0-0 #t)
)
)
)
(set! sv-96 (+ sv-96 -1))
sv-96
)
((= (-> sv-112 id) (dma-tag-id end))
(set! sv-16 (&-> (the-as (pointer uint64) sv-32) 2))
(set! sv-48 (the-as int (-> sv-112 qwc)))
(set! s0-0 #t)
(if s2-0
(disasm-vif-tag
(the-as (pointer vif-tag) (&-> (the-as (pointer uint64) sv-32) 1))
(the-as int (+ (* sv-48 4) 2))
gp-0
(= s2-0 'details)
((= (-> sv-112 id) (dma-tag-id cnt))
(set! sv-16 (&-> (the-as (pointer uint64) sv-32) 2))
(set! sv-48 (the-as int (-> sv-112 qwc)))
(if s2-0
(disasm-vif-tag
(the-as (pointer vif-tag) (&-> (the-as (pointer uint64) sv-32) 1))
(the-as int (+ (* (the-as uint sv-48) 4) 2))
gp-0
(= s2-0 'details)
)
)
(set! sv-32 (the-as dma-packet (+ (the-as uint sv-32) (* (+ (the-as uint sv-48) 1) 16))))
sv-32
)
((= (-> sv-112 id) (dma-tag-id next))
(set! sv-16 (&-> (the-as (pointer uint64) sv-32) 2))
(set! sv-48 (the-as int (-> sv-112 qwc)))
(if s2-0
(disasm-vif-tag
(the-as (pointer vif-tag) (&-> (the-as (pointer uint64) sv-32) 1))
(the-as int (+ (* (the-as uint sv-48) 4) 2))
gp-0
(= s2-0 'details)
)
)
(when (= sv-32 (-> sv-112 addr))
(format gp-0 "ERROR: next tag creates infinite loop.~%")
(set! s0-0 'error)
)
(set! sv-32 (the-as dma-packet (-> sv-112 addr)))
sv-32
)
((= (-> sv-112 id) (dma-tag-id call))
(set! sv-16 (&-> (the-as (pointer uint64) sv-32) 2))
(set! sv-48 (the-as int (-> sv-112 qwc)))
(if s2-0
(disasm-vif-tag
(the-as (pointer vif-tag) (&-> (the-as (pointer uint64) sv-32) 1))
(the-as int (+ (* (the-as uint sv-48) 4) 2))
gp-0
(= s2-0 'details)
)
)
(set! sv-32 (the-as dma-packet (-> sv-112 addr)))
(+! sv-96 1)
(cond
((zero? sv-96)
(set! sv-64 (&+ (the-as (pointer uint64) sv-16) (the-as uint sv-48)))
(the-as (pointer uint64) (the-as (pointer uint64) sv-64))
)
(else
(set! sv-80 (&+ (the-as (pointer uint64) sv-16) (the-as uint sv-48)))
(the-as (pointer uint64) (the-as (pointer uint64) sv-80))
)
)
)
(else
(format gp-0 "ERROR: Unknown DMA TAG command.~%")
(set! s0-0 'error)
)
((= (-> sv-112 id) (dma-tag-id ret))
(set! sv-16 (&-> (the-as (pointer uint64) sv-32) 2))
(set! sv-48 (the-as int (-> sv-112 qwc)))
(if s2-0
(disasm-vif-tag
(the-as (pointer vif-tag) (&-> (the-as (pointer uint64) sv-32) 1))
(the-as int (+ (* (the-as uint sv-48) 4) 2))
gp-0
(= s2-0 'details)
)
)
(let ((v1-123 sv-96))
(cond
((zero? v1-123)
(set! sv-32 (the-as dma-packet sv-64))
sv-32
)
((= v1-123 1)
(set! sv-32 (the-as dma-packet sv-80))
sv-32
)
(else
(set! s0-0 #t)
)
)
)
(+! sv-96 -1)
sv-96
)
((= (-> sv-112 id) (dma-tag-id end))
(set! sv-16 (&-> (the-as (pointer uint64) sv-32) 2))
(set! sv-48 (the-as int (-> sv-112 qwc)))
(set! s0-0 #t)
(if s2-0
(disasm-vif-tag
(the-as (pointer vif-tag) (&-> (the-as (pointer uint64) sv-32) 1))
(the-as int (+ (* (the-as uint sv-48) 4) 2))
gp-0
(= s2-0 'details)
)
)
)
(else
(format gp-0 "ERROR: Unknown DMA TAG command.~%")
(set! s0-0 'error)
)
)
(+! s4-0 sv-48)
(+! s5-0 1)
(if (and (>= s1-0 0) (>= s5-0 s1-0))
(set! s0-0 #t)
)
)
(+! s4-0 sv-48)
(+! s5-0 1)
(if (and (>= s1-0 0) (>= s5-0 s1-0))
(set! s0-0 #t)
)
)
(when (or s3-0 (= s0-0 'error))
(format gp-0 "NOTICE: Total tags: ~d~%" s5-0)
+251 -286
View File
@@ -398,7 +398,6 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defun-debug print-prototype-list ()
(local-vars (sv-16 (function prototype-bucket-shrub memory-usage-block int prototype-bucket-shrub)))
(dotimes (gp-0 (-> *level* length))
(let ((s5-0 (-> *level* level gp-0)))
(when (= (-> s5-0 status) 'active)
@@ -418,14 +417,7 @@
(mem-usage (-> s1-0 geometry s0-0) *instance-mem-usage* 0)
)
)
(let ((s0-1 s1-0))
(set! sv-16 (method-of-object s0-1 mem-usage))
(let ((a1-4 (reset! *instance-mem-usage*))
(a2-2 0)
)
(sv-16 s0-1 a1-4 a2-2)
)
)
(mem-usage s1-0 (reset! *instance-mem-usage*) 0)
(let ((v1-29 (calculate-total *instance-mem-usage*)))
(format
#t
@@ -503,17 +495,6 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch object vs none.
(defun-debug draw-instance-info ((arg0 string))
(local-vars
(sv-16 uint)
(sv-32 uint)
(sv-48 uint)
(sv-64 int)
(sv-80 int)
(sv-96 int)
(sv-112 int)
(sv-128 int)
(sv-144 int)
)
(when (and *display-instance-info* *edit-instance*)
(let ((s5-0 (find-instance-by-name *edit-instance*)))
(when s5-0
@@ -624,30 +605,32 @@
(s2-2 (+ (-> (the-as prototype-bucket-shrub s5-0) count 1) (-> (the-as prototype-bucket-shrub s5-0) count 2)))
)
(dotimes (s0-1 (-> s1-2 length))
(set! sv-16 (shrub-num-tris (-> s1-2 data s0-1)))
(set! sv-32 (-> s1-2 data s0-1 header data 2))
(set! sv-48 (-> s1-2 data s0-1 header data 0))
(format
arg0
"~5D ~4D ~5D ~6f ~D~%"
s0-1
sv-16
sv-32
(/ (* 2.0 (the float sv-16)) (the float (- sv-32 sv-16)))
sv-48
)
(+! s3-2 sv-16)
(+! s4-3 sv-32)
(set! f30-0
(+ 29.0
(* 5.5 (the float (- sv-32 sv-16)))
(* 22.0 (the float sv-48))
(* 8.0 (the float sv-32))
(* 53.0 (the float (/ (+ s2-2 9) (the-as uint 10))))
(* (the float s2-2) (+ 15.0 (* 5.0 (the float sv-48)) (* 13.5 (the float sv-32))))
f30-0
)
(let ((sv-16 (shrub-num-tris (-> s1-2 data s0-1)))
(sv-32 (-> s1-2 data s0-1 header data 2))
(sv-48 (-> s1-2 data s0-1 header data 0))
)
(format
arg0
"~5D ~4D ~5D ~6f ~D~%"
s0-1
sv-16
sv-32
(/ (* 2.0 (the float sv-16)) (the float (- sv-32 sv-16)))
sv-48
)
(+! s3-2 sv-16)
(+! s4-3 sv-32)
(set! f30-0
(+ 29.0
(* 5.5 (the float (- sv-32 sv-16)))
(* 22.0 (the float sv-48))
(* 8.0 (the float sv-32))
(* 53.0 (the float (/ (+ s2-2 9) (the-as uint 10))))
(* (the float s2-2) (+ 15.0 (* 5.0 (the float sv-48)) (* 13.5 (the float sv-32))))
f30-0
)
)
)
)
(format
arg0
@@ -662,56 +645,53 @@
)
)
((= s2-1 instance-tie)
(set! sv-144 0)
(let ((s1-3 0)
(let ((sv-144 0)
(s1-3 0)
(s0-2 0)
(s2-3 0)
)
(format arg0 "~%level visible frags tris dverts strlen tex ttris~%")
(set! sv-64 1)
(set! sv-80 3)
(while (>= sv-80 sv-64)
(let ((v1-100 (-> (the-as prototype-bucket-tie s5-0) tie-geom sv-64)))
(set! sv-96 0)
(set! sv-112 0)
(set! sv-128 0)
(dotimes (a0-36 (-> v1-100 length))
(set! sv-96 (+ sv-96 (-> v1-100 data a0-36 debug num-tris)))
(set! sv-112 (+ sv-112 (-> v1-100 data a0-36 debug num-dverts)))
(set! sv-128 (+ sv-128 (-> v1-100 data a0-36 tex-count)))
(let ((sv-64 1)
(sv-80 3)
)
(set! sv-144 (+ sv-144 (-> (the-as prototype-bucket-tie s5-0) count sv-64)))
(format
arg0
"~5D ~7D ~5D ~5D"
sv-64
(-> (the-as prototype-bucket-tie s5-0) count sv-64)
(-> v1-100 length)
sv-96
(while (>= sv-80 sv-64)
(let ((v1-100 (-> (the-as prototype-bucket-tie s5-0) tie-geom sv-64))
(sv-96 0)
(sv-112 0)
(sv-128 0)
)
(dotimes (a0-36 (-> v1-100 length))
(+! sv-96 (-> v1-100 data a0-36 debug num-tris))
(+! sv-112 (-> v1-100 data a0-36 debug num-dverts))
(+! sv-128 (-> v1-100 data a0-36 tex-count))
)
(+! sv-144 (-> (the-as prototype-bucket-tie s5-0) count sv-64))
(format
arg0
"~5D ~7D ~5D ~5D"
sv-64
(-> (the-as prototype-bucket-tie s5-0) count sv-64)
(-> v1-100 length)
sv-96
)
(format
arg0
" ~5D ~6f ~3D ~5D~%"
sv-112
(/ (* 2.0 (the float sv-96)) (the float (- sv-112 sv-96)))
sv-128
(* (the-as uint sv-96) (-> (the-as prototype-bucket-tie s5-0) count sv-64))
)
(+! s1-3 (* (the-as uint sv-96) (-> (the-as prototype-bucket-tie s5-0) count sv-64)))
(+! s0-2 (* (the-as uint sv-112) (-> (the-as prototype-bucket-tie s5-0) count sv-64)))
(+! s3-2 sv-96)
(+! s4-3 sv-112)
(+! s2-3 sv-128)
)
(+! sv-64 1)
)
(format
arg0
" ~5D ~6f ~3D ~5D~%"
sv-112
(/ (* 2.0 (the float sv-96)) (the float (- sv-112 sv-96)))
sv-128
(* (the-as uint sv-96) (-> (the-as prototype-bucket-tie s5-0) count sv-64))
)
(+! s1-3 (* (the-as uint sv-96) (-> (the-as prototype-bucket-tie s5-0) count sv-64)))
(+! s0-2 (* (the-as uint sv-112) (-> (the-as prototype-bucket-tie s5-0) count sv-64)))
(+! s3-2 sv-96)
(+! s4-3 sv-112)
(+! s2-3 sv-128)
(set! sv-64 (+ sv-64 1))
)
(let ((t9-20 format)
(a0-52 arg0)
(a1-28 "total ~7D/~3D ~5D")
(a3-12 (-> s5-0 in-level))
)
(t9-20 a0-52 a1-28 sv-144 a3-12 s3-2)
)
(format arg0 "total ~7D/~3D ~5D" sv-144 (-> s5-0 in-level) s3-2)
(format
arg0
" ~5D ~6f ~3D ~5D~%"
@@ -786,20 +766,7 @@
;; WARN: Return type mismatch int vs none.
;; WARN: Function dma-add-process-drawable has a return type of none, but the expression builder found a return statement.
(defun dma-add-process-drawable ((pd process-drawable) (dc draw-control) (flag symbol) (dma-buf dma-buffer))
(local-vars
(a0-82 int)
(a0-84 int)
(a3-11 uint128)
(sv-16 process-drawable)
(tod time-of-day-context)
(shadow-mask uint)
(lev-idx-for-mood uint)
(my-origin vector)
(lev-mood mood-context)
(light-result-bucket light-hash-bucket)
(index-ptr pointer)
(index-index int)
)
(local-vars (a0-82 int) (a0-84 int) (a3-11 uint128))
(with-pp
(rlet ((acc :class vf)
(Q :class vf)
@@ -827,62 +794,62 @@
(vf6 :class vf)
)
(init-vf0-vector)
(set! sv-16 pd)
(let* ((v1-1 (-> *perf-stats* data 50))
(a0-1 (-> v1-1 ctrl))
)
(+! (-> v1-1 count) 1)
(b! (zero? a0-1) cfg-2 :delay (nop!))
(.mtc0 Perf 0)
(.sync.l)
(.sync.p)
(.mtpc pcr0 0)
(.mtpc pcr1 0)
(.sync.l)
(.sync.p)
(.mtc0 Perf a0-1)
)
(.sync.l)
(.sync.p)
(label cfg-2)
0
(when (-> *blit-displays-work* menu-mode)
(if (not (logtest? (-> dc status) (draw-control-status hud)))
(return #f)
)
)
(logclear! (-> dc status) (draw-control-status on-screen))
(when (not (logtest? (-> dc status) (draw-control-status no-draw no-draw-temp uninited)))
(let ((fg-bounds (-> (the-as foreground-work #x70000000) bounds))
(fg-lights (-> (the-as foreground-work #x70000000) lights))
)
(set! tod *time-of-day-context*)
(.lvf vf16 (&-> dc origin quad))
(.svf (&-> fg-bounds quad) vf16)
(when (sphere-in-view-frustum? fg-bounds)
(cond
((logtest? (-> dc global-effect) (draw-control-global-effect title-light))
(when (not (-> tod title-updated))
(set! (-> tod title-updated) #t)
(let ((s1-0 (-> *math-camera* inv-camera-rot))
(a1-3 (new 'stack-no-clear 'vector))
(s2-0 (new 'stack-no-clear 'vector))
)
(set-vector! a1-3 0.612 0.5 -0.612 0.0)
(set-vector! s2-0 -0.696 0.174 0.696 0.0)
(vector-matrix*! (the-as vector (-> tod title-light-group)) a1-3 s1-0)
(vector-matrix*! (-> tod title-light-group dir1 direction) s2-0 s1-0)
)
)
(vu-lights<-light-group! fg-lights (-> tod title-light-group))
(let ((sv-16 pd))
(let* ((v1-1 (-> *perf-stats* data 50))
(a0-1 (-> v1-1 ctrl))
)
(else
(set! shadow-mask (-> dc shadow-mask))
(let ((shadow-mask-not (lognot shadow-mask)))
(set! lev-idx-for-mood (-> dc level-index))
(let ((light-idx (-> dc light-index))
(lg (new 'stack-no-clear 'light-group))
)
(+! (-> v1-1 count) 1)
(b! (zero? a0-1) cfg-2 :delay (nop!))
(.mtc0 Perf 0)
(.sync.l)
(.sync.p)
(.mtpc pcr0 0)
(.mtpc pcr1 0)
(.sync.l)
(.sync.p)
(.mtc0 Perf a0-1)
)
(.sync.l)
(.sync.p)
(label cfg-2)
0
(when (-> *blit-displays-work* menu-mode)
(if (not (logtest? (-> dc status) (draw-control-status hud)))
(return #f)
)
)
(logclear! (-> dc status) (draw-control-status on-screen))
(when (not (logtest? (-> dc status) (draw-control-status no-draw no-draw-temp uninited)))
(let ((fg-bounds (-> (the-as foreground-work #x70000000) bounds))
(fg-lights (-> (the-as foreground-work #x70000000) lights))
(tod *time-of-day-context*)
)
(.lvf vf16 (&-> dc origin quad))
(.svf (&-> fg-bounds quad) vf16)
(when (sphere-in-view-frustum? fg-bounds)
(cond
((logtest? (-> dc global-effect) (draw-control-global-effect title-light))
(when (not (-> tod title-updated))
(set! (-> tod title-updated) #t)
(let ((s1-0 (-> *math-camera* inv-camera-rot))
(a1-3 (new 'stack-no-clear 'vector))
(s2-0 (new 'stack-no-clear 'vector))
)
(set-vector! a1-3 0.612 0.5 -0.612 0.0)
(set-vector! s2-0 -0.696 0.174 0.696 0.0)
(vector-matrix*! (the-as vector (-> tod title-light-group)) a1-3 s1-0)
(vector-matrix*! (-> tod title-light-group dir1 direction) s2-0 s1-0)
)
)
(vu-lights<-light-group! fg-lights (-> tod title-light-group))
)
(else
(let* ((shadow-mask (-> dc shadow-mask))
(shadow-mask-not (lognot shadow-mask))
(lev-idx-for-mood (-> dc level-index))
(light-idx (-> dc light-index))
(lg (new 'stack-no-clear 'light-group))
)
(if (and (>= lev-idx-for-mood (the-as uint 6)) (< light-idx (the-as uint 20)))
(+! light-idx 20)
)
@@ -931,29 +898,32 @@
(dotimes (fg-light-lev-idx (-> *level* length))
(let ((lev (-> *level* level fg-light-lev-idx)))
(when (= (-> lev status) 'active)
(let ((light-hash (-> lev light-hash)))
(set! my-origin (-> dc origin))
(set! lev-mood (-> lev mood-context))
(let ((light-hash (-> lev light-hash))
(my-origin (-> dc origin))
(lev-mood (-> lev mood-context))
)
(when (nonzero? light-hash)
(let ((light-lookup-result (light-hash-get-bucket-index light-hash (-> dc origin))))
(when (!= light-lookup-result -1)
(set! light-result-bucket (-> light-hash bucket-array light-lookup-result))
(set! index-ptr (+ (+ (-> light-result-bucket index) 0) (the-as uint (-> light-hash index-array))))
(set! index-index 0)
(while (< index-index (the-as int (-> light-result-bucket count)))
(let* ((light-sphere (-> light-hash light-sphere-array (-> (the-as (pointer uint8) (&+ index-ptr index-index)))))
(palette-idx (-> light-sphere palette-index))
(interp (if (= palette-idx -1)
1.0
(-> lev-mood times palette-idx w)
)
)
)
(if (!= (* (-> light-sphere brightness) interp) 0.0)
(add-light-sphere-to-light-group lg light-sphere my-origin lev-mood)
)
(let* ((light-result-bucket (-> light-hash bucket-array light-lookup-result))
(index-ptr (+ (+ (-> light-result-bucket index) 0) (the-as uint (-> light-hash index-array))))
(index-index 0)
)
(while (< index-index (the-as int (-> light-result-bucket count)))
(let* ((light-sphere (-> light-hash light-sphere-array (-> (the-as (pointer uint8) (&+ index-ptr index-index)))))
(palette-idx (-> light-sphere palette-index))
(interp (if (= palette-idx -1)
1.0
(-> lev-mood times palette-idx w)
)
)
)
(if (!= (* (-> light-sphere brightness) interp) 0.0)
(add-light-sphere-to-light-group lg light-sphere my-origin lev-mood)
)
)
(+! index-index 1)
)
(set! index-index (+ index-index 1))
)
)
)
@@ -985,12 +955,7 @@
(.svf (&-> target-shadow-dir quad) vf1)
(vector-normalize! target-shadow-dir -1.0)
(when (< (- (-> target-shadow-dir y)) 0.9063)
(let* ((f0-16 0.4226)
(f1-6 (-> target-shadow-dir x))
(f1-8 (* f1-6 f1-6))
(f2-0 (-> target-shadow-dir z))
(f0-17 (/ f0-16 (sqrtf (+ f1-8 (* f2-0 f2-0)))))
)
(let ((f0-17 (/ 0.4226 (sqrtf (+ (square (-> target-shadow-dir x)) (square (-> target-shadow-dir z)))))))
(set! (-> target-shadow-dir x) (* (-> target-shadow-dir x) f0-17))
(set! (-> target-shadow-dir y) -0.9063)
(set! (-> target-shadow-dir z) (* (-> target-shadow-dir z) f0-17))
@@ -1006,128 +971,128 @@
)
)
)
)
(.lvf vf28 (&-> dc color-mult quad))
(.lvf vf29 (&-> dc color-emissive quad))
(.lvf vf2 (&-> fg-lights color 0 quad))
(.lvf vf3 (&-> fg-lights color 1 quad))
(.lvf vf4 (&-> fg-lights color 2 quad))
(.lvf vf5 (&-> fg-lights ambient quad))
(.mul.vf vf5 vf5 vf28)
(.mul.vf vf2 vf2 vf28)
(.mul.vf vf3 vf3 vf28)
(.mul.vf vf4 vf4 vf28)
(.add.vf vf5 vf5 vf29)
(.svf (&-> fg-lights color 0 quad) vf2)
(.svf (&-> fg-lights color 1 quad) vf3)
(.svf (&-> fg-lights color 2 quad) vf4)
(.svf (&-> fg-lights ambient quad) vf5)
(let ((at-0 *math-camera*))
(.lvf vf16 (&-> at-0 plane 0 quad))
(.lvf vf17 (&-> at-0 plane 1 quad))
(.lvf vf18 (&-> at-0 plane 2 quad))
(.lvf vf19 (&-> at-0 plane 3 quad))
(.lvf vf20 (&-> at-0 guard-plane 0 quad))
(.lvf vf21 (&-> at-0 guard-plane 1 quad))
(.lvf vf22 (&-> at-0 guard-plane 2 quad))
(.lvf vf23 (&-> at-0 guard-plane 3 quad))
(.lvf vf24 (&-> at-0 camera-rot quad 0))
(.lvf vf25 (&-> at-0 camera-rot quad 1))
(.lvf vf26 (&-> at-0 camera-rot quad 2))
(.lvf vf27 (&-> at-0 camera-rot trans quad))
)
(let ((fg-dist (-> (the-as foreground-work #x70000000) distance)))
(.lvf vf15 (&-> fg-bounds quad))
(.mul.w.vf acc vf27 vf0)
(.add.mul.x.vf acc vf24 vf15 acc)
(.add.mul.y.vf acc vf25 vf15 acc)
(.add.mul.z.vf.xyz vf15 vf26 vf15 acc)
(.mul.vf vf28 vf15 vf15)
(.max.w.vf vf29 vf0 vf0)
(.add.y.vf acc vf28 vf28)
(.add.mul.z.vf.x vf28 vf29 vf28 acc)
(.sqrt.vf Q vf28 :ftf #b0)
(.sub.w.vf.w vf28 vf0 vf15)
(.wait.vf)
(.add.vf.w vf15 vf28 Q)
(.svf (&-> fg-dist quad) vf15)
(when (< 0.0 (+ (-> fg-dist z) (-> dc bounds w)))
(let ((lod-idx 0))
(let ((dist-w (-> fg-dist w)))
(set! (-> dc distance) dist-w)
(when (nonzero? (-> dc lod-set max-lod))
(cond
((>= (-> dc force-lod) 0)
(set! lod-idx (-> dc force-lod))
(if (< (-> dc lod-set lod (-> dc lod-set max-lod) dist) dist-w)
(return #f)
)
)
(else
(while (and (< lod-idx (-> dc lod-set max-lod)) (< (-> dc lod-set lod lod-idx dist) dist-w))
(+! lod-idx 1)
(.lvf vf28 (&-> dc color-mult quad))
(.lvf vf29 (&-> dc color-emissive quad))
(.lvf vf2 (&-> fg-lights color 0 quad))
(.lvf vf3 (&-> fg-lights color 1 quad))
(.lvf vf4 (&-> fg-lights color 2 quad))
(.lvf vf5 (&-> fg-lights ambient quad))
(.mul.vf vf5 vf5 vf28)
(.mul.vf vf2 vf2 vf28)
(.mul.vf vf3 vf3 vf28)
(.mul.vf vf4 vf4 vf28)
(.add.vf vf5 vf5 vf29)
(.svf (&-> fg-lights color 0 quad) vf2)
(.svf (&-> fg-lights color 1 quad) vf3)
(.svf (&-> fg-lights color 2 quad) vf4)
(.svf (&-> fg-lights ambient quad) vf5)
(let ((at-0 *math-camera*))
(.lvf vf16 (&-> at-0 plane 0 quad))
(.lvf vf17 (&-> at-0 plane 1 quad))
(.lvf vf18 (&-> at-0 plane 2 quad))
(.lvf vf19 (&-> at-0 plane 3 quad))
(.lvf vf20 (&-> at-0 guard-plane 0 quad))
(.lvf vf21 (&-> at-0 guard-plane 1 quad))
(.lvf vf22 (&-> at-0 guard-plane 2 quad))
(.lvf vf23 (&-> at-0 guard-plane 3 quad))
(.lvf vf24 (&-> at-0 camera-rot quad 0))
(.lvf vf25 (&-> at-0 camera-rot quad 1))
(.lvf vf26 (&-> at-0 camera-rot quad 2))
(.lvf vf27 (&-> at-0 camera-rot trans quad))
)
(let ((fg-dist (-> (the-as foreground-work #x70000000) distance)))
(.lvf vf15 (&-> fg-bounds quad))
(.mul.w.vf acc vf27 vf0)
(.add.mul.x.vf acc vf24 vf15 acc)
(.add.mul.y.vf acc vf25 vf15 acc)
(.add.mul.z.vf.xyz vf15 vf26 vf15 acc)
(.mul.vf vf28 vf15 vf15)
(.max.w.vf vf29 vf0 vf0)
(.add.y.vf acc vf28 vf28)
(.add.mul.z.vf.x vf28 vf29 vf28 acc)
(.sqrt.vf Q vf28 :ftf #b0)
(.sub.w.vf.w vf28 vf0 vf15)
(.wait.vf)
(.add.vf.w vf15 vf28 Q)
(.svf (&-> fg-dist quad) vf15)
(when (< 0.0 (+ (-> fg-dist z) (-> dc bounds w)))
(let ((lod-idx 0))
(let ((dist-w (-> fg-dist w)))
(set! (-> dc distance) dist-w)
(when (nonzero? (-> dc lod-set max-lod))
(cond
((>= (-> dc force-lod) 0)
(set! lod-idx (-> dc force-lod))
(if (< (-> dc lod-set lod (-> dc lod-set max-lod) dist) dist-w)
(return #f)
)
)
(else
(while (and (< lod-idx (-> dc lod-set max-lod)) (< (-> dc lod-set lod lod-idx dist) dist-w))
(+! lod-idx 1)
)
)
)
)
)
(if (and (< (-> dc lod-set lod lod-idx dist) dist-w) (< (-> dc force-lod) 0))
(return #f)
)
(let ((src-lev (-> *level* level (-> dc level-index)))
(corrected-dist (* dist-w (-> *math-camera* fov-correction-factor)))
(tex-use (-> dc mgeo header texture-usage-group))
(if (and (< (-> dc lod-set lod lod-idx dist) dist-w) (< (-> dc force-lod) 0))
(return #f)
)
(dotimes (use-fg-idx 7)
(let ((use-idx (+ use-fg-idx 11)))
(if (not (logtest? (-> dc status) (draw-control-status no-closest-distance)))
(set! (-> src-lev closest-object-array use-idx) (fmin (-> src-lev closest-object-array use-idx) dist-w))
)
)
(let ((tex-lod (cond
((>= corrected-dist (-> tex-use data use-fg-idx data 0 dist))
0
)
((>= corrected-dist (-> tex-use data use-fg-idx data 1 dist))
1
)
(else
2
(let ((src-lev (-> *level* level (-> dc level-index)))
(corrected-dist (* dist-w (-> *math-camera* fov-correction-factor)))
(tex-use (-> dc mgeo header texture-usage-group))
)
(dotimes (use-fg-idx 7)
(let ((use-idx (+ use-fg-idx 11)))
(if (not (logtest? (-> dc status) (draw-control-status no-closest-distance)))
(set! (-> src-lev closest-object-array use-idx) (fmin (-> src-lev closest-object-array use-idx) dist-w))
)
)
(let ((tex-lod (cond
((>= corrected-dist (-> tex-use data use-fg-idx data 0 dist))
0
)
((>= corrected-dist (-> tex-use data use-fg-idx data 1 dist))
1
)
(else
2
)
)
)
)
(a2-23 (+ use-fg-idx 11))
)
(let ((a3-10 (-> src-lev texture-mask a2-23 mask quad))
(t0-3 (-> (the-as (pointer uint128) (+ (the-as uint tex-use) (* 48 use-fg-idx) (* tex-lod 16))) 0))
(a2-23 (+ use-fg-idx 11))
)
(.por a3-11 a3-10 t0-3)
(let ((a3-10 (-> src-lev texture-mask a2-23 mask quad))
(t0-3 (-> (the-as (pointer uint128) (+ (the-as uint tex-use) (* 48 use-fg-idx) (* tex-lod 16))) 0))
)
(.por a3-11 a3-10 t0-3)
)
(set! (-> src-lev texture-mask a2-23 mask quad) a3-11)
)
(set! (-> src-lev texture-mask a2-23 mask quad) a3-11)
)
)
(if (or (guard-band-cull fg-bounds) (< dist-w (* 1.2 (-> *math-camera* d))))
(logior! (-> dc status) (draw-control-status close-to-screen))
(logclear! (-> dc status) (draw-control-status close-to-screen))
)
(logior! (-> dc status) (draw-control-status on-screen))
(if (logtest? (-> dc status) (draw-control-status no-draw-bounds no-draw-bounds2))
(return #f)
)
(set! (-> pp clock) (-> sv-16 clock))
(if (or (= lod-idx (-> dc cur-lod)) (logtest? (-> dc status) (draw-control-status lod-set)))
(foreground-draw dc dma-buf dist-w)
)
)
(if (or (guard-band-cull fg-bounds) (< dist-w (* 1.2 (-> *math-camera* d))))
(logior! (-> dc status) (draw-control-status close-to-screen))
(logclear! (-> dc status) (draw-control-status close-to-screen))
(when (and (< lod-idx (-> dc cur-lod)) (logtest? (-> dc status) (draw-control-status math-skel)))
(let ((v1-159 *matrix-engine*))
(set! (-> v1-159 (-> v1-159 length)) (process->handle sv-16))
(+! (-> v1-159 length) 1)
)
(logior! (-> dc status) (draw-control-status on-screen))
(if (logtest? (-> dc status) (draw-control-status no-draw-bounds no-draw-bounds2))
(return #f)
)
(set! (-> pp clock) (-> sv-16 clock))
(if (or (= lod-idx (-> dc cur-lod)) (logtest? (-> dc status) (draw-control-status lod-set)))
(foreground-draw dc dma-buf dist-w)
)
)
(when (and (< lod-idx (-> dc cur-lod)) (logtest? (-> dc status) (draw-control-status math-skel)))
(let ((v1-159 *matrix-engine*))
(set! (-> v1-159 (-> v1-159 length)) (process->handle sv-16))
(+! (-> v1-159 length) 1)
)
(lod-set! dc lod-idx)
)
(lod-set! dc lod-idx)
(logior! (-> dc status) (draw-control-status lod-set))
)
(logior! (-> dc status) (draw-control-status lod-set))
)
)
)
+9 -9
View File
@@ -6,9 +6,9 @@
;; WARN: Return type mismatch entity vs entity-actor.
(defun entity-actor-lookup ((arg0 res-lump) (arg1 symbol) (arg2 int))
"Given an entity (the res-lump), look up a reference to another entity and return that entity."
(local-vars (sv-16 res-tag))
(set! sv-16 (new 'static 'res-tag))
(let ((v1-1 (res-lump-data arg0 arg1 pointer :tag-ptr (& sv-16))))
(let* ((sv-16 (new 'static 'res-tag))
(v1-1 (res-lump-data arg0 arg1 pointer :tag-ptr (& sv-16)))
)
(the-as
entity-actor
(when (and v1-1 (< arg2 (the-as int (-> sv-16 elt-count))))
@@ -27,12 +27,12 @@
(defun entity-actor-count ((arg0 res-lump) (arg1 symbol))
"Get the number of entities that this res references under the name.
This works on more than just next/prev."
(local-vars (sv-16 res-tag))
(set! sv-16 (new 'static 'res-tag))
(if (res-lump-data arg0 arg1 pointer :tag-ptr (& sv-16))
(the-as int (-> sv-16 elt-count))
0
)
(let ((sv-16 (new 'static 'res-tag)))
(if (res-lump-data arg0 arg1 pointer :tag-ptr (& sv-16))
(the-as int (-> sv-16 elt-count))
0
)
)
)
;; definition of type actor-link-info
File diff suppressed because it is too large Load Diff
+30 -32
View File
@@ -774,9 +774,8 @@
;; definition for method 18 of type res-lump
(defmethod add-32bit-data! ((this res-lump) (arg0 res-tag) (arg1 object))
"Add a single 32-bit value using [[add-data!]]."
(local-vars (sv-16 object))
(set! sv-16 arg1)
(let* ((v1-0 arg0)
(let* ((sv-16 arg1)
(v1-0 arg0)
(a1-4 (copy-and-set-field v1-0 inlined? 1))
)
(add-data! this a1-4 (& sv-16))
@@ -788,20 +787,19 @@
(defmethod get-curve-data! ((this res-lump) (arg0 curve) (arg1 symbol) (arg2 symbol) (arg3 float))
"Read curve data and write it to curve-target. Return #t if both
control points and knots data was succesfully read, #f otherwise."
(local-vars (sv-16 res-tag) (sv-32 res-tag))
(let ((s5-0 #f))
(set! sv-16 (new 'static 'res-tag))
(let ((a0-2 ((method-of-object this get-property-data)
this
arg1
'exact
arg3
(the-as pointer #f)
(& sv-16)
*res-static-buf*
(let* ((sv-16 (new 'static 'res-tag))
(a0-2 ((method-of-object this get-property-data)
this
arg1
'exact
arg3
(the-as pointer #f)
(& sv-16)
*res-static-buf*
)
)
)
)
)
(when a0-2
(set! (-> arg0 cverts) (the-as (inline-array vector) a0-2))
(set! (-> arg0 num-cverts) (the-as int (-> sv-16 elt-count)))
@@ -814,18 +812,18 @@
)
(set! (-> arg0 num-cverts) 256)
)
(set! sv-32 (new 'static 'res-tag))
(let ((a0-6 ((method-of-object this get-property-data)
this
arg2
'exact
arg3
(the-as pointer #f)
(& sv-32)
*res-static-buf*
(let* ((sv-32 (new 'static 'res-tag))
(a0-6 ((method-of-object this get-property-data)
this
arg2
'exact
arg3
(the-as pointer #f)
(& sv-32)
*res-static-buf*
)
)
)
)
)
(when a0-6
(set! (-> arg0 knots) (the-as (pointer float) a0-6))
(set! (-> arg0 num-knots) (the-as int (-> sv-32 elt-count)))
@@ -848,7 +846,6 @@
;; WARN: Using new Jak 2 rtype-of
;; WARN: Using new Jak 2 rtype-of
(defmethod mem-usage ((this res-lump) (usage memory-usage-block) (flags int))
(local-vars (sv-16 int))
(let ((s3-0 48)
(s2-0 "res")
)
@@ -908,12 +905,13 @@
(+! (-> usage data s3-0 used) v1-68)
(+! (-> usage data s3-0 total) (logand -16 (+ v1-68 15)))
)
(set! sv-16 0)
(while (< sv-16 (-> (the-as array s0-0) length))
(let ((a0-63 (-> (the-as (array object) s0-0) sv-16)))
((method-of-type (rtype-of a0-63) mem-usage) a0-63 usage flags)
(let ((sv-16 0))
(while (< sv-16 (-> (the-as array s0-0) length))
(let ((a0-63 (-> (the-as (array object) s0-0) sv-16)))
((method-of-type (rtype-of a0-63) mem-usage) a0-63 usage flags)
)
(+! sv-16 1)
)
(set! sv-16 (+ sv-16 1))
)
)
(else
+62 -117
View File
@@ -274,21 +274,6 @@
;; WARN: Return type mismatch int vs none.
;; WARN: Function (method 10 effect-control) has a return type of none, but the expression builder found a return statement.
(defmethod do-effect ((this effect-control) (arg0 symbol) (arg1 float) (arg2 int))
(local-vars
(sv-320 int)
(sv-336 symbol)
(sv-352 symbol)
(sv-368 symbol)
(sv-384 vector)
(sv-400 matrix)
(sv-416 int)
(sv-432 symbol)
(sv-448 symbol)
(sv-464 symbol)
(sv-480 vector)
(sv-496 matrix)
(sv-512 res-lump)
)
(cond
((logtest? (-> this flags) (effect-control-flag ecf2))
(return #f)
@@ -411,16 +396,15 @@
(let ((s2-1 run-function-in-process)
(s1-0 s4-1)
(s0-0 part-tracker-init)
(sv-320 0)
(sv-336 (the-as symbol #f))
(sv-352 (the-as symbol #f))
(sv-368 (the-as symbol #f))
(sv-400 *launch-matrix*)
)
(set! sv-320 0)
(set! sv-336 (the-as symbol #f))
(set! sv-352 (the-as symbol #f))
(set! sv-368 (the-as symbol #f))
(set! sv-400 *launch-matrix*)
(set! sv-384 (-> sv-400 trans))
(let ((v1-55 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data s5-0)) quad)))
(set! (-> sv-384 quad) v1-55)
)
(set! (-> sv-400 trans quad)
(-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data s5-0)) quad)
)
((the-as (function object object object object object object object object none) s2-1)
s1-0
s0-0
@@ -517,16 +501,15 @@
(let ((s2-3 run-function-in-process)
(s1-3 s4-3)
(s0-3 part-tracker-init)
(sv-416 0)
(sv-432 (the-as symbol #f))
(sv-448 (the-as symbol #f))
(sv-464 (the-as symbol #f))
(sv-496 *launch-matrix*)
)
(set! sv-416 0)
(set! sv-432 (the-as symbol #f))
(set! sv-448 (the-as symbol #f))
(set! sv-464 (the-as symbol #f))
(set! sv-496 *launch-matrix*)
(set! sv-480 (-> sv-496 trans))
(let ((v1-95 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data s5-0)) quad)))
(set! (-> sv-480 quad) v1-95)
)
(set! (-> sv-496 trans quad)
(-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data s5-0)) quad)
)
((the-as (function object object object object object object object object none) s2-3)
s1-3
s0-3
@@ -582,17 +565,16 @@
(set! (-> v1-106 death-timer-org) (-> v1-106 death-timer))
(set! (-> v1-106 death-draw-overlap) (-> (the-as death-info s3-0) overlap))
)
(when (-> (the-as death-info s3-0) sound)
(let* ((s2-5 this)
(s1-4 (method-of-object s2-5 play-effect-sound))
(s0-4 (-> (the-as death-info s3-0) sound))
)
(set! sv-512 (-> this res))
(let ((t1-12 (string->sound-name (symbol->string (-> (the-as death-info s3-0) sound)))))
(s1-4 s2-5 s0-4 arg1 s5-0 sv-512 t1-12)
(if (-> (the-as death-info s3-0) sound)
(play-effect-sound
this
(-> (the-as death-info s3-0) sound)
arg1
s5-0
(-> this res)
(string->sound-name (symbol->string (-> (the-as death-info s3-0) sound)))
)
)
)
(send-event (-> this process) 'death-start (the-as death-info s3-0))
)
)
@@ -610,26 +592,6 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod do-effect-for-surface ((this effect-control) (arg0 symbol) (arg1 float) (arg2 int) (arg3 basic) (arg4 pat-surface))
(local-vars
(sv-64
(function sparticle-system sparticle-launcher matrix sparticle-launch-state sparticle-launch-control float none)
)
(sv-80 sparticle-system)
(sv-96 vector)
(sv-112 matrix)
(sv-128
(function sparticle-system sparticle-launcher matrix sparticle-launch-state sparticle-launch-control float none)
)
(sv-144 sparticle-system)
(sv-160 vector)
(sv-176 matrix)
(sv-192
(function sparticle-system sparticle-launcher matrix sparticle-launch-state sparticle-launch-control float none)
)
(sv-208 sparticle-system)
(sv-224 vector)
(sv-240 matrix)
)
(let ((s1-0 (the-as sound-name #f)))
(-> *display* frames (-> *display* last-screen) run-time)
(case arg0
@@ -907,18 +869,14 @@
)
)
(when (nonzero? s0-0)
(set! sv-64 sp-launch-particles-var)
(set! sv-80 *sp-particle-system-2d*)
(set! sv-112 *launch-matrix*)
(set! sv-96 (-> sv-112 trans))
(let ((v1-63 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data arg2)) quad)))
(set! (-> sv-96 quad) v1-63)
)
(let ((a3-6 #f)
(t0-1 #f)
(t1-1 1.0)
(let ((sv-64 sp-launch-particles-var)
(sv-80 *sp-particle-system-2d*)
(sv-112 *launch-matrix*)
)
(sv-64 sv-80 s0-0 sv-112 (the-as sparticle-launch-state a3-6) (the-as sparticle-launch-control t0-1) t1-1)
(set! (-> sv-112 trans quad)
(-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data arg2)) quad)
)
(sv-64 sv-80 s0-0 sv-112 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
)
)
@@ -961,18 +919,14 @@
)
)
(when (nonzero? s0-1)
(set! sv-128 sp-launch-particles-var)
(set! sv-144 *sp-particle-system-2d*)
(set! sv-176 *launch-matrix*)
(set! sv-160 (-> sv-176 trans))
(let ((v1-79 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data arg2)) quad)))
(set! (-> sv-160 quad) v1-79)
)
(let ((a3-7 #f)
(t0-2 #f)
(t1-2 1.0)
(let ((sv-128 sp-launch-particles-var)
(sv-144 *sp-particle-system-2d*)
(sv-176 *launch-matrix*)
)
(sv-128 sv-144 s0-1 sv-176 (the-as sparticle-launch-state a3-7) (the-as sparticle-launch-control t0-2) t1-2)
(set! (-> sv-176 trans quad)
(-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data arg2)) quad)
)
(sv-128 sv-144 s0-1 sv-176 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
)
)
@@ -1015,18 +969,14 @@
)
)
(when (nonzero? s0-2)
(set! sv-192 sp-launch-particles-var)
(set! sv-208 *sp-particle-system-2d*)
(set! sv-240 *launch-matrix*)
(set! sv-224 (-> sv-240 trans))
(let ((v1-96 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data arg2)) quad)))
(set! (-> sv-224 quad) v1-96)
)
(let ((a3-8 #f)
(t0-3 #f)
(t1-3 1.0)
(let ((sv-192 sp-launch-particles-var)
(sv-208 *sp-particle-system-2d*)
(sv-240 *launch-matrix*)
)
(sv-192 sv-208 s0-2 sv-240 (the-as sparticle-launch-state a3-8) (the-as sparticle-launch-control t0-3) t1-3)
(set! (-> sv-240 trans quad)
(-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data arg2)) quad)
)
(sv-192 sv-208 s0-2 sv-240 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
)
)
@@ -1043,9 +993,8 @@
;; definition for method 12 of type effect-control
;; INFO: Used lq/sq
(defmethod play-effect-sound ((this effect-control) (arg0 symbol) (arg1 float) (arg2 int) (arg3 basic) (arg4 sound-name))
(local-vars (sv-112 res-tag) (sv-128 sound-name) (sv-144 basic) (sv-160 (function vector vector float)))
(set! sv-144 arg3)
(let ((s0-0 arg4)
(let ((sv-144 arg3)
(s0-0 arg4)
(gp-0 (the-as object (new 'stack 'sound-spec)))
(s5-0 (if (< arg2 0)
(the-as vector #f)
@@ -1057,15 +1006,17 @@
(logior! (-> (the-as sound-spec gp-0) mask) (sound-mask volume))
(set! (-> (the-as sound-spec gp-0) pitch-mod) 0)
(set! (-> (the-as sound-spec gp-0) volume) 1024)
(set! sv-112 (new 'static 'res-tag))
(let* ((t9-2 (method-of-type res-lump get-property-data))
(a1-5 'effect-param)
(a2-1 'exact)
(a3-1 arg1)
(t0-1 #f)
(t1-1 (the-as (pointer res-tag) (& sv-112)))
(t2-0 *res-static-buf*)
(a1-6 (t9-2 (the-as res-lump sv-144) a1-5 a2-1 a3-1 (the-as pointer t0-1) t1-1 t2-0))
(let* ((sv-112 (new 'static 'res-tag))
(a1-6 ((method-of-type res-lump get-property-data)
(the-as res-lump sv-144)
'effect-param
'exact
arg1
(the-as pointer #f)
(& sv-112)
*res-static-buf*
)
)
)
(when a1-6
(effect-param->sound-spec
@@ -1090,22 +1041,16 @@
)
)
(if (or (and (nonzero? (-> (the-as sound-spec gp-0) fo-max))
(let ((f30-0 (* 4096.0 (the float (-> (the-as sound-spec gp-0) fo-max)))))
(set! sv-160 vector-vector-distance)
(let ((a0-8 (ear-trans 0))
(a1-7 s5-0)
)
(< f30-0 (sv-160 a0-8 a1-7))
)
)
(< (* 4096.0 (the float (-> (the-as sound-spec gp-0) fo-max))) (vector-vector-distance (ear-trans 0) s5-0))
)
(= (-> (the-as (pointer int8) gp-0) 9) 126)
)
(return 0)
)
(when *debug-effect-control*
(set! sv-128 s0-0)
(string<-charp (clear *temp-string*) (the-as (pointer uint8) (& sv-128)))
(let ((sv-128 s0-0))
(string<-charp (clear *temp-string*) (the-as (pointer uint8) (& sv-128)))
)
(format
#t
"(~5D) effect sound ~A ~A (~S) frame ~F joint ~D "
+45 -42
View File
@@ -1327,51 +1327,53 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch object vs fact-info.
(defmethod new fact-info ((allocation symbol) (type-to-make type) (arg0 process) (arg1 pickup-type) (arg2 float))
(local-vars (sv-16 fact-info) (sv-20 res-lump) (sv-24 task-mask))
(set! sv-16 (object-new allocation type-to-make (the-as int (-> type-to-make size))))
(set! sv-20 (the-as res-lump (-> arg0 entity)))
(set! sv-24 (process-task-mask arg0))
(when (zero? sv-16)
(go process-drawable-art-error "memory")
(return (the-as fact-info 0))
)
(set! (-> sv-16 process) arg0)
(set! (-> sv-16 pickup-type) arg1)
(set! (-> sv-16 pickup-amount) arg2)
(let ((s4-1 (-> (lookup-tag-idx sv-20 'eco-info 'base -1000000000.0) lo)))
(when (>= (the-as int s4-1) 0)
(let ((s3-0 (the-as int s4-1))
(s2-0 (-> sv-20 tag s4-1))
)
0
(while (= (-> s2-0 name) (-> sv-20 tag s4-1 name))
(let ((v1-17 (make-property-data sv-20 0.0 (the-as res-tag-pair s3-0) (the-as pointer #f)))
(a0-7 (the int (-> s2-0 key-frame)))
)
(when (or (< a0-7 0) (and (-> arg0 entity) (logtest? sv-24 (ash 1 a0-7))))
(when v1-17
(let ((a0-15 (-> s2-0 elt-count)))
(set! (-> sv-16 pickup-type) (the-as pickup-type (-> (the-as (pointer int32) v1-17))))
(set! (-> sv-16 pickup-amount) (if (< (the-as uint 1) a0-15)
(the float (-> (the-as (pointer int32) v1-17) 1))
arg2
)
)
(let ((sv-16 (object-new allocation type-to-make (the-as int (-> type-to-make size)))))
(let ((sv-20 (the-as res-lump (-> arg0 entity))))
(let ((sv-24 (process-task-mask arg0)))
(when (zero? sv-16)
(go process-drawable-art-error "memory")
(return (the-as fact-info 0))
)
(set! (-> sv-16 process) arg0)
(set! (-> sv-16 pickup-type) arg1)
(set! (-> sv-16 pickup-amount) arg2)
(let ((s4-1 (-> (lookup-tag-idx sv-20 'eco-info 'base -1000000000.0) lo)))
(when (>= (the-as int s4-1) 0)
(let ((s3-0 (the-as int s4-1))
(s2-0 (-> sv-20 tag s4-1))
)
0
(while (= (-> s2-0 name) (-> sv-20 tag s4-1 name))
(let ((v1-17 (make-property-data sv-20 0.0 (the-as res-tag-pair s3-0) (the-as pointer #f)))
(a0-7 (the int (-> s2-0 key-frame)))
)
(when (or (< a0-7 0) (and (-> arg0 entity) (logtest? sv-24 (ash 1 a0-7))))
(when v1-17
(let ((a0-15 (-> s2-0 elt-count)))
(set! (-> sv-16 pickup-type) (the-as pickup-type (-> (the-as (pointer int32) v1-17))))
(set! (-> sv-16 pickup-amount) (if (< (the-as uint 1) a0-15)
(the float (-> (the-as (pointer int32) v1-17) 1))
arg2
)
)
)
)
)
)
(+! s3-0 1)
(set! s2-0 (-> sv-20 tag s3-0))
)
)
)
(+! s3-0 1)
(set! s2-0 (-> sv-20 tag s3-0))
)
)
(set! (-> sv-16 options) (res-lump-value sv-20 'options actor-option :time -1000000000.0))
(if (logtest? (-> sv-16 options) (actor-option fade-out respawn-delay))
(set! (-> sv-16 fade-time) (the-as time-frame (the int (* 300.0 (res-lump-float sv-20 'timeout)))))
)
)
(the-as fact-info sv-16)
)
(set! (-> sv-16 options) (res-lump-value sv-20 'options actor-option :time -1000000000.0))
(if (logtest? (-> sv-16 options) (actor-option fade-out respawn-delay))
(set! (-> sv-16 fade-time) (the-as time-frame (the int (* 300.0 (res-lump-float sv-20 'timeout)))))
)
(the-as fact-info sv-16)
)
;; definition for method 11 of type fact-info
@@ -1409,7 +1411,6 @@
(arg2 pickup-type)
(arg3 float)
)
(local-vars (sv-16 res-tag) (sv-32 res-tag))
(let ((gp-0 (the-as fact-info-enemy ((method-of-type fact-info new) allocation type-to-make arg0 arg2 arg3))))
(let ((s5-0 (the-as res-lump (-> gp-0 process entity))))
(set! (-> gp-0 speed) (res-lump-float s5-0 'speed :default 1.0))
@@ -1421,8 +1422,9 @@
(set! (-> gp-0 cam-notice-dist) (res-lump-float s5-0 'cam-notice-dist :default -4096.0))
(set! (-> gp-0 enemy-options) (res-lump-value s5-0 'enemy-options enemy-option :time -1000000000.0))
(let ((s4-1 0))
(set! sv-16 (new 'static 'res-tag))
(let ((v1-11 (res-lump-data s5-0 'trigger pointer :tag-ptr (& sv-16))))
(let* ((sv-16 (new 'static 'res-tag))
(v1-11 (res-lump-data s5-0 'trigger pointer :tag-ptr (& sv-16)))
)
(when v1-11
(logior! (-> gp-0 enemy-options) (enemy-option has-trigger))
(let ((a0-13 0))
@@ -1445,8 +1447,9 @@
)
)
(when (logtest? s4-1 2)
(set! sv-32 (new 'static 'res-tag))
(let ((v1-20 (res-lump-data s5-0 'trig-ag pointer :tag-ptr (& sv-32))))
(let* ((sv-32 (new 'static 'res-tag))
(v1-20 (res-lump-data s5-0 'trig-ag pointer :tag-ptr (& sv-32)))
)
(if (and v1-20 (nonzero? (-> sv-32 elt-count)))
(set! (-> gp-0 trig-actor-group) (the-as (pointer actor-group) v1-20))
(clear-mask-bits gp-0 2)
+312 -199
View File
@@ -299,66 +299,22 @@
;; definition for method 9 of type game-info
;; INFO: Used lq/sq
;; ERROR: Expression building failed: In (method 9 game-info): Expression pass could not find the set-to-run function. Found t9-31 instead. Make sure there are no casts on this function.
(defmethod initialize! ((this game-info) (arg0 symbol) (arg1 game-save) (arg2 string))
(local-vars
(v0-17 object)
(v0-29 process-tree)
(v0-30 continue-point)
(v0-31 none)
(v0-32 game-info)
(v1-0 symbol)
(v1-16 symbol)
(v1-135 symbol)
(v1-154 process)
(v1-157 (pointer process))
(v1-158 type)
(v1-159 int)
(v1-160 (pointer string))
(v1-161 symbol)
(v1-162 type)
(v1-163 process)
(a0-95 process)
(a0-96 game-info)
(a0-97 cpu-thread)
(a0-99 int)
(a0-100 symbol)
(a1-47 process-tree)
(a1-48 (function symbol symbol continue-point game-save none :behavior process))
(a2-11 type)
(a2-12 symbol)
(a2-13 string)
(a2-14 symbol)
(a3-4 int)
(a3-5 symbol)
(t0-3 continue-point)
(t1-3 game-save)
(s0-1 (function symbol symbol continue-point game-save none :behavior process))
(s1-2 cpu-thread)
(s2-2 function)
(s3-2 process)
(s4-1 level-load-info)
(t9-29 (function process process-tree basic pointer process-tree))
(t9-30 (function game-info continue-point))
(t9-31 function)
(t9-32 (function symbol none))
(sv-96 game-task-node-info)
(sv-112 symbol)
)
(cond
((or (= v1-0 'dead) (= v1-0 'life))
(local-vars (v0-3 int))
(case arg0
(('dead 'life)
(+! (-> this total-deaths) 1)
(+! (-> this continue-deaths) 1)
(+! (-> this task-deaths) 1)
(when *target*
(set! s4-1 (-> *target* current-level info))
(set! (-> this deaths-per-level (-> s4-1 task-level))
(the-as uint (seekl (the-as int (-> this deaths-per-level (-> s4-1 task-level))) 255 1))
)
(let ((s4-1 (-> *target* current-level info)))
(set! (-> this deaths-per-level (-> s4-1 task-level))
(the-as uint (seekl (the-as int (-> this deaths-per-level (-> s4-1 task-level))) 255 1))
)
)
)
(set! v1-16 (-> this mode))
(cond
((= v1-16 'play)
(case (-> this mode)
(('play)
(set! arg0 'life)
)
(else
@@ -367,89 +323,248 @@
)
)
)
((= v1-0 'try)
(('try)
(+! (-> this total-trys) 1)
)
)
(cond
((= v1-135 'movie)
(task-node-reset arg0)
(update-task-masks arg0)
)
((= v1-135 'debug)
(reset-actors arg0)
(if arg1
(load-game this arg1)
)
)
((= v1-135 'play)
(when (begin
(if v1-154
(-> v1-154 ppointer)
)
(when s3-2
(set! v1-158 process)
(set! t9-29 (method-of-type process activate))
(set! a0-95 s3-2)
(set! a1-47 *default-pool*)
(set! v1-159 #xff37)
(set! a2-11 process)
(set! a2-12 (-> process symbol))
(set! v1-160 (sym->str-ptr (-> process symbol)))
(set! a2-13 (symbol->string (-> process symbol)))
(set! a3-4 #x70004000)
(call! a0-95 a1-47 a2-13 a3-4)
(set! s2-2 set-to-run)
(set! s1-2 (-> s3-2 main-thread))
(set! s0-1 (lambda :behavior process
((arg0 symbol) (arg1 symbol) (arg2 continue-point) (arg3 game-save))
(set! (-> self mask) (process-mask))
(stop arg0)
(reset-actors arg1)
(close! (-> *game-info* sub-task-list (game-task-node fortress-escape-start)) 'event)
(set-continue! *game-info* arg2 #f)
(when arg3
(load-game *game-info* arg3)
(set! arg2 (get-current-continue-forced *game-info*))
(reset-actors 'life)
(send-event (handle->process (-> *game-info* auto-save-proc)) 'done)
)
(suspend)
(start arg0 arg2)
(none)
)
(case arg0
(('dead 'life 'try)
(let ((s2-0 (level-get-target-inside *level*)))
(when s2-0
(let ((s1-0 (-> *game-info* sub-task-list)))
(dotimes (s0-0 (-> s1-0 length))
(when (nonzero? s0-0)
(let ((sv-96 (-> s1-0 s0-0)))
(if (open? sv-96)
(set! v0-3 (when (and (= (-> s2-0 info taskname) (-> sv-96 level))
(and (or (not (-> sv-96 info)) (handle->process (-> sv-96 info manager)))
(>= (- (-> *display* game-clock frame-counter) (-> this death-time)) (seconds 2))
)
)
(format #t "death count inc for ~S~%" (-> sv-96 name))
(set! v0-3 (seekl (the-as int (-> sv-96 death-count)) #xffff 1))
(set! (-> sv-96 death-count) (the-as uint v0-3))
v0-3
)
)
)
(set! v1-161 (-> this mode))
(set! sv-112 v1-161)
(set! a0-96 this)
(set! v1-162 (-> a0-96 type))
(set! t9-30 (method-of-object a0-96 get-current-continue-forced))
(set! v0-30 (get-current-continue-forced this))
(set! t0-3 v0-30)
(set! t1-3 arg1)
(set! t9-31 s2-2)
(set! a0-97 s1-2)
(set! a1-48 s0-1)
(set! a2-14 sv-112)
(set! a3-5 arg0)
(call! a0-97 a1-48 a2-14 a3-5 t0-3 t1-3)
(set! v1-157 (-> s3-2 ppointer))
)
)
v1-157
)
(set! v1-163 (-> v1-157 0))
(set! (-> v1-163 mask) (the-as process-mask 0))
(set! a0-99 0)
)
)
)
(set! t9-32 set-master-mode)
(set! a0-100 'game)
(set! v0-17 (call! a0-100))
(set! (-> this death-time) (-> *display* game-clock frame-counter))
)
)
(set! v1-164 v0-17)
(kill-current-talker (the-as symbol '()) '() 'die)
(case arg0
(('game)
(+! (-> this task-counter) 1)
(reset! (-> *display* total-game-clock))
(set! (-> this features) (game-feature sidekick))
(set! (-> this debug-features) (game-feature))
(set! (-> this secrets) (game-secrets))
(set! (-> this purchase-secrets) (game-secrets))
(set-continue!
this
(cond
(arg2
(empty)
arg2
)
((demo?)
"demo-start"
)
(*debug-segment*
"game-start"
)
(else
"title-start"
)
)
#f
)
(set! (-> this auto-save-count) 0)
(set! (-> *setting-control* user-default auto-save) #f)
(set! (-> this money) 0.0)
(set! (-> this money-total) 0.0)
(set! (-> this fuel) 0.0)
(set! (-> this buzzer-total) 0.0)
(set! (-> this eco-pill-dark) 0.0)
(set! (-> this eco-pill-dark-total) 0.0)
(set! (-> this gem) 0.0)
(set! (-> this gem-total) 0.0)
(set! (-> this skill) 0.0)
(set! (-> this skill-total) 0.0)
(set! (-> this karma) 0.0)
(set! (-> this perm-list length) 0)
(dotimes (v1-69 (-> this unknown-pad6 allocated-length))
(set! (-> this unknown-pad6 v1-69) (the-as uint 0))
)
(set! (-> this death-movie-tick) (rand-vu-int-count 10))
(set! (-> this gun-type) (pickup-type eco-red))
(set! (-> this gun-ammo 0) (-> *FACT-bank* ammo-yellow-start))
(set! (-> this gun-ammo 1) (-> *FACT-bank* ammo-red-start))
(set! (-> this gun-ammo 2) (-> *FACT-bank* ammo-blue-start))
(set! (-> this gun-ammo 3) (-> *FACT-bank* ammo-dark-start))
(set! (-> this shield) 100.0)
(set! (-> this score) 0.0)
(set! (-> this score-owner) (the-as handle #f))
(set! (-> this goal) 0.0)
(set! (-> this miss) 0.0)
(set! (-> this miss-max) 0.0)
(set! (-> this timer) 0)
(set! (-> this timer-flash) #f)
(set! (-> this timer-owner) (the-as handle #f))
(set! (-> this counter) 0.0)
(set! (-> this counter-flash) #f)
(set! (-> this wanted-flash) #f)
(set! (-> this distance) 0.0)
(set! (-> this attack-id) (the-as uint 2))
(set! (-> this total-trys) 0)
(set! (-> this total-deaths) 0)
(set! (-> this continue-deaths) 0)
(set! (-> this task-deaths) 0)
(set! (-> this death-pos length) 0)
(set! (-> this game-start-time) (-> *display* game-clock frame-counter))
(set! (-> this task-pickup-time) (-> *display* game-clock frame-counter))
(set! (-> this continue-time) (-> *display* game-clock frame-counter))
(set! (-> this death-time) (-> *display* game-clock frame-counter))
(set! (-> this hit-time) (-> *display* game-clock frame-counter))
(dotimes (v1-95 110)
(set! (-> this unknown-array1 0) 0)
(set! (-> this task-close-times 0) 0)
(nop!)
)
(dotimes (v1-98 32)
(set! (-> this money-per-level v1-98) (the-as uint 0))
(set! (-> this deaths-per-level v1-98) (the-as uint 0))
(set! (-> this task-enter-times v1-98) 0)
(set! (-> this task-in-times v1-98) 0)
(set! (-> this level-opened v1-98) (the-as uint 0))
(nop!)
)
(let ((v1-102 (-> *game-info* sub-task-list)))
(dotimes (a0-41 (-> v1-102 length))
(when (nonzero? a0-41)
(let ((a1-16 (-> v1-102 a0-41)))
(set! (-> a1-16 death-count) (the-as uint 0))
(set! (-> a1-16 gem-count) (the-as uint 0))
(set! (-> a1-16 skill-count) (the-as uint 0))
(set! (-> a1-16 close-time) 0)
)
0
)
)
)
(dotimes (v1-105 (-> this game-score length))
(set! (-> this game-score v1-105) 0.0)
)
(dotimes (s3-1 19)
(case s3-1
((4 5 6 7 10 11 12 13 15 14 16 17 18)
(let ((v1-112 (get-game-score-ref this s3-1))
(a0-62 (-> *highscore-info-array* s3-1))
)
(set! (-> v1-112 0) (-> a0-62 gold-score))
(set! (-> v1-112 1) (-> a0-62 silver-score))
(set! (-> v1-112 2) (-> a0-62 bronze-score))
)
)
)
)
(initialize *bigmap*)
)
)
(case arg0
(('game 'try 'life)
(case (-> this mode)
(('play)
(set! *display-profile* #f)
(set! *display-entity-errors* #f)
)
)
(set! (-> this life-max) (-> *GAME-bank* life-max-default))
(set! (-> this life) (-> *GAME-bank* life-start-default))
(set! (-> this gun-ammo 0)
(fmax (-> this gun-ammo 0) (* (you-suck-scale *game-info* #f) (-> *FACT-bank* ammo-yellow-start)))
)
(set! (-> this gun-ammo 1)
(fmax (-> this gun-ammo 1) (* (you-suck-scale *game-info* #f) (-> *FACT-bank* ammo-red-start)))
)
(set! (-> this gun-ammo 2)
(fmax (-> this gun-ammo 2) (* (you-suck-scale *game-info* #f) (-> *FACT-bank* ammo-blue-start)))
)
(set! (-> this gun-ammo 3)
(fmax (-> this gun-ammo 3) (* (you-suck-scale *game-info* #f) (-> *FACT-bank* ammo-dark-start)))
)
)
)
(let ((v1-135 (-> this mode)))
(cond
((= v1-135 'movie)
(task-node-reset arg0)
(update-task-masks arg0)
)
((= v1-135 'debug)
(reset-actors arg0)
(if arg1
(load-game this arg1)
)
)
((= v1-135 'play)
(when *target*
(set-setting *setting-control* *target* 'allow-pause #f 0 0)
(set-setting *setting-control* *target* 'allow-progress #f 0 0)
(set-setting *setting-control* *target* 'allow-continue #f 0 0)
(apply-settings *setting-control*)
)
(send-event (handle->process (-> *game-info* auto-save-proc)) 'die)
(set! (-> *setting-control* user-default border-mode) #f)
(set! (-> *setting-control* user-default region-mode) #f)
(apply-settings *setting-control*)
(set! *spawn-actors* #f)
(set-blackout-frames (seconds 0.1))
(send-event *target* 'reset)
(let ((v1-157 (process-spawn-function
process
(lambda :behavior process
((arg0 symbol) (arg1 symbol) (arg2 continue-point) (arg3 game-save))
(set! (-> self mask) (process-mask))
(stop arg0)
(reset-actors arg1)
(close! (-> *game-info* sub-task-list (game-task-node fortress-escape-start)) 'event)
(set-continue! *game-info* arg2 #f)
(when arg3
(load-game *game-info* arg3)
(set! arg2 (get-current-continue-forced *game-info*))
(reset-actors 'life)
(send-event (handle->process (-> *game-info* auto-save-proc)) 'done)
)
(suspend)
(start arg0 arg2)
(none)
)
(-> this mode)
arg0
(get-current-continue-forced this)
arg1
:from *4k-dead-pool*
)
)
)
(when v1-157
(set! (-> v1-157 0 mask) (process-mask))
0
)
)
(set-master-mode 'game)
)
)
)
(label cfg-131)
(set! v0-32 this)
(ret-value v0-32)
this
)
;; definition for method 10 of type game-info
@@ -1285,18 +1400,7 @@
;; definition for method 18 of type game-info
;; INFO: Used lq/sq
(defmethod debug-inspect ((this game-info) (arg0 symbol))
(local-vars
(sv-16 int)
(sv-24 int)
(sv-32 int)
(sv-40 int)
(sv-48 int)
(sv-56 int)
(sv-64 string)
(sv-80 string)
(sv-96 string)
(sv-112 string)
)
(local-vars (sv-96 string) (sv-112 string))
(inspect this)
(when (or (not arg0) (= arg0 'game-task))
(format #t "~Tgame-task:~%")
@@ -1307,48 +1411,50 @@
)
(while (>= (the-as uint s3-0) (the-as uint s4-0))
(when (task-complete? this (the-as game-task s4-0))
(set! sv-16 0)
(set! sv-24 0)
(set! sv-32 0)
(set! sv-40 0)
(set! sv-48 0)
(set! sv-56 0)
(let ((game-subtasks (-> *game-info* sub-task-list)))
(dotimes (i (-> game-subtasks length))
(when (nonzero? i)
(let ((subtasks (-> game-subtasks i)))
(when (= (-> subtasks task) s4-0)
(when (zero? sv-24)
(set! sv-24 (the-as int (-> subtasks close-time)))
(set! sv-16 (the-as int (-> subtasks close-time)))
)
(when (logtest? (-> subtasks flags) (game-task-node-flag closed))
(set! sv-32 (the-as int (-> subtasks close-time)))
(set! sv-40 (the-as int (-> subtasks gem-count)))
(set! sv-48 (the-as int (-> subtasks skill-count)))
)
(set! sv-56 (+ sv-56 (-> subtasks death-count)))
(if (logtest? (-> subtasks flags) (game-task-node-flag close-task))
(goto cfg-19)
(let ((sv-16 0)
(sv-24 0)
(sv-32 0)
(sv-40 0)
(sv-48 0)
(sv-56 0)
)
(let ((game-subtasks (-> *game-info* sub-task-list)))
(dotimes (i (-> game-subtasks length))
(when (nonzero? i)
(let ((subtasks (-> game-subtasks i)))
(when (= (-> subtasks task) s4-0)
(when (zero? sv-24)
(set! sv-24 (the-as int (-> subtasks close-time)))
(set! sv-16 (the-as int (-> subtasks close-time)))
)
(when (logtest? (-> subtasks flags) (game-task-node-flag closed))
(set! sv-32 (the-as int (-> subtasks close-time)))
(set! sv-40 (the-as int (-> subtasks gem-count)))
(set! sv-48 (the-as int (-> subtasks skill-count)))
)
(+! sv-56 (-> subtasks death-count))
(if (logtest? (-> subtasks flags) (game-task-node-flag close-task))
(goto cfg-19)
)
)
)
)
)
)
)
(label cfg-19)
(if (nonzero? (-> this task-close-times s4-0))
(set! sv-24 (max sv-24 (-> this task-close-times s4-0)))
(label cfg-19)
(if (nonzero? (-> this task-close-times s4-0))
(set! sv-24 (max sv-24 (-> this task-close-times s4-0)))
)
(format
#t
"~T~T~-32S ~6,,1f min ~6,,1f min ~3d ~3d ~3d~%"
(game-task->string (the-as game-task s4-0))
(* 0.000055555556 (the float (- sv-24 sv-16)))
(* 0.000055555556 (the float (- sv-32 sv-24)))
sv-56
sv-40
sv-48
)
(format
#t
"~T~T~-32S ~6,,1f min ~6,,1f min ~3d ~3d ~3d~%"
(game-task->string (the-as game-task s4-0))
(* 0.000055555556 (the float (- sv-24 sv-16)))
(* 0.000055555556 (the float (- sv-32 sv-24)))
sv-56
sv-40
sv-48
)
)
(+! s4-0 1)
@@ -1359,30 +1465,37 @@
(let ((s4-1 (-> *game-info* sub-task-list)))
(dotimes (s3-1 (-> s4-1 length))
(when (nonzero? s3-1)
(let ((s2-1 (-> s4-1 s3-1))
(s1-1 format)
(s0-1 #t)
)
(set! sv-64 "~-55S ~-16S ~S ~A~%")
(set! sv-80 (-> s2-1 name))
(cond
((logtest? (-> s2-1 flags) (game-task-node-flag closed))
(set! sv-96 "closed")
)
((open? s2-1)
(set! sv-96 "open")
)
(else
(set! sv-96 "inactive")
)
)
(if (task-complete? *game-info* (-> s2-1 task))
(set! sv-112 "res")
(set! sv-112 " ")
)
(let ((t1-1 (lookup-text! *common-text* (-> s2-1 description) #f)))
(s1-1 s0-1 sv-64 sv-80 sv-96 sv-112 t1-1)
)
(let* ((s2-1 (-> s4-1 s3-1))
(s1-1 format)
(s0-1 #t)
(sv-64 "~-55S ~-16S ~S ~A~%")
(sv-80 (-> s2-1 name))
)
(set! sv-96 (cond
((logtest? (-> s2-1 flags) (game-task-node-flag closed))
(set! sv-96 "closed")
sv-96
)
((open? s2-1)
(set! sv-96 "open")
sv-96
)
(else
"inactive"
)
)
)
(set! sv-112 (cond
((task-complete? *game-info* (-> s2-1 task))
(set! sv-112 "res")
sv-112
)
(else
" "
)
)
)
(s1-1 s0-1 sv-64 sv-80 sv-96 sv-112 (lookup-text! *common-text* (-> s2-1 description) #f))
)
)
)
+19 -34
View File
@@ -359,7 +359,6 @@
;; definition for method 11 of type game-save
;; INFO: Used lq/sq
(defmethod debug-inspect ((this game-save) (arg0 symbol))
(local-vars (sv-16 int) (sv-32 string) (sv-48 string))
(format #t "[~8x] ~A~%" this (-> this type))
(format #t "~Tversion: ~D~%" (-> this version))
(format #t "~Tallocated-length: ~D~%" (-> this allocated-length))
@@ -385,19 +384,15 @@
(s3-0 0)
)
(while (< (the-as int s4-0) (the-as int (&-> this tag 0 user-int8 (-> this length))))
(let ((s2-0 format)
(s1-0 #t)
(s0-0 "~T [~3D] ~-32S [~3D/~3D] ~12D ~8f ")
)
(set! sv-16 s3-0)
(let ((a3-2 (game-save-elt->string (-> (the-as (inline-array game-save-tag) s4-0) 0 elt-type)))
(t0-1 (-> (the-as (inline-array game-save-tag) s4-0) 0 elt-count))
(t1-1 (-> (the-as (inline-array game-save-tag) s4-0) 0 elt-size))
(t2-1 (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))
(t3-0 (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0))
)
(s2-0 s1-0 s0-0 sv-16 a3-2 t0-1 t1-1 t2-1 t3-0)
)
(format
#t
"~T [~3D] ~-32S [~3D/~3D] ~12D ~8f "
s3-0
(game-save-elt->string (-> (the-as (inline-array game-save-tag) s4-0) 0 elt-type))
(-> (the-as (inline-array game-save-tag) s4-0) 0 elt-count)
(-> (the-as (inline-array game-save-tag) s4-0) 0 elt-size)
(-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64)
(-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)
)
(let ((v1-0 (-> (the-as (inline-array game-save-tag) s4-0) 0 elt-type)))
(if (or (= v1-0 (game-save-elt name)) (= v1-0 (game-save-elt continue)))
@@ -409,31 +404,21 @@
(case (-> (the-as (inline-array game-save-tag) s4-0) 0 elt-type)
(((game-save-elt node-death-count) (game-save-elt node-skill-count) (game-save-elt node-gem-count))
(dotimes (s2-1 (-> (the-as (inline-array game-save-tag) s4-0) 0 elt-count))
(let ((s1-1 format)
(s0-1 #t)
)
(set! sv-32 " ~-32S: ~D~%")
(let ((a2-15 (game-task-node->string (the-as game-task-node s2-1)))
(a3-3 (-> (the-as (inline-array game-save-tag) s4-0) 1 user-uint16 s2-1))
)
(s1-1 s0-1 sv-32 a2-15 a3-3)
)
(format
#t
" ~-32S: ~D~%"
(game-task-node->string (the-as game-task-node s2-1))
(-> (the-as (inline-array game-save-tag) s4-0) 1 user-uint16 s2-1)
)
)
)
(((game-save-elt node-close-time))
(dotimes (s2-2 (-> (the-as (inline-array game-save-tag) s4-0) 0 elt-count))
(let ((s1-2 format)
(s0-2 #t)
)
(set! sv-48 " ~-32S: ~D~%")
(let ((a2-16 (game-task-node->string (the-as game-task-node s2-2)))
(a3-4
(-> (the-as (pointer uint64) (+ (the-as uint (-> (the-as (inline-array game-save-tag) s4-0) 1)) (* s2-2 8))))
)
)
(s1-2 s0-2 sv-48 a2-16 a3-4)
)
(format
#t
" ~-32S: ~D~%"
(game-task-node->string (the-as game-task-node s2-2))
(-> (the-as (pointer uint64) (+ (the-as uint (-> (the-as (inline-array game-save-tag) s4-0) 1)) (* s2-2 8))))
)
)
)
+12 -16
View File
@@ -169,16 +169,14 @@ or collectable items on the ground (jetboard / weapon upgrades / etc)"
(when (< (-> this rod-of-god-scale) 0.0)
(set! (-> this rod-of-god-scale) 0.0)
(set! (-> this moving) #f)
(let ((f0-15 81920.0))
(cond
((< (* f0-15 f0-15) (vector-vector-xz-distance-squared (-> this pos) (-> this root trans)))
(kill-callback (-> *minimap* engine) (-> this minimap))
(set! (-> this root trans quad) (-> this pos quad))
(set! (-> this minimap) (add-icon! *minimap* this (-> this map-icon) (the-as int #f) (the-as vector #t) 0))
)
(else
(set! (-> this root trans quad) (-> this pos quad))
)
(cond
((< (square 81920.0) (vector-vector-xz-distance-squared (-> this pos) (-> this root trans)))
(kill-callback (-> *minimap* engine) (-> this minimap))
(set! (-> this root trans quad) (-> this pos quad))
(set! (-> this minimap) (add-icon! *minimap* this (-> this map-icon) (the-as int #f) (the-as vector #t) 0))
)
(else
(set! (-> this root trans quad) (-> this pos quad))
)
)
)
@@ -227,12 +225,10 @@ or collectable items on the ground (jetboard / weapon upgrades / etc)"
(if (logtest? (-> self flags) (task-arrow-flags task-arrow-flag-03))
(task-arrow-method-23 self (-> self pos))
)
(let ((f0-0 4096.0))
(when (< (* f0-0 f0-0) (vector-vector-xz-distance-squared (-> self pos) (-> self root trans)))
(set! v0-2 #t)
(set! (-> self moving) (the-as symbol v0-2))
v0-2
)
(when (< (square 4096.0) (vector-vector-xz-distance-squared (-> self pos) (-> self root trans)))
(set! v0-2 #t)
(set! (-> self moving) (the-as symbol v0-2))
v0-2
)
)
(('leave)
+74 -80
View File
@@ -50,21 +50,6 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod debug-draw ((this cylinder) (arg0 vector4w))
(local-vars
(sv-896 matrix)
(sv-912 vector)
(sv-928 vector)
(sv-944 vector)
(sv-960 vector)
(sv-976 vector)
(sv-992 vector)
(sv-1008 vector)
(sv-1024 vector)
(sv-1040 vector)
(sv-1056 vector)
(sv-1072 vector)
(sv-1088 vector)
)
(rlet ((acc :class vf)
(vf0 :class vf)
(vf1 :class vf)
@@ -89,76 +74,85 @@
(s3-0 (new 'stack-no-clear 'matrix))
)
(matrix-axis-angle! s3-0 (-> this axis) 4096.0)
(set! sv-896 (new 'stack-no-clear 'matrix))
(vector-matrix*! (the-as vector sv-896) (-> this origin) s3-0)
(let ((v1-6 (-> s3-0 trans)))
(.lvf vf4 (&-> (-> this origin) quad))
(.lvf vf5 (&-> sv-896 quad 0))
(.mov.vf.w vf6 vf0)
(.sub.vf.xyz vf6 vf4 vf5)
(.svf (&-> v1-6 quad) vf6)
(let ((sv-896 (new 'stack-no-clear 'matrix)))
(vector-matrix*! (the-as vector sv-896) (-> this origin) s3-0)
(let ((v1-6 (-> s3-0 trans)))
(.lvf vf4 (&-> (-> this origin) quad))
(.lvf vf5 (&-> sv-896 quad 0))
(.mov.vf.w vf6 vf0)
(.sub.vf.xyz vf6 vf4 vf5)
(.svf (&-> v1-6 quad) vf6)
)
)
(dotimes (v1-7 8)
(vector+! (-> s5-0 vert (+ v1-7 8)) (-> this origin) s1-0)
(vector+float*! (-> s5-0 vert (+ v1-7 8)) (-> s5-0 vert (+ v1-7 8)) s0-0 (the float v1-7))
)
(dotimes (s0-1 8)
(set! sv-944 (-> s5-0 vert s0-1))
(set! sv-912 (-> this origin))
(set! sv-928 s1-0)
(let ((f0-8 (cos (* 2048.0 (the float (- 7 s0-1))))))
(.lvf vf2 (&-> sv-928 quad))
(.lvf vf1 (&-> sv-912 quad))
(let ((v1-19 f0-8))
(.mov vf3 v1-19)
(let ((sv-944 (-> s5-0 vert s0-1)))
(let ((sv-912 (-> this origin))
(sv-928 s1-0)
(f0-8 (cos (* 2048.0 (the float (- 7 s0-1)))))
)
(.lvf vf2 (&-> sv-928 quad))
(.lvf vf1 (&-> sv-912 quad))
(let ((v1-19 f0-8))
(.mov vf3 v1-19)
)
)
(.add.x.vf.w vf4 vf0 vf0)
(.mul.x.vf acc vf2 vf3)
(.add.mul.w.vf.xyz vf4 vf1 vf0 acc)
(.svf (&-> sv-944 quad) vf4)
)
(.add.x.vf.w vf4 vf0 vf0)
(.mul.x.vf acc vf2 vf3)
(.add.mul.w.vf.xyz vf4 vf1 vf0 acc)
(.svf (&-> sv-944 quad) vf4)
(set! sv-992 (-> s5-0 vert s0-1))
(set! sv-960 (-> s5-0 vert s0-1))
(set! sv-976 (-> this axis))
(let ((f0-13 (* (- (-> this radius)) (sin (* 2048.0 (the float (- 7 s0-1)))))))
(.lvf vf2 (&-> sv-976 quad))
(.lvf vf1 (&-> sv-960 quad))
(let ((v1-33 f0-13))
(.mov vf3 v1-33)
(let ((sv-992 (-> s5-0 vert s0-1)))
(let ((sv-960 (-> s5-0 vert s0-1))
(sv-976 (-> this axis))
(f0-13 (* (- (-> this radius)) (sin (* 2048.0 (the float (- 7 s0-1))))))
)
(.lvf vf2 (&-> sv-976 quad))
(.lvf vf1 (&-> sv-960 quad))
(let ((v1-33 f0-13))
(.mov vf3 v1-33)
)
)
(.add.x.vf.w vf4 vf0 vf0)
(.mul.x.vf acc vf2 vf3)
(.add.mul.w.vf.xyz vf4 vf1 vf0 acc)
(.svf (&-> sv-992 quad) vf4)
)
(.add.x.vf.w vf4 vf0 vf0)
(.mul.x.vf acc vf2 vf3)
(.add.mul.w.vf.xyz vf4 vf1 vf0 acc)
(.svf (&-> sv-992 quad) vf4)
(set! sv-1040 (-> s5-0 vert (+ s0-1 16)))
(set! sv-1008 (-> this origin))
(set! sv-1024 s1-0)
(let ((f0-16 (cos (* 2048.0 (the float s0-1)))))
(.lvf vf2 (&-> sv-1024 quad))
(.lvf vf1 (&-> sv-1008 quad))
(let ((v1-43 f0-16))
(.mov vf3 v1-43)
(let ((sv-1040 (-> s5-0 vert (+ s0-1 16))))
(let ((sv-1008 (-> this origin))
(sv-1024 s1-0)
(f0-16 (cos (* 2048.0 (the float s0-1))))
)
(.lvf vf2 (&-> sv-1024 quad))
(.lvf vf1 (&-> sv-1008 quad))
(let ((v1-43 f0-16))
(.mov vf3 v1-43)
)
)
(.add.x.vf.w vf4 vf0 vf0)
(.mul.x.vf acc vf2 vf3)
(.add.mul.w.vf.xyz vf4 vf1 vf0 acc)
(.svf (&-> sv-1040 quad) vf4)
)
(.add.x.vf.w vf4 vf0 vf0)
(.mul.x.vf acc vf2 vf3)
(.add.mul.w.vf.xyz vf4 vf1 vf0 acc)
(.svf (&-> sv-1040 quad) vf4)
(set! sv-1088 (-> s5-0 vert (+ s0-1 16)))
(set! sv-1056 (-> s5-0 vert (+ s0-1 16)))
(set! sv-1072 (-> this axis))
(let ((f0-21 (+ (-> this length) (* (-> this radius) (sin (* 2048.0 (the float s0-1)))))))
(.lvf vf2 (&-> sv-1072 quad))
(.lvf vf1 (&-> sv-1056 quad))
(let ((v1-57 f0-21))
(.mov vf3 v1-57)
(let ((sv-1088 (-> s5-0 vert (+ s0-1 16))))
(let ((sv-1056 (-> s5-0 vert (+ s0-1 16)))
(sv-1072 (-> this axis))
(f0-21 (+ (-> this length) (* (-> this radius) (sin (* 2048.0 (the float s0-1))))))
)
(.lvf vf2 (&-> sv-1072 quad))
(.lvf vf1 (&-> sv-1056 quad))
(let ((v1-57 f0-21))
(.mov vf3 v1-57)
)
)
(.add.x.vf.w vf4 vf0 vf0)
(.mul.x.vf acc vf2 vf3)
(.add.mul.w.vf.xyz vf4 vf1 vf0 acc)
(.svf (&-> sv-1088 quad) vf4)
)
(.add.x.vf.w vf4 vf0 vf0)
(.mul.x.vf acc vf2 vf3)
(.add.mul.w.vf.xyz vf4 vf1 vf0 acc)
(.svf (&-> sv-1088 quad) vf4)
)
(dotimes (s2-1 16)
(dotimes (s1-1 24)
@@ -255,7 +249,6 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod debug-draw ((this cylinder-flat) (arg0 vector4w))
(local-vars (sv-448 vector))
(rlet ((vf0 :class vf)
(vf4 :class vf)
(vf5 :class vf)
@@ -276,14 +269,15 @@
(s3-0 (new 'stack-no-clear 'matrix))
)
(matrix-axis-angle! s3-0 (-> this axis) 4096.0)
(set! sv-448 (new 'stack-no-clear 'vector))
(vector-matrix*! sv-448 (-> this origin) s3-0)
(let ((v1-6 (-> s3-0 trans)))
(.lvf vf4 (&-> (-> this origin) quad))
(.lvf vf5 (&-> sv-448 quad))
(.mov.vf.w vf6 vf0)
(.sub.vf.xyz vf6 vf4 vf5)
(.svf (&-> v1-6 quad) vf6)
(let ((sv-448 (new 'stack-no-clear 'vector)))
(vector-matrix*! sv-448 (-> this origin) s3-0)
(let ((v1-6 (-> s3-0 trans)))
(.lvf vf4 (&-> (-> this origin) quad))
(.lvf vf5 (&-> sv-448 quad))
(.mov.vf.w vf6 vf0)
(.sub.vf.xyz vf6 vf4 vf5)
(.svf (&-> v1-6 quad) vf6)
)
)
(dotimes (v1-7 8)
(vector+! (-> s5-0 vert (+ v1-7 1)) (-> this origin) s1-0)
+21 -60
View File
@@ -265,11 +265,7 @@
)
)
)
(let ((f0-6 (vector-vector-distance-squared s5-0 arg0))
(f1-4 (-> arg0 w))
)
(< f0-6 (* f1-4 f1-4))
)
(< (vector-vector-distance-squared s5-0 arg0) (square (-> arg0 w)))
)
)
@@ -531,9 +527,7 @@
"Create a rotation matrix representing the rotation between two vectors."
(let* ((a1-3 (vector-normalize! (vector-cross! (new-stack-vector0) arg2 arg1) 1.0))
(f0-1 (vector-dot arg1 arg2))
(f1-0 1.0)
(f2-0 f0-1)
(f1-2 (sqrtf (- f1-0 (* f2-0 f2-0))))
(f1-2 (sqrtf (- 1.0 (square f0-1))))
)
(matrix-axis-sin-cos! arg0 a1-3 f1-2 f0-1)
)
@@ -548,21 +542,10 @@
(f30-0 (vector-dot arg1 arg2))
(f28-0 (cos arg3))
)
(cond
((< f30-0 f28-0)
(matrix-axis-sin-cos! arg0 s4-1 (sin arg3) f28-0)
)
(else
(let ((t9-5 matrix-axis-sin-cos!)
(a0-6 arg0)
(a1-4 s4-1)
(f0-1 1.0)
(f1-0 f30-0)
)
(t9-5 a0-6 a1-4 (sqrtf (- f0-1 (* f1-0 f1-0))) f30-0)
)
(if (< f30-0 f28-0)
(matrix-axis-sin-cos! arg0 s4-1 (sin arg3) f28-0)
(matrix-axis-sin-cos! arg0 s4-1 (sqrtf (- 1.0 (square f30-0))) f30-0)
)
)
)
)
@@ -616,21 +599,10 @@
(f30-0 (cos arg3))
(f0-2 (+ 1.0 (* (+ -1.0 f28-0) arg4)))
)
(cond
((< f0-2 f30-0)
(matrix-axis-sin-cos! arg0 s4-1 (sin arg3) f30-0)
)
(else
(let ((t9-5 matrix-axis-sin-cos!)
(a0-6 arg0)
(a1-4 s4-1)
(f1-3 1.0)
(f2-1 f0-2)
)
(t9-5 a0-6 a1-4 (sqrtf (- f1-3 (* f2-1 f2-1))) f0-2)
)
(if (< f0-2 f30-0)
(matrix-axis-sin-cos! arg0 s4-1 (sin arg3) f30-0)
(matrix-axis-sin-cos! arg0 s4-1 (sqrtf (- 1.0 (square f0-2))) f0-2)
)
)
)
)
@@ -646,13 +618,8 @@
(matrix-identity! arg0)
)
(else
(let* ((f0-4 (cos (* arg3 (acos f0-1))))
(t9-5 matrix-axis-sin-cos!)
(a0-6 arg0)
(f1-1 1.0)
(f2-1 f0-4)
)
(t9-5 a0-6 gp-1 (sqrtf (- f1-1 (* f2-1 f2-1))) f0-4)
(let ((f0-4 (cos (* arg3 (acos f0-1)))))
(matrix-axis-sin-cos! arg0 gp-1 (sqrtf (- 1.0 (square f0-4))) f0-4)
)
)
)
@@ -770,7 +737,6 @@
;; INFO: Used lq/sq
(defun vector-vector-deg-slerp! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float) (arg4 vector))
"Unused. No clue what this does."
(local-vars (sv-112 (function float float float float)))
(cond
((>= 0.0 arg3)
(set! (-> arg0 quad) (-> arg1 quad))
@@ -784,15 +750,11 @@
(s0-1 (forward-up->quaternion (new 'stack-no-clear 'quaternion) s0-0 arg4))
(a2-5 (forward-up->quaternion (new 'stack-no-clear 'quaternion) s1-0 arg4))
(a1-6 (quaternion-slerp! (new 'stack-no-clear 'quaternion) s0-1 a2-5 arg3))
(s2-1 vector-normalize-copy!)
(s1-1 arg0)
(s0-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) a1-6))
)
(set! sv-112 lerp)
(let ((s3-1 (vector-length arg1))
(a1-7 (vector-length arg2))
)
(s2-1 s1-1 s0-2 (sv-112 s3-1 a1-7 arg3))
(vector-normalize-copy!
arg0
(vector-z-quaternion! (new 'stack-no-clear 'vector) a1-6)
(lerp (vector-length arg1) (vector-length arg2) arg3)
)
)
)
@@ -1124,7 +1086,7 @@
(f8-0 (fabs f2-1))
)
(nop!)
(let ((f7-1 (* f1-1 f1-1)))
(let ((f7-1 (square f1-1)))
(nop!)
(let ((f6-2 (- f6-1 f8-0)))
(b! (nonzero? a0-1) cfg-2 :delay (set! f8-1 (*.s f2-1 f2-1)))
@@ -1141,14 +1103,14 @@
(f12-0 (* f6-3 f0-1))
(f10-0 (* f0-1 f2-1))
(f11-0 (* f3-0 f2-1))
(f9-0 (* f0-1 f0-1))
(f9-0 (square f0-1))
(f12-1 (* f12-0 f3-0))
)
(.mula.s f3-0 f3-0)
(.madda.s f4-0 f4-0)
(.msub.s f3-1 f5-0 f5-0)
(let* ((f5-1 (* f12-1 f1-2))
(f12-2 (* f1-2 f1-2))
(f12-2 (square f1-2))
(f11-1 (* f11-0 f1-2))
(f10-1 (* f10-0 f12-2))
(f8-2 (* f8-1 f12-2))
@@ -1212,14 +1174,14 @@
(f12-3 (* f6-6 f0-1))
(f10-3 (* f0-1 f1-1))
(f11-2 (* f4-0 f1-1))
(f9-2 (* f0-1 f0-1))
(f9-2 (square f0-1))
(f12-4 (* f12-3 f4-0))
)
(.mula.s f4-0 f4-0)
(.madda.s f3-0 f3-0)
(.msub.s f4-5 f5-0 f5-0)
(let* ((f5-11 (* f12-4 f2-5))
(f12-5 (* f2-5 f2-5))
(f12-5 (square f2-5))
(f11-3 (* f11-2 f2-5))
(f10-4 (* f10-3 f12-5))
(f7-5 (* f7-1 f12-5))
@@ -1676,9 +1638,8 @@
;; WARN: Stack slot offset 48 signed mismatch
(defun curve-closest-point ((arg0 curve) (arg1 vector) (arg2 float) (arg3 float) (arg4 int) (arg5 float))
"Get the input value for the point on the curve. Approximate! And is O(n_knots)."
(local-vars (sv-48 float))
(set! sv-48 arg3)
(let ((s3-0 arg4)
(let ((sv-48 arg3)
(s3-0 arg4)
(gp-0 arg5)
(f30-0 (curve-length arg0))
(s2-0 (new 'stack-no-clear 'vector))
+5 -11
View File
@@ -96,9 +96,9 @@ These path-controls are typically allocated on a process heap."
(must-exist symbol)
)
"Allocate a new path-control, set up the curve to point to the specified lump data."
(local-vars (v0-3 object) (sv-16 res-tag) (sv-32 float))
(set! sv-32 lump-time)
(let ((s0-0 lump-actor)
(local-vars (v0-3 object))
(let ((sv-32 lump-time)
(s0-0 lump-actor)
(s1-0 must-exist)
)
(if (not s0-0)
@@ -112,14 +112,8 @@ These path-controls are typically allocated on a process heap."
)
)
(let ((s2-0 (the-as object 0)))
(set! sv-16 (new 'static 'res-tag))
(let* ((t9-1 (method-of-type res-lump get-property-data))
(a1-2 lump-name)
(a2-2 'interp)
(t0-1 #f)
(t1-1 (the-as (pointer res-tag) (& sv-16)))
(t2-1 *res-static-buf*)
(s0-1 (t9-1 s0-0 a1-2 a2-2 sv-32 (the-as pointer t0-1) t1-1 t2-1))
(let* ((sv-16 (new 'static 'res-tag))
(s0-1 (res-lump-data s0-0 lump-name pointer :tag-ptr (& sv-16) :time sv-32))
)
(cond
(s0-1
+119 -116
View File
@@ -45,140 +45,143 @@
;; WARN: Stack slot offset 148 signed mismatch
;; WARN: Stack slot offset 148 signed mismatch
(defmethod plane-volume-method-9 ((this plane-volume) (arg0 symbol) (arg1 vector-array) (arg2 vector-array))
(local-vars
(sv-144 vector)
(sv-148 number)
(sv-152 int)
(sv-160 vector)
(sv-176 vector)
(sv-192 vector)
(sv-208 vector)
(sv-224 vector)
(sv-240 int)
(sv-256 int)
)
(set! (-> this volume-type) arg0)
(set! (-> this point-count) 0)
(set! (-> this first-point) (the-as (pointer vector) (-> arg1 data (-> arg1 length))))
(set! (-> this normal-count) 0)
(set! (-> this first-normal) (the-as (pointer vector) (-> arg2 data (-> arg2 length))))
(dotimes (s3-0 (-> this num-planes))
(set! sv-176 (new 'stack-no-clear 'vector))
(set! (-> sv-176 quad) (the-as uint128 0))
(set! sv-192 (new 'stack-no-clear 'vector))
(set! (-> sv-192 quad) (the-as uint128 0))
(set! sv-208 (new 'stack-no-clear 'vector))
(set! (-> sv-208 quad) (the-as uint128 0))
(set! sv-224 (new 'stack-no-clear 'vector))
(set! (-> sv-224 quad) (the-as uint128 0))
0.0
0.0
0.0
(set! (-> (new 'stack-no-clear 'vector) quad) (the-as uint128 0))
(let ((s1-0 (new-stack-vector0))
(s0-0 0)
(s2-0 (-> this plane))
)
(set! sv-240 0)
(while (< sv-240 (-> this num-planes))
(when (!= s3-0 sv-240)
(vector-float*! sv-176 (the-as vector (-> s2-0 sv-240)) (-> s2-0 sv-240 w))
(vector-cross! sv-192 (the-as vector (-> s2-0 sv-240)) (the-as vector (-> s2-0 s3-0)))
(vector-normalize! sv-192 1.0)
(vector-cross! sv-208 sv-192 (the-as vector (-> s2-0 sv-240)))
(vector-normalize! sv-208 1.0)
(let ((f0-4 (plane-volume-intersect-dist (-> s2-0 s3-0) sv-176 sv-208)))
(when (!= f0-4 409600000.0)
(vector+float*! sv-224 sv-176 sv-208 f0-4)
(set! sv-144 (new-stack-vector0))
(set! sv-148 0.0)
(set! sv-152 0)
(set! sv-160 (new-stack-vector0))
(set! (-> sv-144 quad) (-> sv-224 quad))
(set! sv-256 0)
(while (< sv-256 (-> this num-planes))
(when (and (!= sv-256 s3-0) (!= sv-256 sv-240))
(let ((f0-6 (plane-volume-intersect-dist (-> s2-0 sv-256) sv-144 sv-192)))
(cond
((= f0-6 409600000.0)
)
((zero? sv-152)
(vector+float*! sv-144 sv-144 sv-192 f0-6)
(set! (-> sv-160 quad) (-> s2-0 sv-256 quad))
(set! sv-148 8192000.0)
(set! sv-152 1)
)
((begin (vector-float*! sv-224 sv-192 f0-6) (>= (vector-dot sv-224 sv-160) 0.0))
)
((>= (vector-dot sv-224 (the-as vector (-> s2-0 sv-256))) 0.0)
(when (< (fabs f0-6) (fabs (the-as float sv-148)))
(set! sv-148 f0-6)
(set! sv-152 (+ sv-152 1))
)
)
(else
(vector+float*! sv-144 sv-144 sv-192 f0-6)
(set! (-> sv-160 quad) (-> s2-0 sv-256 quad))
(set! sv-152 (+ sv-152 1))
(if (< (fabs f0-6) (fabs (the-as float sv-148)))
(set! sv-148 (- (the-as float sv-148) f0-6))
(set! sv-148 0.0)
(let ((sv-176 (new 'stack-no-clear 'vector)))
(set! (-> sv-176 quad) (the-as uint128 0))
(let ((sv-192 (new 'stack-no-clear 'vector)))
(set! (-> sv-192 quad) (the-as uint128 0))
(let ((sv-208 (new 'stack-no-clear 'vector)))
(set! (-> sv-208 quad) (the-as uint128 0))
(let ((sv-224 (new 'stack-no-clear 'vector)))
(set! (-> sv-224 quad) (the-as uint128 0))
0.0
0.0
0.0
(set! (-> (new 'stack-no-clear 'vector) quad) (the-as uint128 0))
(let ((s1-0 (new-stack-vector0))
(s0-0 0)
(s2-0 (-> this plane))
)
(let ((sv-240 0))
(while (< sv-240 (-> this num-planes))
(when (!= s3-0 sv-240)
(vector-float*! sv-176 (the-as vector (-> s2-0 sv-240)) (-> s2-0 sv-240 w))
(vector-cross! sv-192 (the-as vector (-> s2-0 sv-240)) (the-as vector (-> s2-0 s3-0)))
(vector-normalize! sv-192 1.0)
(vector-cross! sv-208 sv-192 (the-as vector (-> s2-0 sv-240)))
(vector-normalize! sv-208 1.0)
(let ((f0-4 (plane-volume-intersect-dist (-> s2-0 s3-0) sv-176 sv-208)))
(when (!= f0-4 409600000.0)
(vector+float*! sv-224 sv-176 sv-208 f0-4)
(let ((sv-144 (new-stack-vector0))
(sv-148 0.0)
(sv-152 0)
)
(let ((sv-160 (new-stack-vector0)))
(set! (-> sv-144 quad) (-> sv-224 quad))
(let ((sv-256 0))
(while (< sv-256 (-> this num-planes))
(when (and (!= sv-256 s3-0) (!= sv-256 sv-240))
(let ((f0-6 (plane-volume-intersect-dist (-> s2-0 sv-256) sv-144 sv-192)))
(cond
((= f0-6 409600000.0)
)
((zero? sv-152)
(vector+float*! sv-144 sv-144 sv-192 f0-6)
(set! (-> sv-160 quad) (-> s2-0 sv-256 quad))
(set! sv-148 8192000.0)
(set! sv-152 1)
)
((begin (vector-float*! sv-224 sv-192 f0-6) (>= (vector-dot sv-224 sv-160) 0.0))
)
((>= (vector-dot sv-224 (the-as vector (-> s2-0 sv-256))) 0.0)
(when (< (fabs f0-6) (fabs (the-as float sv-148)))
(set! sv-148 f0-6)
(+! sv-152 1)
)
)
(else
(vector+float*! sv-144 sv-144 sv-192 f0-6)
(set! (-> sv-160 quad) (-> s2-0 sv-256 quad))
(+! sv-152 1)
(set! sv-148 (cond
((< (fabs f0-6) (fabs (the-as float sv-148)))
(set! sv-148 (- (the-as float sv-148) f0-6))
sv-148
)
(else
0.0
)
)
)
)
)
)
)
(+! sv-256 1)
)
)
)
(cond
((zero? sv-152)
)
((= (the-as float sv-148) 0.0)
)
(else
(dotimes (v1-79 (-> this num-planes))
(when (and (!= v1-79 s3-0) (!= v1-79 sv-240))
(if (< 4096.0 (- (vector-dot sv-144 (the-as vector (-> s2-0 v1-79))) (-> s2-0 v1-79 w)))
(goto cfg-42)
)
)
)
(vector+float*! sv-224 sv-144 sv-192 (the-as float sv-148))
(cond
((< (-> arg1 allocated-length) (+ (-> arg1 length) 2))
(format 0 "ERROR <AG>: vol-control #x~X out of volume points~%" this)
)
(else
(set! (-> arg1 data (-> arg1 length) quad) (-> sv-144 quad))
(set! (-> arg1 data (+ (-> arg1 length) 1) quad) (-> sv-224 quad))
(+! (-> arg1 length) 2)
(+! (-> this point-count) 2)
)
)
(vector+! s1-0 s1-0 sv-144)
(vector+! s1-0 s1-0 sv-224)
(+! s0-0 2)
)
)
)
)
)
)
(label cfg-42)
(+! sv-240 1)
)
(set! sv-256 (+ sv-256 1))
)
(cond
((zero? sv-152)
)
((= (the-as float sv-148) 0.0)
)
(else
(dotimes (v1-79 (-> this num-planes))
(when (and (!= v1-79 s3-0) (!= v1-79 sv-240))
(if (< 4096.0 (- (vector-dot sv-144 (the-as vector (-> s2-0 v1-79))) (-> s2-0 v1-79 w)))
(goto cfg-42)
)
)
(when (nonzero? s0-0)
(vector-float*! s1-0 s1-0 (/ 1.0 (the float s0-0)))
(cond
((< (-> arg2 allocated-length) (+ (-> arg2 length) 2))
(format 0 "ERROR <AG>: vol-control #x~X out of volume normals~%" this)
)
(else
(set! (-> arg2 data (-> arg2 length) quad) (-> s1-0 quad))
(set! (-> arg2 data (+ (-> arg2 length) 1) quad) (-> s2-0 s3-0 quad))
(+! (-> arg2 length) 2)
(set! (-> this normal-count) (+ (-> this normal-count) 2))
)
(vector+float*! sv-224 sv-144 sv-192 (the-as float sv-148))
(cond
((< (-> arg1 allocated-length) (+ (-> arg1 length) 2))
(format 0 "ERROR <AG>: vol-control #x~X out of volume points~%" this)
)
(else
(set! (-> arg1 data (-> arg1 length) quad) (-> sv-144 quad))
(set! (-> arg1 data (+ (-> arg1 length) 1) quad) (-> sv-224 quad))
(+! (-> arg1 length) 2)
(+! (-> this point-count) 2)
)
)
(vector+! s1-0 s1-0 sv-144)
(vector+! s1-0 s1-0 sv-224)
(+! s0-0 2)
)
)
)
)
)
(label cfg-42)
(set! sv-240 (+ sv-240 1))
)
(when (nonzero? s0-0)
(vector-float*! s1-0 s1-0 (/ 1.0 (the float s0-0)))
(cond
((< (-> arg2 allocated-length) (+ (-> arg2 length) 2))
(format 0 "ERROR <AG>: vol-control #x~X out of volume normals~%" this)
)
(else
(set! (-> arg2 data (-> arg2 length) quad) (-> s1-0 quad))
(set! (-> arg2 data (+ (-> arg2 length) 1) quad) (-> s2-0 s3-0 quad))
(+! (-> arg2 length) 2)
(set! (-> this normal-count) (+ (-> this normal-count) 2))
)
)
)
)
)
+110 -114
View File
@@ -29,7 +29,6 @@
;; definition for function draw-drawable-tree-tfrag
;; WARN: Return type mismatch drawable-tree-tfrag vs none.
(defun draw-drawable-tree-tfrag ((arg0 drawable-tree-tfrag))
(local-vars (sv-16 int))
(when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask tfrag))
(let ((s5-0 (+ (-> arg0 length) -1)))
(when (nonzero? s5-0)
@@ -53,126 +52,125 @@
(let* ((v1-14 (-> arg0 arrays s5-0))
(s4-1 (&+ v1-14 32))
(s3-0 (-> v1-14 length))
(sv-16 (+ (/ (-> s4-1 id) 8) #x38a0 #x70000000))
(s5-1 (-> *display* frames (-> *display* on-screen) global-buf base))
)
(set! sv-16 (+ (/ (-> s4-1 id) 8) #x38a0 #x70000000))
(let ((s5-1 (-> *display* frames (-> *display* on-screen) global-buf base)))
(let* ((s1-0 (-> *display* frames (-> *display* on-screen) global-buf))
(s2-0 (-> s1-0 base))
)
(set! (-> *tfrag-work* wait-to-spr) (the-as uint 0))
(set! (-> *tfrag-work* wait-from-spr) (the-as uint 0))
(set! (-> *tfrag-work* texture-dists) (the-as uint (-> *level* draw-level *draw-index* bsp tfrag-closest)))
(set! (-> *tfrag-work* last-call) (the-as uint 0))
(draw-inline-array-tfrag (the-as pointer sv-16) s4-1 s3-0 s1-0)
(set! (-> *level* draw-level *draw-index* tfrag-last-calls 0) (the-as int (-> *tfrag-work* last-call)))
(update-wait-stats
(-> *perf-stats* data 42)
(the-as uint 0)
(-> *tfrag-work* wait-to-spr)
(-> *tfrag-work* wait-from-spr)
(let* ((s1-0 (-> *display* frames (-> *display* on-screen) global-buf))
(s2-0 (-> s1-0 base))
)
(set! (-> *tfrag-work* wait-to-spr) (the-as uint 0))
(set! (-> *tfrag-work* wait-from-spr) (the-as uint 0))
(set! (-> *tfrag-work* texture-dists) (the-as uint (-> *level* draw-level *draw-index* bsp tfrag-closest)))
(set! (-> *tfrag-work* last-call) (the-as uint 0))
(draw-inline-array-tfrag (the-as pointer sv-16) s4-1 s3-0 s1-0)
(set! (-> *level* draw-level *draw-index* tfrag-last-calls 0) (the-as int (-> *tfrag-work* last-call)))
(update-wait-stats
(-> *perf-stats* data 42)
(the-as uint 0)
(-> *tfrag-work* wait-to-spr)
(-> *tfrag-work* wait-from-spr)
)
(let ((a3-3 (-> s1-0 base)))
(let ((v1-46 (the-as dma-packet (-> s1-0 base))))
(set! (-> v1-46 dma) (new 'static 'dma-tag :id (dma-tag-id next)))
(set! (-> v1-46 vif0) (new 'static 'vif-tag))
(set! (-> v1-46 vif1) (new 'static 'vif-tag))
(set! (-> s1-0 base) (the-as pointer (&+ v1-46 16)))
)
(let ((a3-3 (-> s1-0 base)))
(let ((v1-46 (the-as dma-packet (-> s1-0 base))))
(set! (-> v1-46 dma) (new 'static 'dma-tag :id (dma-tag-id next)))
(set! (-> v1-46 vif0) (new 'static 'vif-tag))
(set! (-> v1-46 vif1) (new 'static 'vif-tag))
(set! (-> s1-0 base) (the-as pointer (&+ v1-46 16)))
)
(let ((t9-3 dma-bucket-insert-tag)
(a0-22 (-> *display* frames (-> *display* on-screen) bucket-group))
(v1-53 *draw-index*)
)
(t9-3
a0-22
(cond
((zero? v1-53)
(bucket-id tfrag-l0-tfrag)
)
((= v1-53 1)
(bucket-id tfrag-l1-tfrag)
)
((= v1-53 2)
(bucket-id tfrag-l2-tfrag)
)
((= v1-53 3)
(bucket-id tfrag-l3-tfrag)
)
((= v1-53 4)
(bucket-id tfrag-l4-tfrag)
)
(else
(bucket-id tfrag-l5-tfrag)
)
)
s2-0
(the-as (pointer dma-tag) a3-3)
(let ((t9-3 dma-bucket-insert-tag)
(a0-22 (-> *display* frames (-> *display* on-screen) bucket-group))
(v1-53 *draw-index*)
)
(t9-3
a0-22
(cond
((zero? v1-53)
(bucket-id tfrag-l0-tfrag)
)
((= v1-53 1)
(bucket-id tfrag-l1-tfrag)
)
((= v1-53 2)
(bucket-id tfrag-l2-tfrag)
)
((= v1-53 3)
(bucket-id tfrag-l3-tfrag)
)
((= v1-53 4)
(bucket-id tfrag-l4-tfrag)
)
(else
(bucket-id tfrag-l5-tfrag)
)
)
s2-0
(the-as (pointer dma-tag) a3-3)
)
)
)
(let* ((s1-1 (-> *display* frames (-> *display* on-screen) global-buf))
(s2-1 (-> s1-1 base))
)
(set! (-> *tfrag-work* near-wait-to-spr) (the-as uint 0))
(set! (-> *tfrag-work* near-wait-from-spr) (the-as uint 0))
(set! (-> *tfrag-work* last-call) (the-as uint 0))
(draw-inline-array-tfrag-scissor (the-as pointer sv-16) s4-1 s3-0 s1-1)
(set! (-> *level* draw-level *draw-index* tfrag-last-calls 1) (the-as int (-> *tfrag-work* last-call)))
(update-wait-stats
(-> *perf-stats* data 43)
(the-as uint 0)
(-> *tfrag-work* near-wait-to-spr)
(-> *tfrag-work* near-wait-from-spr)
)
(let* ((s1-1 (-> *display* frames (-> *display* on-screen) global-buf))
(s2-1 (-> s1-1 base))
)
(set! (-> *tfrag-work* near-wait-to-spr) (the-as uint 0))
(set! (-> *tfrag-work* near-wait-from-spr) (the-as uint 0))
(set! (-> *tfrag-work* last-call) (the-as uint 0))
(draw-inline-array-tfrag-scissor (the-as pointer sv-16) s4-1 s3-0 s1-1)
(set! (-> *level* draw-level *draw-index* tfrag-last-calls 1) (the-as int (-> *tfrag-work* last-call)))
(update-wait-stats
(-> *perf-stats* data 43)
(the-as uint 0)
(-> *tfrag-work* near-wait-to-spr)
(-> *tfrag-work* near-wait-from-spr)
)
(let ((a3-6 (-> s1-1 base)))
(let ((v1-70 (the-as dma-packet (-> s1-1 base))))
(set! (-> v1-70 dma) (new 'static 'dma-tag :id (dma-tag-id next)))
(set! (-> v1-70 vif0) (new 'static 'vif-tag))
(set! (-> v1-70 vif1) (new 'static 'vif-tag))
(set! (-> s1-1 base) (the-as pointer (&+ v1-70 16)))
)
(let ((a3-6 (-> s1-1 base)))
(let ((v1-70 (the-as dma-packet (-> s1-1 base))))
(set! (-> v1-70 dma) (new 'static 'dma-tag :id (dma-tag-id next)))
(set! (-> v1-70 vif0) (new 'static 'vif-tag))
(set! (-> v1-70 vif1) (new 'static 'vif-tag))
(set! (-> s1-1 base) (the-as pointer (&+ v1-70 16)))
)
(let ((t9-6 dma-bucket-insert-tag)
(a0-32 (-> *display* frames (-> *display* on-screen) bucket-group))
(v1-77 *draw-index*)
)
(t9-6
a0-32
(cond
((zero? v1-77)
(bucket-id tfrag-s-l0-tfrag)
)
((= v1-77 1)
(bucket-id tfrag-s-l1-tfrag)
)
((= v1-77 2)
(bucket-id tfrag-s-l2-tfrag)
)
((= v1-77 3)
(bucket-id tfrag-s-l3-tfrag)
)
((= v1-77 4)
(bucket-id tfrag-s-l4-tfrag)
)
(else
(bucket-id tfrag-s-l5-tfrag)
)
)
s2-1
(the-as (pointer dma-tag) a3-6)
(let ((t9-6 dma-bucket-insert-tag)
(a0-32 (-> *display* frames (-> *display* on-screen) bucket-group))
(v1-77 *draw-index*)
)
(t9-6
a0-32
(cond
((zero? v1-77)
(bucket-id tfrag-s-l0-tfrag)
)
((= v1-77 1)
(bucket-id tfrag-s-l1-tfrag)
)
((= v1-77 2)
(bucket-id tfrag-s-l2-tfrag)
)
((= v1-77 3)
(bucket-id tfrag-s-l3-tfrag)
)
((= v1-77 4)
(bucket-id tfrag-s-l4-tfrag)
)
(else
(bucket-id tfrag-s-l5-tfrag)
)
)
s2-1
(the-as (pointer dma-tag) a3-6)
)
)
)
(let ((v1-78 *dma-mem-usage*))
(when (nonzero? v1-78)
(set! (-> v1-78 length) (max 2 (-> v1-78 length)))
(set! (-> v1-78 data 1 name) "tfragment")
(+! (-> v1-78 data 1 count) 1)
(+! (-> v1-78 data 1 used)
(&- (-> *display* frames (-> *display* on-screen) global-buf base) (the-as uint s5-1))
)
(set! (-> v1-78 data 1 total) (-> v1-78 data 1 used))
)
)
(let ((v1-78 *dma-mem-usage*))
(when (nonzero? v1-78)
(set! (-> v1-78 length) (max 2 (-> v1-78 length)))
(set! (-> v1-78 data 1 name) "tfragment")
(+! (-> v1-78 data 1 count) 1)
(+! (-> v1-78 data 1 used)
(&- (-> *display* frames (-> *display* on-screen) global-buf base) (the-as uint s5-1))
)
(set! (-> v1-78 data 1 total) (-> v1-78 data 1 used))
)
)
)
@@ -184,7 +182,6 @@
;; definition for function draw-drawable-tree-tfrag-trans
;; WARN: Return type mismatch drawable-tree-tfrag vs none.
(defun draw-drawable-tree-tfrag-trans ((arg0 drawable-tree-tfrag))
(local-vars (sv-16 int))
(when (logtest? (vu1-renderer-mask tfrag-trans) (-> *display* vu1-enable-user))
(let ((s5-0 (+ (-> arg0 length) -1)))
(when (nonzero? s5-0)
@@ -208,8 +205,8 @@
(let* ((v1-13 (-> arg0 arrays s5-0))
(s5-1 (&+ v1-13 32))
(s4-1 (-> v1-13 length))
(sv-16 (+ (/ (-> s5-1 id) 8) #x38a0 #x70000000))
)
(set! sv-16 (+ (/ (-> s5-1 id) 8) #x38a0 #x70000000))
(let* ((s2-0 (-> *display* frames (-> *display* on-screen) global-buf))
(s3-0 (-> s2-0 base))
)
@@ -326,7 +323,6 @@
;; definition for function draw-drawable-tree-tfrag-water
;; WARN: Return type mismatch drawable-tree-tfrag vs none.
(defun draw-drawable-tree-tfrag-water ((arg0 drawable-tree-tfrag))
(local-vars (sv-16 int))
(when (logtest? (vu1-renderer-mask tfrag-water) (-> *display* vu1-enable-user))
(let ((s5-0 (+ (-> arg0 length) -1)))
(when (nonzero? s5-0)
@@ -350,8 +346,8 @@
(let* ((v1-13 (-> arg0 arrays s5-0))
(s5-1 (&+ v1-13 32))
(s4-1 (-> v1-13 length))
(sv-16 (+ (/ (-> s5-1 id) 8) #x38a0 #x70000000))
)
(set! sv-16 (+ (/ (-> s5-1 id) 8) #x38a0 #x70000000))
(let* ((s2-0 (-> *display* frames (-> *display* on-screen) global-buf))
(s3-0 (-> s2-0 base))
)
+15 -23
View File
@@ -630,22 +630,18 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch symbol vs none.
(defun-debug tie-ints ()
(local-vars (sv-16 uint))
(let ((gp-0 (+ #x3da0 #x1100c000)))
(dotimes (s5-0 16)
(if (< s5-0 10)
(format 0 " ")
)
(let ((s4-0 format)
(s3-0 0)
(s2-0 "vi~d: ~6d #x~4,'0X ~s~%")
(s1-0 s5-0)
(s0-0 (-> (the-as (pointer uint32) (+ gp-0 (* (* s5-0 4) 4))) 0))
)
(set! sv-16 (-> (the-as (pointer uint32) (+ gp-0 (* (* s5-0 4) 4))) 0))
(let ((t1-0 (tie-int-reg s5-0)))
(s4-0 s3-0 s2-0 s1-0 s0-0 sv-16 t1-0)
)
(format
0
"vi~d: ~6d #x~4,'0X ~s~%"
s5-0
(-> (the-as (pointer uint32) (+ gp-0 (* (* s5-0 4) 4))) 0)
(-> (the-as (pointer uint32) (+ gp-0 (* (* s5-0 4) 4))) 0)
(tie-int-reg s5-0)
)
)
)
@@ -656,7 +652,6 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch symbol vs none.
(defun-debug tie-floats ()
(local-vars (sv-16 uint) (sv-32 uint))
(let ((gp-0 (the-as (pointer uint32) (+ #x3da0 #x1100c000))))
(dotimes (s5-0 32)
(if (< s5-0 10)
@@ -671,17 +666,14 @@
(-> gp-0 (+ (* s5-0 4) 2))
(-> gp-0 (+ (* s5-0 4) 3))
)
(let ((s4-0 format)
(s3-0 0)
(s2-0 "~F ~F ~F ~F ~s~%")
(s1-0 (-> gp-0 (* s5-0 4)))
(s0-0 (-> gp-0 (+ (* s5-0 4) 1)))
)
(set! sv-16 (-> gp-0 (+ (* s5-0 4) 2)))
(set! sv-32 (-> gp-0 (+ (* s5-0 4) 3)))
(let ((t2-1 (tie-float-reg s5-0)))
(s4-0 s3-0 s2-0 s1-0 s0-0 sv-16 sv-32 t2-1)
)
(format
0
"~F ~F ~F ~F ~s~%"
(-> gp-0 (* s5-0 4))
(-> gp-0 (+ (* s5-0 4) 1))
(-> gp-0 (+ (* s5-0 4) 2))
(-> gp-0 (+ (* s5-0 4) 3))
(tie-float-reg s5-0)
)
)
)
+4 -8
View File
@@ -70,7 +70,6 @@
;; WARN: Stack slot offset 16 signed mismatch
;; WARN: Stack slot offset 16 signed mismatch
(defun render-eyes-32 ((arg0 dma-buffer) (arg1 eye-control) (arg2 int))
(local-vars (sv-16 float))
(let ((s4-0 32)
(s3-0 (+ (* arg2 32) 32))
(s2-0 (* arg2 32))
@@ -78,8 +77,8 @@
(let ((f28-0 (* 16.0 (+ (the float (+ s4-0 16)) (* 32.0 (-> arg1 left x)))))
(f26-0 (* 16.0 (+ (the float (+ s3-0 16)) (* 32.0 (-> arg1 left y)))))
(f30-0 (* 16.0 (+ (the float (+ s4-0 48)) (* 32.0 (-> arg1 right x)))))
(sv-16 (* 16.0 (+ (the float (+ s3-0 16)) (* 32.0 (-> arg1 right y)))))
)
(set! sv-16 (* 16.0 (+ (the float (+ s3-0 16)) (* 32.0 (-> arg1 right y)))))
(let ((s1-0 (-> arg1 shaders 0)))
(let ((v1-14 (the-as object (-> arg0 base))))
(set! (-> (the-as dma-gif-packet v1-14) dma-vif quad) (-> *eye-work* adgif-tmpl dma-vif quad))
@@ -294,7 +293,6 @@
;; WARN: Stack slot offset 16 signed mismatch
;; WARN: Stack slot offset 16 signed mismatch
(defun render-eyes-32-different ((arg0 dma-buffer) (arg1 eye-control) (arg2 int))
(local-vars (sv-16 float))
(let ((s4-0 32)
(s3-0 (+ (* arg2 32) 32))
(s2-0 (* arg2 32))
@@ -302,8 +300,8 @@
(let ((f28-0 (* 16.0 (+ (the float (+ s4-0 16)) (* 32.0 (-> arg1 left x)))))
(f26-0 (* 16.0 (+ (the float (+ s3-0 16)) (* 32.0 (-> arg1 left y)))))
(f30-0 (* 16.0 (+ (the float (+ s4-0 48)) (* 32.0 (-> arg1 right x)))))
(sv-16 (* 16.0 (+ (the float (+ s3-0 16)) (* 32.0 (-> arg1 right y)))))
)
(set! sv-16 (* 16.0 (+ (the float (+ s3-0 16)) (* 32.0 (-> arg1 right y)))))
(let ((s1-0 (-> arg1 shaders 0)))
(let ((v1-14 (the-as object (-> arg0 base))))
(set! (-> (the-as dma-gif-packet v1-14) dma-vif quad) (-> *eye-work* adgif-tmpl dma-vif quad))
@@ -575,7 +573,6 @@
;; WARN: Stack slot offset 16 signed mismatch
;; WARN: Stack slot offset 16 signed mismatch
(defun render-eyes-64 ((arg0 dma-buffer) (arg1 eye-control) (arg2 int))
(local-vars (sv-16 float))
(let ((s4-0 64)
(s3-0 (+ (* arg2 64) 64))
(s2-0 (* arg2 64))
@@ -583,8 +580,8 @@
(let ((f28-0 (* 16.0 (+ (the float (+ s4-0 32)) (* 64.0 (-> arg1 left x)))))
(f26-0 (* 16.0 (+ (the float (+ s3-0 32)) (* 64.0 (-> arg1 left y)))))
(f30-0 (* 16.0 (+ (the float (+ s4-0 96)) (* 64.0 (-> arg1 right x)))))
(sv-16 (* 16.0 (+ (the float (+ s3-0 32)) (* 64.0 (-> arg1 right y)))))
)
(set! sv-16 (* 16.0 (+ (the float (+ s3-0 32)) (* 64.0 (-> arg1 right y)))))
(let ((s1-0 (-> arg1 shaders 0)))
(let ((v1-14 (the-as object (-> arg0 base))))
(set! (-> (the-as dma-gif-packet v1-14) dma-vif quad) (-> *eye-work* adgif-tmpl dma-vif quad))
@@ -799,7 +796,6 @@
;; WARN: Stack slot offset 16 signed mismatch
;; WARN: Stack slot offset 16 signed mismatch
(defun render-eyes-64-different ((arg0 dma-buffer) (arg1 eye-control) (arg2 int))
(local-vars (sv-16 float))
(let ((s4-0 64)
(s3-0 (+ (* arg2 64) 64))
(s2-0 (* arg2 64))
@@ -807,8 +803,8 @@
(let ((f28-0 (* 16.0 (+ (the float (+ s4-0 32)) (* 64.0 (-> arg1 left x)))))
(f26-0 (* 16.0 (+ (the float (+ s3-0 32)) (* 64.0 (-> arg1 left y)))))
(f30-0 (* 16.0 (+ (the float (+ s4-0 96)) (* 64.0 (-> arg1 right x)))))
(sv-16 (* 16.0 (+ (the float (+ s3-0 32)) (* 64.0 (-> arg1 right y)))))
)
(set! sv-16 (* 16.0 (+ (the float (+ s3-0 32)) (* 64.0 (-> arg1 right y)))))
(let ((s1-0 (-> arg1 shaders 0)))
(let ((v1-14 (the-as object (-> arg0 base))))
(set! (-> (the-as dma-gif-packet v1-14) dma-vif quad) (-> *eye-work* adgif-tmpl dma-vif quad))
+354 -359
View File
@@ -37,12 +37,12 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defun lightning-fractal-gen ((arg0 (inline-array vector)) (arg1 int) (arg2 int) (arg3 float) (arg4 lightning-spec))
(local-vars (sv-16 vector) (sv-32 vector))
(when (< 1 (- arg2 arg1))
(let ((s1-0 (/ (+ arg1 arg2) 2)))
(set! sv-16 (-> arg0 arg1))
(set! sv-32 (-> arg0 arg2))
(let ((s0-0 (-> arg0 s1-0)))
(let ((sv-16 (-> arg0 arg1))
(sv-32 (-> arg0 arg2))
(s0-0 (-> arg0 s1-0))
)
(let* ((f30-0 (* 0.5 (+ (-> sv-16 x) (-> sv-32 x))))
(f28-0 arg3)
(f26-0 -0.5)
@@ -80,7 +80,6 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defun lightning-uniform-gen ((arg0 (inline-array vector)) (arg1 int) (arg2 int) (arg3 float) (arg4 lightning-spec))
(local-vars (sv-32 vector))
(let ((s4-0 (-> arg0 arg1))
(s3-0 (-> arg0 arg2))
(f30-0 (/ 1.0 (the float (- arg2 arg1))))
@@ -91,29 +90,30 @@
)
(while (>= s0-0 s1-0)
(vector-lerp! (-> arg0 s1-0) s4-0 s3-0 f28-0)
(set! sv-32 s2-0)
(let* ((f26-0 0.4)
(f24-0 -0.5)
(v1-7 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-8 (the-as number (logior #x3f800000 v1-7)))
)
(set! (-> sv-32 x) (* f26-0 (+ f24-0 (+ -1.0 (the-as float v1-8))) arg3))
(let ((sv-32 s2-0))
(let* ((f26-0 0.4)
(f24-0 -0.5)
(v1-7 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-8 (the-as number (logior #x3f800000 v1-7)))
)
(set! (-> sv-32 x) (* f26-0 (+ f24-0 (+ -1.0 (the-as float v1-8))) arg3))
)
(let* ((f26-1 0.4)
(f24-1 -0.5)
(v1-13 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-14 (the-as number (logior #x3f800000 v1-13)))
)
(set! (-> sv-32 y) (* f26-1 (+ f24-1 (+ -1.0 (the-as float v1-14))) arg3))
)
(let* ((f26-2 0.4)
(f24-2 -0.5)
(v1-19 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-20 (the-as number (logior #x3f800000 v1-19)))
)
(set! (-> sv-32 z) (* f26-2 (+ f24-2 (+ -1.0 (the-as float v1-20))) arg3))
)
(set! (-> sv-32 w) 1.0)
)
(let* ((f26-1 0.4)
(f24-1 -0.5)
(v1-13 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-14 (the-as number (logior #x3f800000 v1-13)))
)
(set! (-> sv-32 y) (* f26-1 (+ f24-1 (+ -1.0 (the-as float v1-14))) arg3))
)
(let* ((f26-2 0.4)
(f24-2 -0.5)
(v1-19 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-20 (the-as number (logior #x3f800000 v1-19)))
)
(set! (-> sv-32 z) (* f26-2 (+ f24-2 (+ -1.0 (the-as float v1-20))) arg3))
)
(set! (-> sv-32 w) 1.0)
(vector+! (-> arg0 s1-0) (-> arg0 s1-0) s2-0)
(+! f28-0 f30-0)
(+! s1-0 1)
@@ -167,7 +167,6 @@
(arg4 float)
(arg5 lightning-spec)
)
(local-vars (sv-80 vector) (sv-96 vector) (sv-112 vector) (sv-128 vector) (sv-144 vector))
(rlet ((vf0 :class vf)
(vf4 :class vf)
(vf5 :class vf)
@@ -176,78 +175,83 @@
(init-vf0-vector)
(when (< 1 (- arg3 arg2))
(let ((s0-0 (/ (+ arg2 arg3) 2)))
(set! sv-96 (new 'stack-no-clear 'vector))
(let ((v1-5 (-> arg0 arg2))
(a0-3 (-> arg1 arg2))
)
(.lvf vf4 (&-> v1-5 quad))
(.lvf vf5 (&-> a0-3 quad))
)
(.mov.vf.w vf6 vf0)
(.sub.vf.xyz vf6 vf4 vf5)
(.svf (&-> sv-96 quad) vf6)
(set! sv-112 (new 'stack-no-clear 'vector))
(let ((v1-9 (-> arg0 arg3))
(a0-5 (-> arg1 arg3))
)
(.lvf vf4 (&-> v1-9 quad))
(.lvf vf5 (&-> a0-5 quad))
)
(.mov.vf.w vf6 vf0)
(.sub.vf.xyz vf6 vf4 vf5)
(.svf (&-> sv-112 quad) vf6)
(set! sv-144 (new 'stack-no-clear 'vector))
(set! sv-128 (new 'stack-no-clear 'vector))
(set! sv-80 sv-144)
(let* ((f30-0 arg4)
(f28-0 -0.5)
(v1-15 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-16 (the-as number (logior #x3f800000 v1-15)))
)
(set! (-> sv-80 x) (* f30-0 (+ f28-0 (+ -1.0 (the-as float v1-16)))))
)
(let* ((f30-1 arg4)
(f28-1 -0.5)
(v1-20 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-21 (the-as number (logior #x3f800000 v1-20)))
)
(set! (-> sv-80 y) (* f30-1 (+ f28-1 (+ -1.0 (the-as float v1-21)))))
)
(let* ((f30-2 arg4)
(f28-2 -0.5)
(v1-25 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-26 (the-as number (logior #x3f800000 v1-25)))
)
(set! (-> sv-80 z) (* f30-2 (+ f28-2 (+ -1.0 (the-as float v1-26)))))
)
(set! (-> sv-80 w) 1.0)
(let ((v1-31 sv-128)
(a0-15 sv-128)
)
(let ((sv-96 (new 'stack-no-clear 'vector)))
(let ((v1-5 (-> arg0 arg2))
(a0-3 (-> arg1 arg2))
)
(.lvf vf4 (&-> v1-5 quad))
(.lvf vf5 (&-> a0-3 quad))
)
(.mov.vf.w vf6 vf0)
(.lvf vf4 (&-> sv-96 quad))
(.lvf vf5 (&-> sv-112 quad))
(.add.vf.xyz vf6 vf4 vf5)
(.svf (&-> a0-15 quad) vf6)
(vector-float*! v1-31 a0-15 0.5)
)
(let ((v1-33 sv-144))
(let ((a0-16 sv-144))
(.sub.vf.xyz vf6 vf4 vf5)
(.svf (&-> sv-96 quad) vf6)
(let ((sv-112 (new 'stack-no-clear 'vector)))
(let ((v1-9 (-> arg0 arg3))
(a0-5 (-> arg1 arg3))
)
(.lvf vf4 (&-> v1-9 quad))
(.lvf vf5 (&-> a0-5 quad))
)
(.mov.vf.w vf6 vf0)
(.lvf vf4 (&-> a0-16 quad))
(.sub.vf.xyz vf6 vf4 vf5)
(.svf (&-> sv-112 quad) vf6)
(let ((sv-144 (new 'stack-no-clear 'vector)))
(let ((sv-128 (new 'stack-no-clear 'vector)))
(let ((sv-80 sv-144))
(let* ((f30-0 arg4)
(f28-0 -0.5)
(v1-15 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-16 (the-as number (logior #x3f800000 v1-15)))
)
(set! (-> sv-80 x) (* f30-0 (+ f28-0 (+ -1.0 (the-as float v1-16)))))
)
(let* ((f30-1 arg4)
(f28-1 -0.5)
(v1-20 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-21 (the-as number (logior #x3f800000 v1-20)))
)
(set! (-> sv-80 y) (* f30-1 (+ f28-1 (+ -1.0 (the-as float v1-21)))))
)
(let* ((f30-2 arg4)
(f28-2 -0.5)
(v1-25 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-26 (the-as number (logior #x3f800000 v1-25)))
)
(set! (-> sv-80 z) (* f30-2 (+ f28-2 (+ -1.0 (the-as float v1-26)))))
)
(set! (-> sv-80 w) 1.0)
)
(let ((v1-31 sv-128)
(a0-15 sv-128)
)
(.mov.vf.w vf6 vf0)
(.lvf vf4 (&-> sv-96 quad))
(.lvf vf5 (&-> sv-112 quad))
(.add.vf.xyz vf6 vf4 vf5)
(.svf (&-> a0-15 quad) vf6)
(vector-float*! v1-31 a0-15 0.5)
)
(let ((v1-33 sv-144))
(let ((a0-16 sv-144))
(.mov.vf.w vf6 vf0)
(.lvf vf4 (&-> a0-16 quad))
)
(.lvf vf5 (&-> sv-128 quad))
(.add.vf.xyz vf6 vf4 vf5)
(.svf (&-> v1-33 quad) vf6)
)
)
(let ((v1-35 (-> arg0 s0-0)))
(let ((a0-19 (-> arg1 s0-0)))
(.mov.vf.w vf6 vf0)
(.lvf vf4 (&-> a0-19 quad))
)
(.lvf vf5 (&-> sv-144 quad))
(.add.vf.xyz vf6 vf4 vf5)
(.svf (&-> v1-35 quad) vf6)
)
)
)
(.lvf vf5 (&-> sv-128 quad))
(.add.vf.xyz vf6 vf4 vf5)
(.svf (&-> v1-33 quad) vf6)
)
(let ((v1-35 (-> arg0 s0-0)))
(let ((a0-19 (-> arg1 s0-0)))
(.mov.vf.w vf6 vf0)
(.lvf vf4 (&-> a0-19 quad))
)
(.lvf vf5 (&-> sv-144 quad))
(.add.vf.xyz vf6 vf4 vf5)
(.svf (&-> v1-35 quad) vf6)
)
(lightning-trail-fractal-gen arg0 arg1 arg2 s0-0 (* arg4 (-> arg5 reduction)) arg5)
(lightning-trail-fractal-gen arg0 arg1 s0-0 arg3 (* arg4 (-> arg5 reduction)) arg5)
@@ -347,7 +351,7 @@
;; definition for function lightning-fade
(defbehavior lightning-fade process ((arg0 lightning-control))
(local-vars (v0-1 int) (sv-16 rgba))
(local-vars (v0-1 int))
(let ((f0-0 (-> arg0 spec fade-time)))
(-> arg0 process 0 clock)
(cond
@@ -356,8 +360,8 @@
(let ((gp-0 (-> arg0 state)))
(let* ((s5-0 (-> arg0 spec))
(f30-0 (fmax 0.0 (fmin 1.0 (* (- 1.0 (/ (-> gp-0 counter) f0-0)) (-> s5-0 fade-start-factor)))))
(sv-16 (-> s5-0 fade-to-color))
)
(set! sv-16 (-> s5-0 fade-to-color))
(set! (-> gp-0 start-color) (rgba-lerp sv-16 (-> s5-0 start-color) (the-as rgba f30-0)))
(set! v0-1 (the-as int (rgba-lerp sv-16 (-> s5-0 end-color) (the-as rgba f30-0))))
)
@@ -391,24 +395,16 @@
;; definition for function lightning-update
;; INFO: Used lq/sq
(defun lightning-update ((arg0 lightning-control))
(local-vars
(sv-16 lightning-spec)
(sv-20 vector-array)
(sv-24 vector-array)
(sv-28 vector-array)
(sv-32 symbol)
(sv-36 clock)
)
(let* ((gp-0 (-> arg0 state points-to-draw))
(s4-0 (+ gp-0 -1))
(s5-0 (-> arg0 state))
(sv-16 (-> arg0 spec))
(sv-20 (-> s5-0 line))
(sv-24 (-> s5-0 meet))
(sv-28 (-> s5-0 path))
(sv-32 (= (-> s5-0 mode) (lightning-mode lm1)))
(sv-36 (-> arg0 process 0 clock))
)
(set! sv-16 (-> arg0 spec))
(set! sv-20 (-> s5-0 line))
(set! sv-24 (-> s5-0 meet))
(set! sv-28 (-> s5-0 path))
(set! sv-32 (= (-> s5-0 mode) (lightning-mode lm1)))
(set! sv-36 (-> arg0 process 0 clock))
(when (not (or (= (-> sv-36 time-adjust-ratio) 0.0) (< gp-0 2)))
(when (logtest? (-> sv-16 flags) (lightning-spec-flags size-from-adjust-dist))
(let ((f1-1 (vector-vector-distance (-> sv-24 data 0) (-> sv-24 data s4-0))))
@@ -499,22 +495,7 @@
;; WARN: Stack slot offset 28 signed mismatch
;; WARN: Stack slot offset 28 signed mismatch
(defun lightning-draw ((arg0 dma-buffer) (arg1 lightning-control) (arg2 lightning-globals))
(local-vars
(sv-16 math-camera)
(sv-20 (inline-array gcf-vertex))
(sv-24 lightning-spec)
(sv-28 float)
(sv-32 texture)
(sv-48 vector-array)
(sv-64 int)
(sv-80 int)
(sv-96 int)
(sv-112 int)
(sv-128 int)
(sv-144 int)
(sv-160 int)
(sv-176 gcf-control)
)
(local-vars (sv-128 int))
(rlet ((acc :class vf)
(vf0 :class vf)
(vf1 :class vf)
@@ -528,255 +509,269 @@
(vf9 :class vf)
)
(init-vf0-vector)
(set! sv-16 *math-camera*)
(set! sv-20 (the-as (inline-array gcf-vertex) *gsf-buffer*))
(let* ((s3-0 (-> arg1 state points-to-draw))
(let* ((sv-16 *math-camera*)
(sv-20 (the-as (inline-array gcf-vertex) *gsf-buffer*))
(s3-0 (-> arg1 state points-to-draw))
(s2-0 (+ s3-0 -1))
(s1-0 *lightning-gcf*)
(s0-0 (-> sv-16 camera-rot))
(sv-32 (lookup-texture-by-id (-> arg1 spec texture)))
(sv-48 (-> arg1 state line))
(sv-24 (-> arg1 spec))
)
(set! sv-32 (lookup-texture-by-id (-> arg1 spec texture)))
(set! sv-48 (-> arg1 state line))
(set! sv-24 (-> arg1 spec))
(when (< 1 s3-0)
(set! sv-64 0)
(while (< sv-64 2)
(set! sv-28 (/ 1.0 (the float s2-0)))
(cond
((logtest? (-> sv-24 flags) (lightning-spec-flags lsf0))
(set! sv-80 0)
(while (< sv-80 (* s3-0 2))
(cond
((not (logtest? sv-80 1))
(gs-packed-rgba-lerp!
(-> sv-20 sv-80 clr)
(-> arg1 state start-color)
(-> arg1 state end-color)
(* (the float (/ sv-80 2)) sv-28)
)
(let ((v1-25 (-> sv-20 sv-80)))
(set! (-> v1-25 tex x) 0)
(set! (-> v1-25 tex y) (* (/ 4096 s3-0) (/ sv-80 2)))
(set! (-> v1-25 tex z) 4096)
(set! (-> v1-25 tex w) 0)
)
)
(else
(gs-packed-rgba-lerp!
(-> sv-20 sv-80 clr)
(-> arg1 state start-color)
(-> arg1 state end-color)
(* (the float (/ sv-80 2)) sv-28)
)
(let ((v1-35 (-> sv-20 sv-80)))
(set! (-> v1-35 tex x) 4096)
(set! (-> v1-35 tex y) (* (/ 4096 s3-0) (/ sv-80 2)))
(set! (-> v1-35 tex z) 4096)
(set! (-> v1-35 tex w) 0)
(let ((sv-64 0))
(while (< sv-64 2)
(let ((sv-28 (/ 1.0 (the float s2-0))))
(cond
((logtest? (-> sv-24 flags) (lightning-spec-flags lsf0))
(let ((sv-80 0))
(while (< sv-80 (* s3-0 2))
(cond
((not (logtest? sv-80 1))
(gs-packed-rgba-lerp!
(-> sv-20 sv-80 clr)
(-> arg1 state start-color)
(-> arg1 state end-color)
(* (the float (/ sv-80 2)) sv-28)
)
(let ((v1-25 (-> sv-20 sv-80)))
(set! (-> v1-25 tex x) 0)
(set! (-> v1-25 tex y) (* (/ 4096 s3-0) (/ sv-80 2)))
(set! (-> v1-25 tex z) 4096)
(set! (-> v1-25 tex w) 0)
)
)
(else
(gs-packed-rgba-lerp!
(-> sv-20 sv-80 clr)
(-> arg1 state start-color)
(-> arg1 state end-color)
(* (the float (/ sv-80 2)) sv-28)
)
(let ((v1-35 (-> sv-20 sv-80)))
(set! (-> v1-35 tex x) 4096)
(set! (-> v1-35 tex y) (* (/ 4096 s3-0) (/ sv-80 2)))
(set! (-> v1-35 tex z) 4096)
(set! (-> v1-35 tex w) 0)
)
)
)
(+! sv-80 1)
)
)
)
(set! sv-80 (+ sv-80 1))
)
)
((logtest? (-> sv-24 flags) (lightning-spec-flags lsf1))
(dotimes (v1-45 (* s3-0 2))
(cond
((not (logtest? v1-45 1))
(let ((a0-26 (-> sv-20 v1-45)))
(set! (-> a0-26 tex x) 0)
(set! (-> a0-26 tex y) (* (/ 4096 s3-0) (/ v1-45 2)))
(set! (-> a0-26 tex z) 4096)
(set! (-> a0-26 tex w) 0)
)
)
(else
(let ((a0-30 (-> sv-20 v1-45)))
(set! (-> a0-30 tex x) 4096)
(set! (-> a0-30 tex y) (* (/ 4096 s3-0) (/ v1-45 2)))
(set! (-> a0-30 tex z) 4096)
(set! (-> a0-30 tex w) 0)
((logtest? (-> sv-24 flags) (lightning-spec-flags lsf1))
(dotimes (v1-45 (* s3-0 2))
(cond
((not (logtest? v1-45 1))
(let ((a0-26 (-> sv-20 v1-45)))
(set! (-> a0-26 tex x) 0)
(set! (-> a0-26 tex y) (* (/ 4096 s3-0) (/ v1-45 2)))
(set! (-> a0-26 tex z) 4096)
(set! (-> a0-26 tex w) 0)
)
)
(else
(let ((a0-30 (-> sv-20 v1-45)))
(set! (-> a0-30 tex x) 4096)
(set! (-> a0-30 tex y) (* (/ 4096 s3-0) (/ v1-45 2)))
(set! (-> a0-30 tex z) 4096)
(set! (-> a0-30 tex w) 0)
)
)
)
)
(dotimes (v1-48 (* s2-0 2))
(set! (-> sv-20 v1-48 clr x) (the-as int (-> arg1 state start-color r)))
(set! (-> sv-20 v1-48 clr y) (the-as int (-> arg1 state start-color g)))
(set! (-> sv-20 v1-48 clr z) (the-as int (-> arg1 state start-color b)))
(set! (-> sv-20 v1-48 clr w) (the-as int (-> arg1 state start-color a)))
)
(dotimes (v1-51 2)
(let ((a0-45 (+ v1-51 (* s2-0 2))))
(set! (-> sv-20 a0-45 clr x) (the-as int (-> arg1 state end-color r)))
(set! (-> sv-20 a0-45 clr y) (the-as int (-> arg1 state end-color g)))
(set! (-> sv-20 a0-45 clr z) (the-as int (-> arg1 state end-color b)))
(set! (-> sv-20 a0-45 clr w) (the-as int (-> arg1 state end-color a)))
)
)
)
)
(dotimes (v1-48 (* s2-0 2))
(set! (-> sv-20 v1-48 clr x) (the-as int (-> arg1 state start-color r)))
(set! (-> sv-20 v1-48 clr y) (the-as int (-> arg1 state start-color g)))
(set! (-> sv-20 v1-48 clr z) (the-as int (-> arg1 state start-color b)))
(set! (-> sv-20 v1-48 clr w) (the-as int (-> arg1 state start-color a)))
)
(dotimes (v1-51 2)
(let ((a0-45 (+ v1-51 (* s2-0 2))))
(set! (-> sv-20 a0-45 clr x) (the-as int (-> arg1 state end-color r)))
(set! (-> sv-20 a0-45 clr y) (the-as int (-> arg1 state end-color g)))
(set! (-> sv-20 a0-45 clr z) (the-as int (-> arg1 state end-color b)))
(set! (-> sv-20 a0-45 clr w) (the-as int (-> arg1 state end-color a)))
)
)
)
((logtest? (-> sv-24 flags) (lightning-spec-flags lsf2))
(dotimes (v1-58 (* s3-0 2))
(cond
((not (logtest? v1-58 1))
(let ((a0-52 (-> sv-20 v1-58)))
(set! (-> a0-52 tex x) 0)
(set! (-> a0-52 tex y) (* (/ 4096 s3-0) (/ v1-58 2)))
(set! (-> a0-52 tex z) 4096)
(set! (-> a0-52 tex w) 0)
)
)
(else
(let ((a0-56 (-> sv-20 v1-58)))
(set! (-> a0-56 tex x) 4096)
(set! (-> a0-56 tex y) (* (/ 4096 s3-0) (/ v1-58 2)))
(set! (-> a0-56 tex z) 4096)
(set! (-> a0-56 tex w) 0)
((logtest? (-> sv-24 flags) (lightning-spec-flags lsf2))
(dotimes (v1-58 (* s3-0 2))
(cond
((not (logtest? v1-58 1))
(let ((a0-52 (-> sv-20 v1-58)))
(set! (-> a0-52 tex x) 0)
(set! (-> a0-52 tex y) (* (/ 4096 s3-0) (/ v1-58 2)))
(set! (-> a0-52 tex z) 4096)
(set! (-> a0-52 tex w) 0)
)
)
(else
(let ((a0-56 (-> sv-20 v1-58)))
(set! (-> a0-56 tex x) 4096)
(set! (-> a0-56 tex y) (* (/ 4096 s3-0) (/ v1-58 2)))
(set! (-> a0-56 tex z) 4096)
(set! (-> a0-56 tex w) 0)
)
)
)
)
(dotimes (v1-61 (* (+ s3-0 -2) 2))
(let ((a0-58 (+ v1-61 2)))
(set! (-> sv-20 a0-58 clr x) (the-as int (-> arg1 state start-color r)))
(set! (-> sv-20 a0-58 clr y) (the-as int (-> arg1 state start-color g)))
(set! (-> sv-20 a0-58 clr z) (the-as int (-> arg1 state start-color b)))
(set! (-> sv-20 a0-58 clr w) (the-as int (-> arg1 state start-color a)))
)
)
(dotimes (v1-64 2)
(let ((a0-63 v1-64))
(set! (-> sv-20 a0-63 clr x) (the-as int (-> arg1 state end-color r)))
(set! (-> sv-20 a0-63 clr y) (the-as int (-> arg1 state end-color g)))
(set! (-> sv-20 a0-63 clr z) (the-as int (-> arg1 state end-color b)))
(set! (-> sv-20 a0-63 clr w) (the-as int (-> arg1 state end-color a)))
)
)
(dotimes (v1-67 2)
(let ((a0-67 (+ v1-67 (* s2-0 2))))
(set! (-> sv-20 a0-67 clr x) (the-as int (-> arg1 state end-color r)))
(set! (-> sv-20 a0-67 clr y) (the-as int (-> arg1 state end-color g)))
(set! (-> sv-20 a0-67 clr z) (the-as int (-> arg1 state end-color b)))
(set! (-> sv-20 a0-67 clr w) (the-as int (-> arg1 state end-color a)))
)
)
)
)
(dotimes (v1-61 (* (+ s3-0 -2) 2))
(let ((a0-58 (+ v1-61 2)))
(set! (-> sv-20 a0-58 clr x) (the-as int (-> arg1 state start-color r)))
(set! (-> sv-20 a0-58 clr y) (the-as int (-> arg1 state start-color g)))
(set! (-> sv-20 a0-58 clr z) (the-as int (-> arg1 state start-color b)))
(set! (-> sv-20 a0-58 clr w) (the-as int (-> arg1 state start-color a)))
)
)
(dotimes (v1-64 2)
(let ((a0-63 v1-64))
(set! (-> sv-20 a0-63 clr x) (the-as int (-> arg1 state end-color r)))
(set! (-> sv-20 a0-63 clr y) (the-as int (-> arg1 state end-color g)))
(set! (-> sv-20 a0-63 clr z) (the-as int (-> arg1 state end-color b)))
(set! (-> sv-20 a0-63 clr w) (the-as int (-> arg1 state end-color a)))
)
)
(dotimes (v1-67 2)
(let ((a0-67 (+ v1-67 (* s2-0 2))))
(set! (-> sv-20 a0-67 clr x) (the-as int (-> arg1 state end-color r)))
(set! (-> sv-20 a0-67 clr y) (the-as int (-> arg1 state end-color g)))
(set! (-> sv-20 a0-67 clr z) (the-as int (-> arg1 state end-color b)))
(set! (-> sv-20 a0-67 clr w) (the-as int (-> arg1 state end-color a)))
)
)
)
)
(let ((f0-8 (-> sv-24 radius))
(f1-4 0.5)
(v1-73 (the-as object (&-> (the-as (inline-array vector) sv-48) 0 w)))
(a0-71 (the-as object (-> sv-20 0)))
(a1-82 (the-as object (-> sv-20 1)))
)
1
(.lvf vf1 (&-> s0-0 quad 0))
(.lvf vf2 (&-> s0-0 quad 1))
(.lvf vf3 (&-> s0-0 quad 2))
(.lvf vf4 (&-> s0-0 trans quad))
(let ((a2-44 f0-8))
(.mov vf8 a2-44)
)
(let ((a2-45 f1-4))
(.mov vf17 a2-45)
)
(.add.x.vf.y vf17 vf0 vf8)
(.add.w.vf.z vf17 vf0 vf0)
(.add.w.vf.z vf17 vf17 vf0)
(dotimes (a2-46 s3-0)
(.lvf vf8 (&-> (the-as (inline-array vector) v1-73) 0 quad))
(.mul.w.vf.xyz acc vf4 vf0)
(.add.mul.x.vf.xyz acc vf1 vf8 acc)
(.add.mul.y.vf.xyz acc vf2 vf8 acc)
(.add.mul.z.vf.xyz vf8 vf3 vf8 acc)
(.add.x.vf vf6 vf8 vf0)
(b! (zero? sv-64) cfg-44 :delay (.add.x.vf vf7 vf8 vf0))
(.add.y.vf.y vf6 vf6 vf17)
(b! #t cfg-45 :delay (.sub.y.vf.y vf7 vf7 vf17))
(label cfg-44)
(.add.y.vf.x vf6 vf6 vf17)
(.sub.y.vf.x vf7 vf7 vf17)
(label cfg-45)
(.svf (&-> (the-as (pointer uint128) a1-82) 2) vf6)
(.svf (&-> (the-as (pointer uint128) a0-71) 2) vf7)
(set! a1-82 (&+ (the-as pointer a1-82) 96))
(set! a0-71 (&+ (the-as pointer a0-71) 96))
(.add.x.vf vf9 vf8 vf0)
(set! v1-73 (-> (the-as (inline-array vector) v1-73) 1))
)
)
(set! sv-96 s2-0)
(set! sv-112 0)
(while (> sv-96 0)
(if (< 40 sv-96)
(set! sv-128 40)
(set! sv-128 sv-96)
(let ((f0-8 (-> sv-24 radius))
(f1-4 0.5)
(v1-73 (the-as object (&-> (the-as (inline-array vector) sv-48) 0 w)))
(a0-71 (the-as object (-> sv-20 0)))
(a1-82 (the-as object (-> sv-20 1)))
)
1
(.lvf vf1 (&-> s0-0 quad 0))
(.lvf vf2 (&-> s0-0 quad 1))
(.lvf vf3 (&-> s0-0 quad 2))
(.lvf vf4 (&-> s0-0 trans quad))
(let ((a2-44 f0-8))
(.mov vf8 a2-44)
)
(set! sv-144 (+ sv-128 1))
(set! sv-160 12)
(let* ((v1-83 arg0)
(a0-73 (the-as object (-> v1-83 base)))
)
(set! (-> (the-as dma-packet a0-73) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc sv-160))
(set! (-> (the-as dma-packet a0-73) vif0) (new 'static 'vif-tag))
(set! (-> (the-as dma-packet a0-73) vif1)
(new 'static 'vif-tag :cmd (vif-cmd unpack-v4-32) :imm (shr (shl (-> arg2 gcf-buf) 54) 54) :num sv-160)
)
(set! (-> v1-83 base) (the-as pointer (&+ (the-as dma-packet a0-73) 16)))
)
(set! sv-176 (the-as gcf-control (-> arg0 base)))
(let* ((v1-86 (-> sv-176 matrix))
(a3-31 (-> sv-16 perspective))
(a0-76 (-> a3-31 quad 0))
(a1-88 (-> a3-31 quad 1))
(a2-58 (-> a3-31 quad 2))
(a3-32 (-> a3-31 trans quad))
)
(set! (-> v1-86 quad 0) a0-76)
(set! (-> v1-86 quad 1) a1-88)
(set! (-> v1-86 quad 2) a2-58)
(set! (-> v1-86 trans quad) a3-32)
)
(quad-copy! (the-as pointer (-> sv-176 giftag)) (the-as pointer (-> s1-0 giftag)) 3)
(set! (-> sv-176 giftag num-strips) (the-as uint 1))
(set! (-> sv-176 num-dps) (the-as uint (* sv-144 2)))
(set! (-> sv-176 kick-offset) (the-as uint 0))
(adgif-shader<-texture-simple! (-> sv-176 shader 0 shader) sv-32)
(adgif-shader-update! (-> sv-176 shader 0 shader) sv-32)
(set! (-> sv-176 shader 0 shader alpha) (new 'static 'gs-alpha :b #x2 :d #x1 :fix #x80))
(set! (-> sv-176 shader 0 shader tex0 tfx) 0)
(set! (-> sv-176 shader 0 pos) (the-as uint 0))
(set! (-> sv-176 shader 0 num) (the-as uint (+ #x8000 (* sv-144 2))))
(&+! (-> arg0 base) (* sv-160 16))
(let* ((v1-104 arg0)
(a0-90 (the-as object (-> v1-104 base)))
)
(set! (-> (the-as dma-packet a0-90) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc (* 6 sv-144)))
(set! (-> (the-as dma-packet a0-90) vif0) (new 'static 'vif-tag))
(set! (-> (the-as dma-packet a0-90) vif1)
(new 'static 'vif-tag :cmd (vif-cmd unpack-v4-32) :imm (shr (shl (-> arg2 vtx-buf) 54) 54) :num (* 6 sv-144))
)
(set! (-> v1-104 base) (the-as pointer (&+ (the-as dma-packet a0-90) 16)))
)
(quad-copy! (-> arg0 base) (the-as pointer (-> sv-20 sv-112)) (* 6 sv-144))
(&+! (-> arg0 base) (* 96 sv-144))
(let* ((v1-109 arg0)
(a0-95 (the-as object (-> v1-109 base)))
)
(set! (-> (the-as dma-packet a0-95) dma) (new 'static 'dma-tag :id (dma-tag-id cnt)))
(set! (-> (the-as dma-packet a0-95) vif0) (new 'static 'vif-tag))
(set! (-> (the-as dma-packet a0-95) vif1) (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd mscal) :msk #x1))
(set! (-> v1-109 base) (the-as pointer (&+ (the-as dma-packet a0-95) 16)))
)
(set! (-> arg2 gcf-buf) (- 1704 (the-as int (-> arg2 gcf-buf))))
(+! (-> arg2 vtx-buf) 279)
(if (< (the-as uint 567) (-> arg2 vtx-buf))
(set! (-> arg2 vtx-buf) (the-as uint 9))
(let ((a2-45 f1-4))
(.mov vf17 a2-45)
)
(set! sv-96 (- sv-96 sv-128))
(set! sv-112 (+ sv-112 (* sv-128 2)))
sv-112
(.add.x.vf.y vf17 vf0 vf8)
(.add.w.vf.z vf17 vf0 vf0)
(.add.w.vf.z vf17 vf17 vf0)
(dotimes (a2-46 s3-0)
(.lvf vf8 (&-> (the-as (inline-array vector) v1-73) 0 quad))
(.mul.w.vf.xyz acc vf4 vf0)
(.add.mul.x.vf.xyz acc vf1 vf8 acc)
(.add.mul.y.vf.xyz acc vf2 vf8 acc)
(.add.mul.z.vf.xyz vf8 vf3 vf8 acc)
(.add.x.vf vf6 vf8 vf0)
(b! (zero? sv-64) cfg-44 :delay (.add.x.vf vf7 vf8 vf0))
(.add.y.vf.y vf6 vf6 vf17)
(b! #t cfg-45 :delay (.sub.y.vf.y vf7 vf7 vf17))
(label cfg-44)
(.add.y.vf.x vf6 vf6 vf17)
(.sub.y.vf.x vf7 vf7 vf17)
(label cfg-45)
(.svf (&-> (the-as (pointer uint128) a1-82) 2) vf6)
(.svf (&-> (the-as (pointer uint128) a0-71) 2) vf7)
(set! a1-82 (&+ (the-as pointer a1-82) 96))
(set! a0-71 (&+ (the-as pointer a0-71) 96))
(.add.x.vf vf9 vf8 vf0)
(set! v1-73 (-> (the-as (inline-array vector) v1-73) 1))
)
)
(let ((sv-96 s2-0)
(sv-112 0)
)
(while (> sv-96 0)
(set! sv-128 (cond
((< 40 sv-96)
(set! sv-128 40)
sv-128
)
(else
sv-96
)
)
)
(let ((sv-144 (+ sv-128 1)))
(let ((sv-160 12))
(let* ((v1-83 arg0)
(a0-73 (the-as object (-> v1-83 base)))
)
(set! (-> (the-as dma-packet a0-73) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc sv-160))
(set! (-> (the-as dma-packet a0-73) vif0) (new 'static 'vif-tag))
(set! (-> (the-as dma-packet a0-73) vif1)
(new 'static 'vif-tag :cmd (vif-cmd unpack-v4-32) :imm (shr (shl (-> arg2 gcf-buf) 54) 54) :num sv-160)
)
(set! (-> v1-83 base) (the-as pointer (&+ (the-as dma-packet a0-73) 16)))
)
(let ((sv-176 (the-as gcf-control (-> arg0 base))))
(let* ((v1-86 (-> sv-176 matrix))
(a3-31 (-> sv-16 perspective))
(a0-76 (-> a3-31 quad 0))
(a1-88 (-> a3-31 quad 1))
(a2-58 (-> a3-31 quad 2))
(a3-32 (-> a3-31 trans quad))
)
(set! (-> v1-86 quad 0) a0-76)
(set! (-> v1-86 quad 1) a1-88)
(set! (-> v1-86 quad 2) a2-58)
(set! (-> v1-86 trans quad) a3-32)
)
(quad-copy! (the-as pointer (-> sv-176 giftag)) (the-as pointer (-> s1-0 giftag)) 3)
(set! (-> sv-176 giftag num-strips) (the-as uint 1))
(set! (-> sv-176 num-dps) (the-as uint (* sv-144 2)))
(set! (-> sv-176 kick-offset) (the-as uint 0))
(adgif-shader<-texture-simple! (-> sv-176 shader 0 shader) sv-32)
(adgif-shader-update! (-> sv-176 shader 0 shader) sv-32)
(set! (-> sv-176 shader 0 shader alpha) (new 'static 'gs-alpha :b #x2 :d #x1 :fix #x80))
(set! (-> sv-176 shader 0 shader tex0 tfx) 0)
(set! (-> sv-176 shader 0 pos) (the-as uint 0))
(set! (-> sv-176 shader 0 num) (the-as uint (+ #x8000 (* sv-144 2))))
)
(&+! (-> arg0 base) (* sv-160 16))
)
(let* ((v1-104 arg0)
(a0-90 (the-as object (-> v1-104 base)))
)
(set! (-> (the-as dma-packet a0-90) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc (* 6 sv-144)))
(set! (-> (the-as dma-packet a0-90) vif0) (new 'static 'vif-tag))
(set! (-> (the-as dma-packet a0-90) vif1)
(new 'static 'vif-tag :cmd (vif-cmd unpack-v4-32) :imm (shr (shl (-> arg2 vtx-buf) 54) 54) :num (* 6 sv-144))
)
(set! (-> v1-104 base) (the-as pointer (&+ (the-as dma-packet a0-90) 16)))
)
(quad-copy! (-> arg0 base) (the-as pointer (-> sv-20 sv-112)) (* 6 sv-144))
(&+! (-> arg0 base) (* 96 sv-144))
)
(let* ((v1-109 arg0)
(a0-95 (the-as object (-> v1-109 base)))
)
(set! (-> (the-as dma-packet a0-95) dma) (new 'static 'dma-tag :id (dma-tag-id cnt)))
(set! (-> (the-as dma-packet a0-95) vif0) (new 'static 'vif-tag))
(set! (-> (the-as dma-packet a0-95) vif1) (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd mscal) :msk #x1))
(set! (-> v1-109 base) (the-as pointer (&+ (the-as dma-packet a0-95) 16)))
)
(set! (-> arg2 gcf-buf) (- 1704 (the-as int (-> arg2 gcf-buf))))
(+! (-> arg2 vtx-buf) 279)
(if (< (the-as uint 567) (-> arg2 vtx-buf))
(set! (-> arg2 vtx-buf) (the-as uint 9))
)
(set! sv-96 (- sv-96 sv-128))
(+! sv-112 (* sv-128 2))
sv-112
)
)
(+! sv-64 1)
)
(set! sv-64 (+ sv-64 1))
)
#f
)
+14 -16
View File
@@ -183,9 +183,9 @@
;; definition for function ripple-find-height
(defun ripple-find-height ((arg0 process-drawable) (arg1 int) (arg2 vector))
(local-vars (sv-16 draw-control) (sv-32 float) (sv-48 float))
(let ((f30-0 (-> arg0 root trans y)))
(set! sv-16 (-> arg0 draw))
(let ((f30-0 (-> arg0 root trans y))
(sv-16 (-> arg0 draw))
)
(if (or (zero? sv-16) (not (-> sv-16 ripple)))
(return f30-0)
)
@@ -219,20 +219,18 @@
(let* ((f22-1 (the float (the int f28-1)))
(f24-1 (the float (the int f26-1)))
(f20-0 (ripple-slow-add-sine-waves s5-0 f22-1 f24-1))
(sv-32 (ripple-slow-add-sine-waves s5-0 (+ 1.0 f22-1) f24-1))
(sv-48 (ripple-slow-add-sine-waves s5-0 f22-1 (+ 1.0 f24-1)))
(f1-6 (ripple-slow-add-sine-waves s5-0 (+ 1.0 f22-1) (+ 1.0 f24-1)))
(f0-22 (+ f20-0 (* (- f28-1 f22-1) (- sv-32 f20-0))))
(f1-9 (+ sv-48 (* (- f28-1 f22-1) (- f1-6 sv-48))))
(f1-12 (+ f0-22 (* (- f26-1 f24-1) (- f1-9 f0-22))))
(f0-23 (-> gp-0 faded-scale))
)
(set! sv-32 (ripple-slow-add-sine-waves s5-0 (+ 1.0 f22-1) f24-1))
(set! sv-48 (ripple-slow-add-sine-waves s5-0 f22-1 (+ 1.0 f24-1)))
(let* ((f1-6 (ripple-slow-add-sine-waves s5-0 (+ 1.0 f22-1) (+ 1.0 f24-1)))
(f0-22 (+ f20-0 (* (- f28-1 f22-1) (- sv-32 f20-0))))
(f1-9 (+ sv-48 (* (- f28-1 f22-1) (- f1-6 sv-48))))
(f1-12 (+ f0-22 (* (- f26-1 f24-1) (- f1-9 f0-22))))
(f0-23 (-> gp-0 faded-scale))
)
(if (< f0-23 0.0)
(set! f0-23 (-> gp-0 global-scale))
)
(+ f30-0 (* (/ f1-12 128) f0-23))
)
(if (< f0-23 0.0)
(set! f0-23 (-> gp-0 global-scale))
)
(+ f30-0 (* (/ f1-12 128) f0-23))
)
)
)
+12 -15
View File
@@ -54,7 +54,6 @@ Without this corrector, the fogginess of the world would change as the FOV chang
(defun update-math-camera ((arg0 math-camera) (arg1 symbol) (arg2 symbol) (arg3 float))
"Compute some one-time camera constants.
These should only change when changing aspect ratio."
(local-vars (sv-16 float))
(set! (-> arg0 x-ratio) (tan (/ arg3 2)))
(if (= arg2 'aspect4x3)
(set! (-> arg0 y-ratio) (* 0.75 (-> arg0 x-ratio)))
@@ -64,26 +63,24 @@ Without this corrector, the fogginess of the world would change as the FOV chang
(f0-7 (-> arg0 y-ratio))
(v1-6 (-> arg0 cull-info))
)
(/ (+ 1.0 (* 4.0 f1-3 f1-3)) (+ 1.0 (* f1-3 f1-3)))
(let ((f2-5 (/ (+ 1.0 (* 4.0 f0-7 f0-7)) (+ 1.0 (* f0-7 f0-7)))))
(/ (+ 1.0 (* 4.0 f1-3 f1-3)) (+ 1.0 (square f1-3)))
(let ((f2-5 (/ (+ 1.0 (* 4.0 f0-7 f0-7)) (+ 1.0 (square f0-7)))))
(set! (-> v1-6 x-fact) (/ (+ 1.0 (* 4.0 f1-3 f1-3)) (* f1-3 (sqrtf (+ 1.0 (* 16.0 f1-3 f1-3))))))
(set! (-> v1-6 y-fact) (/ (+ 1.0 (* 4.0 f0-7 f0-7)) (* f0-7 (sqrtf (+ 1.0 (* 16.0 f0-7 f0-7))))))
(set! (-> v1-6 z-fact) (sqrtf (+ (* (+ -4.0 f2-5) (+ -4.0 f2-5) f0-7 f0-7) (* (+ -1.0 f2-5) (+ -1.0 f2-5)))))
)
(let* ((f2-11 (* f1-3 (-> arg0 d)))
(f1-5 (* f0-7 (-> arg0 d)))
(f0-10 (+ (* f2-11 f2-11) (* f1-5 f1-5)))
(f1-8 (-> arg0 d))
)
(set! (-> v1-6 cam-radius) (sqrtf (+ f0-10 (* f1-8 f1-8))))
(let ((f2-11 (* f1-3 (-> arg0 d)))
(f1-5 (* f0-7 (-> arg0 d)))
)
(set! (-> v1-6 cam-radius) (sqrtf (+ (square f2-11) (square f1-5) (square (-> arg0 d)))))
)
(let* ((f1-12 (* (-> arg0 d) (-> arg0 x-ratio)))
(f0-14 (-> arg0 d))
(f2-13 (* 4.0 f1-12))
(f3-21 (-> arg0 d))
)
(let ((f4-21 (/ 1.0 (sqrtf (+ (* f1-12 f1-12) (* f0-14 f0-14)))))
(f5-11 (/ 1.0 (sqrtf (+ (* f2-13 f2-13) (* f3-21 f3-21)))))
(let ((f4-21 (/ 1.0 (sqrtf (+ (square f1-12) (square f0-14)))))
(f5-11 (/ 1.0 (sqrtf (+ (square f2-13) (square f3-21)))))
)
(set! (-> v1-6 xz-dir-ax) (* f1-12 f4-21))
(set! (-> v1-6 xz-dir-az) (* f0-14 f4-21))
@@ -97,8 +94,8 @@ Without this corrector, the fogginess of the world would change as the FOV chang
(f2-15 (* 4.0 f1-15))
(f3-22 (-> arg0 d))
)
(let ((f4-26 (/ 1.0 (sqrtf (+ (* f1-15 f1-15) (* f0-18 f0-18)))))
(f5-16 (/ 1.0 (sqrtf (+ (* f2-15 f2-15) (* f3-22 f3-22)))))
(let ((f4-26 (/ 1.0 (sqrtf (+ (square f1-15) (square f0-18)))))
(f5-16 (/ 1.0 (sqrtf (+ (square f2-15) (square f3-22)))))
)
(set! (-> v1-6 yz-dir-ay) (* f1-15 f4-26))
(set! (-> v1-6 yz-dir-az) (* f0-18 f4-26))
@@ -157,12 +154,12 @@ Without this corrector, the fogginess of the world would change as the FOV chang
(a0-36 (-> *screen-shot-work* size))
(f0-34 (the float a0-36))
(f20-0 (/ (the float (mod v1-32 a0-36)) f0-34))
(sv-16 (/ (the float (/ v1-32 a0-36)) f0-34))
)
(set! sv-16 (/ (the float (/ v1-32 a0-36)) f0-34))
(format 0 "~f ~f~%" f20-0 sv-16)
(set! (-> arg0 hvdf-off x) (- f24-0 f20-0))
(set! (-> arg0 hvdf-off y) (- f26-0 sv-16))
)
(set! (-> arg0 hvdf-off y) (- f26-0 sv-16))
)
)
(set! (-> arg0 hvdf-off z) f22-0)
+29 -48
View File
@@ -2313,7 +2313,6 @@
;; definition for function update-under-lights
;; INFO: Used lq/sq
(defun update-under-lights ((arg0 mood-context))
(local-vars (sv-80 vector))
(rlet ((vf0 :class vf)
(vf4 :class vf)
(vf5 :class vf)
@@ -2346,28 +2345,27 @@
(s5-0 (-> arg0 light-group 3))
(gp-1 (-> arg0 light-group 4))
)
(let ((s1-0 (new 'static 'vector :x 0.8645 :z -0.5294)))
(set! sv-80 (new 'static 'vector :x -2.0 :z 1950.0))
(let ((v0-1 (target-pos 0))
(s0-0 (new 'stack-no-clear 'vector))
)
(let ((v1-10 s0-0))
(.lvf vf4 (&-> v0-1 quad))
(.lvf vf5 (&-> sv-80 quad))
(.mov.vf.w vf6 vf0)
(.sub.vf.xyz vf6 vf4 vf5)
(.svf (&-> v1-10 quad) vf6)
(let ((s1-0 (new 'static 'vector :x 0.8645 :z -0.5294))
(sv-80 (new 'static 'vector :x -2.0 :z 1950.0))
(v0-1 (target-pos 0))
(s0-0 (new 'stack-no-clear 'vector))
)
(vector-normalize! s0-0 1.0)
(cond
((>= (vector-dot s1-0 s0-0) 0.0)
(set-vector! (-> s2-0 0 dir0 color) 0.6 0.5 0.7 1.0)
(set-vector! (-> s2-0 0 ambi color) 0.3 0.3 0.3 1.0)
)
(else
(set-vector! (-> s2-0 0 dir0 color) 0.2 0.2 0.4 1.0)
(set-vector! (-> s2-0 0 ambi color) 0.2 0.2 0.2 1.0)
)
(let ((v1-10 s0-0))
(.lvf vf4 (&-> v0-1 quad))
(.lvf vf5 (&-> sv-80 quad))
(.mov.vf.w vf6 vf0)
(.sub.vf.xyz vf6 vf4 vf5)
(.svf (&-> v1-10 quad) vf6)
)
(vector-normalize! s0-0 1.0)
(cond
((>= (vector-dot s1-0 s0-0) 0.0)
(set-vector! (-> s2-0 0 dir0 color) 0.6 0.5 0.7 1.0)
(set-vector! (-> s2-0 0 ambi color) 0.3 0.3 0.3 1.0)
)
(else
(set-vector! (-> s2-0 0 dir0 color) 0.2 0.2 0.4 1.0)
(set-vector! (-> s2-0 0 ambi color) 0.2 0.2 0.2 1.0)
)
)
)
@@ -2750,7 +2748,6 @@
;; ERROR: Stack slot load at 32 mismatch: defined as size 4, got size 16
;; WARN: Return type mismatch int vs none.
(defbehavior update-mood-dig1 time-of-day-proc ((arg0 mood-context))
(local-vars (sv-16 float) (sv-32 float))
(update-mood-interior arg0)
(update-dig1-lights arg0)
(cond
@@ -2761,31 +2758,15 @@
(let ((gp-0 (the-as dig1-states (-> arg0 state))))
(set! (-> arg0 times 0 w) 1.0)
(set! (-> arg0 times 1 w) 1.0)
(let ((s4-0 update-mood-pulse)
(s3-0 arg0)
(s2-0 2)
(s1-0 0)
(s0-0 0.85)
)
(set! sv-16 0.15)
(let ((t1-0 (* 182.04445 (seconds-per-frame) (rand-vu-float-range 60.0 200.0)))
(t2-0 0.0)
)
(s4-0 s3-0 s2-0 s1-0 s0-0 sv-16 t1-0 t2-0)
)
)
(let ((s4-1 update-mood-pulse)
(s3-1 arg0)
(s2-1 3)
(s1-1 4)
(s0-1 0.85)
)
(set! sv-32 0.15)
(let ((t1-1 (* 182.04445 (seconds-per-frame) (rand-vu-float-range 120.0 180.0)))
(t2-1 16384.0)
)
(s4-1 s3-1 s2-1 s1-1 s0-1 sv-32 t1-1 t2-1)
)
(update-mood-pulse arg0 2 0 0.85 0.15 (* 182.04445 (seconds-per-frame) (rand-vu-float-range 60.0 200.0)) 0.0)
(update-mood-pulse
arg0
3
4
0.85
0.15
(* 182.04445 (seconds-per-frame) (rand-vu-float-range 120.0 180.0))
16384.0
)
(set! (-> arg0 times 6 w) 1.0)
(if (not (task-node-closed? (game-task-node dig-knock-down-resolution)))
+13 -13
View File
@@ -427,7 +427,7 @@
;; definition for function update-mood-exterior
;; INFO: Used lq/sq
(defun update-mood-exterior ((arg0 mood-context-core3) (arg1 mood-table) (arg2 float) (arg3 int))
(local-vars (v0-1 object) (sv-32 mood-color) (sv-48 mood-color) (sv-64 vector))
(local-vars (v0-1 object))
(cond
((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode)))
(palette-select-special arg0)
@@ -475,18 +475,18 @@
(mem-copy! (the-as pointer (-> arg0 current-fog)) (the-as pointer (-> arg1 mood-fog-table data s3-0)) 48)
)
(else
(set! sv-32 (-> arg1 mood-color-table data s3-0))
(set! sv-48 (-> arg1 mood-color-table data s2-0))
(let ((s1-0 (-> arg0 times)))
(set! sv-64 (-> arg0 times 1))
(let ((s0-0 (-> arg0 light-group)))
(vector4-lerp! (-> s1-0 0) (-> sv-32 amb-color) (-> sv-48 amb-color) f30-0)
(vector4-lerp! sv-64 (-> sv-32 lgt-color) (-> sv-48 lgt-color) f30-0)
(set! (-> arg0 times 2 quad) (-> sv-64 quad))
(set! (-> arg0 times 3 quad) (-> sv-64 quad))
(set! (-> arg0 times 4 quad) (-> sv-64 quad))
(set! (-> s0-0 0 ambi color quad) (-> s1-0 0 quad))
)
(let ((sv-32 (-> arg1 mood-color-table data s3-0))
(sv-48 (-> arg1 mood-color-table data s2-0))
(s1-0 (-> arg0 times))
(sv-64 (-> arg0 times 1))
(s0-0 (-> arg0 light-group))
)
(vector4-lerp! (-> s1-0 0) (-> sv-32 amb-color) (-> sv-48 amb-color) f30-0)
(vector4-lerp! sv-64 (-> sv-32 lgt-color) (-> sv-48 lgt-color) f30-0)
(set! (-> arg0 times 2 quad) (-> sv-64 quad))
(set! (-> arg0 times 3 quad) (-> sv-64 quad))
(set! (-> arg0 times 4 quad) (-> sv-64 quad))
(set! (-> s0-0 0 ambi color quad) (-> s1-0 0 quad))
)
(vector4-lerp!
(-> arg0 current-sky-color)
+35 -43
View File
@@ -545,9 +545,8 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch symbol vs none.
(defmethod ocean-mid-add-upload ((this ocean) (arg0 dma-buffer) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 float))
(local-vars (sv-32 int))
(set! sv-32 arg1)
(let ((s0-0 arg2)
(let ((sv-32 arg1)
(s0-0 arg2)
(s1-0 arg3)
(s4-0 arg4)
(s2-0 arg5)
@@ -1023,42 +1022,43 @@
;; definition for method 58 of type ocean
;; WARN: Return type mismatch int vs none.
(defmethod draw-ocean-mid-seams ((this ocean) (arg0 dma-buffer))
(local-vars (sv-32 uint) (sv-33 uint) (sv-34 uint) (sv-35 uint) (sv-36 sphere))
(ocean-seams-add-constants this arg0)
(set! sv-32 (-> this mid-minx))
(set! sv-33 (-> this mid-maxx))
(set! sv-34 (-> this mid-minz))
(set! sv-35 (-> this mid-maxz))
(set! sv-36 (new 'stack 'sphere))
(set! (-> sv-36 y) (-> this start-corner y))
(set! (-> sv-36 r) 278045.7)
(let ((s4-0 sv-34)
(s3-0 sv-35)
(let ((sv-32 (-> this mid-minx))
(sv-33 (-> this mid-maxx))
(sv-34 (-> this mid-minz))
(sv-35 (-> this mid-maxz))
(sv-36 (new 'stack 'sphere))
)
(while (>= s3-0 s4-0)
(let ((s2-0 sv-32)
(s1-0 sv-33)
)
(while (>= s1-0 s2-0)
(set! (-> sv-36 x) (+ 196608.0 (* 393216.0 (the float s2-0)) (-> this start-corner x)))
(set! (-> sv-36 z) (+ 196608.0 (* 393216.0 (the float s4-0)) (-> this start-corner z)))
(when (sphere-cull sv-36)
(cond
((= s4-0 sv-34)
(ocean-mid-add-upload-top this arg0 s4-0 s2-0)
)
((= s4-0 sv-35)
(ocean-mid-add-upload-bottom this arg0 s4-0 s2-0)
)
(else
(ocean-mid-add-upload-middle this arg0 s4-0 s2-0)
(set! (-> sv-36 y) (-> this start-corner y))
(set! (-> sv-36 r) 278045.7)
(let ((s4-0 sv-34)
(s3-0 sv-35)
)
(while (>= s3-0 s4-0)
(let ((s2-0 sv-32)
(s1-0 sv-33)
)
(while (>= s1-0 s2-0)
(set! (-> sv-36 x) (+ 196608.0 (* 393216.0 (the float s2-0)) (-> this start-corner x)))
(set! (-> sv-36 z) (+ 196608.0 (* 393216.0 (the float s4-0)) (-> this start-corner z)))
(when (sphere-cull sv-36)
(cond
((= s4-0 sv-34)
(ocean-mid-add-upload-top this arg0 s4-0 s2-0)
)
((= s4-0 sv-35)
(ocean-mid-add-upload-bottom this arg0 s4-0 s2-0)
)
(else
(ocean-mid-add-upload-middle this arg0 s4-0 s2-0)
)
)
)
(+! s2-0 1)
)
(+! s2-0 1)
)
(+! s4-0 1)
)
(+! s4-0 1)
)
)
(dotimes (v1-29 36)
@@ -1074,7 +1074,7 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod draw-ocean-mid ((this ocean) (arg0 dma-buffer))
(local-vars (v1-8 float) (v1-9 float) (sv-32 int))
(local-vars (v1-8 float) (v1-9 float))
(rlet ((vf16 :class vf)
(vf17 :class vf)
(vf18 :class vf)
@@ -1131,22 +1131,14 @@
(dotimes (s2-0 6)
(let* ((s1-0 (+ (* 6 s3-0) s2-0))
(s0-0 (-> this ocean-spheres spheres s1-0))
(sv-32 (-> (the-as (pointer int16) (+ (* s1-0 2) (the-as int (-> this ocean-mid-indices))))))
)
(set! sv-32 (-> (the-as (pointer int16) (+ (* s1-0 2) (the-as int (-> this ocean-mid-indices))))))
(when (sphere-cull s0-0)
(cond
((< sv-32 0)
)
((let ((f30-0 (- (vector-vector-distance s0-0 s4-0) (-> s0-0 r))))
(let ((a0-16 this)
(t9-5 (method-of-type ocean ocean-mid-add-upload))
(a1-8 arg0)
(a2-2 s3-0)
(a3-0 s2-0)
(t2-0 f30-0)
)
(t9-5 a0-16 a1-8 a2-2 a3-0 sv-32 s1-0 t2-0)
)
(ocean-mid-add-upload this arg0 s3-0 s2-0 sv-32 s1-0 f30-0)
(< f30-0 786432.0)
)
(ocean-mid-add-call this arg0 73)
+3 -3
View File
@@ -665,7 +665,6 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod draw-ocean-near ((this ocean) (arg0 dma-buffer))
(local-vars (sv-16 uint))
(dma-buffer-add-gs-set arg0
(test-1 (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest greater-equal)))
)
@@ -688,8 +687,9 @@
)
(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)
(let ((s0-0 s4-0)
(sv-16 s3-0)
)
(while (>= sv-16 s0-0)
(when (ocean-trans-camera-masks-bit? this s2-0 s0-0)
(let* ((a1-16 (- (shr s0-0 2) (-> this mid-minx)))
+15 -27
View File
@@ -634,7 +634,6 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod ocean-method-85 ((this ocean) (arg0 dma-buffer))
(local-vars (sv-48 vector4w) (sv-64 vector4w))
(dma-buffer-add-gs-set arg0 (alpha-1 (new 'static 'gs-alpha :b #x2 :d #x1)))
(let ((v1-3 (-> arg0 base)))
(set! (-> (the-as (pointer uint128) v1-3)) (-> this haze-tmpl dma-vif quad))
@@ -648,9 +647,10 @@
(s4-0 (-> arg0 base))
)
(dotimes (s1-0 16)
(let ((s0-0 (the-as object (-> arg0 base))))
(set! sv-48 (-> this haze-verts (* s1-0 2)))
(set! sv-64 (-> this haze-verts (+ (* s1-0 2) 1)))
(let ((s0-0 (the-as object (-> arg0 base)))
(sv-48 (-> this haze-verts (* s1-0 2)))
(sv-64 (-> this haze-verts (+ (* s1-0 2) 1)))
)
(let ((f0-1 (+ -1024.0 (the float (-> sv-48 x))))
(f1-3 (+ -1024.0 (the float (-> sv-48 y))))
(v1-22 s2-0)
@@ -787,7 +787,6 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod ocean-method-88 ((this ocean) (arg0 dma-buffer))
(local-vars (sv-48 vector) (sv-64 uint) (sv-80 vector) (sv-96 vector) (sv-112 vector))
(dma-buffer-add-gs-set arg0
(test-1 (new 'static 'gs-test
:ate #x1
@@ -841,34 +840,23 @@
(vector-float*! (-> s2-2 ambi-color) (-> s2-2 ambi-color) 0.25)
(vector-float*! (-> s2-2 ambi-color-lower) (-> s2-2 ambi-color-lower) 0.25)
(dotimes (s1-0 36)
(let ((v1-36 (-> this cloud-verts s1-0)))
(set! sv-80 (-> this cloud-nrms s1-0))
(let ((s0-0 (-> this cloud-col0 s1-0)))
(set! sv-48 (-> this cloud-col1 s1-0))
(set! sv-112 (-> this cloud-st0 s1-0))
(set! sv-96 (-> this cloud-st1 s1-0))
(set! sv-64 (-> this cloud-alpha s1-0))
(let ((v1-36 (-> this cloud-verts s1-0))
(sv-80 (-> this cloud-nrms s1-0))
(s0-0 (-> this cloud-col0 s1-0))
(sv-48 (-> this cloud-col1 s1-0))
(sv-112 (-> this cloud-st0 s1-0))
(sv-96 (-> this cloud-st1 s1-0))
)
(let ((sv-64 (-> this cloud-alpha s1-0)))
(set! (-> s4-1 x) (* 0.140625 (+ -1024.0 (the float (-> v1-36 x)))))
(set! (-> s4-1 z) (* 0.140625 (+ -1024.0 (the float (-> v1-36 z)))))
(vector-negate! s3-1 sv-80)
(let ((a0-41 this)
(t9-3 (method-of-type ocean ocean-method-86))
(a1-19 s0-0)
(a3-0 (-> s2-2 sun0-color))
(t0-0 (-> s2-2 ambi-color))
)
(t9-3 a0-41 a1-19 sv-80 a3-0 t0-0)
)
(ocean-method-86 this s0-0 sv-80 (-> s2-2 sun0-color) (-> s2-2 ambi-color))
(ocean-method-86 this sv-48 s3-1 (-> s2-2 sun0-color-lower) (-> s2-2 ambi-color-lower))
(set! (-> s0-0 w) (the-as float sv-64))
(set! (-> sv-48 w) (the-as float sv-64))
)
)
(set! (-> sv-48 w) (the-as float sv-64))
(let ((a0-44 this)
(t9-5 (method-of-type ocean ocean-method-87))
(a3-2 s4-1)
)
(t9-5 a0-44 sv-96 sv-112 a3-2)
(ocean-method-87 this sv-96 sv-112 s4-1)
)
)
)
+147 -149
View File
@@ -494,21 +494,22 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod ocean-make-trans-camera-masks ((this 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 (&-> this 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) (+ (-> this start-corner x) (* 393216.0 (the float arg1))))
(set! (-> sv-56 y) (-> this start-corner y))
(set! (-> sv-56 z) (+ (-> this 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 this sv-48 s4-0 s5-0 sv-56)
(let ((sv-48 (the-as ocean-trans-mask (&-> this trans-camera-masks (+ (* arg2 4) arg3))))
(sv-52 (-> *math-camera* trans))
(sv-56 (new-stack-vector0))
(sv-60 (new-stack-vector0))
)
(set! (-> sv-56 x) (+ (-> this start-corner x) (* 393216.0 (the float arg1))))
(set! (-> sv-56 y) (-> this start-corner y))
(set! (-> sv-56 z) (+ (-> this 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 this sv-48 s4-0 s5-0 sv-56)
)
)
)
0
@@ -644,34 +645,35 @@
;; definition for method 38 of type ocean
;; WARN: Return type mismatch int vs none.
(defmethod draw-ocean-transition-seams ((this ocean) (arg0 dma-buffer))
(local-vars (sv-32 uint) (sv-33 uint) (sv-34 uint) (sv-35 uint) (sv-36 sphere))
(set! sv-32 (-> this near-minx))
(set! sv-33 (-> this near-maxx))
(set! sv-34 (-> this near-minz))
(set! sv-35 (-> this near-maxz))
(set! sv-36 (new 'stack 'sphere))
(set! (-> sv-36 y) (-> this 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)) (-> this start-corner x)))
(set! (-> sv-36 z) (+ 49152.0 (* 98304.0 (the float s4-0)) (-> this start-corner z)))
(when (sphere-cull sv-36)
(if (not (ocean-trans-camera-masks-bit? this s4-0 s2-0))
(ocean-trans-add-upload this arg0 s4-0 s2-0)
)
)
(+! s2-0 1)
(let ((sv-32 (-> this near-minx))
(sv-33 (-> this near-maxx))
(sv-34 (-> this near-minz))
(sv-35 (-> this near-maxz))
(sv-36 (new 'stack 'sphere))
)
(set! (-> sv-36 y) (-> this 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)) (-> this start-corner x)))
(set! (-> sv-36 z) (+ 49152.0 (* 98304.0 (the float s4-0)) (-> this start-corner z)))
(when (sphere-cull sv-36)
(if (not (ocean-trans-camera-masks-bit? this s4-0 s2-0))
(ocean-trans-add-upload this arg0 s4-0 s2-0)
)
)
(+! s2-0 1)
)
)
(+! s4-0 1)
)
(+! s4-0 1)
)
)
)
@@ -722,16 +724,6 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod draw-ocean-transition ((this 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! (-> this trans-camera-masks v1-0) (the-as ocean-trans-mask 0))
(set! (-> this near-mask-indices v1-0) (the-as uint -1))
@@ -739,125 +731,131 @@
(dotimes (v1-3 64)
(set! (-> this trans-mask-ptrs v1-3) (the-as pointer #f))
)
(set! sv-32 (-> this mid-minx))
(set! sv-33 (-> this mid-maxx))
(set! sv-34 (-> this mid-minz))
(set! sv-35 (-> this mid-maxz))
(set! sv-36 (new 'stack 'sphere))
(set! (-> sv-36 y) (-> this start-corner y))
(set! (-> sv-36 r) 278045.7)
(let ((s4-0 sv-34)
(s3-0 sv-35)
(let ((sv-32 (-> this mid-minx))
(sv-33 (-> this mid-maxx))
(sv-34 (-> this mid-minz))
(sv-35 (-> this mid-maxz))
)
(while (>= s3-0 s4-0)
(let ((s2-0 sv-32)
(s1-0 sv-33)
(let ((sv-36 (new 'stack 'sphere)))
(set! (-> sv-36 y) (-> this start-corner y))
(set! (-> sv-36 r) 278045.7)
(let ((s4-0 sv-34)
(s3-0 sv-35)
)
(while (>= s1-0 s2-0)
(when (not (ocean-mid-mask-ptrs-bit? this s4-0 s2-0))
(when (ocean-mid-camera-masks-bit? this s4-0 s2-0)
(set! (-> sv-36 x) (+ 196608.0 (* 393216.0 (the float s2-0)) (-> this start-corner x)))
(set! (-> sv-36 z) (+ 196608.0 (* 393216.0 (the float s4-0)) (-> this start-corner z)))
(if (sphere-cull sv-36)
(ocean-make-trans-camera-masks this 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 (&-> this 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))
)
(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? this s4-0 s2-0))
(when (ocean-mid-camera-masks-bit? this s4-0 s2-0)
(set! (-> sv-36 x) (+ 196608.0 (* 393216.0 (the float s2-0)) (-> this start-corner x)))
(set! (-> sv-36 z) (+ 196608.0 (* 393216.0 (the float s4-0)) (-> this start-corner z)))
(if (sphere-cull sv-36)
(ocean-make-trans-camera-masks this s4-0 s2-0 (- s4-0 sv-34) (- s2-0 sv-32))
)
(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))
)
)
)
)
)
)
)
(+! s2-0 1)
)
(+! t1-0 1)
)
(+! s4-0 1)
)
(+! a3-1 1)
)
)
(set! (-> this near-minx) (the-as uint (+ a2-3 -1)))
(set! (-> this near-maxx) (the-as uint (+ a1-7 1)))
(set! (-> this near-minz) (the-as uint (+ a0-11 -1)))
(set! (-> this near-maxz) (the-as uint (+ v1-33 1)))
)
(dotimes (v1-35 16)
(set! (-> this trans-temp-masks v1-35) (the-as uint (-> this 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)
(let ((a2-3 192)
(a1-7 0)
(a0-11 192)
(v1-33 0)
)
(let ((a3-1 sv-34)
(t0-1 sv-35)
)
(while (>= s1-1 s2-1)
(when (not (ocean-mid-mask-ptrs-bit? this s4-1 s2-1))
(when (ocean-mid-camera-masks-bit? this s4-1 s2-1)
(let ((v1-46 (-> this 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! (-> this near-mask-indices sv-44) (the-as uint (-> v1-46 child)))
(let ((s0-0 (-> this 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 this arg0 s4-1 s2-1 (the-as int t0-2) (the-as int sv-44) sv-48)
(while (>= t0-1 a3-1)
(let ((t1-0 sv-32)
(t2-0 sv-33)
)
(while (>= t2-0 t1-0)
(let ((sv-40 (the-as ocean-trans-mask (&-> this 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! (-> this near-minx) (the-as uint (+ a2-3 -1)))
(set! (-> this near-maxx) (the-as uint (+ a1-7 1)))
(set! (-> this near-minz) (the-as uint (+ a0-11 -1)))
(set! (-> this near-maxz) (the-as uint (+ v1-33 1)))
)
(dotimes (v1-35 16)
(set! (-> this trans-temp-masks v1-35) (the-as uint (-> this 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? this s4-1 s2-1))
(when (ocean-mid-camera-masks-bit? this s4-1 s2-1)
(let ((v1-46 (-> this ocean-trans-indices data (+ (* (the-as uint 48) s4-1) s2-1))))
(when (>= (-> v1-46 parent) 0)
(let ((sv-44 (+ (* (- s4-1 sv-34) 4) (- s2-1 sv-32))))
(set! (-> this near-mask-indices sv-44) (the-as uint (-> v1-46 child)))
(let ((s0-0 (-> this ocean-mid-masks data (-> v1-46 parent)))
(sv-48 0)
)
(while (< sv-48 4)
(let ((t0-2 (-> s0-0 mask sv-48)))
(if (!= t0-2 255)
(ocean-trans-add-upload-strip this arg0 s4-1 s2-1 (the-as int t0-2) (the-as int sv-44) sv-48)
)
)
(+! sv-48 1)
)
)
(set! sv-48 (+ sv-48 1))
)
)
)
)
)
(+! s2-1 1)
)
(+! s2-1 1)
)
(+! s4-1 1)
)
(+! s4-1 1)
)
)
(ocean-mid-add-call-flush this arg0 (the-as uint 41))
+277 -273
View File
@@ -158,7 +158,6 @@
;; WARN: Stack slot offset 48 signed mismatch
;; WARN: Return type mismatch int vs none.
(defmethod ocean-method-60 ((this ocean) (arg0 dma-buffer))
(local-vars (sv-48 float) (sv-52 vector) (sv-56 vector))
(let ((vertices (the-as (inline-array ocean-vertex) (+ #x70000000 0))))
(let ((f0-0 (-> this start-corner z)))
(let ((f1-1 (+ -5898240.0 f0-0)))
@@ -172,79 +171,81 @@
(set! (-> vertices 1 pos w) 0.5)
(set! (-> vertices 2 pos w) 1.0)
(set! (-> vertices 3 pos w) 1.0)
(set! sv-48 (-> this start-corner x))
(set! sv-52 (new 'stack-no-clear 'vector))
(set! sv-56 (new 'stack-no-clear 'vector))
(let ((s3-0 (-> this ocean-colors)))
(let ((s2-0 #f))
(rgba-to-vector! this sv-52 (-> s3-0 colors))
(dotimes (s1-0 48)
(let ((f0-8 (+ (* 393216.0 (the float s1-0)) sv-48)))
(let ((f1-6 (+ 393216.0 f0-8)))
(set! (-> vertices 0 pos x) f0-8)
(set! (-> vertices 1 pos x) f1-6)
(set! (-> vertices 2 pos x) f1-6)
(let ((sv-48 (-> this start-corner x))
(sv-52 (new 'stack-no-clear 'vector))
(sv-56 (new 'stack-no-clear 'vector))
)
(let ((s3-0 (-> this ocean-colors)))
(let ((s2-0 #f))
(rgba-to-vector! this sv-52 (-> s3-0 colors))
(dotimes (s1-0 48)
(let ((f0-8 (+ (* 393216.0 (the float s1-0)) sv-48)))
(let ((f1-6 (+ 393216.0 f0-8)))
(set! (-> vertices 0 pos x) f0-8)
(set! (-> vertices 1 pos x) f1-6)
(set! (-> vertices 2 pos x) f1-6)
)
(set! (-> vertices 3 pos x) f0-8)
)
(set! (-> vertices 3 pos x) f0-8)
)
(rgba-to-vector! this sv-56 (&+ (-> s3-0 colors) (* (+ s1-0 1) 4)))
(set! (-> vertices 0 col quad) (-> sv-52 quad))
(set! (-> vertices 1 col quad) (-> sv-56 quad))
(set! (-> vertices 2 col quad) (-> sv-56 quad))
(set! (-> vertices 3 col quad) (-> sv-52 quad))
(set! (-> sv-52 quad) (-> sv-56 quad))
(cond
((render-ocean-quad vertices arg0)
(set! s2-0 #t)
)
(else
(if s2-0
(goto cfg-9)
)
(rgba-to-vector! this sv-56 (&+ (-> s3-0 colors) (* (+ s1-0 1) 4)))
(set! (-> vertices 0 col quad) (-> sv-52 quad))
(set! (-> vertices 1 col quad) (-> sv-56 quad))
(set! (-> vertices 2 col quad) (-> sv-56 quad))
(set! (-> vertices 3 col quad) (-> sv-52 quad))
(set! (-> sv-52 quad) (-> sv-56 quad))
(cond
((render-ocean-quad vertices arg0)
(set! s2-0 #t)
)
(else
(if s2-0
(goto cfg-9)
)
)
)
)
)
)
)
(label cfg-9)
(let ((f0-10 (+ -5898240.0 (-> this start-corner z))))
(let ((f1-9 (+ -5898240.0 f0-10)))
(set! (-> vertices 0 pos z) f1-9)
(set! (-> vertices 1 pos z) f1-9)
(label cfg-9)
(let ((f0-10 (+ -5898240.0 (-> this start-corner z))))
(let ((f1-9 (+ -5898240.0 f0-10)))
(set! (-> vertices 0 pos z) f1-9)
(set! (-> vertices 1 pos z) f1-9)
)
(set! (-> vertices 2 pos z) f0-10)
(set! (-> vertices 3 pos z) f0-10)
)
(set! (-> vertices 2 pos z) f0-10)
(set! (-> vertices 3 pos z) f0-10)
)
(set! (-> vertices 0 pos w) 0.0)
(set! (-> vertices 1 pos w) 0.0)
(set! (-> vertices 2 pos w) 0.5)
(set! (-> vertices 3 pos w) 0.5)
(let ((s3-1 (-> this ocean-colors)))
(let ((s2-1 #f))
(rgba-to-vector! this sv-52 (-> s3-1 colors))
(dotimes (s1-1 48)
(let ((f0-17 (+ (* 393216.0 (the float s1-1)) sv-48)))
(let ((f1-14 (+ 393216.0 f0-17)))
(set! (-> vertices 0 pos x) f0-17)
(set! (-> vertices 1 pos x) f1-14)
(set! (-> vertices 2 pos x) f1-14)
(set! (-> vertices 0 pos w) 0.0)
(set! (-> vertices 1 pos w) 0.0)
(set! (-> vertices 2 pos w) 0.5)
(set! (-> vertices 3 pos w) 0.5)
(let ((s3-1 (-> this ocean-colors)))
(let ((s2-1 #f))
(rgba-to-vector! this sv-52 (-> s3-1 colors))
(dotimes (s1-1 48)
(let ((f0-17 (+ (* 393216.0 (the float s1-1)) sv-48)))
(let ((f1-14 (+ 393216.0 f0-17)))
(set! (-> vertices 0 pos x) f0-17)
(set! (-> vertices 1 pos x) f1-14)
(set! (-> vertices 2 pos x) f1-14)
)
(set! (-> vertices 3 pos x) f0-17)
)
(set! (-> vertices 3 pos x) f0-17)
)
(rgba-to-vector! this sv-56 (&+ (-> s3-1 colors) (* (+ s1-1 1) 4)))
(add-colors! this (-> vertices 0 col) (-> vertices 0))
(add-colors! this (-> vertices 1 col) (-> vertices 1))
(set! (-> vertices 2 col quad) (-> sv-56 quad))
(set! (-> vertices 3 col quad) (-> sv-52 quad))
(set! (-> sv-52 quad) (-> sv-56 quad))
(cond
((render-ocean-quad vertices arg0)
(set! s2-1 #t)
)
(else
(if s2-1
(goto cfg-18)
)
(rgba-to-vector! this sv-56 (&+ (-> s3-1 colors) (* (+ s1-1 1) 4)))
(add-colors! this (-> vertices 0 col) (-> vertices 0))
(add-colors! this (-> vertices 1 col) (-> vertices 1))
(set! (-> vertices 2 col quad) (-> sv-56 quad))
(set! (-> vertices 3 col quad) (-> sv-52 quad))
(set! (-> sv-52 quad) (-> sv-56 quad))
(cond
((render-ocean-quad vertices arg0)
(set! s2-1 #t)
)
(else
(if s2-1
(goto cfg-18)
)
)
)
)
)
@@ -272,7 +273,6 @@
;; WARN: Stack slot offset 48 signed mismatch
;; WARN: Return type mismatch int vs none.
(defmethod ocean-method-61 ((this ocean) (arg0 dma-buffer))
(local-vars (sv-48 float) (sv-52 vector) (sv-56 vector))
(let ((vertices (the-as (inline-array ocean-vertex) (+ #x70000000 0))))
(let* ((f0-1 (+ 18874368.0 (-> this start-corner z)))
(f1-2 (+ 5898240.0 f0-1))
@@ -286,79 +286,81 @@
(set! (-> vertices 1 pos w) 1.0)
(set! (-> vertices 2 pos w) 0.5)
(set! (-> vertices 3 pos w) 0.5)
(set! sv-48 (-> this start-corner x))
(set! sv-52 (new 'stack-no-clear 'vector))
(set! sv-56 (new 'stack-no-clear 'vector))
(let ((s3-0 (-> this ocean-colors)))
(let ((s2-0 #f))
(rgba-to-vector! this sv-52 (&-> s3-0 colors 2444))
(dotimes (s1-0 48)
(let ((f0-9 (+ (* 393216.0 (the float s1-0)) sv-48)))
(let ((f1-7 (+ 393216.0 f0-9)))
(set! (-> vertices 0 pos x) f0-9)
(set! (-> vertices 1 pos x) f1-7)
(set! (-> vertices 2 pos x) f1-7)
(let ((sv-48 (-> this start-corner x))
(sv-52 (new 'stack-no-clear 'vector))
(sv-56 (new 'stack-no-clear 'vector))
)
(let ((s3-0 (-> this ocean-colors)))
(let ((s2-0 #f))
(rgba-to-vector! this sv-52 (&-> s3-0 colors 2444))
(dotimes (s1-0 48)
(let ((f0-9 (+ (* 393216.0 (the float s1-0)) sv-48)))
(let ((f1-7 (+ 393216.0 f0-9)))
(set! (-> vertices 0 pos x) f0-9)
(set! (-> vertices 1 pos x) f1-7)
(set! (-> vertices 2 pos x) f1-7)
)
(set! (-> vertices 3 pos x) f0-9)
)
(set! (-> vertices 3 pos x) f0-9)
)
(rgba-to-vector! this sv-56 (&+ (-> s3-0 colors) (* (+ s1-0 2445) 4)))
(set! (-> vertices 0 col quad) (-> sv-52 quad))
(set! (-> vertices 1 col quad) (-> sv-56 quad))
(set! (-> vertices 2 col quad) (-> sv-56 quad))
(set! (-> vertices 3 col quad) (-> sv-52 quad))
(set! (-> sv-52 quad) (-> sv-56 quad))
(cond
((render-ocean-quad vertices arg0)
(set! s2-0 #t)
)
(else
(if s2-0
(goto cfg-9)
)
(rgba-to-vector! this sv-56 (&+ (-> s3-0 colors) (* (+ s1-0 2445) 4)))
(set! (-> vertices 0 col quad) (-> sv-52 quad))
(set! (-> vertices 1 col quad) (-> sv-56 quad))
(set! (-> vertices 2 col quad) (-> sv-56 quad))
(set! (-> vertices 3 col quad) (-> sv-52 quad))
(set! (-> sv-52 quad) (-> sv-56 quad))
(cond
((render-ocean-quad vertices arg0)
(set! s2-0 #t)
)
(else
(if s2-0
(goto cfg-9)
)
)
)
)
)
)
)
(label cfg-9)
(let* ((f0-11 (+ 24772608.0 (-> this start-corner z)))
(f1-10 (+ 5898240.0 f0-11))
)
(set! (-> vertices 0 pos z) f0-11)
(set! (-> vertices 1 pos z) f0-11)
(set! (-> vertices 2 pos z) f1-10)
(set! (-> vertices 3 pos z) f1-10)
)
(set! (-> vertices 0 pos w) 0.5)
(set! (-> vertices 1 pos w) 0.5)
(set! (-> vertices 2 pos w) 0.0)
(set! (-> vertices 3 pos w) 0.0)
(let ((s3-1 (-> this ocean-colors)))
(let ((s2-1 #f))
(rgba-to-vector! this sv-52 (&-> s3-1 colors 2444))
(dotimes (s1-1 48)
(let ((f0-18 (+ (* 393216.0 (the float s1-1)) sv-48)))
(let ((f1-15 (+ 393216.0 f0-18)))
(set! (-> vertices 0 pos x) f0-18)
(set! (-> vertices 1 pos x) f1-15)
(set! (-> vertices 2 pos x) f1-15)
)
(set! (-> vertices 3 pos x) f0-18)
)
(rgba-to-vector! this sv-56 (&+ (-> s3-1 colors) (* (+ s1-1 2445) 4)))
(set! (-> vertices 0 col quad) (-> sv-52 quad))
(set! (-> vertices 1 col quad) (-> sv-56 quad))
(add-colors! this (-> vertices 2 col) (-> vertices 2))
(add-colors! this (-> vertices 3 col) (-> vertices 3))
(set! (-> sv-52 quad) (-> sv-56 quad))
(cond
((render-ocean-quad vertices arg0)
(set! s2-1 #t)
(label cfg-9)
(let* ((f0-11 (+ 24772608.0 (-> this start-corner z)))
(f1-10 (+ 5898240.0 f0-11))
)
(else
(if s2-1
(goto cfg-18)
)
(set! (-> vertices 0 pos z) f0-11)
(set! (-> vertices 1 pos z) f0-11)
(set! (-> vertices 2 pos z) f1-10)
(set! (-> vertices 3 pos z) f1-10)
)
(set! (-> vertices 0 pos w) 0.5)
(set! (-> vertices 1 pos w) 0.5)
(set! (-> vertices 2 pos w) 0.0)
(set! (-> vertices 3 pos w) 0.0)
(let ((s3-1 (-> this ocean-colors)))
(let ((s2-1 #f))
(rgba-to-vector! this sv-52 (&-> s3-1 colors 2444))
(dotimes (s1-1 48)
(let ((f0-18 (+ (* 393216.0 (the float s1-1)) sv-48)))
(let ((f1-15 (+ 393216.0 f0-18)))
(set! (-> vertices 0 pos x) f0-18)
(set! (-> vertices 1 pos x) f1-15)
(set! (-> vertices 2 pos x) f1-15)
)
(set! (-> vertices 3 pos x) f0-18)
)
(rgba-to-vector! this sv-56 (&+ (-> s3-1 colors) (* (+ s1-1 2445) 4)))
(set! (-> vertices 0 col quad) (-> sv-52 quad))
(set! (-> vertices 1 col quad) (-> sv-56 quad))
(add-colors! this (-> vertices 2 col) (-> vertices 2))
(add-colors! this (-> vertices 3 col) (-> vertices 3))
(set! (-> sv-52 quad) (-> sv-56 quad))
(cond
((render-ocean-quad vertices arg0)
(set! s2-1 #t)
)
(else
(if s2-1
(goto cfg-18)
)
)
)
)
)
@@ -386,7 +388,6 @@
;; WARN: Stack slot offset 48 signed mismatch
;; WARN: Return type mismatch int vs none.
(defmethod ocean-method-62 ((this ocean) (arg0 dma-buffer))
(local-vars (sv-48 float) (sv-52 vector) (sv-56 vector))
(let ((vertices (the-as (inline-array ocean-vertex) (+ #x70000000 0))))
(let* ((f0-0 (-> this start-corner x))
(f1-1 (+ -5898240.0 f0-0))
@@ -400,79 +401,81 @@
(set! (-> vertices 1 pos w) 1.0)
(set! (-> vertices 2 pos w) 1.0)
(set! (-> vertices 3 pos w) 0.5)
(set! sv-48 (-> this start-corner z))
(set! sv-52 (new 'stack-no-clear 'vector))
(set! sv-56 (new 'stack-no-clear 'vector))
(let ((s3-0 (-> this ocean-colors)))
(let ((s2-0 #f))
(rgba-to-vector! this sv-52 (-> s3-0 colors))
(dotimes (s1-0 48)
(let* ((f0-8 (+ (* 393216.0 (the float s1-0)) sv-48))
(f1-6 (+ 393216.0 f0-8))
)
(set! (-> vertices 0 pos z) f0-8)
(set! (-> vertices 1 pos z) f0-8)
(set! (-> vertices 2 pos z) f1-6)
(set! (-> vertices 3 pos z) f1-6)
)
(rgba-to-vector! this sv-56 (&+ (-> s3-0 colors) (* 208 (+ s1-0 1))))
(set! (-> vertices 0 col quad) (-> sv-52 quad))
(set! (-> vertices 1 col quad) (-> sv-52 quad))
(set! (-> vertices 2 col quad) (-> sv-56 quad))
(set! (-> vertices 3 col quad) (-> sv-56 quad))
(set! (-> sv-52 quad) (-> sv-56 quad))
(cond
((render-ocean-quad vertices arg0)
(set! s2-0 #t)
)
(else
(if s2-0
(goto cfg-9)
)
(let ((sv-48 (-> this start-corner z))
(sv-52 (new 'stack-no-clear 'vector))
(sv-56 (new 'stack-no-clear 'vector))
)
(let ((s3-0 (-> this ocean-colors)))
(let ((s2-0 #f))
(rgba-to-vector! this sv-52 (-> s3-0 colors))
(dotimes (s1-0 48)
(let* ((f0-8 (+ (* 393216.0 (the float s1-0)) sv-48))
(f1-6 (+ 393216.0 f0-8))
)
(set! (-> vertices 0 pos z) f0-8)
(set! (-> vertices 1 pos z) f0-8)
(set! (-> vertices 2 pos z) f1-6)
(set! (-> vertices 3 pos z) f1-6)
)
(rgba-to-vector! this sv-56 (&+ (-> s3-0 colors) (* 208 (+ s1-0 1))))
(set! (-> vertices 0 col quad) (-> sv-52 quad))
(set! (-> vertices 1 col quad) (-> sv-52 quad))
(set! (-> vertices 2 col quad) (-> sv-56 quad))
(set! (-> vertices 3 col quad) (-> sv-56 quad))
(set! (-> sv-52 quad) (-> sv-56 quad))
(cond
((render-ocean-quad vertices arg0)
(set! s2-0 #t)
)
(else
(if s2-0
(goto cfg-9)
)
)
)
)
)
)
)
(label cfg-9)
(let* ((f0-10 (+ -5898240.0 (-> this start-corner x)))
(f1-9 (+ -5898240.0 f0-10))
)
(set! (-> vertices 0 pos x) f1-9)
(set! (-> vertices 1 pos x) f0-10)
(set! (-> vertices 2 pos x) f0-10)
(set! (-> vertices 3 pos x) f1-9)
)
(set! (-> vertices 0 pos w) 0.0)
(set! (-> vertices 1 pos w) 0.5)
(set! (-> vertices 2 pos w) 0.5)
(set! (-> vertices 3 pos w) 0.0)
(let ((s3-1 (-> this ocean-colors)))
(let ((s2-1 #f))
(rgba-to-vector! this sv-52 (-> s3-1 colors))
(dotimes (s1-1 48)
(let* ((f0-17 (+ (* 393216.0 (the float s1-1)) sv-48))
(f1-14 (+ 393216.0 f0-17))
)
(set! (-> vertices 0 pos z) f0-17)
(set! (-> vertices 1 pos z) f0-17)
(set! (-> vertices 2 pos z) f1-14)
(set! (-> vertices 3 pos z) f1-14)
)
(rgba-to-vector! this sv-56 (&+ (-> s3-1 colors) (* 208 (+ s1-1 1))))
(add-colors! this (-> vertices 0 col) (-> vertices 0))
(set! (-> vertices 1 col quad) (-> sv-52 quad))
(set! (-> vertices 2 col quad) (-> sv-56 quad))
(add-colors! this (-> vertices 3 col) (-> vertices 3))
(set! (-> sv-52 quad) (-> sv-56 quad))
(cond
((render-ocean-quad vertices arg0)
(set! s2-1 #t)
(label cfg-9)
(let* ((f0-10 (+ -5898240.0 (-> this start-corner x)))
(f1-9 (+ -5898240.0 f0-10))
)
(else
(if s2-1
(goto cfg-18)
)
(set! (-> vertices 0 pos x) f1-9)
(set! (-> vertices 1 pos x) f0-10)
(set! (-> vertices 2 pos x) f0-10)
(set! (-> vertices 3 pos x) f1-9)
)
(set! (-> vertices 0 pos w) 0.0)
(set! (-> vertices 1 pos w) 0.5)
(set! (-> vertices 2 pos w) 0.5)
(set! (-> vertices 3 pos w) 0.0)
(let ((s3-1 (-> this ocean-colors)))
(let ((s2-1 #f))
(rgba-to-vector! this sv-52 (-> s3-1 colors))
(dotimes (s1-1 48)
(let* ((f0-17 (+ (* 393216.0 (the float s1-1)) sv-48))
(f1-14 (+ 393216.0 f0-17))
)
(set! (-> vertices 0 pos z) f0-17)
(set! (-> vertices 1 pos z) f0-17)
(set! (-> vertices 2 pos z) f1-14)
(set! (-> vertices 3 pos z) f1-14)
)
(rgba-to-vector! this sv-56 (&+ (-> s3-1 colors) (* 208 (+ s1-1 1))))
(add-colors! this (-> vertices 0 col) (-> vertices 0))
(set! (-> vertices 1 col quad) (-> sv-52 quad))
(set! (-> vertices 2 col quad) (-> sv-56 quad))
(add-colors! this (-> vertices 3 col) (-> vertices 3))
(set! (-> sv-52 quad) (-> sv-56 quad))
(cond
((render-ocean-quad vertices arg0)
(set! s2-1 #t)
)
(else
(if s2-1
(goto cfg-18)
)
)
)
)
)
@@ -500,7 +503,6 @@
;; WARN: Stack slot offset 48 signed mismatch
;; WARN: Return type mismatch int vs none.
(defmethod ocean-method-63 ((this ocean) (arg0 dma-buffer))
(local-vars (sv-48 float) (sv-52 vector) (sv-56 vector))
(let ((vertices (the-as (inline-array ocean-vertex) (+ #x70000000 0))))
(let ((f0-1 (+ 18874368.0 (-> this start-corner x))))
(let ((f1-2 (+ 5898240.0 f0-1)))
@@ -514,79 +516,81 @@
(set! (-> vertices 1 pos w) 0.5)
(set! (-> vertices 2 pos w) 0.5)
(set! (-> vertices 3 pos w) 1.0)
(set! sv-48 (-> this start-corner z))
(set! sv-52 (new 'stack-no-clear 'vector))
(set! sv-56 (new 'stack-no-clear 'vector))
(let ((s3-0 (-> this ocean-colors)))
(let ((s2-0 #f))
(rgba-to-vector! this sv-52 (&-> s3-0 colors 47))
(dotimes (s1-0 48)
(let* ((f0-9 (+ (* 393216.0 (the float s1-0)) sv-48))
(f1-7 (+ 393216.0 f0-9))
)
(set! (-> vertices 0 pos z) f0-9)
(set! (-> vertices 1 pos z) f0-9)
(set! (-> vertices 2 pos z) f1-7)
(set! (-> vertices 3 pos z) f1-7)
)
(rgba-to-vector! this sv-56 (&+ (-> s3-0 colors) (* (+ (* 52 (+ s1-0 1)) 47) 4)))
(set! (-> vertices 0 col quad) (-> sv-52 quad))
(set! (-> vertices 1 col quad) (-> sv-52 quad))
(set! (-> vertices 2 col quad) (-> sv-56 quad))
(set! (-> vertices 3 col quad) (-> sv-56 quad))
(set! (-> sv-52 quad) (-> sv-56 quad))
(cond
((render-ocean-quad vertices arg0)
(set! s2-0 #t)
)
(else
(if s2-0
(goto cfg-9)
)
(let ((sv-48 (-> this start-corner z))
(sv-52 (new 'stack-no-clear 'vector))
(sv-56 (new 'stack-no-clear 'vector))
)
(let ((s3-0 (-> this ocean-colors)))
(let ((s2-0 #f))
(rgba-to-vector! this sv-52 (&-> s3-0 colors 47))
(dotimes (s1-0 48)
(let* ((f0-9 (+ (* 393216.0 (the float s1-0)) sv-48))
(f1-7 (+ 393216.0 f0-9))
)
(set! (-> vertices 0 pos z) f0-9)
(set! (-> vertices 1 pos z) f0-9)
(set! (-> vertices 2 pos z) f1-7)
(set! (-> vertices 3 pos z) f1-7)
)
(rgba-to-vector! this sv-56 (&+ (-> s3-0 colors) (* (+ (* 52 (+ s1-0 1)) 47) 4)))
(set! (-> vertices 0 col quad) (-> sv-52 quad))
(set! (-> vertices 1 col quad) (-> sv-52 quad))
(set! (-> vertices 2 col quad) (-> sv-56 quad))
(set! (-> vertices 3 col quad) (-> sv-56 quad))
(set! (-> sv-52 quad) (-> sv-56 quad))
(cond
((render-ocean-quad vertices arg0)
(set! s2-0 #t)
)
(else
(if s2-0
(goto cfg-9)
)
)
)
)
)
)
)
(label cfg-9)
(let ((f0-11 (+ 24772608.0 (-> this start-corner x))))
(let ((f1-10 (+ 5898240.0 f0-11)))
(set! (-> vertices 0 pos x) f0-11)
(set! (-> vertices 1 pos x) f1-10)
(set! (-> vertices 2 pos x) f1-10)
(label cfg-9)
(let ((f0-11 (+ 24772608.0 (-> this start-corner x))))
(let ((f1-10 (+ 5898240.0 f0-11)))
(set! (-> vertices 0 pos x) f0-11)
(set! (-> vertices 1 pos x) f1-10)
(set! (-> vertices 2 pos x) f1-10)
)
(set! (-> vertices 3 pos x) f0-11)
)
(set! (-> vertices 3 pos x) f0-11)
)
(set! (-> vertices 0 pos w) 0.5)
(set! (-> vertices 1 pos w) 0.0)
(set! (-> vertices 2 pos w) 0.0)
(set! (-> vertices 3 pos w) 0.5)
(let ((s3-1 (-> this ocean-colors)))
(let ((s2-1 #f))
(rgba-to-vector! this sv-52 (&-> s3-1 colors 47))
(dotimes (s1-1 48)
(let* ((f0-18 (+ (* 393216.0 (the float s1-1)) sv-48))
(f1-15 (+ 393216.0 f0-18))
)
(set! (-> vertices 0 pos z) f0-18)
(set! (-> vertices 1 pos z) f0-18)
(set! (-> vertices 2 pos z) f1-15)
(set! (-> vertices 3 pos z) f1-15)
)
(rgba-to-vector! this sv-56 (&+ (-> s3-1 colors) (* (+ (* 52 (+ s1-1 1)) 47) 4)))
(set! (-> vertices 0 col quad) (-> sv-52 quad))
(add-colors! this (-> vertices 1 col) (-> vertices 1))
(add-colors! this (-> vertices 2 col) (-> vertices 2))
(set! (-> vertices 3 col quad) (-> sv-56 quad))
(set! (-> sv-52 quad) (-> sv-56 quad))
(cond
((render-ocean-quad vertices arg0)
(set! s2-1 #t)
)
(else
(if s2-1
(goto cfg-18)
)
(set! (-> vertices 0 pos w) 0.5)
(set! (-> vertices 1 pos w) 0.0)
(set! (-> vertices 2 pos w) 0.0)
(set! (-> vertices 3 pos w) 0.5)
(let ((s3-1 (-> this ocean-colors)))
(let ((s2-1 #f))
(rgba-to-vector! this sv-52 (&-> s3-1 colors 47))
(dotimes (s1-1 48)
(let* ((f0-18 (+ (* 393216.0 (the float s1-1)) sv-48))
(f1-15 (+ 393216.0 f0-18))
)
(set! (-> vertices 0 pos z) f0-18)
(set! (-> vertices 1 pos z) f0-18)
(set! (-> vertices 2 pos z) f1-15)
(set! (-> vertices 3 pos z) f1-15)
)
(rgba-to-vector! this sv-56 (&+ (-> s3-1 colors) (* (+ (* 52 (+ s1-1 1)) 47) 4)))
(set! (-> vertices 0 col quad) (-> sv-52 quad))
(add-colors! this (-> vertices 1 col) (-> vertices 1))
(add-colors! this (-> vertices 2 col) (-> vertices 2))
(set! (-> vertices 3 col quad) (-> sv-56 quad))
(set! (-> sv-52 quad) (-> sv-56 quad))
(cond
((render-ocean-quad vertices arg0)
(set! s2-1 #t)
)
(else
(if s2-1
(goto cfg-18)
)
)
)
)
)
+65 -58
View File
@@ -435,16 +435,7 @@
;; INFO: Used lq/sq
;; ERROR: Failed load: (set! a2-26 (l.d (+ a0-26 96))) at op 223
(defun draw-prototype-inline-array-shrub ((proto-array-len int) (proto-array (inline-array prototype-bucket-shrub)))
(local-vars
(sv-16 drawable)
(sv-32 uint)
(sv-48 int)
(sv-64 drawable)
(sv-80 int)
(sv-96 uint)
(sv-112 drawable)
(sv-128 int)
)
(local-vars (sv-16 drawable) (sv-48 int))
(let ((v1-0 (the-as prototype-bucket-shrub proto-array))
(a0-6 (-> *display* frames (-> *display* on-screen) global-buf))
)
@@ -661,36 +652,51 @@
(let ((s1-0 (the-as object proto-array)))
(countdown (s0-0 proto-array-len)
(when (nonzero? (-> (the-as prototype-bucket-shrub s1-0) count 1))
(if (logtest? (-> (the-as prototype-bucket-shrub s1-0) flags) (prototype-flags tpage-alpha))
(set! sv-16 (-> (the-as prototype-bucket-shrub s1-0) geometry 2))
(set! sv-16 (-> (the-as prototype-bucket-shrub s1-0) geometry 1))
)
(set! sv-32 (-> (the-as prototype-bucket-shrub s1-0) next 1))
(if (logtest? (-> (the-as prototype-bucket-shrub s1-0) flags) (prototype-flags tpage-alpha))
(set! sv-48 #x51001)
(set! sv-48 #x5026b)
)
(set! sv-64 (&+ sv-16 32))
(set! sv-80 0)
(while (< sv-80 (-> (the-as drawable-group sv-16) length))
(shrub-upload-model
(the-as shrubbery sv-64)
s2-2
(the-as int (-> *instance-shrub-work* start-bank (-> (the-as prototype-bucket-shrub s1-0) mod-count 1)))
)
(if (zero? sv-80)
(dma-buffer-add-gs-set s2-2 (test-1 sv-48))
(set! sv-16 (cond
((logtest? (-> (the-as prototype-bucket-shrub s1-0) flags) (prototype-flags tpage-alpha))
(set! sv-16 (-> (the-as prototype-bucket-shrub s1-0) geometry 2))
sv-16
)
(else
(-> (the-as prototype-bucket-shrub s1-0) geometry 1)
)
)
)
(let ((sv-32 (-> (the-as prototype-bucket-shrub s1-0) next 1)))
(set! sv-48 (cond
((logtest? (-> (the-as prototype-bucket-shrub s1-0) flags) (prototype-flags tpage-alpha))
(set! sv-48 #x51001)
sv-48
)
(else
#x5026b
)
)
)
(let ((sv-64 (&+ sv-16 32))
(sv-80 0)
)
(while (< sv-80 (-> (the-as drawable-group sv-16) length))
(shrub-upload-model
(the-as shrubbery sv-64)
s2-2
(the-as int (-> *instance-shrub-work* start-bank (-> (the-as prototype-bucket-shrub s1-0) mod-count 1)))
)
(if (zero? sv-80)
(dma-buffer-add-gs-set s2-2 (test-1 sv-48))
)
(let* ((v1-97 s2-2)
(a0-42 (-> v1-97 base))
)
(set! (-> (the-as (pointer uint64) a0-42)) (logior #x50000000 (shr (shl sv-32 33) 1)))
(s.w! (+ a0-42 8) 0)
(s.w! (+ a0-42 12) 0)
(set! (-> v1-97 base) (&+ a0-42 16))
)
(&+! sv-64 32)
(+! sv-80 1)
)
(let* ((v1-97 s2-2)
(a0-42 (-> v1-97 base))
)
(set! (-> (the-as (pointer uint64) a0-42)) (logior #x50000000 (shr (shl sv-32 33) 1)))
(s.w! (+ a0-42 8) 0)
(s.w! (+ a0-42 12) 0)
(set! (-> v1-97 base) (&+ a0-42 16))
)
(set! sv-64 (&+ sv-64 32))
(set! sv-80 (+ sv-80 1))
)
)
(set! s1-0 (&+ (the-as prototype-bucket-shrub s1-0) 112))
@@ -765,27 +771,28 @@
(let ((s1-1 (the-as object proto-array)))
(countdown (s0-1 proto-array-len)
(when (nonzero? (-> (the-as prototype-bucket-shrub s1-1) count 2))
(let ((v1-132 (-> (the-as prototype-bucket-shrub s1-1) geometry 2)))
(set! sv-96 (-> (the-as prototype-bucket-shrub s1-1) next 2))
(set! sv-112 (&+ v1-132 32))
(set! sv-128 (-> (the-as drawable-group v1-132) length))
)
(while (nonzero? sv-128)
(set! sv-128 (+ sv-128 -1))
(shrub-upload-model
(the-as shrubbery sv-112)
s2-3
(the-as int (-> *instance-shrub-work* start-bank (-> (the-as prototype-bucket-shrub s1-1) mod-count 2)))
(let* ((v1-132 (-> (the-as prototype-bucket-shrub s1-1) geometry 2))
(sv-96 (-> (the-as prototype-bucket-shrub s1-1) next 2))
(sv-112 (&+ v1-132 32))
(sv-128 (-> (the-as drawable-group v1-132) length))
)
(while (nonzero? sv-128)
(+! sv-128 -1)
(shrub-upload-model
(the-as shrubbery sv-112)
s2-3
(the-as int (-> *instance-shrub-work* start-bank (-> (the-as prototype-bucket-shrub s1-1) mod-count 2)))
)
(let* ((v1-138 s2-3)
(a0-58 (-> v1-138 base))
)
(set! (-> (the-as (pointer uint64) a0-58)) (logior #x50000000 (shr (shl sv-96 33) 1)))
(s.w! (+ a0-58 8) 0)
(s.w! (+ a0-58 12) 0)
(set! (-> v1-138 base) (&+ a0-58 16))
)
(&+! sv-112 32)
)
(let* ((v1-138 s2-3)
(a0-58 (-> v1-138 base))
)
(set! (-> (the-as (pointer uint64) a0-58)) (logior #x50000000 (shr (shl sv-96 33) 1)))
(s.w! (+ a0-58 8) 0)
(s.w! (+ a0-58 12) 0)
(set! (-> v1-138 base) (&+ a0-58 16))
)
(set! sv-112 (&+ sv-112 32))
)
)
(set! s1-1 (&+ (the-as prototype-bucket-shrub s1-1) 112))
+25 -22
View File
@@ -305,7 +305,7 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod draw-clouds ((this sky-work) (arg0 dma-buffer))
(local-vars (v1-19 float) (sv-16 cloud-vert-array) (sv-20 (inline-array sky-vertex)) (sv-32 int))
(local-vars (v1-19 float))
(rlet ((vf23 :class vf)
(vf27 :class vf)
)
@@ -343,13 +343,15 @@
(set-tex-offset (the-as int (-> this off-s)) (the-as int (-> this off-t)))
(let ((s4-1 (the-as object (-> arg0 base))))
(&+! (-> arg0 base) 16)
(set! sv-16 *cloud-vert-array*)
(set! sv-20 *cloud-poly*)
(dotimes (s3-1 9)
(dotimes (s2-2 9)
(let ((s1-0 (+ (* 10 s3-1) s2-2)))
(set! sv-32 (+ (* 9 s3-1) s2-2))
(let ((s0-0 (+ s2-2 81 (* 9 s3-1))))
(let ((sv-16 *cloud-vert-array*)
(sv-20 *cloud-poly*)
)
(dotimes (s3-1 9)
(dotimes (s2-2 9)
(let ((s1-0 (+ (* 10 s3-1) s2-2))
(sv-32 (+ (* 9 s3-1) s2-2))
(s0-0 (+ s2-2 81 (* 9 s3-1)))
)
(cloud-vtx1-to-sky this (-> sv-20 (* sv-32 4)) (-> sv-16 data s1-0))
(cloud-vtx1-to-sky this (-> sv-20 (+ (* sv-32 4) 1)) (-> sv-16 data (+ s1-0 1)))
(cloud-vtx1-to-sky this (-> sv-20 (+ (* sv-32 4) 2)) (-> sv-16 data (+ s1-0 11)))
@@ -361,9 +363,9 @@
)
)
)
)
(dotimes (s5-1 162)
(render-sky-quad (the-as (inline-array sky-vertex) (-> sv-20 (* s5-1 4))) arg0)
(dotimes (s5-1 162)
(render-sky-quad (the-as (inline-array sky-vertex) (-> sv-20 (* s5-1 4))) arg0)
)
)
(close-sky-buffer arg0)
(let ((v1-81 (/ (the-as int (+ (- -16 (the-as int s4-1)) (the-as int (-> arg0 base)))) 16)))
@@ -469,23 +471,24 @@
;; definition for method 27 of type sky-work
;; WARN: Return type mismatch int vs none.
(defmethod draw-haze ((this sky-work) (arg0 dma-buffer))
(local-vars (sv-16 haze-vert-array) (sv-20 (inline-array sky-vertex)))
(rlet ((vf27 :class vf))
(dma-buffer-add-gs-set arg0 (alpha-1 (new 'static 'gs-alpha :b #x1 :d #x1)))
(init-regs-for-large-polygon-draw this)
(.lvf vf27 (&-> this giftag-haze quad))
(let ((s4-0 (the-as object (-> arg0 base))))
(&+! (-> arg0 base) 16)
(set! sv-16 *haze-vert-array*)
(set! sv-20 *haze-poly*)
(dotimes (s3-0 35)
(haze-vtx-to-sky this (-> sv-20 (* s3-0 4)) (-> sv-20 (+ (* s3-0 4) 1)) (-> sv-16 data s3-0))
(haze-vtx-to-sky this (-> sv-20 (+ (* s3-0 4) 3)) (-> sv-20 (+ (* s3-0 4) 2)) (-> sv-16 data (+ s3-0 1)))
)
(haze-vtx-to-sky this (-> sv-20 140) (-> sv-20 141) (-> sv-16 data 35))
(haze-vtx-to-sky this (-> sv-20 143) (-> sv-20 142) (-> sv-16 data 0))
(dotimes (s5-1 36)
(render-sky-quad (the-as (inline-array sky-vertex) (-> sv-20 (* s5-1 4))) arg0)
(let ((sv-16 *haze-vert-array*)
(sv-20 *haze-poly*)
)
(dotimes (s3-0 35)
(haze-vtx-to-sky this (-> sv-20 (* s3-0 4)) (-> sv-20 (+ (* s3-0 4) 1)) (-> sv-16 data s3-0))
(haze-vtx-to-sky this (-> sv-20 (+ (* s3-0 4) 3)) (-> sv-20 (+ (* s3-0 4) 2)) (-> sv-16 data (+ s3-0 1)))
)
(haze-vtx-to-sky this (-> sv-20 140) (-> sv-20 141) (-> sv-16 data 35))
(haze-vtx-to-sky this (-> sv-20 143) (-> sv-20 142) (-> sv-16 data 0))
(dotimes (s5-1 36)
(render-sky-quad (the-as (inline-array sky-vertex) (-> sv-20 (* s5-1 4))) arg0)
)
)
(close-sky-buffer arg0)
(let ((v1-41 (/ (the-as int (+ (- -16 (the-as int s4-0)) (the-as int (-> arg0 base)))) 16)))
@@ -650,7 +650,7 @@
(set! (-> v1-0 x) f0-0)
(set! (-> v1-0 y) f1-0)
(set! (-> v1-0 z) f2-0)
(set! (-> v1-0 w) (sqrtf (- (- (- 1.0 (* f2-0 f2-0)) (* f1-0 f1-0)) (* f0-0 f0-0))))
(set! (-> v1-0 w) (sqrtf (- (- (- 1.0 (square f2-0)) (square f1-0)) (square f0-0))))
)
(quaternion->matrix s5-0 a1-1)
)
@@ -957,7 +957,7 @@
(set! (-> v1-0 x) f0-0)
(set! (-> v1-0 y) f1-0)
(set! (-> v1-0 z) f2-0)
(set! (-> v1-0 w) (sqrtf (- (- (- 1.0 (* f2-0 f2-0)) (* f1-0 f1-0)) (* f0-0 f0-0))))
(set! (-> v1-0 w) (sqrtf (- (- (- 1.0 (square f2-0)) (square f1-0)) (square f0-0))))
)
(set! (-> arg3 qx-qy-qz-sy x) 0.0)
(set! (-> arg3 qx-qy-qz-sy y) 0.0)
@@ -1469,7 +1469,6 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defun execute-part-engine ()
(local-vars (sv-96 sparticle-launcher) (sv-104 int))
(let ((gp-0 *sp-particle-system-2d*))
(let* ((s5-0 *part-engine*)
(s4-0 *part-id-table*)
@@ -1486,28 +1485,30 @@
(when (and (logtest? (-> a1-0 status) (draw-control-status on-screen))
(< (-> a1-0 distance) (-> (the-as vector s0-0) w))
)
(set! sv-96 (-> s4-0 (-> (the-as connection v1-1) param2)))
(set! sv-104 (the-as int (-> (the-as connection v1-1) param0)))
(when (nonzero? sv-96)
(let ((a1-8 (-> a0-2 node-list data sv-104)))
(let* ((v1-7 s3-0)
(t0-0 (-> a1-8 bone transform))
(a0-5 (-> t0-0 quad 0))
(a2-2 (-> t0-0 quad 1))
(a3-0 (-> t0-0 quad 2))
(t0-1 (-> t0-0 trans quad))
)
(set! (-> v1-7 quad 0) a0-5)
(set! (-> v1-7 quad 1) a2-2)
(set! (-> v1-7 quad 2) a3-0)
(set! (-> v1-7 trans quad) t0-1)
(let ((sv-96 (-> s4-0 (-> (the-as connection v1-1) param2)))
(sv-104 (the-as int (-> (the-as connection v1-1) param0)))
)
(vector<-cspace! (-> s3-0 trans) a1-8)
(when (nonzero? sv-96)
(let ((a1-8 (-> a0-2 node-list data sv-104)))
(let* ((v1-7 s3-0)
(t0-0 (-> a1-8 bone transform))
(a0-5 (-> t0-0 quad 0))
(a2-2 (-> t0-0 quad 1))
(a3-0 (-> t0-0 quad 2))
(t0-1 (-> t0-0 trans quad))
)
(set! (-> v1-7 quad 0) a0-5)
(set! (-> v1-7 quad 1) a2-2)
(set! (-> v1-7 quad 2) a3-0)
(set! (-> v1-7 trans quad) t0-1)
)
(vector<-cspace! (-> s3-0 trans) a1-8)
)
(set! (-> s2-0 quad) (-> (the-as vector s0-0) quad))
(set! (-> s2-0 w) 1.0)
(vector-matrix*! (-> s3-0 trans) s2-0 s3-0)
(launch-particles :system gp-0 sv-96 s3-0 :origin-is-matrix #t)
)
(set! (-> s2-0 quad) (-> (the-as vector s0-0) quad))
(set! (-> s2-0 w) 1.0)
(vector-matrix*! (-> s3-0 trans) s2-0 s3-0)
(launch-particles :system gp-0 sv-96 s3-0 :origin-is-matrix #t)
)
)
)
@@ -1662,7 +1663,7 @@
(set! (-> s4-0 x) f0-0)
(set! (-> s4-0 y) f1-0)
(set! (-> s4-0 z) f2-0)
(set! (-> s4-0 w) (sqrtf (- (- (- 1.0 (* f2-0 f2-0)) (* f1-0 f1-0)) (* f0-0 f0-0))))
(set! (-> s4-0 w) (sqrtf (- (- (- 1.0 (square f2-0)) (square f1-0)) (square f0-0))))
)
(quaternion-rotate-y! s4-0 s4-0 (-> s5-0 sprite flag-rot-sy z))
(let ((v1-4 arg2))
@@ -1721,7 +1722,7 @@
(set! (-> s4-0 x) f0-0)
(set! (-> s4-0 y) f1-0)
(set! (-> s4-0 z) f2-0)
(set! (-> s4-0 w) (sqrtf (- (- (- 1.0 (* f2-0 f2-0)) (* f1-0 f1-0)) (* f0-0 f0-0))))
(set! (-> s4-0 w) (sqrtf (- (- (- 1.0 (square f2-0)) (square f1-0)) (square f0-0))))
)
(let ((a1-1 (new-stack-vector0)))
(set! (-> a1-1 y) (-> s5-0 sprite flag-rot-sy z))
@@ -2118,7 +2119,7 @@
(set! (-> arg2 qx-qy-qz-sy z) (+ -16384.0 (atan f30-0 f28-0)))
(let ((f0-17 (-> arg1 omega)))
(if (!= f0-17 0.0)
(set! (-> arg2 x-y-z-sx w) (* (sqrtf (+ (* f30-0 f30-0) (* f28-0 f28-0)))
(set! (-> arg2 x-y-z-sx w) (* (sqrtf (+ (square f30-0) (square f28-0)))
f0-17
(lerp-scale 3.0 0.25 (/ 1.0 (the float (-> s5-0 z))) 0.000001 0.00000014285715)
)
+28 -41
View File
@@ -361,41 +361,28 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defun sp-process-block ((arg0 sparticle-system) (arg1 int) (arg2 sprite-array-2d) (arg3 int))
(local-vars (sv-16 int) (sv-32 int) (sv-48 int) (sv-64 int))
(let ((s3-0 208)
(s2-0 (* 144 arg3))
(s5-0 (* 48 arg3))
)
(set! sv-32 (* 80 arg3))
(let ((s1-0 (+ s3-0 s2-0)))
(set! sv-16 (+ s1-0 s5-0))
(let* ((s3-0 208)
(s2-0 (* 144 arg3))
(s5-0 (* 48 arg3))
(sv-32 (* 80 arg3))
(s1-0 (+ s3-0 s2-0))
)
(let ((sv-16 (+ s1-0 s5-0)))
(sp-copy-to-spr s3-0 (the-as pointer (-> arg0 cpuinfo-table arg1)) s2-0)
(sp-copy-to-spr s1-0 (&+ (-> arg0 vecdata-table) (* 48 arg1)) s5-0)
(let ((t9-2 sp-copy-to-spr)
(a1-7 (-> arg0 adgifdata-table arg1))
)
(t9-2 sv-16 (the-as pointer a1-7) sv-32)
)
(set! sv-48 (+ #x70000000 s3-0))
(set! sv-64 (+ #x70000000 s1-0))
(let ((t1-0 (paused?)))
(cond
((-> arg0 is-3d)
(let ((t9-4 sp-process-block-3d)
(a0-6 arg0)
(a3-1 arg1)
)
(t9-4 a0-6 sv-48 sv-64 a3-1 arg3 t1-0)
)
)
(else
(sp-process-block-2d arg0 sv-48 sv-64 arg1 arg3 t1-0)
)
)
)
(sp-copy-from-spr s3-0 (the-as pointer (-> arg0 cpuinfo-table arg1)) s2-0)
(sp-copy-from-spr s1-0 (&+ (-> arg0 vecdata-table) (* 48 arg1)) s5-0)
(sp-copy-to-spr sv-16 (the-as pointer (-> arg0 adgifdata-table arg1)) sv-32)
)
(let ((sv-48 (+ #x70000000 s3-0))
(sv-64 (+ #x70000000 s1-0))
(t1-0 (paused?))
)
(if (-> arg0 is-3d)
(sp-process-block-3d arg0 sv-48 sv-64 arg1 arg3 t1-0)
(sp-process-block-2d arg0 sv-48 sv-64 arg1 arg3 t1-0)
)
)
(sp-copy-from-spr s3-0 (the-as pointer (-> arg0 cpuinfo-table arg1)) s2-0)
(sp-copy-from-spr s1-0 (&+ (-> arg0 vecdata-table) (* 48 arg1)) s5-0)
)
0
(none)
@@ -443,7 +430,6 @@
(arg1 (function sparticle-system sparticle-cpuinfo none))
(arg2 sparticle-system)
)
(local-vars (sv-16 int))
(let ((s3-0 (the-as object (-> arg2 cpuinfo-table 0)))
(s2-0 (&+ (-> arg2 vecdata-table) 0))
(s1-0 (+ (-> arg2 blocks 0) (-> arg2 blocks 1)))
@@ -451,14 +437,15 @@
(dotimes (s0-0 s1-0)
(cond
((!= (-> arg2 alloc-table s0-0) -1)
(set! sv-16 0)
(while (< sv-16 64)
(if (and (nonzero? (-> (the-as sparticle-cpuinfo s3-0) valid)) (= (-> (the-as sparticle-cpuinfo s3-0) key) arg0))
(arg1 arg2 (the-as sparticle-cpuinfo s3-0))
)
(set! s3-0 (-> (the-as (inline-array sparticle-cpuinfo) s3-0) 1))
(&+! s2-0 48)
(set! sv-16 (+ sv-16 1))
(let ((sv-16 0))
(while (< sv-16 64)
(if (and (nonzero? (-> (the-as sparticle-cpuinfo s3-0) valid)) (= (-> (the-as sparticle-cpuinfo s3-0) key) arg0))
(arg1 arg2 (the-as sparticle-cpuinfo s3-0))
)
(set! s3-0 (-> (the-as (inline-array sparticle-cpuinfo) s3-0) 1))
(&+! s2-0 48)
(+! sv-16 1)
)
)
)
(else
+31 -38
View File
@@ -154,15 +154,7 @@
;; ERROR: Inline assembly instruction marked with TODO - [TODO.VCLIP]
;; ERROR: Unsupported inline assembly instruction kind - [cfc2.i v1, Clipping]
(defun sprite-draw-distorters ((dma-buff dma-buffer))
(local-vars
(v1-15 float)
(v1-21 float)
(clip-result int)
(v1-63 float)
(sprite sprite-vec-data-2d)
(dma-st-flag pointer)
(dma-color pointer)
)
(local-vars (v1-15 float) (v1-21 float) (clip-result int) (v1-63 float))
(rlet ((acc :class vf)
(Q :class vf)
(vf0 :class vf)
@@ -189,10 +181,11 @@
(dotimes (i num-entries)
(let ((aux-elem (-> s3-0 data i)))
(when (= (-> aux-elem aux-type) (sprite-aux-type distort))
(set! sprite (-> aux-elem vec-data))
(let ((dma-position (the-as object (-> dma-buff base))))
(set! dma-st-flag (&+ (the-as pointer dma-position) 16))
(set! dma-color (&+ (the-as pointer dma-position) 32))
(let* ((sprite (-> aux-elem vec-data))
(dma-position (the-as object (-> dma-buff base)))
(dma-st-flag (&+ (the-as pointer dma-position) 16))
(dma-color (&+ (the-as pointer dma-position) 32))
)
(cond
((= (the-as int (-> sprite flag-rot-sy y)) 1)
(.lvf vf3 (&-> *math-camera* sprite-2d quad 0))
@@ -232,32 +225,32 @@
(set! (-> (the-as vector dma-position) w) 255.0)
(set! (-> (the-as vector dma-st-flag) x) (* 0.001953125 (+ -1792.0 (-> (the-as vector dma-position) x))))
(set! (-> (the-as vector dma-st-flag) y) (* 0.001953125 (+ -1840.0 (-> (the-as vector dma-position) y))))
)
(set! (-> (the-as vector dma-st-flag) z) 1.0)
(when (or (< (the-as int (-> sprite flag-rot-sy x)) 3) (< 11 (the-as int (-> sprite flag-rot-sy x))))
(format 0 "Turns = ~D!!!~%" (-> sprite flag-rot-sy x))
(set! (-> sprite flag-rot-sy x) (the-as float #xb))
)
(set! (-> (the-as (pointer int32) dma-st-flag) 3) (the-as int (-> sprite flag-rot-sy x)))
(let* ((f1-4 (- (-> *math-camera* perspective vector 1 y)))
(f2-2 (-> (the-as vector dma-st-flag) y))
(f4-0 (+ f2-2 (* (-> (the-as vector dma-color) x) f1-4)))
(f3-0 256.0)
(f0-9 (-> (the-as vector dma-color) x))
)
(if (< 416.0 f4-0)
(set! f3-0 (/ (- 416.0 f2-2) f1-4))
(set! (-> (the-as vector dma-st-flag) z) 1.0)
(when (or (< (the-as int (-> sprite flag-rot-sy x)) 3) (< 11 (the-as int (-> sprite flag-rot-sy x))))
(format 0 "Turns = ~D!!!~%" (-> sprite flag-rot-sy x))
(set! (-> sprite flag-rot-sy x) (the-as float #xb))
)
(set! (-> (the-as (pointer int32) dma-st-flag) 3) (the-as int (-> sprite flag-rot-sy x)))
(let* ((f1-4 (- (-> *math-camera* perspective vector 1 y)))
(f2-2 (-> (the-as vector dma-st-flag) y))
(f4-0 (+ f2-2 (* (-> (the-as vector dma-color) x) f1-4)))
(f3-0 256.0)
(f0-9 (-> (the-as vector dma-color) x))
)
(if (< 416.0 f4-0)
(set! f3-0 (/ (- 416.0 f2-2) f1-4))
)
(if (< 128.0 f3-0)
(set! f3-0 128.0)
)
(when (< f3-0 f0-9)
(let ((v1-61 (/ f3-0 f0-9)))
(.mov vf1 v1-61)
)
(.mul.x.vf vf2 vf2 vf1)
(.svf (&-> (the-as vector dma-color) quad) vf2)
(.mov v1-63 vf2)
)
(if (< 128.0 f3-0)
(set! f3-0 128.0)
)
(when (< f3-0 f0-9)
(let ((v1-61 (/ f3-0 f0-9)))
(.mov vf1 v1-61)
)
(.mul.x.vf vf2 vf2 vf1)
(.svf (&-> (the-as vector dma-color) quad) vf2)
(.mov v1-63 vf2)
)
)
(&+! (-> dma-buff base) 48)
+19 -17
View File
@@ -728,24 +728,26 @@
;; definition for method 10 of type simple-sprite-system
;; WARN: Return type mismatch int vs none.
(defmethod draw-all-sprites! ((this simple-sprite-system) (arg0 dma-buffer))
(local-vars (sv-528 sprite-glow-dma-packet-data) (sv-532 (pointer texture-id)) (sv-536 pointer))
(b! (zero? (-> this count)) cfg-13 :delay (nop!))
(set! sv-528 *sprite-glow-dma-packet-data*)
(set! sv-532 (new 'stack-no-clear 'array 'texture-id 128))
(set! sv-536 (-> arg0 base))
(dotimes (v1-5 (-> this count))
(set! (-> sv-532 v1-5) (-> this data v1-5 tex-id))
)
(countdown (s4-0 (-> this count))
(let ((s3-0 (-> sv-532 s4-0)))
(when (nonzero? s3-0)
(let ((s2-0 (add-shader-to-dma arg0)))
(adgif-shader<-texture-simple! s2-0 (lookup-texture-by-id s3-0))
(countdown (s1-1 (+ s4-0 1))
(when (= s3-0 (-> sv-532 s1-1))
(set! (-> sv-532 s1-1) (new 'static 'texture-id))
(let ((a2-1 (-> this data s1-1)))
(sprite-glow-add-simple-sprite arg0 sv-528 a2-1 (the-as pointer s2-0))
(let ((sv-528 *sprite-glow-dma-packet-data*)
(sv-532 (new 'stack-no-clear 'array 'texture-id 128))
)
(let ((sv-536 (-> arg0 base)))
)
(dotimes (v1-5 (-> this count))
(set! (-> sv-532 v1-5) (-> this data v1-5 tex-id))
)
(countdown (s4-0 (-> this count))
(let ((s3-0 (-> sv-532 s4-0)))
(when (nonzero? s3-0)
(let ((s2-0 (add-shader-to-dma arg0)))
(adgif-shader<-texture-simple! s2-0 (lookup-texture-by-id s3-0))
(countdown (s1-1 (+ s4-0 1))
(when (= s3-0 (-> sv-532 s1-1))
(set! (-> sv-532 s1-1) (new 'static 'texture-id))
(let ((a2-1 (-> this data s1-1)))
(sprite-glow-add-simple-sprite arg0 sv-528 a2-1 (the-as pointer s2-0))
)
)
)
)
+1 -1
View File
@@ -515,7 +515,7 @@
(set! (-> out x) f0-0)
(set! (-> out y) f1-0)
(set! (-> out z) f2-0)
(set! (-> out w) (sqrtf (- (- (- 1.0 (* f2-0 f2-0)) (* f1-0 f1-0)) (* f0-0 f0-0))))
(set! (-> out w) (sqrtf (- (- (- 1.0 (square f2-0)) (square f1-0)) (square f0-0))))
)
out
)
@@ -121,7 +121,6 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch symbol vs int.
(defun real-fog-texture-anim-func ((arg0 dma-buffer) (arg1 texture-anim))
(local-vars (sv-48 int))
(let ((s4-0 (new 'stack-no-clear 'vector))
(s3-0 (new 'stack-no-clear 'vector))
(s1-0 *fog-texture-work*)
@@ -132,8 +131,9 @@
(set! (-> s2-0 a0-1) v1-1)
)
)
(set! sv-48 0)
(let ((s0-0 0))
(let ((sv-48 0)
(s0-0 0)
)
(let ((f0-0 40955904.0)
(f1-0 -40955904.0)
)
+55 -52
View File
@@ -211,7 +211,7 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch pointer vs none.
(defun texture-anim-layer-draw ((dma-buf dma-buffer) (width int) (height int) (layer texture-anim-layer))
(local-vars (v1-27 float) (sv-224 matrix) (sv-228 matrix) (sv-232 matrix) (sv-236 matrix))
(local-vars (v1-27 float))
(rlet ((acc :class vf)
(vf0 :class vf)
(vf1 :class vf)
@@ -236,44 +236,46 @@
(let ((s4-0 (the-as (pointer uint128) (-> dma-buf base))))
(set! (-> s4-0 0) (-> *texture-anim-work* draw-tmpl dma-vif quad))
(set! (-> s4-0 1) (-> *texture-anim-work* draw-tmpl quad 1))
(set! sv-224 (new 'stack-no-clear 'matrix))
(set! sv-228 (new 'stack-no-clear 'matrix))
(set! sv-232 (new 'stack-no-clear 'matrix))
(let ((v1-7 (new 'stack-no-clear 'matrix)))
(let ((sv-224 (new 'stack-no-clear 'matrix))
(sv-228 (new 'stack-no-clear 'matrix))
(sv-232 (new 'stack-no-clear 'matrix))
(v1-7 (new 'stack-no-clear 'matrix))
)
(set! (-> v1-7 quad 0) (the-as uint128 0))
(set! sv-236 v1-7)
)
(let ((s3-0 *texture-anim-work*))
(.lvf vf1 (&-> s3-0 const quad))
(.lvf vf2 (&-> layer interpolated-color quad))
(.mul.x.vf vf2 vf2 vf1)
(.ftoi.vf vf2 vf2)
(.svf (&-> s4-0 2) vf2)
(matrix-rotate-z! sv-224 (-> layer interpolated-rot x))
(set! (-> sv-236 vector 0 x) (* (-> layer interpolated-scale-offset x) (the float width)))
(set! (-> sv-236 vector 0 y) (* (-> layer interpolated-scale-offset y) (the float height)))
(matrix-scale! sv-232 (the-as vector sv-236))
(matrix*! sv-224 sv-232 sv-224)
(set! (-> sv-224 trans x) (+ 2048.0 (* (-> layer interpolated-scale-offset z) (the float width))))
(set! (-> sv-224 trans y) (+ 2048.0 (* (-> layer interpolated-scale-offset w) (the float height))))
(set! (-> sv-224 trans z) 1048575.94)
(matrix-rotate-z! sv-228 (-> layer interpolated-rot y))
(set! (-> sv-236 vector 0 x) (-> layer interpolated-st-scale-offset x))
(set! (-> sv-236 vector 0 y) (-> layer interpolated-st-scale-offset y))
(matrix-scale! sv-232 (the-as vector sv-236))
(matrix*! sv-228 sv-232 sv-228)
(set! (-> sv-228 trans x) (-> layer interpolated-st-scale-offset z))
(set! (-> sv-228 trans y) (-> layer interpolated-st-scale-offset w))
(.lvf vf11 (&-> sv-224 quad 0))
(.lvf vf12 (&-> sv-224 quad 1))
(.lvf vf14 (&-> sv-224 trans quad))
(.lvf vf15 (&-> sv-228 quad 0))
(.lvf vf16 (&-> sv-228 quad 1))
(.lvf vf18 (&-> sv-228 trans quad))
(.lvf vf7 (&-> s3-0 corner0 quad))
(.lvf vf8 (&-> s3-0 corner1 quad))
(.lvf vf9 (&-> s3-0 corner2 quad))
(.lvf vf10 (&-> s3-0 corner3 quad))
(let ((sv-236 v1-7)
(s3-0 *texture-anim-work*)
)
(.lvf vf1 (&-> s3-0 const quad))
(.lvf vf2 (&-> layer interpolated-color quad))
(.mul.x.vf vf2 vf2 vf1)
(.ftoi.vf vf2 vf2)
(.svf (&-> s4-0 2) vf2)
(matrix-rotate-z! sv-224 (-> layer interpolated-rot x))
(set! (-> sv-236 vector 0 x) (* (-> layer interpolated-scale-offset x) (the float width)))
(set! (-> sv-236 vector 0 y) (* (-> layer interpolated-scale-offset y) (the float height)))
(matrix-scale! sv-232 (the-as vector sv-236))
(matrix*! sv-224 sv-232 sv-224)
(set! (-> sv-224 trans x) (+ 2048.0 (* (-> layer interpolated-scale-offset z) (the float width))))
(set! (-> sv-224 trans y) (+ 2048.0 (* (-> layer interpolated-scale-offset w) (the float height))))
(set! (-> sv-224 trans z) 1048575.94)
(matrix-rotate-z! sv-228 (-> layer interpolated-rot y))
(set! (-> sv-236 vector 0 x) (-> layer interpolated-st-scale-offset x))
(set! (-> sv-236 vector 0 y) (-> layer interpolated-st-scale-offset y))
(matrix-scale! sv-232 (the-as vector sv-236))
(matrix*! sv-228 sv-232 sv-228)
(set! (-> sv-228 trans x) (-> layer interpolated-st-scale-offset z))
(set! (-> sv-228 trans y) (-> layer interpolated-st-scale-offset w))
(.lvf vf11 (&-> sv-224 quad 0))
(.lvf vf12 (&-> sv-224 quad 1))
(.lvf vf14 (&-> sv-224 trans quad))
(.lvf vf15 (&-> sv-228 quad 0))
(.lvf vf16 (&-> sv-228 quad 1))
(.lvf vf18 (&-> sv-228 trans quad))
(.lvf vf7 (&-> s3-0 corner0 quad))
(.lvf vf8 (&-> s3-0 corner1 quad))
(.lvf vf9 (&-> s3-0 corner2 quad))
(.lvf vf10 (&-> s3-0 corner3 quad))
)
)
(.lvf vf19 (&-> layer interpolated-qs quad))
(.mul.x.vf acc vf11 vf7)
@@ -487,7 +489,7 @@
;; WARN: Return type mismatch int vs none.
;; WARN: Function update-texture-anim has a return type of none, but the expression builder found a return statement.
(defun update-texture-anim ((bucket bucket-id) (anim-array texture-anim-array))
(local-vars (tex-height int) (fbp-for-tex uint) (layer-idx int))
(local-vars (fbp-for-tex uint))
(if (-> *blit-displays-work* menu-mode)
(return #f)
)
@@ -500,8 +502,9 @@
)
(when dest-tex
0
(let ((tex-width (-> dest-tex w)))
(set! tex-height (-> dest-tex h))
(let ((tex-width (-> dest-tex w))
(tex-height (-> dest-tex h))
)
(cond
((or (= (-> dest-tex psm) (gs-psm ct32)) (= (-> dest-tex psm) (gs-psm mt8h)))
(set! fbp-for-tex (shr (-> dest-tex dest 0) 5))
@@ -556,12 +559,13 @@
(set! (-> *texture-pool* ids (+ v1-32 a1-43)) (the-as uint 0))
)
)
(set! layer-idx 0)
(while (< layer-idx (the-as int (-> anim num-layers)))
(let ((layer (-> anim data layer-idx)))
((-> layer func) dma-buf fbp-for-tex tex-width tex-height layer (-> anim frame-time))
(let ((layer-idx 0))
(while (< layer-idx (the-as int (-> anim num-layers)))
(let ((layer (-> anim data layer-idx)))
((-> layer func) dma-buf fbp-for-tex tex-width tex-height layer (-> anim frame-time))
)
(+! layer-idx 1)
)
(set! layer-idx (+ layer-idx 1))
)
)
(if (-> anim func)
@@ -963,9 +967,7 @@
(set! v1-10 128)
)
(else
(let* ((f0-9 (sin (* 128.0 (fmin 128.0 (* (the float (- s3-0 s5-0)) f30-0)))))
(f0-11 (* f0-9 f0-9))
)
(let ((f0-11 (square (sin (* 128.0 (fmin 128.0 (* (the float (- s3-0 s5-0)) f30-0)))))))
(set! v1-10 (the int (* 128.0 f0-11)))
)
)
@@ -1247,7 +1249,7 @@
;; definition for method 9 of type texture-anim
;; INFO: Used lq/sq
(defmethod init-textures! ((this texture-anim))
(local-vars (a3-3 uint128) (sv-16 texture-page))
(local-vars (a3-3 uint128))
(if (logtest? (the-as int (-> this func)) 1)
(set! (-> this func)
(the-as (function dma-buffer texture-anim int) (-> (the-as symbol (-> this func)) value))
@@ -1260,8 +1262,9 @@
)
)
(when (-> this tex-name)
(set! sv-16 (the-as texture-page #f))
(let ((a0-3 (lookup-level-texture-by-name (-> this tex-name) (-> *level* loading-level) (& sv-16))))
(let* ((sv-16 (the-as texture-page #f))
(a0-3 (lookup-level-texture-by-name (-> this tex-name) (-> *level* loading-level) (& sv-16)))
)
(set! (-> this tex) a0-3)
(when (and a0-3 sv-16)
0
+221 -230
View File
@@ -756,14 +756,6 @@
This is the old Jak 1 background texture uploading system, which had this near/far concept
for different mip levels. By jak 2, the background system switched to masks and uses
the -pris variant of this function."
(local-vars
(data-ptr pointer)
(vram-ptr uint)
(tpage-num-chunks int)
(chunks-pending int)
(first-chunk int)
(tpage-id uint)
)
(if (not tpage)
(return 0)
)
@@ -771,69 +763,74 @@
(with-dma-buffer-add-bucket ((dma-buf (-> *display* frames (-> *display* on-screen) global-buf))
bucket
)
(set! data-ptr (-> tpage segment 0 block-data))
(set! vram-ptr (shr (-> tpage segment 0 dest) 12))
(set! tpage-num-chunks (the-as int (-> tpage segment 0 size)))
(set! chunks-pending 0)
(set! first-chunk 0)
(set! tpage-id (-> tpage id))
(case mode
(((tex-upload-mode none))
(return 0)
)
(((tex-upload-mode seg0))
)
(((tex-upload-mode seg0-1))
(set! tpage-num-chunks (the-as int (+ tpage-num-chunks (-> tpage segment 1 size))))
)
(((tex-upload-mode seg0-1-2))
(set! tpage-num-chunks (the-as int (-> tpage size)))
)
(((tex-upload-mode seg2))
(set! data-ptr (-> tpage segment 2 block-data))
(set! vram-ptr (shr (-> tpage segment 2 dest) 12))
(set! tpage-num-chunks (the-as int (-> tpage segment 2 size)))
)
)
(set! tpage-num-chunks (shr (min (the-as int (-> dest-seg size)) (the-as int (+ tpage-num-chunks 4095))) 12))
(dotimes (s1-0 tpage-num-chunks)
(let ((v1-28 (+ vram-ptr s1-0)))
(cond
((zero? chunks-pending)
(when (!= (-> pool ids v1-28) tpage-id)
(set! first-chunk s1-0)
(set! (-> pool ids v1-28) tpage-id)
(set! chunks-pending (+ chunks-pending 1))
)
(let ((data-ptr (-> tpage segment 0 block-data))
(vram-ptr (shr (-> tpage segment 0 dest) 12))
(tpage-num-chunks (the-as int (-> tpage segment 0 size)))
(chunks-pending 0)
(first-chunk 0)
)
(let ((tpage-id (-> tpage id)))
(case mode
(((tex-upload-mode none))
(return 0)
)
((= (-> pool ids v1-28) tpage-id)
(upload-vram-data
dma-buf
(the-as int (* (+ vram-ptr first-chunk) 64))
(&+ data-ptr (shl first-chunk 14))
(* chunks-pending 32)
128
)
(+! num-chunks chunks-pending)
(set! chunks-pending 0)
0
(((tex-upload-mode seg0))
)
(else
(set! (-> pool ids v1-28) tpage-id)
(set! chunks-pending (+ chunks-pending 1))
(((tex-upload-mode seg0-1))
(set! tpage-num-chunks (the-as int (+ (the-as uint tpage-num-chunks) (-> tpage segment 1 size))))
)
(((tex-upload-mode seg0-1-2))
(set! tpage-num-chunks (the-as int (-> tpage size)))
)
(((tex-upload-mode seg2))
(set! data-ptr (-> tpage segment 2 block-data))
(set! vram-ptr (shr (-> tpage segment 2 dest) 12))
(set! tpage-num-chunks (the-as int (-> tpage segment 2 size)))
)
)
(set! tpage-num-chunks
(shr (min (the-as int (-> dest-seg size)) (the-as int (+ (the-as uint tpage-num-chunks) 4095))) 12)
)
(dotimes (s1-0 tpage-num-chunks)
(let ((v1-28 (+ vram-ptr s1-0)))
(cond
((zero? chunks-pending)
(when (!= (-> pool ids v1-28) tpage-id)
(set! first-chunk s1-0)
(set! (-> pool ids v1-28) tpage-id)
(+! chunks-pending 1)
)
)
((= (-> pool ids v1-28) tpage-id)
(upload-vram-data
dma-buf
(the-as int (* (+ vram-ptr first-chunk) 64))
(&+ data-ptr (shl first-chunk 14))
(* chunks-pending 32)
128
)
(+! num-chunks chunks-pending)
(set! chunks-pending 0)
0
)
(else
(set! (-> pool ids v1-28) tpage-id)
(+! chunks-pending 1)
)
)
)
)
)
)
(when (nonzero? chunks-pending)
(upload-vram-data
dma-buf
(the-as int (* (+ vram-ptr first-chunk) 64))
(&+ data-ptr (shl first-chunk 14))
(* chunks-pending 32)
128
(when (nonzero? chunks-pending)
(upload-vram-data
dma-buf
(the-as int (* (+ vram-ptr first-chunk) 64))
(&+ data-ptr (shl first-chunk 14))
(* chunks-pending 32)
128
)
(+! num-chunks chunks-pending)
)
(+! num-chunks chunks-pending)
)
(dma-buffer-add-gs-set dma-buf (texflush 1))
)
@@ -907,15 +904,6 @@
This lets us skip uploading entire textures, or mip levels that won't need.
(side note: this optimization is what causes many of the texturing issues in pcsx2,
where the ps2 and pcsx2 disagree on the mip level to use.)"
(local-vars
(data-ptr pointer)
(vram-ptr uint)
(tpage-num-chunks int)
(chunks-pending int)
(first-chunk int)
(tpage-id uint)
(should-upload symbol)
)
(if (not tpage)
(return 0)
)
@@ -923,54 +911,59 @@
(with-dma-buffer-add-bucket ((dma-buf (-> *display* frames (-> *display* on-screen) global-buf))
bucket
)
(set! data-ptr (-> tpage segment 0 block-data))
(set! vram-ptr (shr (-> tpage segment 0 dest) 12))
(set! tpage-num-chunks (the-as int (-> tpage size)))
(set! chunks-pending 0)
(set! first-chunk 0)
(set! tpage-id (-> tpage id))
(set! tpage-num-chunks (shr (min (the-as int (-> dest-seg size)) (the-as int (+ tpage-num-chunks 4095))) 12))
(dotimes (chunk-idx tpage-num-chunks)
(let ((chunk-dest (+ vram-ptr chunk-idx)))
(let ((mask-work (-> arg4 (/ chunk-idx 32))))
(set! should-upload (logtest? mask-work (ash 1 (logand chunk-idx 31))))
(let ((data-ptr (-> tpage segment 0 block-data))
(vram-ptr (shr (-> tpage segment 0 dest) 12))
(tpage-num-chunks (the-as int (-> tpage size)))
(chunks-pending 0)
(first-chunk 0)
)
(cond
((zero? chunks-pending)
(when (and (!= (-> pool ids chunk-dest) tpage-id) should-upload)
(set! first-chunk chunk-idx)
(set! (-> pool ids chunk-dest) tpage-id)
(set! chunks-pending (+ chunks-pending 1))
)
)
((or (= (-> pool ids chunk-dest) tpage-id) (not should-upload))
(upload-vram-data
dma-buf
(the-as int (* (+ vram-ptr first-chunk) 64))
(&+ data-ptr (shl first-chunk 14))
(* chunks-pending 32)
128
)
(+! total-chunks-uploaded chunks-pending)
(set! chunks-pending 0)
0
)
(else
(set! (-> pool ids chunk-dest) tpage-id)
(set! chunks-pending (+ chunks-pending 1))
(let ((tpage-id (-> tpage id)))
(set! tpage-num-chunks
(shr (min (the-as int (-> dest-seg size)) (the-as int (+ (the-as uint tpage-num-chunks) 4095))) 12)
)
(dotimes (chunk-idx tpage-num-chunks)
(let* ((chunk-dest (+ vram-ptr chunk-idx))
(mask-work (-> arg4 (/ chunk-idx 32)))
(should-upload (logtest? mask-work (ash 1 (logand chunk-idx 31))))
)
(cond
((zero? chunks-pending)
(when (and (!= (-> pool ids chunk-dest) tpage-id) should-upload)
(set! first-chunk chunk-idx)
(set! (-> pool ids chunk-dest) tpage-id)
(+! chunks-pending 1)
)
)
((or (= (-> pool ids chunk-dest) tpage-id) (not should-upload))
(upload-vram-data
dma-buf
(the-as int (* (+ vram-ptr first-chunk) 64))
(&+ data-ptr (shl first-chunk 14))
(* chunks-pending 32)
128
)
(+! total-chunks-uploaded chunks-pending)
(set! chunks-pending 0)
0
)
(else
(set! (-> pool ids chunk-dest) tpage-id)
(+! chunks-pending 1)
)
)
)
)
)
)
(when (nonzero? chunks-pending)
(upload-vram-data
dma-buf
(the-as int (* (+ vram-ptr first-chunk) 64))
(&+ data-ptr (shl first-chunk 14))
(* chunks-pending 32)
128
(when (nonzero? chunks-pending)
(upload-vram-data
dma-buf
(the-as int (* (+ vram-ptr first-chunk) 64))
(&+ data-ptr (shl first-chunk 14))
(* chunks-pending 32)
128
)
(+! total-chunks-uploaded chunks-pending)
)
(+! total-chunks-uploaded chunks-pending)
)
(dma-buffer-add-gs-set dma-buf (texflush 1))
)
@@ -1494,9 +1487,8 @@
;; definition for method 12 of type texture-page
(defmethod add-to-dma-buffer ((page texture-page) (buf dma-buffer) (mode tex-upload-mode))
"Add upload DMA to a DMA buffer. Wrapper for upload-vram-data."
(local-vars (sv-16 int))
(let ((v1-0 mode))
(set! sv-16 (cond
(let* ((v1-0 mode)
(sv-16 (cond
((= v1-0 (tex-upload-mode none))
0
)
@@ -1510,16 +1502,17 @@
(the-as int (-> page segment (the-as int mode) size))
)
)
)
)
(let* ((v1-7 (max 0 (the-as int mode)))
(a3-4 (* (/ (+ (/ sv-16 64) 63) 64) 32))
(t1-0 (shr (-> page segment v1-7 dest) 6))
(a2-10 (-> page segment v1-7 block-data))
)
)
(upload-vram-data buf (the-as int t1-0) a2-10 a3-4 128)
(let* ((v1-7 (max 0 (the-as int mode)))
(a3-4 (* (/ (+ (/ sv-16 64) 63) 64) 32))
(t1-0 (shr (-> page segment v1-7 dest) 6))
(a2-10 (-> page segment v1-7 block-data))
)
(upload-vram-data buf (the-as int t1-0) a2-10 a3-4 128)
)
sv-16
)
sv-16
)
;; definition for function texture-relocate
@@ -1616,88 +1609,86 @@
"Set up the font texture. In normal use, the font texture is allocated, and currently uploaded to, the common segment.
This function copies that to the unused upper 8-bits of the depth buffer, and sets up the font
renderer to point to that address."
(local-vars (sv-16 int) (sv-20 int))
(let ((s3-0 (-> this font-palette)))
(set! sv-16 (-> this cur))
(set! sv-20 (/ s3-0 64))
(let ((s5-0
(texture-page-login (new 'static 'texture-id :index #x1 :page #xc04) texture-page-default-allocate global)
)
)
(if (and s5-0 (-> s5-0 page))
(set! sv-16 (the-as int (-> s5-0 page segment 0 dest)))
)
(let ((s4-0 *txt-dma-list*))
(let ((v1-6 s4-0))
(set! (-> v1-6 base) (-> v1-6 data))
(set! (-> v1-6 end) (&-> v1-6 data-buffer (-> v1-6 allocated-length)))
)
(let ((s2-0 (lookup-texture-by-id (new 'static 'texture-id :index #x1 :page #xc04)))
(s1-0 #xc2000)
(s0-0 36)
)
(set! (-> s2-0 h) 320)
(texture-relocate s4-0 s2-0 s1-0 (the-as gs-psm s0-0) s3-0)
(font-set-tex0 (the-as (pointer gs-tex0) (-> *font-work* small-font-0-tmpl)) s2-0 s1-0 s0-0 sv-20)
(font-set-tex0 (the-as (pointer gs-tex0) (-> *font-work* small-font-2-tmpl)) s2-0 s1-0 s0-0 sv-20)
)
(let ((s3-1 (lookup-texture-by-id (new 'static 'texture-id :page #xc04)))
(s2-1 #xc2000)
(s1-1 44)
)
(set! (-> s3-1 h) 320)
(texture-relocate s4-0 s3-1 s2-1 (the-as gs-psm s1-1) -1)
(font-set-tex0 (the-as (pointer gs-tex0) (-> *font-work* small-font-1-tmpl)) s3-1 s2-1 s1-1 sv-20)
(font-set-tex0 (the-as (pointer gs-tex0) (-> *font-work* small-font-3-tmpl)) s3-1 s2-1 s1-1 sv-20)
)
(let ((s3-2 (lookup-texture-by-id (new 'static 'texture-id :index #x4 :page #xc04)))
(s2-2 #x90000)
(s1-2 36)
)
(set! (-> s3-2 h) 800)
(texture-relocate s4-0 s3-2 s2-2 (the-as gs-psm s1-2) -1)
(font-set-tex0 (the-as (pointer gs-tex0) (-> *font-work* large-font-0-tmpl)) s3-2 s2-2 s1-2 sv-20)
)
(let ((s3-3 (lookup-texture-by-id (new 'static 'texture-id :index #x2 :page #xc04)))
(s2-3 #x90000)
(s1-3 44)
)
(set! (-> s3-3 h) 800)
(texture-relocate s4-0 s3-3 s2-3 (the-as gs-psm s1-3) -1)
(font-set-tex0 (the-as (pointer gs-tex0) (-> *font-work* large-font-1-tmpl)) s3-3 s2-3 s1-3 sv-20)
)
(let ((s3-4 (lookup-texture-by-id (new 'static 'texture-id :index #x5 :page #xc04)))
(s2-4 #x5e000)
(s1-4 36)
)
(set! (-> s3-4 h) 800)
(texture-relocate s4-0 s3-4 s2-4 (the-as gs-psm s1-4) -1)
(font-set-tex0 (the-as (pointer gs-tex0) (-> *font-work* large-font-2-tmpl)) s3-4 s2-4 s1-4 sv-20)
)
(let ((s3-5 (lookup-texture-by-id (new 'static 'texture-id :index #x3 :page #xc04)))
(s2-5 #x5e000)
(s1-5 44)
)
(set! (-> s3-5 h) 800)
(texture-relocate s4-0 s3-5 s2-5 (the-as gs-psm s1-5) -1)
(font-set-tex0 (the-as (pointer gs-tex0) (-> *font-work* large-font-3-tmpl)) s3-5 s2-5 s1-5 sv-20)
)
(dma-buffer-add-gs-set s4-0 (texflush 1))
(let* ((v1-31 s4-0)
(a0-32 (the-as object (-> v1-31 base)))
)
(set! (-> (the-as dma-packet a0-32) dma) (new 'static 'dma-tag :id (dma-tag-id end)))
(set! (-> (the-as (pointer int64) a0-32) 1) 0)
(set! (-> v1-31 base) (&+ (the-as pointer a0-32) 16))
)
(dma-buffer-send-chain (the-as dma-bank-source #x10009000) s4-0)
(let* ((s3-0 (-> this font-palette))
(sv-16 (-> this cur))
(sv-20 (/ s3-0 64))
(s5-0
(texture-page-login (new 'static 'texture-id :index #x1 :page #xc04) texture-page-default-allocate global)
)
)
(if (and s5-0 (-> s5-0 page))
(set! sv-16 (the-as int (-> s5-0 page segment 0 dest)))
)
(dma-sync (the-as pointer #x10009000) 0 0)
(if (and s5-0 (-> s5-0 page) (= (-> this cur) (+ sv-16 (-> s5-0 page size))))
(set! (-> this cur) sv-16)
(format 0 "ERROR: could not resize texture pool to remove gamefont.~%")
)
(let ((s4-0 *txt-dma-list*))
(let ((v1-6 s4-0))
(set! (-> v1-6 base) (-> v1-6 data))
(set! (-> v1-6 end) (&-> v1-6 data-buffer (-> v1-6 allocated-length)))
)
(let ((s2-0 (lookup-texture-by-id (new 'static 'texture-id :index #x1 :page #xc04)))
(s1-0 #xc2000)
(s0-0 36)
)
(set! (-> s2-0 h) 320)
(texture-relocate s4-0 s2-0 s1-0 (the-as gs-psm s0-0) s3-0)
(font-set-tex0 (the-as (pointer gs-tex0) (-> *font-work* small-font-0-tmpl)) s2-0 s1-0 s0-0 sv-20)
(font-set-tex0 (the-as (pointer gs-tex0) (-> *font-work* small-font-2-tmpl)) s2-0 s1-0 s0-0 sv-20)
)
(let ((s3-1 (lookup-texture-by-id (new 'static 'texture-id :page #xc04)))
(s2-1 #xc2000)
(s1-1 44)
)
(set! (-> s3-1 h) 320)
(texture-relocate s4-0 s3-1 s2-1 (the-as gs-psm s1-1) -1)
(font-set-tex0 (the-as (pointer gs-tex0) (-> *font-work* small-font-1-tmpl)) s3-1 s2-1 s1-1 sv-20)
(font-set-tex0 (the-as (pointer gs-tex0) (-> *font-work* small-font-3-tmpl)) s3-1 s2-1 s1-1 sv-20)
)
(let ((s3-2 (lookup-texture-by-id (new 'static 'texture-id :index #x4 :page #xc04)))
(s2-2 #x90000)
(s1-2 36)
)
(set! (-> s3-2 h) 800)
(texture-relocate s4-0 s3-2 s2-2 (the-as gs-psm s1-2) -1)
(font-set-tex0 (the-as (pointer gs-tex0) (-> *font-work* large-font-0-tmpl)) s3-2 s2-2 s1-2 sv-20)
)
(let ((s3-3 (lookup-texture-by-id (new 'static 'texture-id :index #x2 :page #xc04)))
(s2-3 #x90000)
(s1-3 44)
)
(set! (-> s3-3 h) 800)
(texture-relocate s4-0 s3-3 s2-3 (the-as gs-psm s1-3) -1)
(font-set-tex0 (the-as (pointer gs-tex0) (-> *font-work* large-font-1-tmpl)) s3-3 s2-3 s1-3 sv-20)
)
(let ((s3-4 (lookup-texture-by-id (new 'static 'texture-id :index #x5 :page #xc04)))
(s2-4 #x5e000)
(s1-4 36)
)
(set! (-> s3-4 h) 800)
(texture-relocate s4-0 s3-4 s2-4 (the-as gs-psm s1-4) -1)
(font-set-tex0 (the-as (pointer gs-tex0) (-> *font-work* large-font-2-tmpl)) s3-4 s2-4 s1-4 sv-20)
)
(let ((s3-5 (lookup-texture-by-id (new 'static 'texture-id :index #x3 :page #xc04)))
(s2-5 #x5e000)
(s1-5 44)
)
(set! (-> s3-5 h) 800)
(texture-relocate s4-0 s3-5 s2-5 (the-as gs-psm s1-5) -1)
(font-set-tex0 (the-as (pointer gs-tex0) (-> *font-work* large-font-3-tmpl)) s3-5 s2-5 s1-5 sv-20)
)
(dma-buffer-add-gs-set s4-0 (texflush 1))
(let* ((v1-31 s4-0)
(a0-32 (the-as object (-> v1-31 base)))
)
(set! (-> (the-as dma-packet a0-32) dma) (new 'static 'dma-tag :id (dma-tag-id end)))
(set! (-> (the-as (pointer int64) a0-32) 1) 0)
(set! (-> v1-31 base) (&+ (the-as pointer a0-32) 16))
)
(dma-buffer-send-chain (the-as dma-bank-source #x10009000) s4-0)
)
(dma-sync (the-as pointer #x10009000) 0 0)
(if (and s5-0 (-> s5-0 page) (= (-> this cur) (+ sv-16 (-> s5-0 page size))))
(set! (-> this cur) sv-16)
(format 0 "ERROR: could not resize texture pool to remove gamefont.~%")
)
)
0
(none)
@@ -1887,18 +1878,18 @@
;; definition for function lookup-texture-by-name
(defun lookup-texture-by-name ((tex-name string) (page-name string) (page-out (pointer texture-page)))
"Get a loaded texture by name. Slow."
(local-vars (sv-16 texture-page-dir))
(set! sv-16 *texture-page-dir*)
(dotimes (s3-0 (-> sv-16 length))
(let ((s2-0 (-> sv-16 entries s3-0 page)))
(when (and s2-0 (or (not page-name) (string= (-> s2-0 name) page-name)))
(dotimes (s1-0 (-> s2-0 length))
(let ((s0-0 (-> s2-0 data s1-0)))
(when (and s0-0 (string= (-> s0-0 name) tex-name))
(if page-out
(set! (-> page-out 0) s2-0)
)
(return s0-0)
(let ((sv-16 *texture-page-dir*))
(dotimes (s3-0 (-> sv-16 length))
(let ((s2-0 (-> sv-16 entries s3-0 page)))
(when (and s2-0 (or (not page-name) (string= (-> s2-0 name) page-name)))
(dotimes (s1-0 (-> s2-0 length))
(let ((s0-0 (-> s2-0 data s1-0)))
(when (and s0-0 (string= (-> s0-0 name) tex-name))
(if page-out
(set! (-> page-out 0) s2-0)
)
(return s0-0)
)
)
)
)
@@ -1912,16 +1903,16 @@
;; WARN: Return type mismatch int vs texture-id.
(defun lookup-texture-id-by-name ((tex-name string) (page-name string))
"Get the ID of a loaded texture by name. Slow."
(local-vars (sv-16 texture-page-dir))
(set! sv-16 *texture-page-dir*)
(dotimes (gp-0 (-> sv-16 length))
(let ((s3-0 (-> sv-16 entries gp-0 page)))
(when (and s3-0 (or (not page-name) (string= (-> s3-0 name) page-name)))
(dotimes (s2-0 (-> s3-0 length))
(let ((v1-7 (-> s3-0 data s2-0)))
(if (and v1-7 (string= (-> v1-7 name) tex-name))
(return (new 'static 'texture-id :page gp-0 :index s2-0))
)
(let ((sv-16 *texture-page-dir*))
(dotimes (gp-0 (-> sv-16 length))
(let ((s3-0 (-> sv-16 entries gp-0 page)))
(when (and s3-0 (or (not page-name) (string= (-> s3-0 name) page-name)))
(dotimes (s2-0 (-> s3-0 length))
(let ((v1-7 (-> s3-0 data s2-0)))
(if (and v1-7 (string= (-> v1-7 name) tex-name))
(return (new 'static 'texture-id :page gp-0 :index s2-0))
)
)
)
)
)
+43 -47
View File
@@ -369,7 +369,6 @@
;; definition for method 17 of type level
(defmethod load-continue ((this level))
(local-vars (sv-16 symbol))
(when (-> this linking)
(when (nonzero? (link-resume))
(set! (-> this linking) #f)
@@ -415,8 +414,9 @@
)
(case (-> this status)
(('loading)
(set! sv-16 (the-as symbol #f))
(let ((s5-0 (dgo-load-get-next (& sv-16))))
(let* ((sv-16 (the-as symbol #f))
(s5-0 (dgo-load-get-next (& sv-16)))
)
(when s5-0
(set! (-> this load-buffer-last) (the-as uint s5-0))
(+! (-> *level* load-size) (-> (the-as (pointer uint32) s5-0)))
@@ -827,14 +827,7 @@
;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count]
;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count]
(defun level-update-after-load ((lev level) (lstate login-state))
(local-vars
(current-time int)
(end-time int)
(start-time int)
(sv-16 int)
(proto prototype-bucket-tie)
(geom-idx int)
)
(local-vars (current-time int) (end-time int) (start-time int))
(set! *level-index* (-> lev index))
0
(let ((drawable-trees (-> lev bsp drawable-trees)))
@@ -921,41 +914,44 @@
(let ((proto-array (-> (the-as drawable-tree-instance-tie current-array) prototypes prototype-array-tie)))
(let ((protos (-> (the-as drawable-tree-instance-tie current-array) prototypes)))
(when (< login-state-pos (-> proto-array length))
(set! sv-16 0)
(while (< sv-16 10)
(when (< login-state-pos (-> proto-array length))
(set! proto (-> proto-array array-data (the-as uint login-state-pos)))
(+! (-> protos prototype-max-qwc) 32)
(cond
((logtest? (-> proto flags) (prototype-flags tpage-alpha))
(set! *texture-masks* (-> *level* level *level-index* bsp alpha-masks data (-> proto texture-masks-index)))
)
((logtest? (-> proto flags) (prototype-flags tpage-water))
(set! *texture-masks* (-> *level* level *level-index* bsp water-masks data (-> proto texture-masks-index)))
)
(else
(set! *texture-masks* (-> *level* level *level-index* bsp tfrag-masks data (-> proto texture-masks-index)))
)
)
(when (and *debug-segment* (-> *screen-shot-work* highres-enable))
(dotimes (v1-105 4)
(+! (-> proto dists data v1-105) 40960000.0)
(set! (-> proto rdists data v1-105) (/ 1.0 (-> proto dists data v1-105)))
)
)
(set! geom-idx 0)
(while (< geom-idx 4)
(let ((geom (-> proto tie-geom geom-idx)))
(when (nonzero? geom)
(+! (-> protos prototype-max-qwc) (* 7 (-> geom length)))
(login geom)
(let ((sv-16 0))
(while (< sv-16 10)
(when (< login-state-pos (-> proto-array length))
(let ((proto (-> proto-array array-data (the-as uint login-state-pos))))
(+! (-> protos prototype-max-qwc) 32)
(cond
((logtest? (-> proto flags) (prototype-flags tpage-alpha))
(set! *texture-masks* (-> *level* level *level-index* bsp alpha-masks data (-> proto texture-masks-index)))
)
((logtest? (-> proto flags) (prototype-flags tpage-water))
(set! *texture-masks* (-> *level* level *level-index* bsp water-masks data (-> proto texture-masks-index)))
)
(else
(set! *texture-masks* (-> *level* level *level-index* bsp tfrag-masks data (-> proto texture-masks-index)))
)
)
(when (and *debug-segment* (-> *screen-shot-work* highres-enable))
(dotimes (v1-105 4)
(+! (-> proto dists data v1-105) 40960000.0)
(set! (-> proto rdists data v1-105) (/ 1.0 (-> proto dists data v1-105)))
)
)
(let ((geom-idx 0))
(while (< geom-idx 4)
(let ((geom (-> proto tie-geom geom-idx)))
(when (nonzero? geom)
(+! (-> protos prototype-max-qwc) (* 7 (-> geom length)))
(login geom)
)
)
(+! geom-idx 1)
)
)
)
(set! geom-idx (+ geom-idx 1))
(set! login-state-pos (the-as int (+ (the-as uint login-state-pos) 1)))
)
(set! login-state-pos (the-as int (+ (the-as uint login-state-pos) 1)))
(+! sv-16 1)
)
(set! sv-16 (+ sv-16 1))
)
(set! (-> lstate pos) (the-as uint login-state-pos))
)
@@ -1100,7 +1096,6 @@
;; definition for method 25 of type level
;; INFO: Used lq/sq
(defmethod birth ((this level))
(local-vars (sv-96 int))
(case (-> this status)
(('loaded)
(let ((s5-0 loading-level)
@@ -1142,10 +1137,11 @@
(assign-draw-indices *level*)
(let ((s0-0 (-> this bsp nav-meshes)))
(when (nonzero? s0-0)
(set! sv-96 0)
(while (< sv-96 (-> s0-0 length))
(birth! (-> s0-0 sv-96))
(set! sv-96 (+ sv-96 1))
(let ((sv-96 0))
(while (< sv-96 (-> s0-0 length))
(birth! (-> s0-0 sv-96))
(+! sv-96 1)
)
)
)
)
+93 -115
View File
@@ -91,53 +91,54 @@
;; definition for method 17 of type drawable-region-prim
;; WARN: Return type mismatch int vs none.
(defmethod debug-draw-region ((this drawable-region-prim) (arg0 int))
(local-vars (sv-32 vector2h) (sv-36 vector))
(set! sv-32 (new 'stack 'vector2h))
(set! sv-36 (-> this bsphere))
(add-debug-x #t (bucket-id debug-no-zbuf1) sv-36 (new 'static 'rgba :r #xff :g #xff :a #x80))
(when (nonzero? (-> this region))
(let ((s5-0 add-debug-text-3d)
(s4-0 #t)
(s3-0 318)
)
(format (clear *temp-string*) "region-~D~%" (-> this region id))
(s5-0 s4-0 (the-as bucket-id s3-0) *temp-string* sv-36 (font-color white) sv-32)
)
(+! (-> sv-32 y) 8)
(let ((s5-1 (-> this region on-enter)))
(when s5-1
(let ((s4-1 add-debug-text-3d)
(s3-1 #t)
(s2-1 318)
)
(format (clear *temp-string*) "(on-enter ~S)" s5-1)
(s4-1 s3-1 (the-as bucket-id s2-1) *temp-string* sv-36 (font-color white) sv-32)
)
(+! (-> sv-32 y) 8)
(let ((sv-32 (new 'stack 'vector2h))
(sv-36 (-> this bsphere))
)
)
(let ((s5-2 (-> this region on-inside)))
(when s5-2
(let ((s4-2 add-debug-text-3d)
(s3-2 #t)
(s2-2 318)
)
(format (clear *temp-string*) "(on-inside ~S)" s5-2)
(s4-2 s3-2 (the-as bucket-id s2-2) *temp-string* sv-36 (font-color white) sv-32)
)
(+! (-> sv-32 y) 8)
(add-debug-x #t (bucket-id debug-no-zbuf1) sv-36 (new 'static 'rgba :r #xff :g #xff :a #x80))
(when (nonzero? (-> this region))
(let ((s5-0 add-debug-text-3d)
(s4-0 #t)
(s3-0 318)
)
(format (clear *temp-string*) "region-~D~%" (-> this region id))
(s5-0 s4-0 (the-as bucket-id s3-0) *temp-string* sv-36 (font-color white) sv-32)
)
)
(let ((gp-1 (-> this region on-exit)))
(when gp-1
(let ((s5-3 add-debug-text-3d)
(s4-3 #t)
(s3-3 318)
)
(format (clear *temp-string*) "(on-exit ~S)" gp-1)
(s5-3 s4-3 (the-as bucket-id s3-3) *temp-string* sv-36 (font-color white) sv-32)
(+! (-> sv-32 y) 8)
(let ((s5-1 (-> this region on-enter)))
(when s5-1
(let ((s4-1 add-debug-text-3d)
(s3-1 #t)
(s2-1 318)
)
(format (clear *temp-string*) "(on-enter ~S)" s5-1)
(s4-1 s3-1 (the-as bucket-id s2-1) *temp-string* sv-36 (font-color white) sv-32)
)
(+! (-> sv-32 y) 8)
)
)
(let ((s5-2 (-> this region on-inside)))
(when s5-2
(let ((s4-2 add-debug-text-3d)
(s3-2 #t)
(s2-2 318)
)
(format (clear *temp-string*) "(on-inside ~S)" s5-2)
(s4-2 s3-2 (the-as bucket-id s2-2) *temp-string* sv-36 (font-color white) sv-32)
)
(+! (-> sv-32 y) 8)
)
)
(let ((gp-1 (-> this region on-exit)))
(when gp-1
(let ((s5-3 add-debug-text-3d)
(s4-3 #t)
(s3-3 318)
)
(format (clear *temp-string*) "(on-exit ~S)" gp-1)
(s5-3 s4-3 (the-as bucket-id s3-3) *temp-string* sv-36 (font-color white) sv-32)
)
(+! (-> sv-32 y) 8)
)
(+! (-> sv-32 y) 8)
)
)
)
@@ -337,7 +338,6 @@
;; definition for method 18 of type drawable-region-face
(defmethod track-region ((this drawable-region-face) (arg0 region-prim-area))
"TODO"
(local-vars (sv-48 vector) (sv-52 vector) (sv-56 object))
(-> this region)
(let* ((s4-0 (-> this data))
(v1-1 (-> s4-0 normal))
@@ -346,46 +346,24 @@
)
(when (!= a0-3 s3-0)
(when (nonzero? (-> s4-0 num-points))
(set! sv-48 (new 'stack-no-clear 'vector))
(set! sv-52 (new 'stack-no-clear 'vector))
(set! sv-56 (the-as (inline-array vector) (-> s4-0 points)))
(ray-plane-intersect
sv-48
sv-52
(-> arg0 pos)
(-> arg0 ray)
(-> (the-as (inline-array vector) sv-56) 0)
(-> (the-as (inline-array vector) sv-56) 1)
(-> (the-as (inline-array vector) sv-56) 2)
)
(let ((s4-1 (-> s4-0 num-points))
(s2-0 0)
(s1-0 (vector-negate! (new 'stack-no-clear 'vector) sv-52))
(let ((sv-48 (new 'stack-no-clear 'vector))
(sv-52 (new 'stack-no-clear 'vector))
(sv-56 (-> s4-0 points))
)
(while (< (+ s2-0 2) (the-as int s4-1))
(if (the-as
(inline-array vector)
(or (point-in-triangle-cross
sv-48
sv-52
(-> (the-as (inline-array vector) sv-56) 0)
(-> (the-as (inline-array vector) sv-56) 1)
(-> (the-as (inline-array vector) sv-56) 2)
)
(the-as (inline-array vector) (point-in-triangle-cross
sv-48
s1-0
(-> (the-as (inline-array vector) sv-56) 0)
(-> (the-as (inline-array vector) sv-56) 1)
(-> (the-as (inline-array vector) sv-56) 2)
)
)
)
)
(goto cfg-17)
(ray-plane-intersect sv-48 sv-52 (-> arg0 pos) (-> arg0 ray) (-> sv-56 0) (-> sv-56 1) (-> sv-56 2))
(let ((s4-1 (-> s4-0 num-points))
(s2-0 0)
(s1-0 (vector-negate! (new 'stack-no-clear 'vector) sv-52))
)
(+! s2-0 1)
(set! sv-56 (-> (the-as (inline-array vector) sv-56) 1))
(while (< (+ s2-0 2) (the-as int s4-1))
(if (or (point-in-triangle-cross sv-48 sv-52 (-> sv-56 0) (-> sv-56 1) (-> sv-56 2))
(point-in-triangle-cross sv-48 s1-0 (-> sv-56 0) (-> sv-56 1) (-> sv-56 2))
)
(goto cfg-17)
)
(+! s2-0 1)
(set! sv-56 (the-as (inline-array vector) (-> sv-56 1)))
)
)
)
(set! s3-0 s3-0)
@@ -487,7 +465,6 @@
;; WARN: Return type mismatch int vs symbol.
(defmethod point-in-region-debug! ((this region) (arg0 vector))
"Debug check to see if point is in region. This is not efficient, since it has to find the parent geometry of this region."
(local-vars (sv-16 int) (sv-32 int))
(sphere<-vector+r! (the-as sphere (-> (the-as region-prim-area #x70000000) pos)) arg0 0.0)
(dotimes (s5-0 (-> *level* length))
(let ((s4-0 (-> *level* level s5-0)))
@@ -498,9 +475,10 @@
(s1-0 (-> s4-0 bsp region-trees s2-0))
)
(while (< s2-0 s3-0)
(let ((s0-0 (-> s1-0 data2 (+ (-> s1-0 length) -1) length)))
(set! sv-16 0)
(set! sv-32 (+ (+ (* sv-16 32) 32) (the-as int (-> s1-0 data2 (+ (-> s1-0 length) -1)))))
(let* ((s0-0 (-> s1-0 data2 (+ (-> s1-0 length) -1) length))
(sv-16 0)
(sv-32 (+ (+ (* sv-16 32) 32) (the-as int (-> s1-0 data2 (+ (-> s1-0 length) -1)))))
)
(while (< sv-16 s0-0)
(if (and (= (-> (the-as drawable-region-prim sv-32) region) this)
(within-area?
@@ -510,7 +488,7 @@
)
(return (the-as symbol sv-32))
)
(set! sv-16 (+ sv-16 1))
(+! sv-16 1)
(set! sv-32 (+ (+ (* sv-16 32) 32) (the-as int (-> s1-0 data2 (+ (-> s1-0 length) -1)))))
)
)
@@ -553,33 +531,33 @@
;; definition for function region-tree-execute
;; WARN: Return type mismatch int vs none.
(defun region-tree-execute ((arg0 symbol) (arg1 vector) (arg2 vector))
(local-vars (sv-32 vector))
(set! sv-32 (vector-average! (new 'stack-no-clear 'vector) arg1 arg2))
(set! (-> sv-32 w) (* 0.5 (vector-vector-distance arg1 arg2)))
(set! (-> (the-as region-prim-area #x70000000) region-prim-list num-items) 0)
(set! (-> (the-as region-prim-area #x70000000) region-enter-count) 0)
(set! (-> (the-as region-prim-area #x70000000) region-exit-count) 0)
(set! (-> (the-as region-prim-area #x70000000) region-inside-count) 0)
(set! (-> (the-as region-prim-area #x70000000) region-start-count) 0)
(sphere<-vector+r! (the-as sphere (+ 1296 #x70000000)) arg1 0.0)
(sphere<-vector+r! (the-as sphere (+ 1312 #x70000000)) arg2 0.0)
(vector-! (the-as vector (+ 1328 #x70000000)) arg2 arg1)
(vector-! (the-as vector (+ 1344 #x70000000)) arg1 arg2)
(dotimes (s5-1 (-> *level* length))
(let ((v1-17 (-> *level* level s5-1)))
(when (= (-> v1-17 status) 'active)
(let ((s4-1 (-> v1-17 bsp region-trees)))
(when (nonzero? s4-1)
(let* ((s3-0 (-> s4-1 length))
(s2-0 0)
(a0-14 (-> s4-1 s2-0))
)
(while (< s2-0 s3-0)
(if (= (-> a0-14 name) arg0)
(collect-regions a0-14 (the-as sphere sv-32) 0 (the-as region-prim-list (+ #x70000000 0)))
)
(+! s2-0 1)
(set! a0-14 (-> s4-1 s2-0))
(let ((sv-32 (vector-average! (new 'stack-no-clear 'vector) arg1 arg2)))
(set! (-> sv-32 w) (* 0.5 (vector-vector-distance arg1 arg2)))
(set! (-> (the-as region-prim-area #x70000000) region-prim-list num-items) 0)
(set! (-> (the-as region-prim-area #x70000000) region-enter-count) 0)
(set! (-> (the-as region-prim-area #x70000000) region-exit-count) 0)
(set! (-> (the-as region-prim-area #x70000000) region-inside-count) 0)
(set! (-> (the-as region-prim-area #x70000000) region-start-count) 0)
(sphere<-vector+r! (the-as sphere (+ 1296 #x70000000)) arg1 0.0)
(sphere<-vector+r! (the-as sphere (+ 1312 #x70000000)) arg2 0.0)
(vector-! (the-as vector (+ 1328 #x70000000)) arg2 arg1)
(vector-! (the-as vector (+ 1344 #x70000000)) arg1 arg2)
(dotimes (s5-1 (-> *level* length))
(let ((v1-17 (-> *level* level s5-1)))
(when (= (-> v1-17 status) 'active)
(let ((s4-1 (-> v1-17 bsp region-trees)))
(when (nonzero? s4-1)
(let* ((s3-0 (-> s4-1 length))
(s2-0 0)
(a0-14 (-> s4-1 s2-0))
)
(while (< s2-0 s3-0)
(if (= (-> a0-14 name) arg0)
(collect-regions a0-14 (the-as sphere sv-32) 0 (the-as region-prim-list (+ #x70000000 0)))
)
(+! s2-0 1)
(set! a0-14 (-> s4-1 s2-0))
)
)
)
)
+5 -4
View File
@@ -257,7 +257,7 @@
;; definition for method 16 of type level
;; INFO: Used lq/sq
(defmethod update-vis! ((this level) (vis-info level-vis-info) (unused uint) (in-bsp-vis-string (pointer uint8)))
(local-vars (t0-3 uint128) (extra-vis-length int) (extra-vis-dest (pointer int8)))
(local-vars (t0-3 uint128))
(let* ((cam-leaf-idx (-> vis-info from-bsp current-leaf-idx))
(curr-vis-string-offset (-> vis-info current-vis-string))
(desired-vis-string-offset (-> vis-info vis-string cam-leaf-idx))
@@ -347,9 +347,10 @@
(set! (-> (the-as (pointer int128) (&+ spad-start (* a0-23 16)))) 0)
)
)
(set! extra-vis-length (-> this bsp extra-vis-list-length))
(set! extra-vis-dest (&+ spad-start (- list-len extra-vis-length)))
(let ((extra-vis-in (unpack-vis (-> this bsp drawable-trees) spad-start (the-as (pointer int8) vis-buf))))
(let* ((extra-vis-length (-> this bsp extra-vis-list-length))
(extra-vis-dest (&+ spad-start (- list-len extra-vis-length)))
(extra-vis-in (unpack-vis (-> this bsp drawable-trees) spad-start (the-as (pointer int8) vis-buf)))
)
(dotimes (extra-vis-idx extra-vis-length)
(let ((vis-byte (-> extra-vis-in 0)))
(set! extra-vis-in (&-> extra-vis-in 1))
+240 -244
View File
@@ -16,22 +16,18 @@
;; definition for method 3 of type load-dir
;; INFO: Used lq/sq
(defmethod inspect ((this load-dir))
(local-vars (sv-16 basic))
(format #t "[~8x] ~A~%" this (-> this type))
(format #t "~Tlevel: ~A~%" (-> this lev))
(format #t "~Tallocated-length: ~D~%" (-> this string-array allocated-length))
(format #t "~Tlength: ~D~%" (-> this string-array length))
(dotimes (s5-0 (-> this string-array length))
(let ((s4-0 format)
(s3-0 #t)
(s2-0 "~T [~D] ~S ~A (~D bytes)~%")
(s1-0 s5-0)
(s0-0 (-> this string-array s5-0))
)
(set! sv-16 (-> this data-array s5-0))
(let ((t1-0 (mem-size (-> this data-array s5-0) #f 0)))
(s4-0 s3-0 s2-0 s1-0 s0-0 sv-16 t1-0)
)
(format
#t
"~T [~D] ~S ~A (~D bytes)~%"
s5-0
(-> this string-array s5-0)
(-> this data-array s5-0)
(mem-size (-> this data-array s5-0) #f 0)
)
)
this
@@ -837,7 +833,7 @@
;; definition for function ja-play-spooled-anim
(defbehavior ja-play-spooled-anim process-drawable ((arg0 spool-anim) (arg1 art-joint-anim) (arg2 art-joint-anim) (arg3 (function process-drawable symbol)))
(local-vars (v0-59 int) (sv-176 int))
(local-vars (v0-59 int))
(let ((s2-0 arg2)
(s1-0 arg3)
(gp-0 (new 'stack 'spooler-block arg2 arg3))
@@ -1063,65 +1059,66 @@
(let* ((f30-0 (* 0.05859375 (-> s5-8 speed)))
(f28-0 (+ (-> gp-0 part-audio-start) (/ (the float (+ (-> s5-8 frames num-frames) -1)) f30-0)))
)
(set! sv-176 (current-str-pos (-> gp-0 sid)))
(set-time! (-> gp-0 good-time))
(until (>= (the float v0-59) f28-0)
(if (= (-> self skel root-channel 0) (-> self skel channel))
(logior! (-> self skel status) (joint-control-status valid-spooled-frame))
)
(if (or ((-> gp-0 break-func) self)
(and (<= sv-176 0) (time-elapsed? (-> gp-0 good-time) (seconds 4)))
(and (< 300 (-> gp-0 good-count)) (<= sv-176 0))
)
(goto cfg-130)
)
(gui-control-method-12
*gui-control*
self
(gui-channel art-load)
(gui-action queue)
(-> gp-0 anim name)
(-> gp-0 part)
-20.0
(-> gp-0 sid)
)
(if (< (+ (-> gp-0 part) 1) (-> gp-0 anim parts))
(gui-control-method-12
*gui-control*
self
(gui-channel art-load)
(gui-action queue)
(-> gp-0 anim name)
(+ (-> gp-0 part) 1)
-10.0
(-> gp-0 sid)
(let ((sv-176 (current-str-pos (-> gp-0 sid))))
(set-time! (-> gp-0 good-time))
(until (>= (the float v0-59) f28-0)
(if (= (-> self skel root-channel 0) (-> self skel channel))
(logior! (-> self skel status) (joint-control-status valid-spooled-frame))
)
(logclear! (-> self skel status) (joint-control-status spooling-not-last-block))
(if (or ((-> gp-0 break-func) self)
(and (<= sv-176 0) (time-elapsed? (-> gp-0 good-time) (seconds 4)))
(and (< 300 (-> gp-0 good-count)) (<= sv-176 0))
)
(goto cfg-130)
)
(gui-control-method-12
*gui-control*
self
(gui-channel art-load)
(gui-action queue)
(-> gp-0 anim name)
(-> gp-0 part)
-20.0
(-> gp-0 sid)
)
(execute-commands-up-to *load-state* (ja-aframe-num 0))
(cond
((and (< (-> gp-0 old-pos) sv-176) (< -1 sv-176))
(+! (-> gp-0 good-count) (- (current-time) (-> self clock old-frame-counter)))
(set-time! (-> gp-0 good-time))
)
(else
0
(if (< (+ (-> gp-0 part) 1) (-> gp-0 anim parts))
(gui-control-method-12
*gui-control*
self
(gui-channel art-load)
(gui-action queue)
(-> gp-0 anim name)
(+ (-> gp-0 part) 1)
-10.0
(-> gp-0 sid)
)
(logclear! (-> self skel status) (joint-control-status spooling-not-last-block))
)
(execute-commands-up-to *load-state* (ja-aframe-num 0))
(cond
((and (< (-> gp-0 old-pos) sv-176) (< -1 sv-176))
(+! (-> gp-0 good-count) (- (current-time) (-> self clock old-frame-counter)))
(set-time! (-> gp-0 good-time))
)
(else
0
)
)
(set! (-> gp-0 old-pos) sv-176)
(set-time! (-> gp-0 old-time))
(suspend)
(let* ((f26-0 (* (- (the float (current-str-pos (-> gp-0 sid))) (-> gp-0 part-audio-start)) f30-0))
(f0-16 (if (str-id-is-playing? (the-as int (-> gp-0 sid)))
(fmax 0.0 (fmin f26-0 (the float (+ (-> (ja-group) frames num-frames) -1))))
(fmax 0.0 (fmin (ja-frame-num 0) (the float (+ (-> (ja-group) frames num-frames) -1))))
)
)
)
(ja-no-eval :num! (seek!) :frame-num f0-16)
)
(set! v0-59 (current-str-pos (-> gp-0 sid)))
(set! sv-176 v0-59)
)
(set! (-> gp-0 old-pos) sv-176)
(set-time! (-> gp-0 old-time))
(suspend)
(let* ((f26-0 (* (- (the float (current-str-pos (-> gp-0 sid))) (-> gp-0 part-audio-start)) f30-0))
(f0-16 (if (str-id-is-playing? (the-as int (-> gp-0 sid)))
(fmax 0.0 (fmin f26-0 (the float (+ (-> (ja-group) frames num-frames) -1))))
(fmax 0.0 (fmin (ja-frame-num 0) (the float (+ (-> (ja-group) frames num-frames) -1))))
)
)
)
(ja-no-eval :num! (seek!) :frame-num f0-16)
)
(set! v0-59 (current-str-pos (-> gp-0 sid)))
(set! sv-176 v0-59)
)
(set! (-> gp-0 part-audio-start) f28-0)
)
@@ -1642,7 +1639,6 @@
;; definition for method 19 of type gui-control
;; INFO: Used lq/sq
(defmethod handle-command-list ((this gui-control) (arg0 gui-channel) (arg1 gui-connection))
(local-vars (sv-16 int) (sv-32 int) (sv-48 int))
(let ((gp-0 #t))
(cond
((or (not (gui-control-method-18 this arg0)) (< (-> *display* base-clock frame-counter) (-> this times arg0)))
@@ -1658,8 +1654,9 @@
)
(case a2-1
(((gui-channel hud))
(let ((s0-0 80))
(set! sv-16 90)
(let ((s0-0 80)
(sv-16 90)
)
(while (>= (the-as uint sv-16) (the-as uint s0-0))
(if (not (handle-command this arg0 (the-as gui-channel s0-0) (the-as symbol s1-0) arg1))
(set! gp-0 #f)
@@ -1669,8 +1666,9 @@
)
)
(((gui-channel screen))
(let ((s0-1 66))
(set! sv-32 70)
(let ((s0-1 66)
(sv-32 70)
)
(while (>= (the-as uint sv-32) (the-as uint s0-1))
(if (not (handle-command this arg0 (the-as gui-channel s0-1) (the-as symbol s1-0) arg1))
(set! gp-0 #f)
@@ -1680,8 +1678,9 @@
)
)
(((gui-channel voice))
(let ((s0-2 18))
(set! sv-48 32)
(let ((s0-2 18)
(sv-48 32)
)
(while (>= (the-as uint sv-48) (the-as uint s0-2))
(if (not (handle-command this arg0 (the-as gui-channel s0-2) (the-as symbol s1-0) arg1))
(set! gp-0 #f)
@@ -1852,39 +1851,41 @@
(arg5 (function gui-connection symbol))
(arg6 process)
)
(local-vars (sv-16 gui-action) (sv-17 gui-action) (sv-20 string) (sv-24 (function gui-connection symbol)))
(set! sv-16 arg0)
(set! sv-17 arg3)
(set! sv-20 arg4)
(set! sv-24 arg5)
(let ((s1-0 (the-as gui-connection (-> this engine alive-list next0))))
(-> this engine)
(let ((s0-0 (-> s1-0 next0)))
(while (!= s1-0 (-> this engine alive-list-end))
(when (and (or (= arg1 1) (= arg1 (-> s1-0 id)))
(or (= arg2 (gui-channel none)) (= arg2 (-> s1-0 channel)))
(or (= sv-17 (gui-action none)) (= sv-17 (-> s1-0 action)))
(or (not sv-20) (string= sv-20 (-> s1-0 name)))
(or (not arg5) (arg5 s1-0))
(or (not arg6) (= arg6 (get-process s1-0)))
)
(cond
((and (= sv-16 (gui-action hide)) (!= (-> this ids (-> s1-0 channel)) (-> s1-0 id)))
(set! (-> s1-0 action) (gui-action hidden))
)
((and (= sv-16 (gui-action play)) (= (-> s1-0 action) (gui-action playing)))
)
(else
(set! (-> s1-0 action) sv-16)
(if (and (= sv-16 'play) (handle-command-list this (-> s1-0 channel) s1-0))
(channel-id-set! this s1-0 (-> s1-0 id))
)
(let ((sv-16 arg0)
(sv-17 arg3)
(sv-20 arg4)
)
(let ((sv-24 arg5))
)
(let ((s1-0 (the-as gui-connection (-> this engine alive-list next0))))
(-> this engine)
(let ((s0-0 (-> s1-0 next0)))
(while (!= s1-0 (-> this engine alive-list-end))
(when (and (or (= arg1 1) (= arg1 (-> s1-0 id)))
(or (= arg2 (gui-channel none)) (= arg2 (-> s1-0 channel)))
(or (= sv-17 (gui-action none)) (= sv-17 (-> s1-0 action)))
(or (not sv-20) (string= sv-20 (-> s1-0 name)))
(or (not arg5) (arg5 s1-0))
(or (not arg6) (= arg6 (get-process s1-0)))
)
(cond
((and (= sv-16 (gui-action hide)) (!= (-> this ids (-> s1-0 channel)) (-> s1-0 id)))
(set! (-> s1-0 action) (gui-action hidden))
)
((and (= sv-16 (gui-action play)) (= (-> s1-0 action) (gui-action playing)))
)
(else
(set! (-> s1-0 action) sv-16)
(if (and (= sv-16 'play) (handle-command-list this (-> s1-0 channel) s1-0))
(channel-id-set! this s1-0 (-> s1-0 id))
)
)
)
)
(set! s1-0 (the-as gui-connection s0-0))
(-> this engine)
(set! s0-0 (-> s0-0 next0))
)
(set! s1-0 (the-as gui-connection s0-0))
(-> this engine)
(set! s0-0 (-> s0-0 next0))
)
)
)
@@ -1902,68 +1903,66 @@
(arg4 float)
(arg5 time-frame)
)
(local-vars
(sv-16 int)
(sv-20 gui-connection)
(sv-32 gui-connection)
(sv-48 gui-connection)
(sv-64 gui-connection)
(sv-80 int)
)
(set! sv-32 (the-as gui-connection #f))
(set! sv-48 (the-as gui-connection (-> this engine alive-list next0)))
(-> this engine)
(set! sv-64 (the-as gui-connection (-> sv-48 next0)))
(while (!= sv-48 (-> this engine alive-list-end))
(when (and (= arg1 (-> (the-as gui-connection sv-48) channel))
(string= arg3 (-> (the-as gui-connection sv-48) name))
(= (get-process sv-48) arg0)
)
(set! sv-32 (the-as gui-connection sv-48))
(goto cfg-12)
)
(set! sv-48 (the-as gui-connection sv-64))
(-> this engine)
(set! sv-64 (the-as gui-connection (-> sv-64 next0)))
)
(label cfg-12)
(when (not sv-32)
(set! sv-16 0)
(set! sv-80 32)
(while (nonzero? sv-80)
(set! sv-80 (+ sv-80 -1))
(set! sv-20 (-> this connections sv-80))
(if (and (nonzero? (-> sv-20 id))
(= arg1 (-> sv-20 channel))
(string= arg3 (-> sv-20 name))
(>= (-> sv-20 priority) -1.0)
)
(set! sv-16 (the-as int (-> sv-20 id)))
)
)
(if (zero? sv-16)
(set! sv-16 (the-as int (new-sound-id)))
)
(set! sv-32 (the-as gui-connection (add-connection (-> this engine) arg0 arg4 0 arg3 sv-16)))
sv-32
)
(the-as sound-id (cond
(sv-32
(set! (-> sv-32 priority) arg4)
(set! (-> sv-32 channel) arg1)
(set! (-> sv-32 action) arg2)
(set! (-> sv-32 param2) (the-as int arg3))
(set! (-> sv-32 hold-time) arg5)
(set! (-> sv-32 flags) (gui-connection-flags gcf0))
(set! (-> sv-32 fade) (the-as uint 0))
(the-as int (-> (the-as gui-connection sv-32) id))
)
(else
(format 0 "ERROR: could not connection ~A to gui engine.~%" arg0)
0
)
(let ((sv-32 (the-as gui-connection #f)))
(let ((sv-48 (the-as gui-connection (-> this engine alive-list next0))))
(-> this engine)
(let ((sv-64 (the-as gui-connection (-> sv-48 next0))))
(while (!= sv-48 (-> this engine alive-list-end))
(when (and (= arg1 (-> (the-as gui-connection sv-48) channel))
(string= arg3 (-> (the-as gui-connection sv-48) name))
(= (get-process sv-48) arg0)
)
(set! sv-32 (the-as gui-connection sv-48))
(goto cfg-12)
)
(set! sv-48 (the-as gui-connection sv-64))
(-> this engine)
(set! sv-64 (the-as gui-connection (-> sv-64 next0)))
)
)
)
(label cfg-12)
(when (not sv-32)
(let ((sv-16 0))
(let ((sv-80 32))
(while (nonzero? sv-80)
(+! sv-80 -1)
(let ((sv-20 (-> this connections sv-80)))
(if (and (nonzero? (-> sv-20 id))
(= arg1 (-> sv-20 channel))
(string= arg3 (-> sv-20 name))
(>= (-> sv-20 priority) -1.0)
)
(set! sv-16 (the-as int (-> sv-20 id)))
)
)
)
)
(if (zero? sv-16)
(set! sv-16 (the-as int (new-sound-id)))
)
(set! sv-32 (the-as gui-connection (add-connection (-> this engine) arg0 arg4 0 arg3 sv-16)))
)
sv-32
)
(the-as sound-id (cond
(sv-32
(set! (-> sv-32 priority) arg4)
(set! (-> sv-32 channel) arg1)
(set! (-> sv-32 action) arg2)
(set! (-> sv-32 param2) (the-as int arg3))
(set! (-> sv-32 hold-time) arg5)
(set! (-> sv-32 flags) (gui-connection-flags gcf0))
(set! (-> sv-32 fade) (the-as uint 0))
(the-as int (-> (the-as gui-connection sv-32) id))
)
(else
(format 0 "ERROR: could not connection ~A to gui engine.~%" arg0)
0
)
)
)
)
)
;; definition for method 10 of type gui-control
@@ -1998,90 +1997,87 @@
(arg5 float)
(arg6 sound-id)
)
(local-vars
(sv-16 gui-connection)
(sv-20 int)
(sv-24 gui-connection)
(sv-28 process-drawable)
(sv-32 int)
(sv-48 sound-id)
)
(set! sv-48 arg6)
(set! sv-16 (the-as gui-connection #f))
(set! sv-20 0)
(set! sv-32 32)
(while (nonzero? sv-32)
(set! sv-32 (+ sv-32 -1))
(set! sv-24 (-> this connections sv-32))
(when (and (nonzero? (-> sv-24 id))
(= arg1 (-> sv-24 channel))
(let ((v1-14 (handle->process (-> sv-24 handle))))
(and (or (= v1-14 arg0) (= (-> arg0 type) scene-player) (and v1-14 (= (-> v1-14 type) scene-player)))
(and (string= arg3 (-> sv-24 name)) (= arg4 (-> sv-24 anim-part)))
)
)
)
(when (< (-> sv-24 priority) arg5)
(set! (-> sv-24 time-stamp) (-> this update-time))
(return (the-as sound-id (-> sv-24 id)))
(let ((sv-48 arg6)
(sv-16 (the-as gui-connection #f))
(sv-20 0)
)
(set! sv-16 sv-24)
(goto cfg-44)
)
)
(countdown (v1-33 32)
(let ((a0-15 (-> this connections v1-33)))
(when (or (zero? (-> a0-15 id)) (not (handle->process (-> a0-15 handle))))
(set! sv-16 a0-15)
(set! (-> sv-16 param3) 0)
(set! (-> sv-16 flags) (gui-connection-flags))
(goto cfg-44)
)
)
)
(label cfg-44)
(the-as sound-id (cond
(sv-16
(when (zero? (-> (the-as gui-connection sv-16) id))
(when (zero? sv-20)
(let ((v1-46 (lookup-gui-connection this arg0 arg1 arg3 (new 'static 'sound-id))))
(if v1-46
(set! sv-20 (the-as int (-> v1-46 id)))
)
)
)
(if (zero? sv-20)
(set! sv-20 (the-as int sv-48))
)
(set! (-> sv-16 param3) (if (nonzero? sv-20)
sv-20
(the-as int (new-sound-id))
)
)
)
(when (= arg5 -99.0)
(set! sv-28 (as-type arg0 process-drawable))
(set! arg5 (if sv-28
(vector-vector-distance (target-pos 0) (-> sv-28 root trans))
-1.0
)
)
)
(set! (-> sv-16 time-stamp) (-> this update-time))
(set! (-> sv-16 handle) (process->handle arg0))
(set! (-> sv-16 priority) arg5)
(set! (-> sv-16 channel) arg1)
(set! (-> sv-16 action) arg2)
(set! (-> sv-16 anim-part) (the-as uint arg4))
(set! (-> sv-16 param2) (the-as int arg3))
(set! (-> sv-16 fade) (the-as uint 0))
(the-as int (-> (the-as gui-connection sv-16) id))
)
(else
0
(let ((sv-32 32))
(while (nonzero? sv-32)
(+! sv-32 -1)
(let ((sv-24 (-> this connections sv-32)))
(when (and (nonzero? (-> sv-24 id))
(= arg1 (-> sv-24 channel))
(let ((v1-14 (handle->process (-> sv-24 handle))))
(and (or (= v1-14 arg0) (= (-> arg0 type) scene-player) (and v1-14 (= (-> v1-14 type) scene-player)))
(and (string= arg3 (-> sv-24 name)) (= arg4 (-> sv-24 anim-part)))
)
)
)
(when (< (-> sv-24 priority) arg5)
(set! (-> sv-24 time-stamp) (-> this update-time))
(return (the-as sound-id (-> sv-24 id)))
)
(set! sv-16 sv-24)
(goto cfg-44)
)
)
)
)
(countdown (v1-33 32)
(let ((a0-15 (-> this connections v1-33)))
(when (or (zero? (-> a0-15 id)) (not (handle->process (-> a0-15 handle))))
(set! sv-16 a0-15)
(set! (-> sv-16 param3) 0)
(set! (-> sv-16 flags) (gui-connection-flags))
(goto cfg-44)
)
)
)
(label cfg-44)
(the-as sound-id (cond
(sv-16
(when (zero? (-> (the-as gui-connection sv-16) id))
(when (zero? sv-20)
(let ((v1-46 (lookup-gui-connection this arg0 arg1 arg3 (new 'static 'sound-id))))
(if v1-46
(set! sv-20 (the-as int (-> v1-46 id)))
)
)
)
(if (zero? sv-20)
(set! sv-20 (the-as int sv-48))
)
(set! (-> sv-16 param3) (if (nonzero? sv-20)
sv-20
(the-as int (new-sound-id))
)
)
)
(when (= arg5 -99.0)
(let ((sv-28 (as-type arg0 process-drawable)))
(set! arg5 (if sv-28
(vector-vector-distance (target-pos 0) (-> sv-28 root trans))
-1.0
)
)
)
)
(set! (-> sv-16 time-stamp) (-> this update-time))
(set! (-> sv-16 handle) (process->handle arg0))
(set! (-> sv-16 priority) arg5)
(set! (-> sv-16 channel) arg1)
(set! (-> sv-16 action) arg2)
(set! (-> sv-16 anim-part) (the-as uint arg4))
(set! (-> sv-16 param2) (the-as int arg3))
(set! (-> sv-16 fade) (the-as uint 0))
(the-as int (-> (the-as gui-connection sv-16) id))
)
(else
0
)
)
)
)
)
;; definition for method 21 of type gui-control
+12 -10
View File
@@ -108,11 +108,12 @@
)
(cond
((= (logand (/ arg2 2) 1) 1)
(let* ((f0-0 (-> (the-as (pointer float) (+ (+ (* s2-0 4) (* s3-0 16)) (the-as int arg1)))))
(f0-2 (* f0-0 f0-0))
(f1-0 (-> (the-as (pointer float) (+ (+ (* s1-0 4) (* s3-0 16)) (the-as int arg1)))))
(f30-0 (sqrtf (+ f0-2 (* f1-0 f1-0))))
)
(let ((f30-0 (sqrtf (+ (square (-> (the-as (pointer float) (+ (+ (* s2-0 4) (* s3-0 16)) (the-as int arg1)))))
(square (-> (the-as (pointer float) (+ (+ (* s1-0 4) (* s3-0 16)) (the-as int arg1)))))
)
)
)
)
(cond
((< 0.00000000001 f30-0)
(set! (-> arg0 x) (atan
@@ -140,11 +141,12 @@
)
)
(else
(let* ((f0-21 (-> (the-as (pointer float) (+ (+ (* s3-0 4) (* s3-0 16)) (the-as int arg1)))))
(f0-23 (* f0-21 f0-21))
(f1-3 (-> (the-as (pointer float) (+ (+ (* s3-0 4) (* s2-0 16)) (the-as int arg1)))))
(f30-1 (sqrtf (+ f0-23 (* f1-3 f1-3))))
)
(let ((f30-1 (sqrtf (+ (square (-> (the-as (pointer float) (+ (+ (* s3-0 4) (* s3-0 16)) (the-as int arg1)))))
(square (-> (the-as (pointer float) (+ (+ (* s3-0 4) (* s2-0 16)) (the-as int arg1)))))
)
)
)
)
(cond
((< 0.00000000001 f30-1)
(set! (-> arg0 x)
+5 -5
View File
@@ -640,11 +640,11 @@
)
)
(dotimes (v1-3 6)
(set! f0-1 (- (the-as float f0-1)
(/ (- (* (the-as float (* (the-as float f0-1) (the-as float f0-1))) (the-as float f0-1)) arg0)
(* 3.0 (the-as float f0-1) (the-as float f0-1))
)
)
(set! f0-1
(- (the-as float f0-1) (/ (- (* (the-as float (square (the-as float f0-1))) (the-as float f0-1)) arg0)
(* 3.0 (the-as float f0-1) (the-as float f0-1))
)
)
)
)
(the-as float f0-1)
+7 -18
View File
@@ -48,12 +48,9 @@
;; definition for function vector-angle<-quaternion!
(defun vector-angle<-quaternion! ((arg0 vector) (arg1 quaternion))
"Convert the quaternion arg1 to axis-angle form and store in arg0 (angle goes in w)"
(let* ((f0-0 1.0)
(f1-0 1.0)
(f2-0 (-> arg1 w))
(f30-0 (/ f0-0 (sqrtf (- f1-0 (* f2-0 f2-0)))))
(f0-3 (* 2.0 (acos-rad (-> arg1 w))))
)
(let ((f30-0 (/ 1.0 (sqrtf (- 1.0 (square (-> arg1 w))))))
(f0-3 (* 2.0 (acos-rad (-> arg1 w))))
)
(set! (-> arg0 x) (* (-> arg1 x) f30-0))
(set! (-> arg0 y) (* (-> arg1 y) f30-0))
(set! (-> arg0 z) (* (-> arg1 z) f30-0))
@@ -599,11 +596,7 @@
;; definition for function quaternion-vector-len
(defun quaternion-vector-len ((arg0 quaternion))
"Assuming quaternion is normalized, get the length of the xyz part."
(let ((f0-0 1.0)
(f1-0 (-> arg0 w))
)
(sqrtf (- f0-0 (* f1-0 f1-0)))
)
(sqrtf (- 1.0 (square (-> arg0 w))))
)
;; definition for function quaternion-log!
@@ -689,9 +682,7 @@
(quaternion-normalize! arg0)
)
(else
(let* ((f1-4 1.0)
(f2-1 f0-0)
(f1-6 (sqrtf (- f1-4 (* f2-1 f2-1))))
(let* ((f1-6 (sqrtf (- 1.0 (square f0-0))))
(f0-6 (/ (- f1-6 f0-0) (+ f1-6 f0-0)))
(f28-0 (/ 1.0 f1-6))
)
@@ -767,10 +758,8 @@
(quaternion-negate! s3-0 s3-0)
)
(quaternion-! s5-0 s3-0 arg1)
(let ((f0-1 (quaternion-norm2 s5-0))
(f1-1 arg3)
)
(if (< (* f1-1 f1-1) f0-1)
(let ((f0-1 (quaternion-norm2 s5-0)))
(if (< (square arg3) f0-1)
(quaternion-float*! s5-0 s5-0 (/ arg3 (sqrtf f0-1)))
)
)
+31 -47
View File
@@ -156,63 +156,47 @@
;; ERROR: Unsupported inline assembly instruction kind - [madda.s f1, f4]
;; ERROR: Unsupported inline assembly instruction kind - [madd.s f0, f2, f5]
(defmethod rotate-toward-orientation! ((this trsqv) (arg0 quaternion) (arg1 float) (arg2 float) (arg3 int) (arg4 int) (arg5 float))
(local-vars
(f0-4 float)
(sv-192 (function quaternion vector vector float int quaternion))
(sv-208 quaternion)
(sv-224 vector)
(sv-240 int)
(sv-256 vector)
(sv-272 vector)
)
(set! sv-240 arg4)
(let ((s2-0 arg5)
(local-vars (f0-4 float))
(let ((sv-240 arg4)
(s2-0 arg5)
(s5-0 (get-quaternion this))
)
(let ((gp-0 (new 'stack-no-clear 'quaternion)))
(when (< 0.0 arg2)
(set! sv-192 quaternion-from-two-vectors-smooth!)
(set! sv-208 gp-0)
(set! sv-224 (vector-y-quaternion! (new 'stack-no-clear 'vector) s5-0))
(let ((a2-1 (vector-y-quaternion! (new 'stack-no-clear 'vector) arg0)))
(sv-192 sv-208 sv-224 a2-1 arg2 sv-240)
(quaternion-from-two-vectors-smooth!
gp-0
(vector-y-quaternion! (new 'stack-no-clear 'vector) s5-0)
(vector-y-quaternion! (new 'stack-no-clear 'vector) arg0)
arg2
sv-240
)
(quaternion-normalize! (quaternion*! s5-0 gp-0 s5-0))
)
(when (< 0.0 arg1)
(set! sv-256 (vector-y-quaternion! (new 'stack-no-clear 'vector) s5-0))
(let ((s1-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) s5-0)))
(set! sv-272 (vector-z-quaternion! (new 'stack-no-clear 'vector) arg0))
(let ((s0-1 (new 'stack-no-clear 'matrix)))
(vector-flatten! s1-2 s1-2 sv-256)
(vector-flatten! sv-272 sv-272 sv-256)
(vector-normalize! s1-2 1.0)
(vector-normalize! sv-272 1.0)
(cond
((!= s2-0 0.0)
(let* ((v1-5 (vector-cross! (new 'stack-no-clear 'vector) s1-2 sv-272))
(f0-3 (-> sv-256 x))
(f1-3 (-> sv-256 y))
(f2-0 (-> sv-256 z))
(f3-0 (-> v1-5 x))
(f4-0 (-> v1-5 y))
(f5-0 (-> v1-5 z))
)
(.mula.s f0-3 f3-0)
(.madda.s f1-3 f4-0)
(.madd.s f0-4 f2-0 f5-0)
)
(if (< (* f0-4 s2-0) 0.0)
(matrix-from-two-vectors-the-long-way-smooth! s0-1 s1-2 sv-272 arg1 arg3)
(matrix-from-two-vectors-smooth! s0-1 s1-2 sv-272 arg1 arg3)
)
)
(else
(matrix-from-two-vectors-smooth! s0-1 s1-2 sv-272 arg1 arg3)
)
(let ((sv-256 (vector-y-quaternion! (new 'stack-no-clear 'vector) s5-0))
(s1-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) s5-0))
(sv-272 (vector-z-quaternion! (new 'stack-no-clear 'vector) arg0))
(s0-1 (new 'stack-no-clear 'matrix))
)
(vector-flatten! s1-2 s1-2 sv-256)
(vector-flatten! sv-272 sv-272 sv-256)
(vector-normalize! s1-2 1.0)
(vector-normalize! sv-272 1.0)
(cond
((!= s2-0 0.0)
(let* ((v1-5 (vector-cross! (new 'stack-no-clear 'vector) s1-2 sv-272)))
(set! f0-4 (vector-dot sv-256 v1-5))
)
(if (< (* f0-4 s2-0) 0.0)
(matrix-from-two-vectors-the-long-way-smooth! s0-1 s1-2 sv-272 arg1 arg3)
(matrix-from-two-vectors-smooth! s0-1 s1-2 sv-272 arg1 arg3)
)
)
(else
(matrix-from-two-vectors-smooth! s0-1 s1-2 sv-272 arg1 arg3)
)
(matrix->quaternion gp-0 s0-1)
)
(matrix->quaternion gp-0 s0-1)
)
(quaternion-normalize! (quaternion*! s5-0 gp-0 s5-0))
)
+4 -11
View File
@@ -167,7 +167,7 @@
(let ((f2-0 (* 0.000095873795 (the float (sar (shl (the int arg0) 48) 48)))))
f2-0
(let* ((f1-4 (* 0.999998 f2-0))
(f0-3 (* f2-0 f2-0))
(f0-3 (square f2-0))
(f2-1 (* f2-0 f0-3))
(f1-5 (+ f1-4 (* -0.16666014 f2-1)))
(f2-2 (* f2-1 f0-3))
@@ -522,10 +522,7 @@
16383.996
)
(else
(let* ((f0-6 1.0)
(f1-2 arg0)
(f0-8 (sqrtf (- f0-6 (* f1-2 f1-2))))
)
(let ((f0-8 (sqrtf (- 1.0 (square arg0)))))
(atan0 arg0 f0-8)
)
)
@@ -551,18 +548,14 @@
"Inverse cosine, radians."
(cond
((>= arg0 0.0)
(let* ((f0-1 1.0)
(f1-1 arg0)
(f0-3 (sqrtf (- f0-1 (* f1-1 f1-1))))
(let* ((f0-3 (sqrtf (- 1.0 (square arg0))))
(f0-5 (/ (- f0-3 arg0) (+ f0-3 arg0)))
)
(atan-series-rad f0-5)
)
)
(else
(let* ((f0-6 1.0)
(f1-6 arg0)
(f0-8 (sqrtf (- f0-6 (* f1-6 f1-6))))
(let* ((f0-8 (sqrtf (- 1.0 (square arg0))))
(f0-10 (/ (+ f0-8 arg0) (- f0-8 arg0)))
)
(- 3.1415925 (atan-series-rad f0-10))
+2 -6
View File
@@ -1071,16 +1071,12 @@
;; definition for function vector-length<
(defun vector-length< ((arg0 vector) (arg1 float))
(let ((f0-0 (vector-length-squared arg0))
(f1-0 arg1)
)
(< f0-0 (* f1-0 f1-0))
)
(< (vector-length-squared arg0) (square arg1))
)
;; definition for function vector-length>
(defun vector-length> ((arg0 vector) (arg1 float))
(< (* arg1 arg1) (vector-length-squared arg0))
(< (square arg1) (vector-length-squared arg0))
)
;; definition for symbol *zero-vector*, type vector
+3 -3
View File
@@ -366,7 +366,7 @@
(when (or (!= f0-1 0.0) (!= f2-1 0.0))
(let* ((f1-5 (* f0-1 arg3))
(f0-3 (* f2-1 arg3))
(f2-4 (sqrtf (+ (* f1-5 f1-5) (* f0-3 f0-3))))
(f2-4 (sqrtf (+ (square f1-5) (square f0-3))))
)
(cond
((>= arg2 f2-4)
@@ -398,7 +398,7 @@
(when (or (!= f0-1 0.0) (!= f2-1 0.0))
(let* ((f1-5 (* f0-1 arg3))
(f0-3 (* f2-1 arg3))
(f2-4 (sqrtf (+ (* f1-5 f1-5) (* f0-3 f0-3))))
(f2-4 (sqrtf (+ (square f1-5) (square f0-3))))
)
(cond
((>= arg2 f2-4)
@@ -432,7 +432,7 @@
(let* ((f2-6 (* f0-1 arg3))
(f1-3 (* f1-2 arg3))
(f0-4 (* f3-1 arg3))
(f3-5 (sqrtf (+ (* f2-6 f2-6) (* f1-3 f1-3) (* f0-4 f0-4))))
(f3-5 (sqrtf (+ (square f2-6) (square f1-3) (square f0-4))))
)
(cond
((>= arg2 f3-5)
File diff suppressed because it is too large Load Diff
+6 -10
View File
@@ -110,9 +110,7 @@
)
(else
(if (or (not (cloest-point-on-mesh (-> s3-0 nav) s4-0 (-> gp-0 trans) (the-as nav-poly #f)))
(let ((f0-0 32768.0))
(< (* f0-0 f0-0) (vector-vector-xz-distance-squared s4-0 (-> gp-0 trans)))
)
(< (square 32768.0) (vector-vector-xz-distance-squared s4-0 (-> gp-0 trans)))
)
(return #t)
)
@@ -982,10 +980,8 @@
(a0-2 (-> this fact))
)
(when (and (< f0-0 (+ f1-0 (-> a0-2 notice-top))) (< (- f1-0 (-> a0-2 notice-bottom)) f0-0))
(let* ((f30-0 (-> this enemy-info notice-nav-radius))
(f0-1 f30-0)
)
(or (>= (* f0-1 f0-1) (vector-vector-xz-distance-squared (-> v1-4 trans) arg1))
(let ((f30-0 (-> this enemy-info notice-nav-radius)))
(or (>= (square f30-0) (vector-vector-xz-distance-squared (-> v1-4 trans) arg1))
(is-in-mesh? (-> this nav) arg1 f30-0)
)
)
@@ -1142,7 +1138,6 @@
;; WARN: Return type mismatch int vs none.
(defmethod init-enemy-behaviour-and-stats! ((this nav-enemy) (arg0 nav-enemy-info))
"Initializes a bunch of enemy fields related to how they should react, how many hitpoints they should have, etc"
(local-vars (sv-16 res-tag))
(when (coin-flip? this)
(let ((a0-2 (-> this node-list data 2)))
(set! (-> a0-2 param0) (the-as (function cspace transformq none) cspace<-parented-matrix-joint-flip-z!))
@@ -1244,8 +1239,9 @@
)
(reset-to-collide-spec (-> this focus) (the-as collide-spec a1-9))
)
(set! sv-16 (new 'static 'res-tag))
(let ((v1-82 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16))))
(let* ((sv-16 (new 'static 'res-tag))
(v1-82 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))
)
(cond
((and v1-82 (nonzero? (-> sv-16 elt-count)))
(set! (-> this actor-group) (the-as (pointer actor-group) v1-82))
+80 -88
View File
@@ -649,24 +649,25 @@ and declared out of order (cannot use forward declared structures in inline arra
;; WARN: Return type mismatch vector vs none.
(defmethod closest-point-on-boundary ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector))
"Find the point on the polygon edge that is closest to the query point."
(local-vars (sv-48 vector) (sv-52 vector) (sv-56 float))
(set! sv-48 (new 'stack-no-clear 'vector))
(set! sv-52 (new 'stack-no-clear 'vector))
(set! sv-56 (the-as float 10000000000000000000000000000000000000.0))
(let* ((s3-0 (-> arg0 vertex-count))
(v1-3 (the-as int (+ s3-0 -1)))
)
(dotimes (s2-0 (the-as int s3-0))
(let ((f0-1 (vector-segment-distance-point! arg2 (-> arg0 vertex v1-3) (-> arg0 vertex s2-0) sv-48)))
(when (< f0-1 sv-56)
(set! sv-56 f0-1)
(set! (-> sv-52 quad) (-> sv-48 quad))
)
(let ((sv-48 (new 'stack-no-clear 'vector))
(sv-52 (new 'stack-no-clear 'vector))
)
(let* ((sv-56 (the-as float 10000000000000000000000000000000000000.0))
(s3-0 (-> arg0 vertex-count))
(v1-3 (the-as int (+ s3-0 -1)))
)
(dotimes (s2-0 (the-as int s3-0))
(let ((f0-1 (vector-segment-distance-point! arg2 (-> arg0 vertex v1-3) (-> arg0 vertex s2-0) sv-48)))
(when (< f0-1 sv-56)
(set! sv-56 f0-1)
(set! (-> sv-52 quad) (-> sv-48 quad))
)
)
(set! v1-3 s2-0)
)
(set! v1-3 s2-0)
)
(set! (-> arg1 quad) (-> sv-52 quad))
)
(set! (-> arg1 quad) (-> sv-52 quad))
(none)
)
@@ -679,17 +680,17 @@ and declared out of order (cannot use forward declared structures in inline arra
;; WARN: Return type mismatch vector vs none.
(defmethod project-point-into-poly-2d ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector))
"Find the point in the polygon closest to the query point."
(local-vars (sv-48 vector) (sv-52 vector) (sv-56 float))
(cond
((point-in-poly? this arg0 arg2)
(set! (-> arg1 quad) (-> arg2 quad))
)
(else
(let ((s5-1 arg1))
(set! sv-48 (new 'stack-no-clear 'vector))
(set! sv-52 (new 'stack-no-clear 'vector))
(set! sv-56 (the-as float 10000000000000000000000000000000000000.0))
(let* ((s2-0 (-> arg0 vertex-count))
(let ((s5-1 arg1)
(sv-48 (new 'stack-no-clear 'vector))
(sv-52 (new 'stack-no-clear 'vector))
)
(let* ((sv-56 (the-as float 10000000000000000000000000000000000000.0))
(s2-0 (-> arg0 vertex-count))
(v1-6 (the-as int (+ s2-0 -1)))
)
(dotimes (s1-0 (the-as int s2-0))
@@ -761,81 +762,72 @@ and declared out of order (cannot use forward declared structures in inline arra
;; WARN: Stack slot offset 48 signed mismatch
;; WARN: Return type mismatch int vs none.
(defmethod move-along-nav-ray! ((this nav-mesh) (ray nav-ray))
(local-vars
(next-poly-idx int)
(work nav-mesh-work)
(current-poly nav-poly)
(current-poly-vtx-count uint)
(v0-table (pointer int8))
(v1-table (pointer int8))
(delta-x float)
(delta-z float)
(adj-vtx-0 vector)
(adj-vtx-1 vector)
(adj-edge-dz float)
(adj-edge-minus-dx float)
(sv-68 uint)
)
(set! next-poly-idx -1)
(set! work (-> this work))
(set! current-poly (-> ray current-poly))
(set! current-poly-vtx-count (-> ray current-poly vertex-count))
(set! v0-table (-> this work vert0-table))
(set! v1-table (-> this work vert1-table))
(set! delta-x (- (-> ray dest-pos x) (-> ray current-pos x)))
(set! delta-z (- (-> ray dest-pos z) (-> ray current-pos z)))
(dotimes (i (the-as int current-poly-vtx-count))
(set! adj-vtx-0 (-> current-poly vertex (-> v0-table i)))
(set! adj-vtx-1 (-> current-poly vertex (-> v1-table i)))
(set! adj-edge-dz (- (-> adj-vtx-0 z) (-> adj-vtx-1 z)))
(set! adj-edge-minus-dx (- (-> adj-vtx-1 x) (-> adj-vtx-0 x)))
(let ((heading-dot (+ (* delta-x adj-edge-dz) (* delta-z adj-edge-minus-dx))))
(when (< 0.0 heading-dot)
(let ((f1-10 (+ (* adj-edge-dz (- (-> adj-vtx-0 x) (-> ray current-pos x)))
(* adj-edge-minus-dx (- (-> adj-vtx-0 z) (-> ray current-pos z)))
)
)
)
(when (< f1-10 heading-dot)
(set! next-poly-idx i)
(let ((f0-12 (fmax 0.0 (/ f1-10 heading-dot))))
(set! delta-x (* delta-x f0-12))
(set! delta-z (* delta-z f0-12))
(let ((next-poly-idx -1))
(let ((work (-> this work)))
)
(let ((current-poly (-> ray current-poly))
(current-poly-vtx-count (-> ray current-poly vertex-count))
(v0-table (-> this work vert0-table))
(v1-table (-> this work vert1-table))
(delta-x (- (-> ray dest-pos x) (-> ray current-pos x)))
(delta-z (- (-> ray dest-pos z) (-> ray current-pos z)))
)
(dotimes (i (the-as int current-poly-vtx-count))
(let* ((adj-vtx-0 (-> current-poly vertex (-> v0-table i)))
(adj-vtx-1 (-> current-poly vertex (-> v1-table i)))
(adj-edge-dz (- (-> adj-vtx-0 z) (-> adj-vtx-1 z)))
(adj-edge-minus-dx (- (-> adj-vtx-1 x) (-> adj-vtx-0 x)))
(heading-dot (+ (* delta-x adj-edge-dz) (* delta-z adj-edge-minus-dx)))
)
(when (< 0.0 heading-dot)
(let ((f1-10 (+ (* adj-edge-dz (- (-> adj-vtx-0 x) (-> ray current-pos x)))
(* adj-edge-minus-dx (- (-> adj-vtx-0 z) (-> ray current-pos z)))
)
)
)
(when (< f1-10 heading-dot)
(set! next-poly-idx i)
(let ((f0-12 (fmax 0.0 (/ f1-10 heading-dot))))
(set! delta-x (* delta-x f0-12))
(set! delta-z (* delta-z f0-12))
)
)
)
)
)
)
)
)
(let ((f0-16 (+ (* delta-x (-> ray dir x)) (* delta-z (-> ray dir z)))))
(+! (-> ray len) f0-16)
)
0
(set! (-> ray next-poly) #f)
(cond
((= next-poly-idx -1)
(set! (-> ray current-pos quad) (-> ray dest-pos quad))
(set! (-> ray reached-dest) #t)
(set! (-> ray terminated) #t)
)
(else
(+! (-> ray current-pos x) delta-x)
(+! (-> ray current-pos z) delta-z)
(set! sv-68 (-> current-poly adj-poly next-poly-idx))
(if (!= sv-68 255)
(set! (-> ray next-poly) (-> this poly-array sv-68))
)
(let ((f0-16 (+ (* delta-x (-> ray dir x)) (* delta-z (-> ray dir z)))))
(+! (-> ray len) f0-16)
)
0
(set! (-> ray next-poly) #f)
(cond
((and (-> ray next-poly) (not (logtest? (-> ray next-poly pat) (-> ray ignore))))
(set! (-> ray current-poly) (-> ray next-poly))
((= next-poly-idx -1)
(set! (-> ray current-pos quad) (-> ray dest-pos quad))
(set! (-> ray reached-dest) #t)
(set! (-> ray terminated) #t)
)
(else
(set! (-> ray last-edge) next-poly-idx)
(if (-> ray next-poly)
(set! (-> ray hit-gap) #t)
(set! (-> ray hit-boundary) #t)
(+! (-> ray current-pos x) delta-x)
(+! (-> ray current-pos z) delta-z)
(let ((sv-68 (-> current-poly adj-poly next-poly-idx)))
(if (!= sv-68 255)
(set! (-> ray next-poly) (-> this poly-array sv-68))
)
)
(cond
((and (-> ray next-poly) (not (logtest? (-> ray next-poly pat) (-> ray ignore))))
(set! (-> ray current-poly) (-> ray next-poly))
)
(else
(set! (-> ray last-edge) next-poly-idx)
(if (-> ray next-poly)
(set! (-> ray hit-gap) #t)
(set! (-> ray hit-boundary) #t)
)
(set! (-> ray terminated) #t)
)
(set! (-> ray terminated) #t)
)
)
)
)
File diff suppressed because it is too large Load Diff
+202 -217
View File
@@ -80,27 +80,7 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod update ((this chain-physics) (arg0 process-drawable))
(local-vars
(v1-78 float)
(f0-11 float)
(sv-272 chain-physics-joint)
(sv-288 vector)
(sv-304 vector)
(sv-320 (function vector float vector))
(sv-336 vector)
(sv-352 vector)
(sv-368 vector)
(sv-384 vector)
(sv-400 vector)
(sv-416 vector)
(sv-432 vector)
(sv-448 (inline-array vector))
(sv-464 (inline-array vector))
(sv-480 (inline-array vector))
(sv-496 vector)
(sv-512 (inline-array vector))
(sv-528 vector)
)
(local-vars (v1-78 float) (f0-11 float))
(rlet ((acc :class vf)
(vf0 :class vf)
(vf1 :class vf)
@@ -143,209 +123,214 @@
)
)
(dotimes (s0-0 (the-as int (-> this num-joints)))
(set! sv-272 (-> this chain-joints s0-0))
(set! sv-528 (new 'stack-no-clear 'vector))
(let ((v1-27 (-> sv-272 position quad)))
(set! (-> sv-528 quad) v1-27)
)
(set! (-> sv-272 joint-mod flex-blend) f30-0)
(if (-> this negate-y)
(vector-negate! s1-0 s1-0)
)
(set! sv-288 (new 'stack-no-clear 'vector))
(apply-gravity this sv-288 s0-0 arg0)
(let ((v1-34 sv-528))
(let ((a0-10 sv-528))
(.mov.vf.w vf6 vf0)
(.lvf vf4 (&-> a0-10 quad))
)
(.lvf vf5 (&-> sv-288 quad))
(.add.vf.xyz vf6 vf4 vf5)
(.svf (&-> v1-34 quad) vf6)
)
(when (< s0-0 (the-as int (+ (-> this root-joint-index) -1)))
(set! sv-304 (new 'stack-no-clear 'vector))
(chain-physics-method-14 this sv-304 s0-0)
(let ((v1-40 sv-528))
(let ((a0-13 sv-528))
(.mov.vf.w vf6 vf0)
(.lvf vf4 (&-> a0-13 quad))
(let ((sv-272 (-> this chain-joints s0-0))
(sv-528 (new 'stack-no-clear 'vector))
)
(.lvf vf5 (&-> sv-304 quad))
(.add.vf.xyz vf6 vf4 vf5)
(.svf (&-> v1-40 quad) vf6)
)
)
(clamp-length this sv-528 s3-0 s0-0 arg0)
(set! sv-400 (new 'stack-no-clear 'vector))
(let ((v1-43 sv-528)
(a0-16 s3-0)
)
(.lvf vf4 (&-> v1-43 quad))
(.lvf vf5 (&-> a0-16 quad))
)
(.mov.vf.w vf6 vf0)
(.sub.vf.xyz vf6 vf4 vf5)
(.svf (&-> sv-400 quad) vf6)
(let ((f28-1 (vector-normalize-ret-len! sv-400 1.0))
(f24-0 (vector-dot sv-400 s1-0))
(f26-0 (chain-physics-method-16 this s0-0))
)
(when (< f24-0 (cos f26-0))
(vector--float*! sv-400 sv-400 s1-0 f24-0)
(set! sv-320 vector-normalize!)
(set! sv-336 sv-400)
(let ((a1-17 (sin f26-0)))
(sv-320 sv-336 a1-17)
)
(set! sv-384 sv-400)
(set! sv-352 sv-400)
(set! sv-368 s1-0)
(let ((f0-6 (cos f26-0)))
(.lvf vf2 (&-> sv-368 quad))
(.lvf vf1 (&-> sv-352 quad))
(let ((v1-55 f0-6))
(.mov vf3 v1-55)
)
)
(.add.x.vf.w vf4 vf0 vf0)
(.mul.x.vf acc vf2 vf3)
(.add.mul.w.vf.xyz vf4 vf1 vf0 acc)
(.svf (&-> sv-384 quad) vf4)
(vector+float*! sv-528 s3-0 sv-400 f28-1)
)
)
(chain-physics-method-17 this sv-528 s0-0)
(set! sv-432 (new 'stack-no-clear 'vector))
(let ((v1-61 s3-0)
(a0-27 sv-528)
)
(.lvf vf4 (&-> v1-61 quad))
(.lvf vf5 (&-> a0-27 quad))
)
(.mov.vf.w vf6 vf0)
(.sub.vf.xyz vf6 vf4 vf5)
(.svf (&-> sv-432 quad) vf6)
(vector-normalize-ret-len! sv-432 1.0)
(set! sv-416 (new 'stack-no-clear 'vector))
(let ((v1-64 sv-528)
(a0-30 (-> sv-272 position))
)
(.lvf vf4 (&-> v1-64 quad))
(.lvf vf5 (&-> a0-30 quad))
)
(.mov.vf.w vf6 vf0)
(.sub.vf.xyz vf6 vf4 vf5)
(.svf (&-> sv-416 quad) vf6)
(let ((f28-2 (vector-dot sv-432 sv-416)))
(vector--float*! sv-416 sv-416 sv-432 f28-2)
(cond
((< f28-2 0.0)
(set! f0-11 (* f28-2 (-> this compress-vel-parallel)))
(vector-float*! sv-416 sv-416 (-> this compress-vel))
)
(else
(set! f0-11 (* f28-2 (-> this stretch-vel-parallel)))
(vector-float*! sv-416 sv-416 (-> this stretch-vel))
)
)
)
(let ((v1-73 (-> sv-272 velocity)))
(.lvf vf2 (&-> sv-432 quad))
(.lvf vf1 (&-> sv-416 quad))
(let ((a0-37 f0-11))
(.mov vf3 a0-37)
)
(.add.x.vf.w vf4 vf0 vf0)
(.mul.x.vf acc vf2 vf3)
(.add.mul.w.vf.xyz vf4 vf1 vf0 acc)
(.svf (&-> v1-73 quad) vf4)
)
(vector+! sv-528 (-> sv-272 position) (-> sv-272 velocity))
(let ((a2-9 (vector-! (new 'stack-no-clear 'vector) s3-0 sv-528)))
(.lvf vf1 (&-> a2-9 quad))
(.add.w.vf.x vf2 vf0 vf0)
(.mul.vf vf1 vf1 vf1)
(.mul.x.vf.x acc vf2 vf1)
(.add.mul.y.vf.x acc vf2 vf1 acc)
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
(.mov v1-78 vf1)
(let* ((f0-13 v1-78)
(f1-6 (* (-> this maximum-stretch) (-> this joint-length)))
(f2-3 f1-6)
)
(if (< (* f2-3 f2-3) f0-13)
(vector--float*! sv-528 s3-0 a2-9 (/ f1-6 (sqrtf f0-13)))
)
)
)
(set! (-> sv-272 position quad) (-> sv-528 quad))
(if (-> sv-272 joint-mod)
(set! (-> sv-272 joint-mod trans quad) (-> sv-528 quad))
)
(when (< s0-0 (the-as int (-> this num-joints)))
(vector-! (-> s4-0 vector 1) sv-528 s3-0)
(vector-normalize! (-> s4-0 vector 1) 1.0)
(set! (-> sv-528 quad) (-> sv-272 position quad))
(set! (-> sv-272 joint-mod flex-blend) f30-0)
(if (-> this negate-y)
(vector-negate! (-> s4-0 vector 1) (-> s4-0 vector 1))
(vector-negate! s1-0 s1-0)
)
(vector-cross! (-> s4-0 vector 0) (-> s4-0 vector 1) s2-0)
(vector-normalize! (-> s4-0 vector 0) 1.0)
(set! sv-496 (new 'stack-no-clear 'vector))
(let ((v1-97 (-> sv-272 old-x))
(a0-51 (-> s4-0 vector))
(let ((sv-288 (new 'stack-no-clear 'vector)))
(apply-gravity this sv-288 s0-0 arg0)
(let ((v1-34 sv-528))
(let ((a0-10 sv-528))
(.mov.vf.w vf6 vf0)
(.lvf vf4 (&-> a0-10 quad))
)
(.lvf vf1 (&-> v1-97 quad))
(.lvf vf2 (&-> a0-51 0 quad))
)
(.outer.product.a.vf acc vf1 vf2)
(.outer.product.b.vf vf3 vf2 vf1 acc)
(.svf (&-> sv-496 quad) vf3)
(vector-flatten! sv-496 (-> sv-272 old-x) (-> s4-0 vector 1))
(vector-normalize! sv-496 1.0)
(cond
((< (vector-dot (-> s4-0 vector 0) sv-496) (cos (-> this axial-slop)))
(vector-cross! sv-496 sv-496 (-> s4-0 vector 0))
(vector-cross! sv-496 (-> s4-0 vector 0) sv-496)
(vector-normalize! sv-496 1.0)
(set! sv-464 (-> s4-0 vector))
(set! sv-448 (-> s4-0 vector))
(let ((f0-20 (cos (-> this axial-slop))))
(.lvf vf1 (&-> sv-448 0 quad))
(let ((v1-107 f0-20))
(.mov vf2 v1-107)
)
)
(.add.x.vf.w vf1 vf0 vf0)
(.mul.x.vf.xyz vf1 vf1 vf2)
(.svf (&-> sv-464 0 quad) vf1)
(set! sv-512 (-> s4-0 vector))
(set! sv-480 (-> s4-0 vector))
(let ((f0-22 (sin (-> this axial-slop))))
(.lvf vf2 (&-> sv-496 quad))
(.lvf vf1 (&-> sv-480 0 quad))
(let ((v1-113 f0-22))
(.mov vf3 v1-113)
)
)
(.add.x.vf.w vf4 vf0 vf0)
(.mul.x.vf acc vf2 vf3)
(.add.mul.w.vf.xyz vf4 vf1 vf0 acc)
(.svf (&-> sv-512 0 quad) vf4)
(set! (-> sv-272 old-x quad) (-> s4-0 vector 0 quad))
)
(else
(set! (-> s4-0 vector 0 quad) (-> sv-496 quad))
(set! (-> sv-272 old-x quad) (-> s4-0 vector 0 quad))
(.lvf vf5 (&-> sv-288 quad))
(.add.vf.xyz vf6 vf4 vf5)
(.svf (&-> v1-34 quad) vf6)
)
)
(vector-cross! (-> s4-0 vector 2) (-> s4-0 vector 0) (-> s4-0 vector 1))
(matrix->quaternion (-> sv-272 joint-mod quat) s4-0)
(set! (-> s1-0 quad) (-> s4-0 vector 1 quad))
(set! (-> s2-0 quad) (-> s4-0 vector 2 quad))
0
(when (< s0-0 (the-as int (+ (-> this root-joint-index) -1)))
(let ((sv-304 (new 'stack-no-clear 'vector)))
(chain-physics-method-14 this sv-304 s0-0)
(let ((v1-40 sv-528))
(let ((a0-13 sv-528))
(.mov.vf.w vf6 vf0)
(.lvf vf4 (&-> a0-13 quad))
)
(.lvf vf5 (&-> sv-304 quad))
(.add.vf.xyz vf6 vf4 vf5)
(.svf (&-> v1-40 quad) vf6)
)
)
)
(clamp-length this sv-528 s3-0 s0-0 arg0)
(let ((sv-400 (new 'stack-no-clear 'vector)))
(let ((v1-43 sv-528)
(a0-16 s3-0)
)
(.lvf vf4 (&-> v1-43 quad))
(.lvf vf5 (&-> a0-16 quad))
)
(.mov.vf.w vf6 vf0)
(.sub.vf.xyz vf6 vf4 vf5)
(.svf (&-> sv-400 quad) vf6)
(let ((f28-1 (vector-normalize-ret-len! sv-400 1.0))
(f24-0 (vector-dot sv-400 s1-0))
(f26-0 (chain-physics-method-16 this s0-0))
)
(when (< f24-0 (cos f26-0))
(vector--float*! sv-400 sv-400 s1-0 f24-0)
(vector-normalize! sv-400 (sin f26-0))
(let ((sv-384 sv-400))
(let ((sv-352 sv-400)
(sv-368 s1-0)
(f0-6 (cos f26-0))
)
(.lvf vf2 (&-> sv-368 quad))
(.lvf vf1 (&-> sv-352 quad))
(let ((v1-55 f0-6))
(.mov vf3 v1-55)
)
)
(.add.x.vf.w vf4 vf0 vf0)
(.mul.x.vf acc vf2 vf3)
(.add.mul.w.vf.xyz vf4 vf1 vf0 acc)
(.svf (&-> sv-384 quad) vf4)
)
(vector+float*! sv-528 s3-0 sv-400 f28-1)
)
)
)
(chain-physics-method-17 this sv-528 s0-0)
(let ((sv-432 (new 'stack-no-clear 'vector)))
(let ((a0-27 sv-528))
(.lvf vf4 (&-> s3-0 quad))
(.lvf vf5 (&-> a0-27 quad))
)
(.mov.vf.w vf6 vf0)
(.sub.vf.xyz vf6 vf4 vf5)
(.svf (&-> sv-432 quad) vf6)
(vector-normalize-ret-len! sv-432 1.0)
(let ((sv-416 (new 'stack-no-clear 'vector)))
(let ((v1-64 sv-528)
(a0-30 (-> sv-272 position))
)
(.lvf vf4 (&-> v1-64 quad))
(.lvf vf5 (&-> a0-30 quad))
)
(.mov.vf.w vf6 vf0)
(.sub.vf.xyz vf6 vf4 vf5)
(.svf (&-> sv-416 quad) vf6)
(let ((f28-2 (vector-dot sv-432 sv-416)))
(vector--float*! sv-416 sv-416 sv-432 f28-2)
(cond
((< f28-2 0.0)
(set! f0-11 (* f28-2 (-> this compress-vel-parallel)))
(vector-float*! sv-416 sv-416 (-> this compress-vel))
)
(else
(set! f0-11 (* f28-2 (-> this stretch-vel-parallel)))
(vector-float*! sv-416 sv-416 (-> this stretch-vel))
)
)
)
(let ((v1-73 (-> sv-272 velocity)))
(.lvf vf2 (&-> sv-432 quad))
(.lvf vf1 (&-> sv-416 quad))
(let ((a0-37 f0-11))
(.mov vf3 a0-37)
)
(.add.x.vf.w vf4 vf0 vf0)
(.mul.x.vf acc vf2 vf3)
(.add.mul.w.vf.xyz vf4 vf1 vf0 acc)
(.svf (&-> v1-73 quad) vf4)
)
)
)
(vector+! sv-528 (-> sv-272 position) (-> sv-272 velocity))
(let ((a2-9 (vector-! (new 'stack-no-clear 'vector) s3-0 sv-528)))
(.lvf vf1 (&-> a2-9 quad))
(.add.w.vf.x vf2 vf0 vf0)
(.mul.vf vf1 vf1 vf1)
(.mul.x.vf.x acc vf2 vf1)
(.add.mul.y.vf.x acc vf2 vf1 acc)
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
(.mov v1-78 vf1)
(let ((f0-13 v1-78)
(f1-6 (* (-> this maximum-stretch) (-> this joint-length)))
)
(if (< (square f1-6) f0-13)
(vector--float*! sv-528 s3-0 a2-9 (/ f1-6 (sqrtf f0-13)))
)
)
)
(set! (-> sv-272 position quad) (-> sv-528 quad))
(if (-> sv-272 joint-mod)
(set! (-> sv-272 joint-mod trans quad) (-> sv-528 quad))
)
(when (< s0-0 (the-as int (-> this num-joints)))
(vector-! (-> s4-0 vector 1) sv-528 s3-0)
(vector-normalize! (-> s4-0 vector 1) 1.0)
(if (-> this negate-y)
(vector-negate! (-> s4-0 vector 1) (-> s4-0 vector 1))
)
(vector-cross! (-> s4-0 vector 0) (-> s4-0 vector 1) s2-0)
(vector-normalize! (-> s4-0 vector 0) 1.0)
(let ((sv-496 (new 'stack-no-clear 'vector)))
(let ((v1-97 (-> sv-272 old-x))
(a0-51 (-> s4-0 vector))
)
(.lvf vf1 (&-> v1-97 quad))
(.lvf vf2 (&-> a0-51 0 quad))
)
(.outer.product.a.vf acc vf1 vf2)
(.outer.product.b.vf vf3 vf2 vf1 acc)
(.svf (&-> sv-496 quad) vf3)
(vector-flatten! sv-496 (-> sv-272 old-x) (-> s4-0 vector 1))
(vector-normalize! sv-496 1.0)
(cond
((< (vector-dot (-> s4-0 vector 0) sv-496) (cos (-> this axial-slop)))
(vector-cross! sv-496 sv-496 (-> s4-0 vector 0))
(vector-cross! sv-496 (-> s4-0 vector 0) sv-496)
(vector-normalize! sv-496 1.0)
(let ((sv-464 (-> s4-0 vector)))
(let ((sv-448 (-> s4-0 vector))
(f0-20 (cos (-> this axial-slop)))
)
(.lvf vf1 (&-> sv-448 0 quad))
(let ((v1-107 f0-20))
(.mov vf2 v1-107)
)
)
(.add.x.vf.w vf1 vf0 vf0)
(.mul.x.vf.xyz vf1 vf1 vf2)
(.svf (&-> sv-464 0 quad) vf1)
)
(let ((sv-512 (-> s4-0 vector)))
(let ((sv-480 (-> s4-0 vector))
(f0-22 (sin (-> this axial-slop)))
)
(.lvf vf2 (&-> sv-496 quad))
(.lvf vf1 (&-> sv-480 0 quad))
(let ((v1-113 f0-22))
(.mov vf3 v1-113)
)
)
(.add.x.vf.w vf4 vf0 vf0)
(.mul.x.vf acc vf2 vf3)
(.add.mul.w.vf.xyz vf4 vf1 vf0 acc)
(.svf (&-> sv-512 0 quad) vf4)
)
(set! (-> sv-272 old-x quad) (-> s4-0 vector 0 quad))
)
(else
(set! (-> s4-0 vector 0 quad) (-> sv-496 quad))
(set! (-> sv-272 old-x quad) (-> s4-0 vector 0 quad))
)
)
)
(vector-cross! (-> s4-0 vector 2) (-> s4-0 vector 0) (-> s4-0 vector 1))
(matrix->quaternion (-> sv-272 joint-mod quat) s4-0)
(set! (-> s1-0 quad) (-> s4-0 vector 1 quad))
(set! (-> s2-0 quad) (-> s4-0 vector 2 quad))
0
)
(set! (-> s3-0 quad) (-> sv-528 quad))
)
(set! (-> s3-0 quad) (-> sv-528 quad))
0
)
)
+47 -59
View File
@@ -52,16 +52,9 @@
(matrix-identity! (-> this inertial-tensor))
(matrix-identity! (-> this inv-inertial-tensor))
(let ((f0-4 (/ f24-0 12)))
(let* ((f1-1 f30-0)
(f1-3 (* f1-1 f1-1))
(f2-0 f26-0)
)
(set! (-> this inertial-tensor vector 0 x) (* f0-4 (+ f1-3 (* f2-0 f2-0))))
)
(let ((f1-6 f28-0))
(set! (-> this inertial-tensor vector 1 y) (* f0-4 (+ (* f1-6 f1-6) (* f26-0 f26-0))))
)
(set! (-> this inertial-tensor vector 2 z) (* f0-4 (+ (* f28-0 f28-0) (* f30-0 f30-0))))
(set! (-> this inertial-tensor vector 0 x) (* f0-4 (+ (square f30-0) (square f26-0))))
(set! (-> this inertial-tensor vector 1 y) (* f0-4 (+ (square f28-0) (square f26-0))))
(set! (-> this inertial-tensor vector 2 z) (* f0-4 (+ (square f28-0) (square f30-0))))
)
)
(let ((f0-6 (-> this inertial-tensor vector 0 x)))
@@ -225,8 +218,7 @@
(.svf (&-> a2-1 quad) vf6)
)
(let* ((f0-3 (* 500000000.0 (-> this info mass)))
(f1-1 f0-3)
(f1-3 (* f1-1 f1-1))
(f1-3 (square f0-3))
)
(.lvf vf1 (&-> (-> this ang-momentum) quad))
(.add.w.vf.x vf2 vf0 vf0)
@@ -663,16 +655,6 @@
;; WARN: Stack slot offset 632 signed mismatch
;; WARN: Return type mismatch int vs none.
(defmethod rigid-body-method-15 ((this rigid-body) (arg0 collide-shape-moving) (arg1 float))
(local-vars
(sv-576 vector)
(sv-624 vector)
(sv-628 vector)
(sv-632 float)
(sv-704 vector)
(sv-708 vector)
(sv-712 vector)
(sv-716 vector)
)
(rlet ((acc :class vf)
(vf0 :class vf)
(vf4 :class vf)
@@ -704,46 +686,52 @@
(b! #t cfg-9 :delay (nop!))
(label cfg-3)
(rigid-body-method-14 this (* f30-0 arg1 f28-0))
(set! sv-576 (new 'stack-no-clear 'vector))
(set! sv-624 (new 'stack-no-clear 'vector))
(set! sv-628 (new 'stack-no-clear 'vector))
(vector-! sv-576 (-> this position) (-> s3-0 best-other-tri intersect))
(vector-normalize! sv-576 1.0)
(set! sv-632 (vector-dot sv-576 (-> this lin-momentum)))
(when (< sv-632 0.0)
(vector-float*! sv-624 sv-576 sv-632)
(vector-! sv-628 (-> this lin-momentum) sv-624)
(vector-float*! sv-628 sv-628 (- 1.0 (-> s4-0 friction-factor)))
(vector-float*! sv-624 sv-624 (- (-> s4-0 bounce-factor)))
(vector+! (-> this lin-momentum) sv-628 sv-624)
(vector-float*! (-> this lin-velocity) (-> this lin-momentum) (-> s4-0 inv-mass))
)
(b! (>= f28-0 0.0001) cfg-7 :delay #f)
(vector+float*! (-> this position) (-> this position) sv-576 409.6)
(label cfg-7)
(set! sv-704 (new 'stack-no-clear 'vector))
(set! sv-708 (new 'stack-no-clear 'vector))
(set! sv-712 (new 'stack-no-clear 'vector))
(set! sv-716 (new 'stack-no-clear 'vector))
(vector-! sv-704 (-> s3-0 best-other-tri intersect) (-> this position))
(rigid-body-method-22 this (-> s3-0 best-other-tri intersect) sv-708)
(vector+float*! sv-708 sv-708 sv-576 (- (vector-dot sv-708 sv-576)))
(vector-float*! sv-712 sv-708 (* -1.0 (-> s4-0 mass) (-> s4-0 friction-factor)))
(vector-cross! sv-716 sv-704 sv-712)
(let ((a1-20 (-> this ang-momentum)))
(let ((v1-46 (-> this ang-momentum)))
(let ((a0-27 sv-716))
(let ((a2-6 1.0))
(.mov vf7 a2-6)
(let ((sv-576 (new 'stack-no-clear 'vector)))
(let ((sv-624 (new 'stack-no-clear 'vector))
(sv-628 (new 'stack-no-clear 'vector))
)
(vector-! sv-576 (-> this position) (-> s3-0 best-other-tri intersect))
(vector-normalize! sv-576 1.0)
(let ((sv-632 (vector-dot sv-576 (-> this lin-momentum))))
(when (< sv-632 0.0)
(vector-float*! sv-624 sv-576 sv-632)
(vector-! sv-628 (-> this lin-momentum) sv-624)
(vector-float*! sv-628 sv-628 (- 1.0 (-> s4-0 friction-factor)))
(vector-float*! sv-624 sv-624 (- (-> s4-0 bounce-factor)))
(vector+! (-> this lin-momentum) sv-628 sv-624)
(vector-float*! (-> this lin-velocity) (-> this lin-momentum) (-> s4-0 inv-mass))
)
(.lvf vf5 (&-> a0-27 quad))
)
(.lvf vf4 (&-> v1-46 quad))
)
(.add.x.vf.w vf6 vf0 vf0)
(.mul.x.vf.xyz acc vf5 vf7)
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
(.svf (&-> a1-20 quad) vf6)
(b! (>= f28-0 0.0001) cfg-7 :delay #f)
(vector+float*! (-> this position) (-> this position) sv-576 409.6)
(label cfg-7)
(let ((sv-704 (new 'stack-no-clear 'vector))
(sv-708 (new 'stack-no-clear 'vector))
(sv-712 (new 'stack-no-clear 'vector))
(sv-716 (new 'stack-no-clear 'vector))
)
(vector-! sv-704 (-> s3-0 best-other-tri intersect) (-> this position))
(rigid-body-method-22 this (-> s3-0 best-other-tri intersect) sv-708)
(vector+float*! sv-708 sv-708 sv-576 (- (vector-dot sv-708 sv-576)))
(vector-float*! sv-712 sv-708 (* -1.0 (-> s4-0 mass) (-> s4-0 friction-factor)))
(vector-cross! sv-716 sv-704 sv-712)
(let ((a1-20 (-> this ang-momentum)))
(let ((v1-46 (-> this ang-momentum)))
(let ((a0-27 sv-716))
(let ((a2-6 1.0))
(.mov vf7 a2-6)
)
(.lvf vf5 (&-> a0-27 quad))
)
(.lvf vf4 (&-> v1-46 quad))
)
(.add.x.vf.w vf6 vf0 vf0)
(.mul.x.vf.xyz acc vf5 vf7)
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
(.svf (&-> a1-20 quad) vf6)
)
)
)
(vector-rotate*! (-> this ang-velocity) (-> this ang-momentum) (-> this inv-i-world))
(set! f30-0 (* f30-0 (- 1.0 f28-0)))
+5 -14
View File
@@ -50,10 +50,9 @@
;; definition for method 14 of type trajectory
;; WARN: Return type mismatch int vs none.
(defmethod setup-from-to-y-vel! ((this trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float))
(let* ((f0-0 arg2)
(f1-3 (- (* f0-0 f0-0) (* 2.0 (- (-> arg0 y) (-> arg1 y)) arg3)))
(f0-3 900.0)
)
(let ((f1-3 (- (square arg2) (* 2.0 (- (-> arg0 y) (-> arg1 y)) arg3)))
(f0-3 900.0)
)
(when (>= f1-3 0.0)
(let ((f0-4 (sqrtf f1-3)))
(set! f0-3 (fmax (/ (- (- arg2) f0-4) arg3) (/ (+ (- arg2) f0-4) arg3)))
@@ -88,13 +87,7 @@
(let ((f0-1 (- (-> arg1 y) (-> arg0 y))))
(cond
((= f0-1 0.0)
(let ((t9-0 (method-of-type trajectory setup-from-to-duration!))
(v1-2 arg2)
(f0-3 (* -8.0 arg3))
(f1-3 arg2)
)
(t9-0 this arg0 arg1 v1-2 (/ f0-3 (* f1-3 f1-3)))
)
(setup-from-to-duration! this arg0 arg1 arg2 (/ (* -8.0 arg3) (square arg2)))
(return 0)
)
((and (< 0.0 f0-1) (< 0.0 arg3) (< arg3 f0-1))
@@ -105,9 +98,7 @@
)
)
(let* ((f1-14 (/ (- arg3 f0-1) arg3))
(f0-6 -2.0)
(f1-18 (/ (- 1.0 f1-14) (- arg2 (* arg2 (sqrtf f1-14)))))
(f0-8 (* f0-6 (* f1-18 f1-18) arg3))
(f0-8 (* -2.0 (square (/ (- 1.0 f1-14) (- arg2 (* arg2 (sqrtf f1-14))))) arg3))
)
(setup-from-to-duration! this arg0 arg1 arg2 f0-8)
)
@@ -106,7 +106,6 @@
;; INFO: Used lq/sq
;; WARN: Using new Jak 2 rtype-of
(defun-debug cspace-inspect-tree ((arg0 process-drawable) (arg1 cspace) (arg2 int) (arg3 int) (arg4 object))
(local-vars (sv-16 string) (sv-32 int) (sv-48 int))
(if (and (= arg4 'mesh) (zero? *debug-vertex-stats*))
(set! *debug-vertex-stats* (new 'debug 'debug-vertex-stats))
)
@@ -132,15 +131,12 @@
#f
)
((= v1-11 'mesh)
(let ((s1-0 format)
(s0-0 #t)
)
(set! sv-16 " ~D/~D/~F")
(set! sv-32 (drawable-frag-count (-> arg1 geo)))
(set! sv-48 (drawable-tri-count (-> arg1 geo)))
(let ((t0-2 (drawable-vertex-ratio (-> arg1 geo) *debug-vertex-stats*)))
(s1-0 s0-0 sv-16 sv-32 sv-48 t0-2)
)
(format
#t
" ~D/~D/~F"
(drawable-frag-count (-> arg1 geo))
(drawable-tri-count (-> arg1 geo))
(drawable-vertex-ratio (-> arg1 geo) *debug-vertex-stats*)
)
)
)
@@ -255,7 +251,6 @@
;; definition for method 9 of type lod-set
;; INFO: Used lq/sq
(defmethod setup-lods! ((this lod-set) (arg0 skeleton-group) (arg1 art-group) (arg2 entity))
(local-vars (sv-16 res-tag))
(let ((v1-0 (-> arg1 length))
(s3-0 (-> arg0 max-lod))
)
@@ -278,13 +273,13 @@
(set! (-> this lod s3-0 dist) (res-lump-float arg2 'vis-dist :default 4095996000.0))
)
)
(let ((v1-14 (-> arg1 data (-> arg0 jgeo))))
(set! sv-16 (new 'static 'res-tag))
(let ((v1-15 (res-lump-data (-> v1-14 extra) 'lod-dist pointer :tag-ptr (& sv-16))))
(when v1-15
(dotimes (a0-6 (the-as int (-> sv-16 elt-count)))
(set! (-> this lod a0-6 dist) (-> (the-as (pointer float) (&+ v1-15 (* a0-6 4)))))
)
(let* ((v1-14 (-> arg1 data (-> arg0 jgeo)))
(sv-16 (new 'static 'res-tag))
(v1-15 (res-lump-data (-> v1-14 extra) 'lod-dist pointer :tag-ptr (& sv-16)))
)
(when v1-15
(dotimes (a0-6 (the-as int (-> sv-16 elt-count)))
(set! (-> this lod a0-6 dist) (-> (the-as (pointer float) (&+ v1-15 (* a0-6 4)))))
)
)
)
@@ -476,12 +471,6 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch symbol vs none.
(defun draw-joint-axes ((arg0 process-drawable))
(local-vars
(sv-64 (function symbol bucket-id vector vector meters rgba symbol))
(sv-80 symbol)
(sv-96 int)
(sv-112 vector)
)
(let ((s5-0 (new 'stack-no-clear 'vector2h))
(s4-0 (shl #x8000 16))
(s3-0 (new 'stack-no-clear 'vector))
@@ -494,17 +483,19 @@
(let ((s1-0 (-> arg0 node-list data s2-0 bone transform)))
(vector<-cspace! s3-0 (-> arg0 node-list data s2-0))
(dotimes (s0-0 3)
(set! sv-64 add-debug-vector)
(set! sv-80 #t)
(set! sv-96 318)
(set! sv-112 s3-0)
(let ((a3-0
(vector-normalize-copy! (new 'stack-no-clear 'vector) (the-as vector (+ (the-as uint s1-0) (* s0-0 16))) 1.0)
)
(t0-0 #x444ccccd)
(t1-0 (logior (ash 255 (* s0-0 8)) s4-0))
(let ((sv-64 add-debug-vector)
(sv-80 #t)
(sv-96 318)
(sv-112 s3-0)
)
(sv-64 sv-80 (the-as bucket-id sv-96) sv-112 a3-0 (the-as meters t0-0) (the-as rgba t1-0))
(sv-64
sv-80
(the-as bucket-id sv-96)
sv-112
(vector-normalize-copy! (new 'stack-no-clear 'vector) (the-as vector (+ (the-as uint s1-0) (* s0-0 16))) 1.0)
(meters 0.2)
(the-as rgba (logior (ash 255 (* s0-0 8)) s4-0))
)
)
)
)
@@ -629,7 +620,7 @@
;; WARN: Stack slot offset 20 signed mismatch
;; WARN: Stack slot offset 20 signed mismatch
(defun skeleton-group->draw-control ((arg0 process-drawable) (arg1 skeleton-group) (arg2 (pointer cspace-array)))
(local-vars (s2-0 draw-control) (sv-16 art-element) (sv-20 int))
(local-vars (s2-0 draw-control))
(let ((s3-0 (if (= (-> arg1 texture-level) 6)
(-> *level* default-level)
(-> arg0 level)
@@ -642,61 +633,63 @@
(set! s2-0 (the-as draw-control #f))
(goto cfg-50)
)
(set! sv-16 (-> s1-0 data (-> arg1 jgeo)))
(set! sv-20 (-> s1-0 length))
(when (or (< (-> arg1 jgeo) 0) (>= (-> arg1 jgeo) sv-20) (not sv-16) (!= (-> sv-16 type) art-joint-geo))
(go process-drawable-art-error "joint-geo")
(set! s2-0 (the-as draw-control #f))
(goto cfg-50)
)
(set! s2-0 (new 'process 'draw-control arg0 (the-as symbol sv-16)))
(let ((v1-24 s2-0))
(set! (-> v1-24 status) (draw-control-status uninited))
(set! (-> v1-24 art-group) s1-0)
(set! (-> v1-24 jgeo) (the-as art-joint-geo sv-16))
(set! (-> v1-24 force-lod) -1)
(set! (-> v1-24 cur-lod) -1)
(set! (-> v1-24 shadow) #f)
(set! (-> v1-24 shadow-ctrl) #f)
(set! (-> v1-24 data-format) (draw-control-data-format merc))
(set! (-> v1-24 color-mult quad) (-> (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) quad))
(set! (-> v1-24 color-emissive quad) (-> (new 'static 'vector) quad))
(set! (-> v1-24 longest-edge) (-> arg1 longest-edge))
(set! (-> v1-24 origin-joint-index) (the-as uint (-> arg1 origin-joint-index)))
(set! (-> v1-24 shadow-joint-index) (the-as uint (-> arg1 shadow-joint-index)))
)
(set! (-> s2-0 bounds quad) (-> arg1 bounds quad))
(let ((v1-26 (-> arg1 shadow)))
(when (and (> v1-26 0) (< v1-26 sv-20))
(let ((s0-0 (-> s1-0 data v1-26)))
(if (and (not (logtest? (the-as int (res-lump-value (-> arg0 entity) 'options uint128 :time -1000000000.0)) 8192))
(= (-> s0-0 type) shadow-geo)
)
(set! (-> s2-0 shadow) (the-as shadow-geo s0-0))
(let ((sv-16 (-> s1-0 data (-> arg1 jgeo))))
(let ((sv-20 (-> s1-0 length)))
(when (or (< (-> arg1 jgeo) 0) (>= (-> arg1 jgeo) sv-20) (not sv-16) (!= (-> sv-16 type) art-joint-geo))
(go process-drawable-art-error "joint-geo")
(set! s2-0 (the-as draw-control #f))
(goto cfg-50)
)
(set! s2-0 (new 'process 'draw-control arg0 (the-as symbol sv-16)))
(let ((v1-24 s2-0))
(set! (-> v1-24 status) (draw-control-status uninited))
(set! (-> v1-24 art-group) s1-0)
(set! (-> v1-24 jgeo) (the-as art-joint-geo sv-16))
(set! (-> v1-24 force-lod) -1)
(set! (-> v1-24 cur-lod) -1)
(set! (-> v1-24 shadow) #f)
(set! (-> v1-24 shadow-ctrl) #f)
(set! (-> v1-24 data-format) (draw-control-data-format merc))
(set! (-> v1-24 color-mult quad) (-> (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) quad))
(set! (-> v1-24 color-emissive quad) (-> (new 'static 'vector) quad))
(set! (-> v1-24 longest-edge) (-> arg1 longest-edge))
(set! (-> v1-24 origin-joint-index) (the-as uint (-> arg1 origin-joint-index)))
(set! (-> v1-24 shadow-joint-index) (the-as uint (-> arg1 shadow-joint-index)))
)
(set! (-> s2-0 bounds quad) (-> arg1 bounds quad))
(let ((v1-26 (-> arg1 shadow)))
(when (and (> v1-26 0) (< v1-26 sv-20))
(let ((s0-0 (-> s1-0 data v1-26)))
(if (and (not (logtest? (the-as int (res-lump-value (-> arg0 entity) 'options uint128 :time -1000000000.0)) 8192))
(= (-> s0-0 type) shadow-geo)
)
(set! (-> s2-0 shadow) (the-as shadow-geo s0-0))
)
)
)
)
)
)
(if (not (setup-lods! (-> s2-0 lod-set) arg1 s1-0 (-> arg0 entity)))
(go process-drawable-art-error "mesh")
(if (not (setup-lods! (-> s2-0 lod-set) arg1 s1-0 (-> arg0 entity)))
(go process-drawable-art-error "mesh")
)
(let ((v1-41 (res-lump-value (-> sv-16 extra) 'texture-bucket int :default (the-as uint128 1) :time -1000000000.0))
)
(case (if (= (-> arg1 texture-level) 6)
6
(-> s3-0 index)
)
((6)
(set! v1-41 (-> arg1 sort))
)
)
(set! (-> s2-0 default-texture-page) (the-as uint v1-41))
)
)
(let ((v1-41 (res-lump-value (-> sv-16 extra) 'texture-bucket int :default (the-as uint128 1) :time -1000000000.0))
)
(case (if (= (-> arg1 texture-level) 6)
6
(-> s3-0 index)
)
((6)
(set! v1-41 (-> arg1 sort))
)
(set! (-> s2-0 level-index) (the-as uint (-> s3-0 index)))
(set! (-> s2-0 dma-add-func) (the-as (function process-drawable draw-control symbol object none) nothing))
(set! (-> arg2 0) (setup-cspace-and-add s2-0 (the-as art-joint-geo sv-16) 'process))
)
(set! (-> s2-0 default-texture-page) (the-as uint v1-41))
)
(set! (-> s2-0 level-index) (the-as uint (-> s3-0 index)))
)
(set! (-> s2-0 dma-add-func) (the-as (function process-drawable draw-control symbol object none) nothing))
(set! (-> arg2 0) (setup-cspace-and-add s2-0 (the-as art-joint-geo sv-16) 'process))
(set! (-> s2-0 dma-add-func) dma-add-process-drawable)
(set! (-> s2-0 shadow-mask) (res-lump-value (-> arg0 entity) 'shadow-mask uint :time -1000000000.0))
(set! (-> s2-0 shadow-values) (res-lump-value (-> arg0 entity) 'shadow-values uint :time -1000000000.0))
+1 -1
View File
@@ -495,7 +495,7 @@ It's 32 bytes + type tag (ignored by C kernel)."
(f28-0 (* 0.0078125 (the float (- 127 (the-as int (-> pad lefty))))))
)
(set! (-> pad stick0-dir) (atan (- f30-0) f28-0))
(set! (-> pad stick0-speed) (fmin 1.0 (sqrtf (+ (* f30-0 f30-0) (* f28-0 f28-0)))))
(set! (-> pad stick0-speed) (fmin 1.0 (sqrtf (+ (square f30-0) (square f28-0)))))
)
(if (< (-> pad stick0-speed) 0.3)
(set! (-> pad stick0-speed) 0.0)
+43 -48
View File
@@ -183,7 +183,7 @@
;; definition for method 9 of type scene-actor
;; INFO: Used lq/sq
(defmethod scene-actor-method-9 ((this scene-actor) (arg0 scene-player))
(local-vars (s4-0 (pointer process)) (sv-96 process) (sv-112 process))
(local-vars (s4-0 (pointer process)))
(let ((s1-0 (if (-> this level)
(level-get *level* (-> this level))
(-> *level* default-level)
@@ -223,26 +223,26 @@
)
)
)
(set! sv-96 (get-process *default-dead-pool* manipy #x4000))
(set! s4-0 (when sv-96
(let ((t9-7 (method-of-type manipy activate)))
(t9-7 (the-as manipy sv-96) arg0 (-> this name) (the-as pointer #x70004000))
)
(run-now-in-process
sv-96
manipy-init
(-> arg0 root trans)
s1-1
s2-0
#f
(if (and s3-0 (logtest? (game-secrets big-head little-head) (-> *game-info* secrets)))
1
0
)
)
(-> sv-96 ppointer)
)
)
(let ((sv-96 (get-process *default-dead-pool* manipy #x4000)))
(set! s4-0
(when sv-96
((method-of-type manipy activate) (the-as manipy sv-96) arg0 (-> this name) (the-as pointer #x70004000))
(run-now-in-process
sv-96
manipy-init
(-> arg0 root trans)
s1-1
s2-0
#f
(if (and s3-0 (logtest? (game-secrets big-head little-head) (-> *game-info* secrets)))
1
0
)
)
(-> sv-96 ppointer)
)
)
)
(set! (-> arg0 level) s0-0)
(send-event (ppointer->process s4-0) 'anim-mode 'clone-anim)
(send-event (ppointer->process s4-0) 'blend-shape #t)
@@ -300,16 +300,19 @@
)
)
(when (and s4-0 (logtest? (-> this flags) 2))
(set! sv-112 (get-process *default-dead-pool* manipy #x4000))
(let ((s0-1 (when sv-112
(let ((t9-24 (method-of-type manipy activate)))
(t9-24 (the-as manipy sv-112) (ppointer->process s4-0) (-> this name) (the-as pointer #x70004000))
(let* ((sv-112 (get-process *default-dead-pool* manipy #x4000))
(s0-1 (when sv-112
((method-of-type manipy activate)
(the-as manipy sv-112)
(ppointer->process s4-0)
(-> this name)
(the-as pointer #x70004000)
)
(run-now-in-process sv-112 manipy-init (-> arg0 root trans) s1-1 s2-0 #f 0)
(-> sv-112 ppointer)
)
)
)
(run-now-in-process sv-112 manipy-init (-> arg0 root trans) s1-1 s2-0 #f 0)
(-> sv-112 ppointer)
)
)
)
(send-event (ppointer->process s0-1) 'mirror #t)
(send-event (ppointer->process s0-1) 'anim-mode 'mirror)
(if (nonzero? (-> this light-index))
@@ -741,15 +744,13 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch pointer vs none.
(defun draw-subtitle-image ((arg0 subtitle-image) (arg1 font-context))
(local-vars (sv-16 pointer) (sv-32 int))
(let ((gp-0 (-> arg0 width))
(s5-0 (-> arg0 height))
)
(let ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)))
(set! sv-16 (-> s4-0 base))
(unpack-comp-rle (the-as (pointer int8) sv-16) (the-as (pointer int8) (-> arg0 data)))
(&+! (-> s4-0 base) (logand -16 (+ (shr (* gp-0 s5-0) 1) 15)))
)
(let* ((gp-0 (-> arg0 width))
(s5-0 (-> arg0 height))
(s4-0 (-> *display* frames (-> *display* on-screen) global-buf))
(sv-16 (-> s4-0 base))
)
(unpack-comp-rle (the-as (pointer int8) sv-16) (the-as (pointer int8) (-> arg0 data)))
(&+! (-> s4-0 base) (logand -16 (+ (shr (* gp-0 s5-0) 1) 15)))
(with-dma-buffer-add-bucket ((s3-0 (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id subtitle)
)
@@ -761,16 +762,10 @@
(trxreg (new 'static 'gs-trxreg :rrw gp-0 :rrh s5-0))
(trxdir (new 'static 'gs-trxdir))
)
(let ((t9-2 dma-buffer-add-ref-texture)
(a0-13 s3-0)
(a2-8 gp-0)
(a3-1 s5-0)
(t0-1 s0-0)
(dma-buffer-add-ref-texture s3-0 sv-16 (the-as int gp-0) (the-as int s5-0) (the-as gs-psm s0-0))
(let ((sv-32 (+ (log2 (the-as int (+ gp-0 -1))) 1))
(v1-17 (+ (log2 (the-as int (+ s5-0 -1))) 1))
)
(t9-2 a0-13 sv-16 (the-as int a2-8) (the-as int a3-1) (the-as gs-psm t0-1))
)
(set! sv-32 (+ (log2 (the-as int (+ gp-0 -1))) 1))
(let ((v1-17 (+ (log2 (the-as int (+ s5-0 -1))) 1)))
(dma-buffer-add-gs-set s3-0
(test-1 (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always)))
(alpha-1 (new 'static 'gs-alpha :b #x1 :d #x1))
+89 -95
View File
@@ -717,9 +717,9 @@
"Send play rpc to play a sound!
Last arg can by a symbol with value [[#t]], in which case it will pull `trans` [[vector]] off the current [[process-drawable]]
otherwise, an explicit [[vector]] can be provided"
(local-vars (sv-16 sound-group))
(set! sv-16 arg5)
(let ((s4-0 arg6))
(let ((sv-16 arg5)
(s4-0 arg6)
)
(when *sound-player-enable*
(let ((s5-0 (the-as sound-rpc-play (get-sound-buffer-entry))))
(set! (-> s5-0 command) (sound-command play))
@@ -892,105 +892,99 @@
;; WARN: Return type mismatch object vs ambient-sound.
(defmethod new ambient-sound ((allocation symbol) (type-to-make type) (arg0 basic) (arg1 vector))
"Set up ambient-sound. Can use an entity-actor (grabs from lump), sound-spec, or name as a string."
(local-vars
(sv-16 sound-spec)
(sv-32 sound-name)
(sv-48 (pointer float))
(sv-52 pointer)
(sv-56 int)
(sv-64 res-tag)
)
(set! sv-16 (the-as sound-spec #f))
(set! sv-32 (the-as sound-name 0))
(set! sv-48 (the-as (pointer float) #f))
(set! sv-52 (the-as pointer #f))
(set! sv-56 0)
(case (-> arg0 type)
((entity-actor)
(let ((v1-2
((method-of-type res-lump get-property-struct)
(the-as res-lump arg0)
'effect-name
'exact
0.0
(the-as structure #f)
(the-as (pointer res-tag) #f)
*res-static-buf*
)
)
)
(when v1-2
(set! sv-32 (string->sound-name (symbol->string v1-2)))
(set! sv-48 (res-lump-data (the-as res-lump arg0) 'cycle-speed (pointer float)))
(set! sv-16 *ambient-spec*)
(set! sv-64 (new 'static 'res-tag))
(let ((v1-7
((method-of-type res-lump get-property-data)
(the-as res-lump arg0)
'effect-param
'exact
0.0
(the-as pointer #f)
(& sv-64)
*res-static-buf*
)
)
(let ((sv-16 (the-as sound-spec #f))
(sv-32 (the-as sound-name 0))
(sv-48 (the-as (pointer float) #f))
(sv-52 (the-as pointer #f))
(sv-56 0)
)
(case (-> arg0 type)
((entity-actor)
(let ((v1-2
((method-of-type res-lump get-property-struct)
(the-as res-lump arg0)
'effect-name
'exact
0.0
(the-as structure #f)
(the-as (pointer res-tag) #f)
*res-static-buf*
)
)
)
(when v1-2
(set! sv-32 (string->sound-name (symbol->string v1-2)))
(set! sv-48 (res-lump-data (the-as res-lump arg0) 'cycle-speed (pointer float)))
(set! sv-16 *ambient-spec*)
(let* ((sv-64 (new 'static 'res-tag))
(v1-7
((method-of-type res-lump get-property-data)
(the-as res-lump arg0)
'effect-param
'exact
0.0
(the-as pointer #f)
(& sv-64)
*res-static-buf*
)
)
)
(when v1-7
(set! sv-52 v1-7)
(set! sv-56 (the-as int (-> sv-64 elt-count)))
)
(when v1-7
(set! sv-52 v1-7)
(set! sv-56 (the-as int (-> sv-64 elt-count)))
)
)
)
)
)
((sound-spec)
(set! sv-16 (the-as sound-spec arg0))
)
((string)
(set! sv-32 (string->sound-name (the-as string arg0)))
)
(else
(format 0 "ERROR: ambient sound was told to play an unknown ~A.~%" arg0)
)
)
(the-as
ambient-sound
(cond
((or sv-16 (nonzero? sv-32))
(let ((s5-1 (the-as object (object-new allocation type-to-make (the-as int (-> type-to-make size))))))
(set! (-> (the-as ambient-sound s5-1) spec) sv-16)
(set! (-> (the-as ambient-sound s5-1) name) sv-32)
(set! (-> (the-as ambient-sound s5-1) playing-id) (new-sound-id))
(set! (-> (the-as ambient-sound s5-1) params) (the-as (pointer float) sv-52))
(set! (-> (the-as ambient-sound s5-1) param-count) sv-56)
(set! (-> (the-as ambient-sound s5-1) entity) #f)
(set! (-> (the-as ambient-sound s5-1) sound-count) 1)
(set! (-> (the-as ambient-sound s5-1) volume) 1024)
(set! (-> (the-as ambient-sound s5-1) pitch) 0)
(when (and sv-16 (!= sv-16 *ambient-spec*))
(if (logtest? (-> (the-as sound-spec sv-16) mask) (sound-mask volume))
(set! (-> (the-as ambient-sound s5-1) volume) (-> (the-as sound-spec sv-16) volume))
)
(if (logtest? (-> (the-as sound-spec sv-16) mask) (sound-mask pitch))
(set! (-> (the-as ambient-sound s5-1) pitch) (-> (the-as sound-spec sv-16) pitch-mod))
)
)
(cond
(sv-48
(set! (-> (the-as ambient-sound s5-1) time-base) (the-as time-frame (the int (* 300.0 (-> sv-48 0)))))
(set! (-> (the-as ambient-sound s5-1) time-random) (the-as time-frame (the int (* 300.0 (-> sv-48 1)))))
)
(else
(set! (-> (the-as ambient-sound s5-1) time-base) -1)
)
)
(set! (-> (the-as ambient-sound s5-1) trans quad) (-> arg1 quad))
s5-1
)
((sound-spec)
(set! sv-16 (the-as sound-spec arg0))
)
((string)
(set! sv-32 (string->sound-name (the-as string arg0)))
)
(else
0
(format 0 "ERROR: ambient sound was told to play an unknown ~A.~%" arg0)
)
)
(the-as
ambient-sound
(cond
((or sv-16 (nonzero? sv-32))
(let ((s5-1 (the-as object (object-new allocation type-to-make (the-as int (-> type-to-make size))))))
(set! (-> (the-as ambient-sound s5-1) spec) sv-16)
(set! (-> (the-as ambient-sound s5-1) name) sv-32)
(set! (-> (the-as ambient-sound s5-1) playing-id) (new-sound-id))
(set! (-> (the-as ambient-sound s5-1) params) (the-as (pointer float) sv-52))
(set! (-> (the-as ambient-sound s5-1) param-count) sv-56)
(set! (-> (the-as ambient-sound s5-1) entity) #f)
(set! (-> (the-as ambient-sound s5-1) sound-count) 1)
(set! (-> (the-as ambient-sound s5-1) volume) 1024)
(set! (-> (the-as ambient-sound s5-1) pitch) 0)
(when (and sv-16 (!= sv-16 *ambient-spec*))
(if (logtest? (-> (the-as sound-spec sv-16) mask) (sound-mask volume))
(set! (-> (the-as ambient-sound s5-1) volume) (-> (the-as sound-spec sv-16) volume))
)
(if (logtest? (-> (the-as sound-spec sv-16) mask) (sound-mask pitch))
(set! (-> (the-as ambient-sound s5-1) pitch) (-> (the-as sound-spec sv-16) pitch-mod))
)
)
(cond
(sv-48
(set! (-> (the-as ambient-sound s5-1) time-base) (the-as time-frame (the int (* 300.0 (-> sv-48 0)))))
(set! (-> (the-as ambient-sound s5-1) time-random) (the-as time-frame (the int (* 300.0 (-> sv-48 1)))))
)
(else
(set! (-> (the-as ambient-sound s5-1) time-base) -1)
)
)
(set! (-> (the-as ambient-sound s5-1) trans quad) (-> arg1 quad))
s5-1
)
)
(else
0
)
)
)
)
+6 -13
View File
@@ -43,11 +43,9 @@
)
(if (or (< (the-as time-frame (-> s5-1 request-timeout)) a0-8)
(or (not v1-20)
(let ((f0-0 245760.0))
(< (* f0-0 f0-0)
(vector-vector-distance-squared (-> this target-pos) (-> (the-as process-drawable v1-20) root trans))
)
)
(< (square 245760.0)
(vector-vector-distance-squared (-> this target-pos) (-> (the-as process-drawable v1-20) root trans))
)
)
)
(speech-channel-method-12 this)
@@ -183,14 +181,9 @@
;; definition for method 9 of type speech-channel
;; WARN: Return type mismatch int vs none.
(defmethod speech-channel-method-9 ((this speech-channel) (arg0 process-drawable) (arg1 speech-type))
(let ((f0-0 (vector-vector-distance-squared (-> arg0 root trans) (-> this target-pos)))
(f1-0 245760.0)
)
(when (< f0-0 (* f1-0 f1-0))
(let* ((f1-3 -1.0)
(f2-0 409600.0)
(f0-2 (+ (* f0-0 (/ f1-3 (* f2-0 f2-0))) (the float (-> this speech-table arg1 priority))))
)
(let ((f0-0 (vector-vector-distance-squared (-> arg0 root trans) (-> this target-pos))))
(when (< f0-0 (square 245760.0))
(let ((f0-2 (+ (* f0-0 (/ -1.0 (square 409600.0))) (the float (-> this speech-table arg1 priority)))))
(when (< (-> this request priority) f0-2)
(set! (-> this request priority) f0-2)
(set! (-> this request handle) (process->handle arg0))
+35 -40
View File
@@ -98,7 +98,6 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod hash-actors ((this actor-hash-buckets))
(local-vars (sv-16 hash-object-info) (sv-32 collide-prim-core) (sv-48 collide-shape) (sv-64 hash-object-info))
(set! (-> this hash) *actor-hash*)
(set! (-> this list) *collide-hit-by-others-list*)
(clear-objects! (-> this hash))
@@ -117,11 +116,12 @@
(set! s2-0
(cond
((< s2-0 (-> s3-0 max-object-count))
(let ((a0-7 (-> s3-0 sphere-array s2-0)))
(set! sv-16 (-> s3-0 object-array s2-0))
(let ((a0-7 (-> s3-0 sphere-array s2-0))
(sv-16 (-> s3-0 object-array s2-0))
)
(mem-copy! (the-as pointer a0-7) (the-as pointer s1-0) 16)
(set! (-> sv-16 object) s0-0)
)
(set! (-> sv-16 object) s0-0)
(dotimes (v1-12 3)
(set! (-> s3-0 box-min v1-12)
(fmin (-> s3-0 box-min v1-12) (- (-> s1-0 world-sphere data v1-12) (-> s1-0 world-sphere w)))
@@ -158,20 +158,15 @@
(while (!= v1-25 (-> this list alive-list-end))
(let* ((s4-1 (the-as collide-shape (-> (the-as connection v1-25) param1)))
(f0-4 (vector-vector-distance-squared (-> this tpos) (-> s4-1 trans)))
(f1-4 102400.0)
)
(cond
((< f0-4 (* f1-4 f1-4))
((< f0-4 (square 102400.0))
((method-of-type actor-hash-bucket add-actor-cshape) (-> this data 0) s4-1)
)
((let ((f1-7 204800.0))
(< f0-4 (* f1-7 f1-7))
)
((< f0-4 (square 204800.0))
(add-actor-cshape (-> this data 1) s4-1)
)
((let ((f1-10 307200.0))
(< f0-4 (* f1-10 f1-10))
)
((< f0-4 (square 307200.0))
(add-actor-cshape (-> this data 2) s4-1)
)
(else
@@ -188,38 +183,38 @@
(dotimes (s5-3 4)
(let ((s4-2 (-> this data s5-3)))
(countdown (s3-1 (-> s4-2 length))
(let ((s2-1 (-> s4-2 data s3-1 cshape))
(s1-1 (-> this hash))
)
(set! sv-32 (-> s2-1 root-prim prim-core))
(set! sv-48 s2-1)
(let ((s0-1 (-> s1-1 object-count)))
(set! s0-1
(cond
((< s0-1 (-> s1-1 max-object-count))
(let ((a0-40 (-> s1-1 sphere-array s0-1)))
(set! sv-64 (-> s1-1 object-array s0-1))
(mem-copy! (the-as pointer a0-40) (the-as pointer sv-32) 16)
)
(let* ((s2-1 (-> s4-2 data s3-1 cshape))
(s1-1 (-> this hash))
(sv-32 (-> s2-1 root-prim prim-core))
(sv-48 s2-1)
(s0-1 (-> s1-1 object-count))
)
(set! s0-1
(cond
((< s0-1 (-> s1-1 max-object-count))
(let ((a0-40 (-> s1-1 sphere-array s0-1))
(sv-64 (-> s1-1 object-array s0-1))
)
(mem-copy! (the-as pointer a0-40) (the-as pointer sv-32) 16)
(set! (-> sv-64 object) sv-48)
(dotimes (v1-53 3)
(set! (-> s1-1 box-min v1-53)
(fmin (-> s1-1 box-min v1-53) (- (-> sv-32 world-sphere data v1-53) (-> sv-32 world-sphere w)))
)
(set! (-> s1-1 box-max v1-53)
(fmax (-> s1-1 box-max v1-53) (+ (-> sv-32 world-sphere data v1-53) (-> sv-32 world-sphere w)))
)
)
(+! (-> s1-1 object-count) 1)
s0-1
)
(else
-1
)
(dotimes (v1-53 3)
(set! (-> s1-1 box-min v1-53)
(fmin (-> s1-1 box-min v1-53) (- (-> sv-32 world-sphere data v1-53) (-> sv-32 world-sphere w)))
)
(set! (-> s1-1 box-max v1-53)
(fmax (-> s1-1 box-max v1-53) (+ (-> sv-32 world-sphere data v1-53) (-> sv-32 world-sphere w)))
)
)
(+! (-> s1-1 object-count) 1)
s0-1
)
(else
-1
)
)
(set! (-> s2-1 actor-hash-index) s0-1)
)
)
(set! (-> s2-1 actor-hash-index) s0-1)
)
)
)
+393 -393
View File
@@ -113,9 +113,6 @@
(a1-3 uint128)
(a2-3 uint128)
(a2-4 uint128)
(sv-16 int)
(sv-20 collide-list)
(sv-640 int)
)
(rlet ((acc :class vf)
(vf0 :class vf)
@@ -137,214 +134,217 @@
(vf9 :class vf)
)
(init-vf0-vector)
(set! sv-16 (-> arg1 num-items))
(set! sv-20 arg1)
(dotimes (s4-0 sv-16)
(let ((s3-0 (-> sv-20 items s4-0 mesh)))
(cond
((= (-> s3-0 type) instance-tie)
(let* ((v1-4 s3-0)
(s1-0 (-> v1-4 bucket-ptr))
)
(when (not (or (logtest? (-> s1-0 flags) (prototype-flags no-collide))
(logtest? (-> v1-4 flags) (instance-flags no-collide))
)
)
(if *collide-list-boxes*
(add-collide-debug-box (-> s3-0 bsphere) (new 'static 'rgba :r #xff :a #x80))
)
(let ((s0-0 (new 'stack-no-clear 'matrix))
(s2-0 (new 'stack-no-clear 'collide-query))
(let ((sv-16 (-> arg1 num-items))
(sv-20 arg1)
)
(dotimes (s4-0 sv-16)
(let ((s3-0 (-> sv-20 items s4-0 mesh)))
(cond
((= (-> s3-0 type) instance-tie)
(let* ((v1-4 s3-0)
(s1-0 (-> v1-4 bucket-ptr))
)
(when (not (or (logtest? (-> s1-0 flags) (prototype-flags no-collide))
(logtest? (-> v1-4 flags) (instance-flags no-collide))
)
)
(if *collide-list-boxes*
(add-collide-debug-box (-> s3-0 bsphere) (new 'static 'rgba :r #xff :a #x80))
)
(mem-copy! (the-as pointer s2-0) (the-as pointer arg2) 540)
(nop!)
(nop!)
(let ((v1-11 (the-as uint128 (-> s3-0 origin vector4h 3 long))))
(let ((s0-0 (new 'stack-no-clear 'matrix))
(s2-0 (new 'stack-no-clear 'collide-query))
)
(mem-copy! (the-as pointer s2-0) (the-as pointer arg2) 540)
(nop!)
(let ((a2-2 (the-as uint128 (-> s3-0 origin vector4h 0 long))))
(.pextlh v1-12 v1-11 0)
(let ((a0-9 (the-as uint128 (-> s3-0 origin vector4h 1 long))))
(.pw.sra a1-3 v1-12 10)
(let ((v1-13 (the-as uint128 (-> s3-0 origin vector4h 2 long))))
(.pextlh a2-3 a2-2 0)
(nop!)
(.pw.sra a2-4 a2-3 16)
(nop!)
(.pextlh a0-10 a0-9 0)
(.mov vf4 a1-3)
(.pw.sra a0-11 a0-10 16)
(.mov vf1 a2-4)
(.pextlh v1-14 v1-13 0)
(nop!)
(let ((v1-11 (the-as uint128 (-> s3-0 origin vector4h 3 long))))
(nop!)
(let ((a2-2 (the-as uint128 (-> s3-0 origin vector4h 0 long))))
(.pextlh v1-12 v1-11 0)
(let ((a0-9 (the-as uint128 (-> s3-0 origin vector4h 1 long))))
(.pw.sra a1-3 v1-12 10)
(let ((v1-13 (the-as uint128 (-> s3-0 origin vector4h 2 long))))
(.pextlh a2-3 a2-2 0)
(nop!)
(.pw.sra a2-4 a2-3 16)
(nop!)
(.pextlh a0-10 a0-9 0)
(.mov vf4 a1-3)
(.pw.sra a0-11 a0-10 16)
(.mov vf1 a2-4)
(.pextlh v1-14 v1-13 0)
)
)
)
)
)
(.mov vf2 a0-11)
(.pw.sra v1-15 v1-14 16)
(.lvf vf5 (&-> s3-0 bsphere quad))
(nop!)
(.mov vf3 v1-15)
(.itof.vf vf4 vf4)
(nop!)
(vitof12.xyzw vf1 vf1)
(nop!)
(vitof12.xyzw vf2 vf2)
(nop!)
(vitof12.xyzw vf3 vf3)
(nop!)
(.add.vf.xyz vf4 vf4 vf5)
(nop!)
(nop!)
(.svf (&-> s2-0 instance-mat quad 0) vf1)
(nop!)
(.svf (&-> s2-0 instance-mat quad 1) vf2)
(nop!)
(.svf (&-> s2-0 instance-mat quad 2) vf3)
(nop!)
(.svf (&-> s2-0 instance-mat trans quad) vf4)
(matrix-4x4-inverse! s0-0 (-> s2-0 instance-mat))
(nop!)
(nop!)
(.lvf vf7 (&-> arg2 bbox min quad))
(nop!)
(.lvf vf14 (&-> arg2 bbox max quad))
(nop!)
(.lvf vf1 (&-> s0-0 quad 0))
(nop!)
(.lvf vf2 (&-> s0-0 quad 1))
(nop!)
(.lvf vf3 (&-> s0-0 quad 2))
(nop!)
(.lvf vf4 (&-> s0-0 trans quad))
(.mul.w.vf acc vf4 vf0)
(nop!)
(.add.mul.x.vf acc vf1 vf7 acc)
(nop!)
(.add.mul.y.vf acc vf2 vf7 acc)
(nop!)
(.add.mul.z.vf vf8 vf3 vf14 acc)
(nop!)
(.mul.w.vf acc vf4 vf0)
(nop!)
(.add.mul.x.vf acc vf1 vf7 acc)
(nop!)
(.add.mul.y.vf acc vf2 vf14 acc)
(nop!)
(.add.mul.z.vf vf9 vf3 vf7 acc)
(nop!)
(.mul.w.vf acc vf4 vf0)
(nop!)
(.add.mul.x.vf acc vf1 vf7 acc)
(nop!)
(.add.mul.y.vf acc vf2 vf14 acc)
(nop!)
(.add.mul.z.vf vf10 vf3 vf14 acc)
(nop!)
(.min.vf vf5 vf8 vf9)
(nop!)
(.max.vf vf6 vf8 vf9)
(nop!)
(.mul.w.vf acc vf4 vf0)
(nop!)
(.add.mul.x.vf acc vf1 vf14 acc)
(nop!)
(.add.mul.y.vf acc vf2 vf7 acc)
(nop!)
(.add.mul.z.vf vf11 vf3 vf7 acc)
(nop!)
(.min.vf vf5 vf5 vf10)
(nop!)
(.max.vf vf6 vf6 vf10)
(nop!)
(.mul.w.vf acc vf4 vf0)
(nop!)
(.add.mul.x.vf acc vf1 vf14 acc)
(nop!)
(.add.mul.y.vf acc vf2 vf7 acc)
(nop!)
(.add.mul.z.vf vf12 vf3 vf14 acc)
(nop!)
(.min.vf vf5 vf5 vf11)
(nop!)
(.max.vf vf6 vf6 vf11)
(nop!)
(.mul.w.vf acc vf4 vf0)
(nop!)
(.add.mul.x.vf acc vf1 vf14 acc)
(nop!)
(.add.mul.y.vf acc vf2 vf14 acc)
(nop!)
(.add.mul.z.vf vf13 vf3 vf7 acc)
(nop!)
(.min.vf vf5 vf5 vf12)
(nop!)
(.max.vf vf6 vf6 vf12)
(nop!)
(.mul.w.vf acc vf4 vf0)
(nop!)
(.add.mul.x.vf acc vf1 vf14 acc)
(nop!)
(.add.mul.y.vf acc vf2 vf14 acc)
(nop!)
(.add.mul.z.vf vf14 vf3 vf14 acc)
(nop!)
(.min.vf vf5 vf5 vf13)
(nop!)
(.max.vf vf6 vf6 vf13)
(nop!)
(.mul.w.vf acc vf4 vf0)
(nop!)
(.add.mul.x.vf acc vf1 vf7 acc)
(nop!)
(.add.mul.y.vf acc vf2 vf7 acc)
(nop!)
(.add.mul.z.vf vf7 vf3 vf7 acc)
(nop!)
(.min.vf vf5 vf5 vf14)
(nop!)
(.max.vf vf6 vf6 vf14)
(nop!)
(.min.vf vf5 vf5 vf7)
(nop!)
(.max.vf vf6 vf6 vf7)
(nop!)
(.ftoi.vf vf16 vf5)
(nop!)
(.ftoi.vf vf17 vf6)
(nop!)
(nop!)
(.svf (&-> s2-0 bbox min quad) vf5)
(nop!)
(.svf (&-> s2-0 bbox max quad) vf6)
(nop!)
(.svf (&-> s2-0 bbox4w min quad) vf16)
(nop!)
(.svf (&-> s2-0 bbox4w max quad) vf17)
(let ((s1-1 (-> s1-0 collide-hash-fragment-array)))
(set! sv-640 (-> s1-1 length))
(set! (-> s2-0 instance-ptr) s3-0)
(dotimes (s3-1 sv-640)
(set! (-> (the-as collide-hash-scratch #x70000000) collidable-bits 0) (the-as uint128 0))
(set! (-> (the-as collide-hash-scratch #x70000000) collidable-bits 1) (the-as uint128 0))
(set! (-> (the-as collide-hash-scratch #x70000000) tris) (the-as uint 0))
(fill-bg-using-box-new arg0 (-> s1-1 fragments s3-1) s2-0)
(+! (-> *collide-stats* tris) (-> (the-as collide-hash-scratch #x70000000) tris))
(.mov vf2 a0-11)
(.pw.sra v1-15 v1-14 16)
(.lvf vf5 (&-> s3-0 bsphere quad))
(nop!)
(.mov vf3 v1-15)
(.itof.vf vf4 vf4)
(nop!)
(vitof12.xyzw vf1 vf1)
(nop!)
(vitof12.xyzw vf2 vf2)
(nop!)
(vitof12.xyzw vf3 vf3)
(nop!)
(.add.vf.xyz vf4 vf4 vf5)
(nop!)
(nop!)
(.svf (&-> s2-0 instance-mat quad 0) vf1)
(nop!)
(.svf (&-> s2-0 instance-mat quad 1) vf2)
(nop!)
(.svf (&-> s2-0 instance-mat quad 2) vf3)
(nop!)
(.svf (&-> s2-0 instance-mat trans quad) vf4)
(matrix-4x4-inverse! s0-0 (-> s2-0 instance-mat))
(nop!)
(nop!)
(.lvf vf7 (&-> arg2 bbox min quad))
(nop!)
(.lvf vf14 (&-> arg2 bbox max quad))
(nop!)
(.lvf vf1 (&-> s0-0 quad 0))
(nop!)
(.lvf vf2 (&-> s0-0 quad 1))
(nop!)
(.lvf vf3 (&-> s0-0 quad 2))
(nop!)
(.lvf vf4 (&-> s0-0 trans quad))
(.mul.w.vf acc vf4 vf0)
(nop!)
(.add.mul.x.vf acc vf1 vf7 acc)
(nop!)
(.add.mul.y.vf acc vf2 vf7 acc)
(nop!)
(.add.mul.z.vf vf8 vf3 vf14 acc)
(nop!)
(.mul.w.vf acc vf4 vf0)
(nop!)
(.add.mul.x.vf acc vf1 vf7 acc)
(nop!)
(.add.mul.y.vf acc vf2 vf14 acc)
(nop!)
(.add.mul.z.vf vf9 vf3 vf7 acc)
(nop!)
(.mul.w.vf acc vf4 vf0)
(nop!)
(.add.mul.x.vf acc vf1 vf7 acc)
(nop!)
(.add.mul.y.vf acc vf2 vf14 acc)
(nop!)
(.add.mul.z.vf vf10 vf3 vf14 acc)
(nop!)
(.min.vf vf5 vf8 vf9)
(nop!)
(.max.vf vf6 vf8 vf9)
(nop!)
(.mul.w.vf acc vf4 vf0)
(nop!)
(.add.mul.x.vf acc vf1 vf14 acc)
(nop!)
(.add.mul.y.vf acc vf2 vf7 acc)
(nop!)
(.add.mul.z.vf vf11 vf3 vf7 acc)
(nop!)
(.min.vf vf5 vf5 vf10)
(nop!)
(.max.vf vf6 vf6 vf10)
(nop!)
(.mul.w.vf acc vf4 vf0)
(nop!)
(.add.mul.x.vf acc vf1 vf14 acc)
(nop!)
(.add.mul.y.vf acc vf2 vf7 acc)
(nop!)
(.add.mul.z.vf vf12 vf3 vf14 acc)
(nop!)
(.min.vf vf5 vf5 vf11)
(nop!)
(.max.vf vf6 vf6 vf11)
(nop!)
(.mul.w.vf acc vf4 vf0)
(nop!)
(.add.mul.x.vf acc vf1 vf14 acc)
(nop!)
(.add.mul.y.vf acc vf2 vf14 acc)
(nop!)
(.add.mul.z.vf vf13 vf3 vf7 acc)
(nop!)
(.min.vf vf5 vf5 vf12)
(nop!)
(.max.vf vf6 vf6 vf12)
(nop!)
(.mul.w.vf acc vf4 vf0)
(nop!)
(.add.mul.x.vf acc vf1 vf14 acc)
(nop!)
(.add.mul.y.vf acc vf2 vf14 acc)
(nop!)
(.add.mul.z.vf vf14 vf3 vf14 acc)
(nop!)
(.min.vf vf5 vf5 vf13)
(nop!)
(.max.vf vf6 vf6 vf13)
(nop!)
(.mul.w.vf acc vf4 vf0)
(nop!)
(.add.mul.x.vf acc vf1 vf7 acc)
(nop!)
(.add.mul.y.vf acc vf2 vf7 acc)
(nop!)
(.add.mul.z.vf vf7 vf3 vf7 acc)
(nop!)
(.min.vf vf5 vf5 vf14)
(nop!)
(.max.vf vf6 vf6 vf14)
(nop!)
(.min.vf vf5 vf5 vf7)
(nop!)
(.max.vf vf6 vf6 vf7)
(nop!)
(.ftoi.vf vf16 vf5)
(nop!)
(.ftoi.vf vf17 vf6)
(nop!)
(nop!)
(.svf (&-> s2-0 bbox min quad) vf5)
(nop!)
(.svf (&-> s2-0 bbox max quad) vf6)
(nop!)
(.svf (&-> s2-0 bbox4w min quad) vf16)
(nop!)
(.svf (&-> s2-0 bbox4w max quad) vf17)
(let* ((s1-1 (-> s1-0 collide-hash-fragment-array))
(sv-640 (-> s1-1 length))
)
(set! (-> s2-0 instance-ptr) s3-0)
(dotimes (s3-1 sv-640)
(set! (-> (the-as collide-hash-scratch #x70000000) collidable-bits 0) (the-as uint128 0))
(set! (-> (the-as collide-hash-scratch #x70000000) collidable-bits 1) (the-as uint128 0))
(set! (-> (the-as collide-hash-scratch #x70000000) tris) (the-as uint 0))
(fill-bg-using-box-new arg0 (-> s1-1 fragments s3-1) s2-0)
(+! (-> *collide-stats* tris) (-> (the-as collide-hash-scratch #x70000000) tris))
)
)
)
)
)
)
)
(else
(if *collide-list-boxes*
(add-collide-debug-box (-> s3-0 bsphere) (new 'static 'rgba :r #xff :g #xff :a #x80))
)
(set! (-> (the-as collide-hash-scratch #x70000000) collidable-bits 0) (the-as uint128 0))
(set! (-> (the-as collide-hash-scratch #x70000000) collidable-bits 1) (the-as uint128 0))
(set! (-> arg2 instance-ptr) #f)
(set! (-> (the-as collide-hash-scratch #x70000000) tris) (the-as uint 0))
(fill-bg-using-box-new arg0 s3-0 arg2)
(+! (-> *collide-stats* tris) (-> (the-as collide-hash-scratch #x70000000) tris))
(else
(if *collide-list-boxes*
(add-collide-debug-box (-> s3-0 bsphere) (new 'static 'rgba :r #xff :g #xff :a #x80))
)
(set! (-> (the-as collide-hash-scratch #x70000000) collidable-bits 0) (the-as uint128 0))
(set! (-> (the-as collide-hash-scratch #x70000000) collidable-bits 1) (the-as uint128 0))
(set! (-> arg2 instance-ptr) #f)
(set! (-> (the-as collide-hash-scratch #x70000000) tris) (the-as uint 0))
(fill-bg-using-box-new arg0 s3-0 arg2)
(+! (-> *collide-stats* tris) (-> (the-as collide-hash-scratch #x70000000) tris))
)
)
)
)
@@ -380,8 +380,6 @@
(a1-3 uint128)
(a2-3 uint128)
(a2-4 uint128)
(sv-16 int)
(sv-640 int)
)
(rlet ((acc :class vf)
(vf0 :class vf)
@@ -398,211 +396,213 @@
(vf9 :class vf)
)
(init-vf0-vector)
(set! sv-16 (-> arg1 num-items))
(dotimes (s3-0 sv-16)
(let ((s2-0 (-> arg1 items s3-0 mesh)))
(cond
((= (-> s2-0 type) instance-tie)
(let ((v1-4 s2-0))
(when (not (or (logtest? (-> v1-4 bucket-ptr flags) (prototype-flags no-collide))
(logtest? (-> v1-4 flags) (instance-flags no-collide))
)
)
(if *collide-list-boxes*
(add-collide-debug-box (-> s2-0 bsphere) (new 'static 'rgba :r #xff :a #x80))
)
(let ((s0-0 (new 'stack-no-clear 'matrix))
(s1-0 (new 'stack-no-clear 'collide-query))
(let ((sv-16 (-> arg1 num-items)))
(dotimes (s3-0 sv-16)
(let ((s2-0 (-> arg1 items s3-0 mesh)))
(cond
((= (-> s2-0 type) instance-tie)
(let ((v1-4 s2-0))
(when (not (or (logtest? (-> v1-4 bucket-ptr flags) (prototype-flags no-collide))
(logtest? (-> v1-4 flags) (instance-flags no-collide))
)
)
(if *collide-list-boxes*
(add-collide-debug-box (-> s2-0 bsphere) (new 'static 'rgba :r #xff :a #x80))
)
(mem-copy! (the-as pointer s1-0) (the-as pointer arg2) 540)
(nop!)
(let ((v1-11 (the-as uint128 (-> s2-0 origin vector4h 3 long))))
(let ((s0-0 (new 'stack-no-clear 'matrix))
(s1-0 (new 'stack-no-clear 'collide-query))
)
(mem-copy! (the-as pointer s1-0) (the-as pointer arg2) 540)
(nop!)
(let ((a2-2 (the-as uint128 (-> s2-0 origin vector4h 0 long))))
(.pextlh v1-12 v1-11 0)
(let ((a0-9 (the-as uint128 (-> s2-0 origin vector4h 1 long))))
(.pw.sra a1-3 v1-12 10)
(let ((v1-13 (the-as uint128 (-> s2-0 origin vector4h 2 long))))
(.pextlh a2-3 a2-2 0)
(nop!)
(.pw.sra a2-4 a2-3 16)
(nop!)
(.pextlh a0-10 a0-9 0)
(.mov vf4 a1-3)
(.pw.sra a0-11 a0-10 16)
(.mov vf1 a2-4)
(.pextlh v1-14 v1-13 0)
(let ((v1-11 (the-as uint128 (-> s2-0 origin vector4h 3 long))))
(nop!)
(let ((a2-2 (the-as uint128 (-> s2-0 origin vector4h 0 long))))
(.pextlh v1-12 v1-11 0)
(let ((a0-9 (the-as uint128 (-> s2-0 origin vector4h 1 long))))
(.pw.sra a1-3 v1-12 10)
(let ((v1-13 (the-as uint128 (-> s2-0 origin vector4h 2 long))))
(.pextlh a2-3 a2-2 0)
(nop!)
(.pw.sra a2-4 a2-3 16)
(nop!)
(.pextlh a0-10 a0-9 0)
(.mov vf4 a1-3)
(.pw.sra a0-11 a0-10 16)
(.mov vf1 a2-4)
(.pextlh v1-14 v1-13 0)
)
)
)
)
)
(.mov vf2 a0-11)
(.pw.sra v1-15 v1-14 16)
(.lvf vf5 (&-> s2-0 bsphere quad))
(nop!)
(.mov vf3 v1-15)
(.itof.vf vf4 vf4)
(nop!)
(vitof12.xyzw vf1 vf1)
(nop!)
(vitof12.xyzw vf2 vf2)
(nop!)
(vitof12.xyzw vf3 vf3)
(nop!)
(.add.vf.xyz vf4 vf4 vf5)
(nop!)
(nop!)
(.svf (&-> s1-0 instance-mat quad 0) vf1)
(nop!)
(.svf (&-> s1-0 instance-mat quad 1) vf2)
(nop!)
(.svf (&-> s1-0 instance-mat quad 2) vf3)
(nop!)
(.svf (&-> s1-0 instance-mat trans quad) vf4)
(matrix-4x4-inverse! s0-0 (-> s1-0 instance-mat))
(nop!)
(nop!)
(.lvf vf7 (&-> arg2 start-pos quad))
(nop!)
(.lvf vf8 (&-> arg2 move-dist quad))
(nop!)
(.lvf vf1 (&-> s0-0 quad 0))
(nop!)
(.lvf vf2 (&-> s0-0 quad 1))
(nop!)
(.lvf vf3 (&-> s0-0 quad 2))
(nop!)
(.lvf vf4 (&-> s0-0 trans quad))
(.add.vf vf8 vf7 vf8)
(let ((v1-16 (-> s2-0 rmin-scale)))
(.mul.x.vf acc vf1 vf7)
(let ((f2-0 (-> arg2 radius)))
(.add.mul.y.vf acc vf2 vf7 acc)
(.sll v1-17 v1-16 16)
(.add.mul.z.vf acc vf3 vf7 acc)
(let ((f1-0 (the-as float v1-17)))
(.add.mul.w.vf vf7 vf4 vf0 acc)
(nop!)
(.mul.x.vf acc vf1 vf8)
(let ((f2-1 (* f2-0 f1-0)))
(.add.mul.y.vf acc vf2 vf8 acc)
(.mov vf2 a0-11)
(.pw.sra v1-15 v1-14 16)
(.lvf vf5 (&-> s2-0 bsphere quad))
(nop!)
(.mov vf3 v1-15)
(.itof.vf vf4 vf4)
(nop!)
(vitof12.xyzw vf1 vf1)
(nop!)
(vitof12.xyzw vf2 vf2)
(nop!)
(vitof12.xyzw vf3 vf3)
(nop!)
(.add.vf.xyz vf4 vf4 vf5)
(nop!)
(nop!)
(.svf (&-> s1-0 instance-mat quad 0) vf1)
(nop!)
(.svf (&-> s1-0 instance-mat quad 1) vf2)
(nop!)
(.svf (&-> s1-0 instance-mat quad 2) vf3)
(nop!)
(.svf (&-> s1-0 instance-mat trans quad) vf4)
(matrix-4x4-inverse! s0-0 (-> s1-0 instance-mat))
(nop!)
(nop!)
(.lvf vf7 (&-> arg2 start-pos quad))
(nop!)
(.lvf vf8 (&-> arg2 move-dist quad))
(nop!)
(.lvf vf1 (&-> s0-0 quad 0))
(nop!)
(.lvf vf2 (&-> s0-0 quad 1))
(nop!)
(.lvf vf3 (&-> s0-0 quad 2))
(nop!)
(.lvf vf4 (&-> s0-0 trans quad))
(.add.vf vf8 vf7 vf8)
(let ((v1-16 (-> s2-0 rmin-scale)))
(.mul.x.vf acc vf1 vf7)
(let ((f2-0 (-> arg2 radius)))
(.add.mul.y.vf acc vf2 vf7 acc)
(.sll v1-17 v1-16 16)
(.add.mul.z.vf acc vf3 vf7 acc)
(let ((f1-0 (the-as float v1-17)))
(.add.mul.w.vf vf7 vf4 vf0 acc)
(nop!)
(.add.mul.z.vf acc vf3 vf8 acc)
(nop!)
(.add.mul.w.vf vf8 vf4 vf0 acc)
(nop!)
(nop!)
(.svf (&-> s1-0 start-pos quad) vf7)
(.min.vf vf5 vf7 vf8)
(set! (-> s1-0 radius) f2-1)
(.mul.x.vf acc vf1 vf8)
(let ((f2-1 (* f2-0 f1-0)))
(.add.mul.y.vf acc vf2 vf8 acc)
(nop!)
(.add.mul.z.vf acc vf3 vf8 acc)
(nop!)
(.add.mul.w.vf vf8 vf4 vf0 acc)
(nop!)
(nop!)
(.svf (&-> s1-0 start-pos quad) vf7)
(.min.vf vf5 vf7 vf8)
(set! (-> s1-0 radius) f2-1)
)
)
)
)
)
(.max.vf vf6 vf7 vf8)
(nop!)
(nop!)
(.lvf vf9 (&-> s1-0 exit-planes 0 quad))
(.sub.vf vf8 vf8 vf7)
(nop!)
(.sub.w.vf vf5 vf5 vf9)
(nop!)
(.add.w.vf vf6 vf6 vf9)
(nop!)
(nop!)
(.svf (&-> s1-0 move-dist quad) vf8)
(.ftoi.vf vf10 vf5)
(nop!)
(.ftoi.vf vf11 vf6)
(nop!)
(nop!)
(.svf (&-> s1-0 bbox min quad) vf5)
(nop!)
(.svf (&-> s1-0 bbox max quad) vf6)
(nop!)
(.svf (&-> s1-0 bbox4w min quad) vf10)
(nop!)
(.svf (&-> s1-0 bbox4w max quad) vf11)
(set! (-> s1-0 rlength x) (if (= (-> s1-0 move-dist x) 0.0)
0.0
(/ 1.0 (-> s1-0 move-dist x))
)
(.max.vf vf6 vf7 vf8)
(nop!)
(nop!)
(.lvf vf9 (&-> s1-0 exit-planes 0 quad))
(.sub.vf vf8 vf8 vf7)
(nop!)
(.sub.w.vf vf5 vf5 vf9)
(nop!)
(.add.w.vf vf6 vf6 vf9)
(nop!)
(nop!)
(.svf (&-> s1-0 move-dist quad) vf8)
(.ftoi.vf vf10 vf5)
(nop!)
(.ftoi.vf vf11 vf6)
(nop!)
(nop!)
(.svf (&-> s1-0 bbox min quad) vf5)
(nop!)
(.svf (&-> s1-0 bbox max quad) vf6)
(nop!)
(.svf (&-> s1-0 bbox4w min quad) vf10)
(nop!)
(.svf (&-> s1-0 bbox4w max quad) vf11)
(set! (-> s1-0 rlength x) (if (= (-> s1-0 move-dist x) 0.0)
0.0
(/ 1.0 (-> s1-0 move-dist x))
)
)
(set! (-> s1-0 rlength y) (if (= (-> s1-0 move-dist y) 0.0)
0.0
(/ 1.0 (-> s1-0 move-dist y))
)
)
(set! (-> s1-0 rlength z) (if (= (-> s1-0 move-dist z) 0.0)
0.0
(/ 1.0 (-> s1-0 move-dist z))
)
)
(let ((f0-12 1.0))
(.lvf vf1 (&-> (-> s1-0 move-dist) quad))
(.add.w.vf.x vf2 vf0 vf0)
(.mul.vf vf1 vf1 vf1)
(.mul.x.vf.x acc vf2 vf1)
(.add.mul.y.vf.x acc vf2 vf1 acc)
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
(.mov v1-26 vf1)
(set! (-> s1-0 rlength w) (/ f0-12 v1-26))
)
(set! (-> s1-0 exit-planes 0 x) (if (< 0.0 (-> s1-0 move-dist x))
0.0
100000000000000000000000000000000000000.0
)
)
(set! (-> s1-0 exit-planes 0 y) (if (< 0.0 (-> s1-0 move-dist y))
0.0
100000000000000000000000000000000000000.0
)
)
(set! (-> s1-0 exit-planes 0 z) (if (< 0.0 (-> s1-0 move-dist z))
0.0
100000000000000000000000000000000000000.0
)
)
(set! (-> s1-0 exit-planes 1 x) (if (< (-> s1-0 move-dist x) 0.0)
0.0
100000000000000000000000000000000000000.0
)
)
(set! (-> s1-0 exit-planes 1 y) (if (< (-> s1-0 move-dist y) 0.0)
0.0
100000000000000000000000000000000000000.0
)
)
(set! (-> s1-0 exit-planes 1 z) (if (< (-> s1-0 move-dist z) 0.0)
0.0
100000000000000000000000000000000000000.0
)
)
(let* ((s0-1 (-> s2-0 bucket-ptr collide-hash-fragment-array))
(sv-640 (-> s0-1 length))
)
(set! (-> s1-0 instance-ptr) s2-0)
(dotimes (s2-1 sv-640)
(set! (-> (the-as collide-hash-scratch #x70000000) collidable-bits 0) (the-as uint128 0))
(set! (-> (the-as collide-hash-scratch #x70000000) collidable-bits 1) (the-as uint128 0))
(set! (-> (the-as collide-hash-scratch #x70000000) tris) (the-as uint 0))
(fill-bg-using-line-sphere-new arg0 (-> s0-1 fragments s2-1) s1-0)
(+! (-> *collide-stats* tris) (-> (the-as collide-hash-scratch #x70000000) tris))
)
(set! (-> s1-0 rlength y) (if (= (-> s1-0 move-dist y) 0.0)
0.0
(/ 1.0 (-> s1-0 move-dist y))
)
)
(set! (-> s1-0 rlength z) (if (= (-> s1-0 move-dist z) 0.0)
0.0
(/ 1.0 (-> s1-0 move-dist z))
)
)
(let ((f0-12 1.0))
(.lvf vf1 (&-> (-> s1-0 move-dist) quad))
(.add.w.vf.x vf2 vf0 vf0)
(.mul.vf vf1 vf1 vf1)
(.mul.x.vf.x acc vf2 vf1)
(.add.mul.y.vf.x acc vf2 vf1 acc)
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
(.mov v1-26 vf1)
(set! (-> s1-0 rlength w) (/ f0-12 v1-26))
)
(set! (-> s1-0 exit-planes 0 x) (if (< 0.0 (-> s1-0 move-dist x))
0.0
100000000000000000000000000000000000000.0
)
)
(set! (-> s1-0 exit-planes 0 y) (if (< 0.0 (-> s1-0 move-dist y))
0.0
100000000000000000000000000000000000000.0
)
)
(set! (-> s1-0 exit-planes 0 z) (if (< 0.0 (-> s1-0 move-dist z))
0.0
100000000000000000000000000000000000000.0
)
)
(set! (-> s1-0 exit-planes 1 x) (if (< (-> s1-0 move-dist x) 0.0)
0.0
100000000000000000000000000000000000000.0
)
)
(set! (-> s1-0 exit-planes 1 y) (if (< (-> s1-0 move-dist y) 0.0)
0.0
100000000000000000000000000000000000000.0
)
)
(set! (-> s1-0 exit-planes 1 z) (if (< (-> s1-0 move-dist z) 0.0)
0.0
100000000000000000000000000000000000000.0
)
)
(let ((s0-1 (-> s2-0 bucket-ptr collide-hash-fragment-array)))
(set! sv-640 (-> s0-1 length))
(set! (-> s1-0 instance-ptr) s2-0)
(dotimes (s2-1 sv-640)
(set! (-> (the-as collide-hash-scratch #x70000000) collidable-bits 0) (the-as uint128 0))
(set! (-> (the-as collide-hash-scratch #x70000000) collidable-bits 1) (the-as uint128 0))
(set! (-> (the-as collide-hash-scratch #x70000000) tris) (the-as uint 0))
(fill-bg-using-line-sphere-new arg0 (-> s0-1 fragments s2-1) s1-0)
(+! (-> *collide-stats* tris) (-> (the-as collide-hash-scratch #x70000000) tris))
)
)
)
)
)
)
(else
(if *collide-list-boxes*
(add-collide-debug-box (-> s2-0 bsphere) (new 'static 'rgba :r #xff :g #xff :a #x80))
)
(set! (-> (the-as collide-hash-scratch #x70000000) collidable-bits 0) (the-as uint128 0))
(set! (-> (the-as collide-hash-scratch #x70000000) collidable-bits 1) (the-as uint128 0))
(set! (-> arg2 instance-ptr) #f)
(set! (-> (the-as collide-hash-scratch #x70000000) tris) (the-as uint 0))
(fill-bg-using-line-sphere-new arg0 s2-0 arg2)
(+! (-> *collide-stats* tris) (-> (the-as collide-hash-scratch #x70000000) tris))
(else
(if *collide-list-boxes*
(add-collide-debug-box (-> s2-0 bsphere) (new 'static 'rgba :r #xff :g #xff :a #x80))
)
(set! (-> (the-as collide-hash-scratch #x70000000) collidable-bits 0) (the-as uint128 0))
(set! (-> (the-as collide-hash-scratch #x70000000) collidable-bits 1) (the-as uint128 0))
(set! (-> arg2 instance-ptr) #f)
(set! (-> (the-as collide-hash-scratch #x70000000) tris) (the-as uint 0))
(fill-bg-using-line-sphere-new arg0 s2-0 arg2)
(+! (-> *collide-stats* tris) (-> (the-as collide-hash-scratch #x70000000) tris))
)
)
)
)
+37 -36
View File
@@ -568,44 +568,45 @@
;; definition (debug) for function draw-grid
;; WARN: Return type mismatch int vs none.
(defun-debug draw-grid ((arg0 vector) (arg1 vector) (arg2 (pointer int8)) (arg3 rgba))
(local-vars (sv-64 vector) (sv-68 vector) (sv-72 vector))
(set! sv-64 (new 'stack-no-clear 'vector))
(set! sv-68 (new 'stack-no-clear 'vector))
(set! sv-72 (new 'stack-no-clear 'vector))
(dotimes (v1-3 3)
(set! (-> sv-64 data v1-3) (/ (- (-> arg1 data v1-3) (-> arg0 data v1-3)) (the float (-> arg2 v1-3))))
)
(set! (-> sv-68 x) (-> arg0 x))
(set! (-> sv-72 x) (-> arg1 x))
(dotimes (s2-0 (+ (-> arg2 1) 1))
(set! (-> sv-68 y) (+ (-> arg0 y) (* (the float s2-0) (-> sv-64 y))))
(set! (-> sv-72 y) (-> sv-68 y))
(dotimes (s1-0 (+ (-> arg2 2) 1))
(set! (-> sv-68 z) (+ (-> arg0 z) (* (the float s1-0) (-> sv-64 z))))
(set! (-> sv-72 z) (-> sv-68 z))
(add-debug-line #t (bucket-id debug2) sv-68 sv-72 arg3 #f (the-as rgba -1))
(let ((sv-64 (new 'stack-no-clear 'vector))
(sv-68 (new 'stack-no-clear 'vector))
(sv-72 (new 'stack-no-clear 'vector))
)
(dotimes (v1-3 3)
(set! (-> sv-64 data v1-3) (/ (- (-> arg1 data v1-3) (-> arg0 data v1-3)) (the float (-> arg2 v1-3))))
)
)
(set! (-> sv-68 z) (-> arg0 z))
(set! (-> sv-72 z) (-> arg1 z))
(dotimes (s2-1 (+ (-> arg2 1) 1))
(set! (-> sv-68 y) (+ (-> arg0 y) (* (the float s2-1) (-> sv-64 y))))
(set! (-> sv-72 y) (-> sv-68 y))
(dotimes (s1-1 (+ (-> arg2 0) 1))
(set! (-> sv-68 x) (+ (-> arg0 x) (* (the float s1-1) (-> sv-64 x))))
(set! (-> sv-68 x) (-> arg0 x))
(set! (-> sv-72 x) (-> arg1 x))
(dotimes (s2-0 (+ (-> arg2 1) 1))
(set! (-> sv-68 y) (+ (-> arg0 y) (* (the float s2-0) (-> sv-64 y))))
(set! (-> sv-72 y) (-> sv-68 y))
(dotimes (s1-0 (+ (-> arg2 2) 1))
(set! (-> sv-68 z) (+ (-> arg0 z) (* (the float s1-0) (-> sv-64 z))))
(set! (-> sv-72 z) (-> sv-68 z))
(add-debug-line #t (bucket-id debug2) sv-68 sv-72 arg3 #f (the-as rgba -1))
)
)
(set! (-> sv-68 z) (-> arg0 z))
(set! (-> sv-72 z) (-> arg1 z))
(dotimes (s2-1 (+ (-> arg2 1) 1))
(set! (-> sv-68 y) (+ (-> arg0 y) (* (the float s2-1) (-> sv-64 y))))
(set! (-> sv-72 y) (-> sv-68 y))
(dotimes (s1-1 (+ (-> arg2 0) 1))
(set! (-> sv-68 x) (+ (-> arg0 x) (* (the float s1-1) (-> sv-64 x))))
(set! (-> sv-72 x) (-> sv-68 x))
(add-debug-line #t (bucket-id debug2) sv-68 sv-72 arg3 #f (the-as rgba -1))
)
)
(set! (-> sv-68 y) (-> arg0 y))
(set! (-> sv-72 y) (-> arg1 y))
(dotimes (s3-1 (+ (-> arg2 0) 1))
(set! (-> sv-68 x) (+ (-> arg0 x) (* (the float s3-1) (-> sv-64 x))))
(set! (-> sv-72 x) (-> sv-68 x))
(add-debug-line #t (bucket-id debug2) sv-68 sv-72 arg3 #f (the-as rgba -1))
)
)
(set! (-> sv-68 y) (-> arg0 y))
(set! (-> sv-72 y) (-> arg1 y))
(dotimes (s3-1 (+ (-> arg2 0) 1))
(set! (-> sv-68 x) (+ (-> arg0 x) (* (the float s3-1) (-> sv-64 x))))
(set! (-> sv-72 x) (-> sv-68 x))
(dotimes (s2-2 (+ (-> arg2 2) 1))
(set! (-> sv-68 z) (+ (-> arg0 z) (* (the float s2-2) (-> sv-64 z))))
(set! (-> sv-72 z) (-> sv-68 z))
(add-debug-line #t (bucket-id debug2) sv-68 sv-72 arg3 #f (the-as rgba -1))
(dotimes (s2-2 (+ (-> arg2 2) 1))
(set! (-> sv-68 z) (+ (-> arg0 z) (* (the float s2-2) (-> sv-64 z))))
(set! (-> sv-72 z) (-> sv-68 z))
(add-debug-line #t (bucket-id debug2) sv-68 sv-72 arg3 #f (the-as rgba -1))
)
)
)
0

Some files were not shown because too many files have changed in this diff Show More