mirror of
https://github.com/open-goal/jak-project
synced 2026-05-25 23:35:33 -04:00
7348e6a4ff
Update the decompiler to use the new vf macros. Also, fix a bunch of silly casting issues where accessing inline fields with an offset of 0 would be better than a cast:  --------- Co-authored-by: water111 <awaterford1111445@gmail.com>
201 lines
4.9 KiB
Common Lisp
Vendored
Generated
201 lines
4.9 KiB
Common Lisp
Vendored
Generated
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; definition for function drawable-sphere-box-intersect?
|
|
;; INFO: Used lq/sq
|
|
(defun drawable-sphere-box-intersect? ((drawable drawable) (bbox bounding-box4w))
|
|
"TODO"
|
|
(local-vars (v1-1 uint128) (v1-2 uint128) (v1-3 uint128) (a0-1 uint128) (a1-2 uint128) (a2-0 uint128))
|
|
(rlet ((vf1 :class vf)
|
|
(vf2 :class vf)
|
|
(vf3 :class vf)
|
|
(vf4 :class vf)
|
|
)
|
|
(nop!)
|
|
(nop!)
|
|
(.lvf vf1 (&-> drawable bsphere quad))
|
|
(.add.w.vf.xyz vf2 vf1 vf1)
|
|
(let ((v1-0 (-> bbox min quad)))
|
|
(.sub.w.vf.xyz vf1 vf1 vf1)
|
|
(let ((a1-1 (-> bbox max quad)))
|
|
(.ftoi.vf vf4 vf2)
|
|
(nop!)
|
|
(.ftoi.vf vf3 vf1)
|
|
(nop!)
|
|
(.mov a0-1 vf4)
|
|
(nop!)
|
|
(.mov a2-0 vf3)
|
|
(nop!)
|
|
(.pcgtw a1-2 a2-0 a1-1)
|
|
)
|
|
(nop!)
|
|
(.pcgtw v1-1 v1-0 a0-1)
|
|
)
|
|
(nop!)
|
|
(.por v1-2 a1-2 v1-1)
|
|
(nop!)
|
|
(.ppach v1-3 (the-as uint128 0) v1-2)
|
|
(nop!)
|
|
(let ((v1-4 (shl (the-as int v1-3) 16)))
|
|
(nop!)
|
|
(zero? v1-4)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for function instance-sphere-box-intersect?
|
|
;; INFO: Used lq/sq
|
|
(defun instance-sphere-box-intersect? ((drawable drawable) (tie instance-tie) (bbox bounding-box4w))
|
|
"TODO"
|
|
(local-vars
|
|
(v1-3 uint128)
|
|
(v1-4 uint128)
|
|
(v1-5 uint128)
|
|
(a0-2 uint128)
|
|
(a1-2 uint128)
|
|
(a2-1 uint128)
|
|
(a3-1 uint128)
|
|
(a3-3 uint128)
|
|
(a3-4 uint128)
|
|
(t0-1 uint128)
|
|
(t0-2 uint128)
|
|
(t1-0 uint128)
|
|
(t2-1 uint128)
|
|
(t2-2 uint128)
|
|
)
|
|
(rlet ((acc :class vf)
|
|
(vf0 :class vf)
|
|
(vf1 :class vf)
|
|
(vf10 :class vf)
|
|
(vf2 :class vf)
|
|
(vf3 :class vf)
|
|
(vf4 :class vf)
|
|
(vf5 :class vf)
|
|
(vf6 :class vf)
|
|
(vf7 :class vf)
|
|
(vf8 :class vf)
|
|
(vf9 :class vf)
|
|
)
|
|
(init-vf0-vector)
|
|
(nop!)
|
|
(let ((v1-0 (-> tie max-scale)))
|
|
(nop!)
|
|
(let ((a3-0 (the-as uint128 (-> tie origin vector4h 3 long))))
|
|
(nop!)
|
|
(let ((t2-0 (the-as uint128 (-> tie origin vector4h 0 long))))
|
|
(.pextlh a3-1 a3-0 0)
|
|
(let ((t0-0 (the-as uint128 (-> tie origin vector4h 1 long))))
|
|
(.pw.sra t1-0 a3-1 10)
|
|
(let ((a3-2 (the-as uint128 (-> tie origin vector4h 2 long))))
|
|
(.pextlh t2-1 t2-0 0)
|
|
(nop!)
|
|
(.pw.sra t2-2 t2-1 16)
|
|
(nop!)
|
|
(.pextlh t0-1 t0-0 0)
|
|
(.mov vf8 t1-0)
|
|
(.pw.sra t0-2 t0-1 16)
|
|
(.mov vf5 t2-2)
|
|
(.pextlh a3-3 a3-2 0)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(.mov vf6 t0-2)
|
|
(.pw.sra a3-4 a3-3 16)
|
|
(.lvf vf9 (&-> tie bsphere quad))
|
|
(nop!)
|
|
(.mov vf7 a3-4)
|
|
(nop!)
|
|
(.mov vf10 v1-0)
|
|
)
|
|
(.itof.vf vf8 vf8)
|
|
(nop!)
|
|
(vitof12.xyzw vf5 vf5)
|
|
(nop!)
|
|
(vitof12.xyzw vf6 vf6)
|
|
(nop!)
|
|
(vitof12.xyzw vf7 vf7)
|
|
(nop!)
|
|
(.add.vf.xyz vf8 vf8 vf9)
|
|
(nop!)
|
|
(nop!)
|
|
(.lvf vf9 (&-> drawable bsphere quad))
|
|
(vitof12.xyzw vf10 vf10)
|
|
(nop!)
|
|
(.mul.w.vf.x vf10 vf10 vf9)
|
|
(nop!)
|
|
(.mul.x.vf acc vf5 vf9)
|
|
(nop!)
|
|
(.add.mul.y.vf acc vf6 vf9 acc)
|
|
(let ((v1-2 (-> bbox min quad)))
|
|
(.add.mul.z.vf acc vf7 vf9 acc)
|
|
(let ((a1-1 (-> bbox max quad)))
|
|
(.add.mul.w.vf vf1 vf8 vf0 acc)
|
|
(nop!)
|
|
(.add.x.vf.xyz vf2 vf1 vf10)
|
|
(nop!)
|
|
(.sub.x.vf.xyz vf1 vf1 vf10)
|
|
(nop!)
|
|
(.ftoi.vf vf4 vf2)
|
|
(nop!)
|
|
(.ftoi.vf vf3 vf1)
|
|
(nop!)
|
|
(.mov a0-2 vf4)
|
|
(nop!)
|
|
(.mov a2-1 vf3)
|
|
(nop!)
|
|
(.pcgtw a1-2 a2-1 a1-1)
|
|
)
|
|
(nop!)
|
|
(.pcgtw v1-3 v1-2 a0-2)
|
|
)
|
|
(nop!)
|
|
(.por v1-4 a1-2 v1-3)
|
|
(nop!)
|
|
(.ppach v1-5 (the-as uint128 0) v1-4)
|
|
(nop!)
|
|
(let ((v1-6 (shl (the-as int v1-5) 16)))
|
|
(nop!)
|
|
(zero? v1-6)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for function instance-tfragment-add-debug-sphere
|
|
;; INFO: Used lq/sq
|
|
(defun instance-tfragment-add-debug-sphere ((drawable drawable) (tie instance-tie))
|
|
"TODO"
|
|
(local-vars (v1-1 uint128) (v1-2 uint128) (a3-0 float))
|
|
(rlet ((vf0 :class vf)
|
|
(vf10 :class vf)
|
|
(vf11 :class vf)
|
|
(vf12 :class vf)
|
|
(vf9 :class vf)
|
|
)
|
|
(init-vf0-vector)
|
|
(nop!)
|
|
(let ((v1-0 (the-as uint128 (-> tie origin vector4h 3 long))))
|
|
(.pextlh v1-1 v1-0 0)
|
|
)
|
|
(.lvf vf9 (&-> drawable bsphere quad))
|
|
(.pw.sra v1-2 v1-1 10)
|
|
(.lvf vf10 (&-> tie bsphere quad))
|
|
(nop!)
|
|
(.mov vf12 v1-2)
|
|
(.itof.vf vf12 vf12)
|
|
(nop!)
|
|
(.add.vf.xyz vf10 vf10 vf12)
|
|
(nop!)
|
|
(.add.vf.xyz vf9 vf9 vf10)
|
|
(nop!)
|
|
(.add.w.vf.x vf11 vf0 vf9)
|
|
(nop!)
|
|
(.mov a3-0 vf11)
|
|
(nop!)
|
|
(let ((a2-0 (new-stack-vector0)))
|
|
(.svf (&-> a2-0 quad) vf9)
|
|
(add-debug-sphere #t (bucket-id debug2) a2-0 a3-0 (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80))
|
|
)
|
|
)
|
|
)
|