(init-vf0-vector) to make vector code a bit more readable (#494)

* decomp: Use a macro for loading VF0 (maybe should be in goal-lib.gc?)

* update references

* lint: format

* delete now unused file
This commit is contained in:
Tyler Wilding 2021-05-16 13:49:24 -04:00 committed by GitHub
parent bf6e9fc9e9
commit b75a64fc29
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 129 additions and 123 deletions

View file

@ -938,11 +938,7 @@ goos::Object RLetElement::to_form_internal(const Env& env) const {
// NOTE - initialize any relevant registers in the body first
for (auto& reg : sorted_regs) {
if (reg.get_kind() == Reg::RegisterKind::VF && reg.to_string() == "vf0") {
// TODO - a good idea to move this to a macro like initialize-constant-vector! or something.
// There could be some clever way to do this initialization that's faster that a normal static
// load.
rletForm.push_back(
pretty_print::to_symbol("(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))"));
rletForm.push_back(pretty_print::to_symbol("(init-vf0-vector)")); // Defined in vector-h.gc
}
}

View file

@ -381,7 +381,7 @@
(vf30 :class vf)
(vf31 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(let ((v1-0 0))
)
(.lvf vf24 (&-> *math-camera* camera-temp vector 0 quad))
@ -427,7 +427,7 @@
(vf30 :class vf)
(vf31 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(let ((v1-0 0))
)
(.lvf vf24 (&-> *math-camera* camera-temp vector 0 quad))
@ -475,7 +475,7 @@
(vf30 :class vf)
(vf31 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(let ((v1-0 0))
)
(.lvf vf24 (&-> *math-camera* camera-temp vector 0 quad))

View file

@ -40,7 +40,7 @@
(vf4 :class vf)
(vf5 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf3 arg1)
(.lvf vf4 arg0)
(.add.vf vf5 vf4 vf3)
@ -104,7 +104,7 @@
(vf5 :class vf)
(vf6 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf4 arg1)
(.lvf vf5 arg0)
(.mov vf1 arg2)
@ -129,7 +129,7 @@
(vf2 :class vf)
(vf3 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf1 arg0)
(.sub.w.vf vf2 vf1 vf1 :mask #b111)
(.add.w.vf vf3 vf1 vf1 :mask #b111)
@ -182,7 +182,7 @@
(sph-max :class vf)
(sph :class vf))
;; init constant
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
;; init min/max. in the case we don't have any spheres, we should return (0,0,0,1) for min/max.
(set! current-min vf0)
(set! current-max vf0)

View file

@ -15,7 +15,7 @@
(vf1 :class vf)
(vf2 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(let*
((f0-1 (+ (-> arg0 wind-normal w) (rand-vu-float-range -1024.0 1024.0)))
(f30-1 (- f0-1 (* (the float (the int (/ f0-1 65536.0))) 65536.0)))

View file

@ -344,7 +344,7 @@
(vf4 :class vf)
(vf8 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
;; this makes the upper 3x3 correct because R^-1 = R^T for any rotation.
;; but now the transform is in the wrong spot, and needs to be rotated
;; and inverted.
@ -433,7 +433,7 @@
(.xor.vf vf23 vf23 vf23)
(.xor.vf vf19 vf19 vf19)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
;; (nop!)
;; (nop!)
(.lvf vf23 (&-> src vector 0 quad))
@ -929,7 +929,7 @@
(a1 :class i128 :type uint128)
(r0 :class i128 :type uint128)) ;; will be used for zero check.
;; initialize constant vectors
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.xor.p r0 r0 r0)
;; this is an overly complicated check to see if xyz = 0.
@ -1334,7 +1334,7 @@
(vf14 :class vf)
(vf15 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf10 (&-> src vector 0 quad))
(.lvf vf11 (&-> src vector 1 quad))
(.lvf vf12 (&-> src vector 2 quad))
@ -1939,7 +1939,7 @@
(acc :class vf)
(v1 :type int)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
;; blez a3, L3
(when-goto (<= count 0) end)

View file

@ -213,7 +213,7 @@
(vf0 :class vf)
(vf1 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf1 (&-> arg0 vec quad))
(.mul.vf vf1 vf1 vf1)
(.add.z.vf acc vf1 vf1 :mask #b1000)
@ -232,7 +232,7 @@
(vf0 :class vf)
(vf1 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf1 (&-> arg0 vec quad))
(.mul.vf vf1 vf1 vf1)
(.add.z.vf acc vf1 vf1 :mask #b1000)
@ -252,7 +252,7 @@
(vf1 :class vf)
(vf2 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf1 (&-> arg0 vec quad))
(.mul.vf vf2 vf1 vf1)
(.add.z.vf acc vf2 vf2 :mask #b1000)
@ -278,7 +278,7 @@
(vf2 :class vf)
(vf3 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf1 (&-> arg1 vec quad))
(.mul.vf vf2 vf1 vf1)
(.sub.vf vf3 vf3 vf3)
@ -305,7 +305,7 @@
(vf1 :class vf)
(vf2 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf1 (&-> arg0 vec quad))
(.lvf vf2 (&-> arg1 vec quad))
(.mul.vf vf1 vf1 vf2)
@ -327,7 +327,7 @@
(vf3 :class vf)
(vf4 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf1 (&-> arg1 vec quad))
(.lvf vf2 (&-> arg2 vec quad))
(.sub.vf vf4 vf0 vf0 :mask #b1000)
@ -413,7 +413,7 @@
(vf4 :class vf)
(vf5 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf1 (&-> arg1 vec quad))
(.add.vf vf5 vf1 vf1)
(.add.w.vf vf2 vf0 vf1 :mask #b1)
@ -826,7 +826,7 @@
(vf6 :class vf)
(vf7 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(let ((s4-0 (new 'stack-no-clear 'vector))
(gp-0 (new 'stack-no-clear 'vector))
(s5-0 (new 'stack-no-clear 'vector))

View file

@ -70,7 +70,7 @@
(vf5 :class vf)
(vf6 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(vector-y-angle
(vector-! (new 'stack-no-clear 'vector) arg0 (-> obj trans))
)
@ -84,7 +84,7 @@
(vf5 :class vf)
(vf6 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(deg-diff
(y-angle obj)

View file

@ -401,7 +401,7 @@
(vf6 :class vf)
(vf9 :class vf) ;; coeffs
(acc :class vf))
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
;;(.lqc2 vf1 0 arg1)
(.lvf vf1 src)
;;(.vsub.xyzw vf2 vf2 vf2)
@ -455,7 +455,7 @@
(vf14 :class vf)
(acc :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
;; (.lqc2 vf1 0 arg2)
(.lvf vf1 src)
;; (.vsub.xyzw vf14 vf14 vf14)

View file

@ -496,6 +496,11 @@
(set! (-> vec w) ,wv)))
)
(defmacro init-vf0-vector ()
"Initializes the VF0 vector which is a constant vector in the VU set to <0,0,0,1>"
`(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
)
(defun vector-dot ((a vector) (b vector))
"Take the dot product of two vectors.
Only does the x, y, z compoments.

View file

@ -27,7 +27,7 @@
(vf5 :class vf)
(vf6 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.mov vf6 arg2)
(.lvf vf4 (&-> arg1 quad))
(.add.x.vf vf5 vf0 vf0 :mask #b1000)
@ -44,7 +44,7 @@
(vf5 :class vf)
(vf6 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf4 (&-> arg1 quad))
(.lvf vf5 (&-> arg2 quad))
(.add.x.vf vf6 vf0 vf0 :mask #b1000)
@ -63,7 +63,7 @@
(vf6 :class vf)
(vf7 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.mov vf7 arg3)
(.lvf vf5 (&-> arg2 quad))
(.lvf vf4 (&-> arg1 quad))
@ -85,7 +85,7 @@
(vf6 :class vf)
(vf7 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.mov vf7 arg3)
(.lvf vf5 (&-> arg2 quad))
(.lvf vf4 (&-> arg1 quad))
@ -107,7 +107,7 @@
(vf6 :class vf)
(vf7 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf5 (&-> arg2 quad))
;; get started on the first divide ASAP.
;; do this before loading the second value.
@ -141,7 +141,7 @@
(vf1 :class vf)
(vf2 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf1 (&-> arg1 quad))
(.mov vf2 arg2)
(.add.x.vf vf1 vf0 vf0 :mask #b1000)
@ -160,7 +160,7 @@
(vf3 :class vf)
(vf4 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(let ((v1-0 #x3f000000))
(.lvf vf1 (&-> arg1 quad))
(.lvf vf2 (&-> arg2 quad))
@ -185,7 +185,7 @@
(vf3 :class vf)
(vf4 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf2 (&-> arg2 quad))
(.lvf vf1 (&-> arg1 quad))
(.mov vf3 arg3)
@ -207,7 +207,7 @@
(vf3 :class vf)
(vf4 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf2 (&-> arg2 quad))
(.lvf vf1 (&-> arg1 quad))
(.mov vf3 arg3)
@ -227,7 +227,7 @@
(vf3 :class vf)
(vf4 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.mov vf3 arg2)
(.div.vf Q vf0 vf3 :fsf #b11 :ftf #b0)
(.lvf vf1 (&-> arg1 quad))
@ -248,7 +248,7 @@
(vf1 :class vf)
(vf4 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf1 (&-> arg1 quad))
(.sub.vf vf4 vf0 vf1 :mask #b111)
(.add.x.vf vf4 vf0 vf0 :mask #b1000)
@ -262,7 +262,7 @@
(rlet ((vf0 :class vf)
(vf1 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf1 (&-> arg0 quad))
(.sub.vf vf1 vf0 vf1 :mask #b111)
(.svf (&-> arg0 quad) vf1)
@ -315,7 +315,7 @@
(vf2 :class vf)
(vf3 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf1 (&-> arg0 quad))
(.lvf vf2 (&-> arg1 quad))
(.sub.vf vf1 vf2 vf1)
@ -343,7 +343,7 @@
(vf4 :class vf)
(vf5 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.mov vf4 arg2)
(.lvf vf1 (&-> arg1 quad))
(.lvf vf2 (&-> arg0 quad))
@ -525,7 +525,7 @@
(vf1 :class vf)
(vf2 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(let ((v1-0 arg0))
(let ((a1-0 arg0)
(f0-0 (-> *display* seconds-per-frame))
@ -568,7 +568,7 @@
(vf1 :class vf)
(vf2 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(let ((v0-0 delta-p))
(let ((v1-0 velocity)
(f0-1 (* scale (-> *display* seconds-per-frame)))
@ -600,7 +600,7 @@
(vf1 :class vf)
(vf2 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf1 (&-> arg1 quad))
(let ((f0-0 (-> *display* frames-per-second)))
(.mov at-0 f0-0)
@ -620,7 +620,7 @@
(vf1 :class vf)
(vf2 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf1 (&-> arg1 quad))
(let ((f0-0 (-> *display* seconds-per-frame)))
(.mov at-0 f0-0)
@ -641,7 +641,7 @@
(vf0 :class vf)
(vf1 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf1 (&-> arg0 quad))
(.mul.vf vf1 vf1 vf1)
(.mul.x.vf acc vf0 vf1 :mask #b1000)
@ -666,7 +666,7 @@
(vf1 :class vf)
(vf2 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf1 (&-> arg0 quad))
(.add.w.vf vf2 vf0 vf0 :mask #b1)
(.mul.vf vf1 vf1 vf1)
@ -703,7 +703,7 @@
(vf2 :class vf)
(vf3 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf2 (&-> arg0 quad))
(.lvf vf3 (&-> arg1 quad))
(.sub.vf vf1 vf3 vf2)
@ -750,7 +750,7 @@
(vf2 :class vf)
(vf3 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf2 (&-> arg0 quad))
(.lvf vf3 (&-> arg1 quad))
(.sub.vf vf1 vf3 vf2)
@ -794,7 +794,7 @@
(vf2 :class vf)
(vf3 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf1 (&-> arg0 quad))
(.mul.vf vf2 vf1 vf1 :mask #b111)
(let ((v1-0 arg1))
@ -825,7 +825,7 @@
(vf2 :class vf)
(vf3 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf1 (&-> arg0 quad))
(.mul.vf vf2 vf1 vf1 :mask #b111)
(let ((v1-0 arg1))
@ -1005,7 +1005,7 @@
(vf3 :class vf)
(vf4 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf1 (&-> a quad))
(.lvf vf2 (&-> b quad))
(.mov vf4 alpha)
@ -1027,7 +1027,7 @@
(vf3 :class vf)
(vf4 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(cond
((>= 0.0 alpha)
(set! (-> out quad) (-> a quad))
@ -1272,7 +1272,7 @@
(vf3 :class vf)
(vf4 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf1 (&-> arg0 quad))
(.lvf vf2 (&-> arg1 quad))
(.sub.vf vf3 vf1 vf2 :mask #b111)

View file

@ -493,7 +493,7 @@
delayed-rand-vector
((obj delayed-rand-vector) (arg0 int) (arg1 int) (arg2 float) (arg3 float))
(rlet ((vf0 :class vf))
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(set! (-> obj min-time) arg0)
(set! (-> obj max-time) arg1)
(set! (-> obj xz-max) (* 0.5 arg2))
@ -541,7 +541,7 @@
;; definition for method 12 of type delayed-rand-vector
(defmethod dummy-12 delayed-rand-vector ((obj delayed-rand-vector))
(rlet ((vf0 :class vf))
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(if
(>=
(the-as int (- (-> *display* base-frame-counter) (-> obj start-time)))
@ -568,7 +568,7 @@
(arg3 float)
)
(rlet ((vf0 :class vf))
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(cond
(arg0
(let ((v1-0 (-> obj value)))
@ -606,7 +606,7 @@
(vf5 :class vf)
(vf6 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(let ((s5-0 (new 'stack 'vector)))
(cond
(arg0
@ -724,4 +724,4 @@
)
(-> obj value)
)
)
)

View file

@ -588,3 +588,8 @@
(define-extern vector-rad<-vector-deg/2! (function vector vector int))
(define-extern sprite-distorter-generate-tables (function none))
(defmacro init-vf0-vector ()
"Initializes the VF0 vector which is a constant vector in the VU set to <0,0,0,1>"
`(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
)

View file

@ -319,7 +319,7 @@
;; definition for method 0 of type math-camera
(defmethod new math-camera ((allocation symbol) (type-to-make type))
(rlet ((vf0 :class vf))
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(let
((gp-0
(object-new allocation type-to-make (the-as int (-> type-to-make size)))
@ -371,7 +371,7 @@
(vf5 :class vf)
(vf6 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(let ((local-trans (new 'stack-no-clear 'vector)))
(set! (-> local-trans quad) (the-as uint128 0))
(set! (-> local-trans x) (cond
@ -504,7 +504,7 @@
(vf30 :class vf)
(vf31 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(let ((v1-0 0))
)
(.lvf vf24 (&-> *math-camera* camera-temp vector 0 quad))
@ -552,7 +552,7 @@
(vf30 :class vf)
(vf31 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(let ((v1-0 0))
)
(.lvf vf24 (&-> *math-camera* camera-temp vector 0 quad))
@ -600,7 +600,7 @@
(vf30 :class vf)
(vf31 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(let ((v1-0 0))
)
(.lvf vf24 (&-> *math-camera* camera-temp vector 0 quad))

View file

@ -37,7 +37,7 @@
(vf4 :class vf)
(vf5 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf3 arg1)
(.lvf vf4 arg0)
(.add.vf vf5 vf4 vf3)
@ -100,7 +100,7 @@
(vf5 :class vf)
(vf6 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf4 arg1)
(.lvf vf5 arg0)
(.mov vf1 arg2)
@ -124,7 +124,7 @@
(vf2 :class vf)
(vf3 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf1 (&-> arg0 quad))
(.sub.w.vf vf2 vf1 vf1 :mask #b111)
(.add.w.vf vf3 vf1 vf1 :mask #b111)

View file

@ -11,7 +11,7 @@
(vf1 :class vf)
(vf2 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(let*
((f0-1 (+ (-> arg0 wind-normal w) (rand-vu-float-range -1024.0 1024.0)))
(f30-1 (- f0-1 (* (the float (the int (/ f0-1 65536.0))) 65536.0)))

View file

@ -139,7 +139,7 @@
(vf1 :class vf)
(vf2 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(TODO.VRGET vf1)
(.sqrt.vf Q vf1 :ftf #b0)
(.add.vf vf2 vf0 Q :mask #b1)
@ -158,7 +158,7 @@
(rlet ((vf0 :class vf)
(vf1 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(TODO.VRGET vf1)
(.sub.w.vf vf1 vf1 vf0)
(.mov v0-0 vf1)

View file

@ -320,7 +320,7 @@
(vf4 :class vf)
(vf8 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(matrix-transpose! dst src)
(.lvf vf1 (&-> dst vector 0 quad))
(.lvf vf2 (&-> dst vector 1 quad))
@ -380,7 +380,7 @@
(vf8 :class vf)
(vf9 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(nop!)
(nop!)
(.lvf vf23 (&-> src vector 0 quad))
@ -1101,7 +1101,7 @@
(vf14 :class vf)
(vf15 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf10 (&-> src vector 0 quad))
(.lvf vf11 (&-> src vector 1 quad))
(.lvf vf12 (&-> src vector 2 quad))

View file

@ -226,7 +226,7 @@
(vf0 :class vf)
(vf1 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf1 (&-> arg0 vec quad))
(.mul.vf vf1 vf1 vf1)
(.add.z.vf acc vf1 vf1 :mask #b1000)
@ -245,7 +245,7 @@
(vf0 :class vf)
(vf1 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf1 (&-> arg0 vec quad))
(.mul.vf vf1 vf1 vf1)
(.add.z.vf acc vf1 vf1 :mask #b1000)
@ -265,7 +265,7 @@
(vf1 :class vf)
(vf2 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf1 (&-> arg0 vec quad))
(.mul.vf vf2 vf1 vf1)
(.add.z.vf acc vf2 vf2 :mask #b1000)
@ -291,7 +291,7 @@
(vf2 :class vf)
(vf3 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf1 (&-> arg1 vec quad))
(.mul.vf vf2 vf1 vf1)
(.sub.vf vf3 vf3 vf3)
@ -318,7 +318,7 @@
(vf1 :class vf)
(vf2 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf1 (&-> arg0 vec quad))
(.lvf vf2 (&-> arg1 vec quad))
(.mul.vf vf1 vf1 vf2)
@ -340,7 +340,7 @@
(vf3 :class vf)
(vf4 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf1 (&-> arg1 vec quad))
(.lvf vf2 (&-> arg2 vec quad))
(.sub.vf vf4 vf0 vf0 :mask #b1000)
@ -423,7 +423,7 @@
(vf4 :class vf)
(vf5 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf1 (&-> arg1 vec quad))
(.add.vf vf5 vf1 vf1)
(.add.w.vf vf2 vf0 vf1 :mask #b1)
@ -866,7 +866,7 @@
(vf6 :class vf)
(vf7 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(let ((s4-0 (new 'stack-no-clear 'vector))
(gp-0 (new 'stack-no-clear 'vector))
(s5-0 (new 'stack-no-clear 'vector))

View file

@ -105,7 +105,7 @@
(vf5 :class vf)
(vf6 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(let ((t9-0 vector-y-angle)
(v1-0 (new 'stack-no-clear 'vector))
)
@ -128,7 +128,7 @@
(vf5 :class vf)
(vf6 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(let ((gp-0 deg-diff)
(s3-0 (y-angle obj))
(t9-1 vector-y-angle)

View file

@ -322,7 +322,7 @@
(vf6 :class vf)
(vf9 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf1 (&-> arg1 quad))
(.sub.vf vf2 vf2 vf2)
(.lvf vf9 (&-> *cos-poly-vec* quad))
@ -360,7 +360,7 @@
(vf8 :class vf)
(vf9 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf1 (&-> arg2 quad))
(.sub.vf vf14 vf14 vf14)
(.lvf vf11 (&-> *sin-poly-vec2* quad))

View file

@ -890,7 +890,7 @@
(vf2 :class vf)
(vf3 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf1 (&-> arg0 quad))
(.lvf vf2 (&-> arg1 quad))
(.mul.vf vf1 vf1 vf2)
@ -911,7 +911,7 @@
(vf5 :class vf)
(vf6 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.mov.vf vf6 vf0 :mask #b1000)
(.lvf vf4 (&-> arg1 quad))
(.lvf vf5 (&-> arg2 quad))
@ -928,7 +928,7 @@
(vf5 :class vf)
(vf6 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf4 (&-> arg1 quad))
(.lvf vf5 (&-> arg2 quad))
(.mov.vf vf6 vf0 :mask #b1000)
@ -948,7 +948,7 @@
;; definition for function vector-reset!
(defun vector-reset! ((arg0 vector))
(rlet ((vf0 :class vf))
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.svf (&-> arg0 quad) vf0)
arg0
)

View file

@ -23,7 +23,7 @@
(vf5 :class vf)
(vf6 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.mov vf6 arg2)
(.lvf vf4 (&-> arg1 quad))
(.add.x.vf vf5 vf0 vf0 :mask #b1000)
@ -40,7 +40,7 @@
(vf5 :class vf)
(vf6 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf4 (&-> arg1 quad))
(.lvf vf5 (&-> arg2 quad))
(.add.x.vf vf6 vf0 vf0 :mask #b1000)
@ -59,7 +59,7 @@
(vf6 :class vf)
(vf7 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.mov vf7 arg3)
(.lvf vf5 (&-> arg2 quad))
(.lvf vf4 (&-> arg1 quad))
@ -80,7 +80,7 @@
(vf6 :class vf)
(vf7 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.mov vf7 arg3)
(.lvf vf5 (&-> arg2 quad))
(.lvf vf4 (&-> arg1 quad))
@ -101,7 +101,7 @@
(vf6 :class vf)
(vf7 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf5 (&-> arg2 quad))
(.div.vf Q vf0 vf5 :fsf #b11 :ftf #b1)
(.add.x.vf vf6 vf0 vf0 :mask #b1000)
@ -130,7 +130,7 @@
(vf1 :class vf)
(vf2 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf1 (&-> arg1 quad))
(.mov vf2 arg2)
(.add.x.vf vf1 vf0 vf0 :mask #b1000)
@ -149,7 +149,7 @@
(vf3 :class vf)
(vf4 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(let ((v1-0 #x3f000000))
(.lvf vf1 (&-> arg1 quad))
(.lvf vf2 (&-> arg2 quad))
@ -172,7 +172,7 @@
(vf3 :class vf)
(vf4 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf2 (&-> arg2 quad))
(.lvf vf1 (&-> arg1 quad))
(.mov vf3 arg3)
@ -193,7 +193,7 @@
(vf3 :class vf)
(vf4 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf2 (&-> arg2 quad))
(.lvf vf1 (&-> arg1 quad))
(.mov vf3 arg3)
@ -213,7 +213,7 @@
(vf3 :class vf)
(vf4 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.mov vf3 arg2)
(.div.vf Q vf0 vf3 :fsf #b11 :ftf #b0)
(.lvf vf1 (&-> arg1 quad))
@ -233,7 +233,7 @@
(vf1 :class vf)
(vf4 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf1 (&-> arg1 quad))
(.sub.vf vf4 vf0 vf1 :mask #b111)
(.add.x.vf vf4 vf0 vf0 :mask #b1000)
@ -247,7 +247,7 @@
(rlet ((vf0 :class vf)
(vf1 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf1 (&-> arg0 quad))
(.sub.vf vf1 vf0 vf1 :mask #b111)
(.svf (&-> arg0 quad) vf1)
@ -267,7 +267,7 @@
(vf2 :class vf)
(vf3 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf1 (&-> arg0 quad))
(.lvf vf2 (&-> arg1 quad))
(.sub.vf vf1 vf2 vf1)
@ -290,7 +290,7 @@
(vf4 :class vf)
(vf5 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.mov vf4 arg2)
(.lvf vf1 (&-> arg1 quad))
(.lvf vf2 (&-> arg0 quad))
@ -462,7 +462,7 @@
(vf1 :class vf)
(vf2 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(let ((v1-0 arg0))
(let ((a1-0 arg0)
(f0-0 (-> *display* seconds-per-frame))
@ -511,7 +511,7 @@
(vf1 :class vf)
(vf2 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(let ((v0-0 delta-p))
(let ((v1-0 velocity)
(f0-1 (* scale (-> *display* seconds-per-frame)))
@ -547,7 +547,7 @@
(vf1 :class vf)
(vf2 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf1 (&-> arg1 quad))
(let ((f0-0 (-> *display* frames-per-second)))
(.mov at-0 f0-0)
@ -567,7 +567,7 @@
(vf1 :class vf)
(vf2 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf1 (&-> arg1 quad))
(let ((f0-0 (-> *display* seconds-per-frame)))
(.mov at-0 f0-0)
@ -588,7 +588,7 @@
(vf0 :class vf)
(vf1 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf1 (&-> arg0 quad))
(.mul.vf vf1 vf1 vf1)
(.mul.x.vf acc vf0 vf1 :mask #b1000)
@ -613,7 +613,7 @@
(vf1 :class vf)
(vf2 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf1 (&-> arg0 quad))
(.add.w.vf vf2 vf0 vf0 :mask #b1)
(.mul.vf vf1 vf1 vf1)
@ -645,7 +645,7 @@
(vf2 :class vf)
(vf3 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf2 (&-> arg0 quad))
(.lvf vf3 (&-> arg1 quad))
(.sub.vf vf1 vf3 vf2)
@ -692,7 +692,7 @@
(vf2 :class vf)
(vf3 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf2 (&-> arg0 quad))
(.lvf vf3 (&-> arg1 quad))
(.sub.vf vf1 vf3 vf2)
@ -736,7 +736,7 @@
(vf2 :class vf)
(vf3 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf1 (&-> arg0 quad))
(.mul.vf vf2 vf1 vf1 :mask #b111)
(let ((v1-0 arg1))
@ -766,7 +766,7 @@
(vf2 :class vf)
(vf3 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf1 (&-> arg0 quad))
(.mul.vf vf2 vf1 vf1 :mask #b111)
(let ((v1-0 arg1))
@ -935,7 +935,7 @@
(vf3 :class vf)
(vf4 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf1 (&-> a quad))
(.lvf vf2 (&-> b quad))
(.mov vf4 alpha)
@ -957,7 +957,7 @@
(vf3 :class vf)
(vf4 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(cond
((>= 0.0 alpha)
(set! (-> out quad) (-> a quad))
@ -1192,7 +1192,7 @@
(vf3 :class vf)
(vf4 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(.lvf vf1 (&-> arg0 quad))
(.lvf vf2 (&-> arg1 quad))
(.sub.vf vf3 vf1 vf2 :mask #b111)

View file

@ -472,7 +472,7 @@
delayed-rand-vector
((obj delayed-rand-vector) (arg0 int) (arg1 int) (arg2 float) (arg3 float))
(rlet ((vf0 :class vf))
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(set! (-> obj min-time) arg0)
(set! (-> obj max-time) arg1)
(set! (-> obj xz-max) (* 0.5 arg2))
@ -518,7 +518,7 @@
;; definition for method 12 of type delayed-rand-vector
(defmethod dummy-12 delayed-rand-vector ((obj delayed-rand-vector))
(rlet ((vf0 :class vf))
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(if
(>=
(the-as int (- (-> *display* base-frame-counter) (-> obj start-time)))
@ -543,7 +543,7 @@
(arg3 float)
)
(rlet ((vf0 :class vf))
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(cond
(arg0
(let ((v1-0 (-> obj value)))
@ -575,7 +575,7 @@
(vf5 :class vf)
(vf6 :class vf)
)
(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0))
(init-vf0-vector)
(let ((s5-0 (new 'stack-no-clear 'vector)))
(cond
(arg0