mirror of
https://github.com/open-goal/jak-project
synced 2026-08-20 14:24:45 -04:00
dc5dc9c76c
Some notes: - `draw-prototype-inline-array-shrub` can probably be decompiled but I'm not comfortable doing this function myself. It's got a ton of inline assembly (or at least I think it's inline assembly) and is very long. I left this marked as asm for now but I am confident in the function definition. - The VU program is identical to Jak 1 (yay) - There's some new `dma-test` stuff at the end of the file, not really sure what it's doing but it runs in the top-level.
1328 lines
47 KiB
Common Lisp
Vendored
Generated
1328 lines
47 KiB
Common Lisp
Vendored
Generated
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; definition for function plane-from-points
|
|
(defun plane-from-points ((arg0 (inline-array plane)) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 int))
|
|
(let ((s4-0 (new 'stack-no-clear 'vector)))
|
|
(vector-cross! s4-0 arg1 arg2)
|
|
(vector-normalize! s4-0 1.0)
|
|
(set! (-> s4-0 w) (vector-dot s4-0 arg3))
|
|
(set! (-> (&-> arg0 0 data arg4) 0) (-> s4-0 x))
|
|
(set! (-> (&-> arg0 0 data arg4) 4) (-> s4-0 y))
|
|
(set! (-> (&-> arg0 0 data arg4) 8) (-> s4-0 z))
|
|
(set! (-> (&-> arg0 0 data arg4) 12) (-> s4-0 w))
|
|
)
|
|
)
|
|
|
|
;; definition for function set-point
|
|
(defun set-point ((arg0 vector) (arg1 float) (arg2 float) (arg3 float))
|
|
(set! (-> arg0 x) arg1)
|
|
(set! (-> arg0 y) arg2)
|
|
(set! (-> arg0 z) arg3)
|
|
(set! (-> arg0 w) 1.0)
|
|
)
|
|
|
|
;; 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)))
|
|
(f26-0 (* arg2 (-> arg0 y-ratio) (-> arg0 d)))
|
|
(f28-0 (* arg2 (-> arg0 x-ratio) (-> arg0 f)))
|
|
(f24-0 (* arg2 (-> arg0 y-ratio) (-> arg0 f)))
|
|
)
|
|
(set-point (-> s5-0 hither-top-left) (- f30-0) f26-0 (-> arg0 d))
|
|
(set-point (-> s5-0 hither-top-right) f30-0 f26-0 (-> arg0 d))
|
|
(set-point (-> s5-0 hither-bottom-left) (- f30-0) (- f26-0) (-> arg0 d))
|
|
(set-point (-> s5-0 hither-bottom-right) f30-0 (- f26-0) (-> arg0 d))
|
|
(set-point (-> s5-0 yon-top-left) (- f28-0) f24-0 (-> arg0 f))
|
|
(set-point (-> s5-0 yon-top-right) f28-0 f24-0 (-> arg0 f))
|
|
(set-point (-> s5-0 yon-bottom-left) (- f28-0) (- f24-0) (-> arg0 f))
|
|
(set-point (-> s5-0 yon-bottom-right) f28-0 (- f24-0) (-> arg0 f))
|
|
)
|
|
(vector-matrix*! (-> s5-0 hither-top-left) (-> s5-0 hither-top-left) arg3)
|
|
(vector-matrix*! (-> s5-0 hither-top-right) (-> s5-0 hither-top-right) arg3)
|
|
(vector-matrix*! (-> s5-0 hither-bottom-left) (-> s5-0 hither-bottom-left) arg3)
|
|
(vector-matrix*! (-> s5-0 hither-bottom-right) (-> s5-0 hither-bottom-right) arg3)
|
|
(vector-matrix*! (-> s5-0 yon-top-left) (-> s5-0 yon-top-left) arg3)
|
|
(vector-matrix*! (-> s5-0 yon-top-right) (-> s5-0 yon-top-right) arg3)
|
|
(vector-matrix*! (-> s5-0 yon-bottom-left) (-> s5-0 yon-bottom-left) arg3)
|
|
(vector-matrix*! (-> s5-0 yon-bottom-right) (-> s5-0 yon-bottom-right) arg3)
|
|
(when (= arg2 1.0)
|
|
(vector-! (the-as vector (-> *fog-texture-work* corner)) (-> s5-0 yon-top-left) (-> arg3 trans))
|
|
(vector-! (-> *fog-texture-work* corner 1) (-> s5-0 yon-top-right) (-> arg3 trans))
|
|
(vector-! (-> *fog-texture-work* corner 2) (-> s5-0 yon-bottom-left) (-> arg3 trans))
|
|
(vector-! (-> *fog-texture-work* corner 3) (-> s5-0 yon-bottom-right) (-> arg3 trans))
|
|
)
|
|
(let ((s2-1 (new-stack-vector0))
|
|
(s3-1 (new-stack-vector0))
|
|
(s1-0 (new-stack-vector0))
|
|
(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)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for symbol *update-leaf-when-outside-bsp*, type symbol
|
|
(define *update-leaf-when-outside-bsp* #t)
|
|
|
|
;; definition for function update-visible
|
|
;; INFO: Used lq/sq
|
|
;; ERROR: failed type prop at 290: Could not figure out load: (set! v1 (l.w s3))
|
|
(defun update-visible ((a0-0 math-camera))
|
|
(local-vars
|
|
(v0-0 none)
|
|
(v0-1 none)
|
|
(v0-2 none)
|
|
(v0-3 none)
|
|
(v0-4 none)
|
|
(v0-5 object)
|
|
(v0-6 none)
|
|
(v0-7 none)
|
|
(v0-8 none)
|
|
(v0-9 symbol)
|
|
(v1-0 symbol)
|
|
(v1-2 int)
|
|
(v1-3 int)
|
|
(v1-4 int)
|
|
(v1-5 level)
|
|
(v1-6 level-group)
|
|
(v1-7 int)
|
|
(v1-10 int)
|
|
(v1-11 int)
|
|
(v1-12 int)
|
|
(v1-13 symbol)
|
|
(v1-15 bsp-header)
|
|
(v1-16 int)
|
|
(v1-17 int)
|
|
(v1-18 symbol)
|
|
(v1-19 symbol)
|
|
(v1-20 symbol)
|
|
(v1-21 symbol)
|
|
(v1-22 symbol)
|
|
(v1-23 symbol)
|
|
(v1-24 level-vis-info)
|
|
(v1-25 bsp-header)
|
|
(v1-26 symbol)
|
|
(v1-28 symbol)
|
|
(v1-29 int)
|
|
(v1-30 int)
|
|
(v1-31 int)
|
|
(v1-32 symbol)
|
|
(v1-33 symbol)
|
|
(v1-34 symbol)
|
|
(v1-37 type)
|
|
(v1-38 none)
|
|
(v1-40 int)
|
|
(v1-44 symbol)
|
|
(v1-45 symbol)
|
|
(v1-46 level-group)
|
|
(v1-48 bsp-header)
|
|
(v1-50 bsp-header)
|
|
(v1-52 level-group)
|
|
(v1-53 int)
|
|
(v1-56 symbol)
|
|
(v1-57 symbol)
|
|
(v1-58 symbol)
|
|
(v1-60 int)
|
|
(v1-61 int)
|
|
(v1-62 int)
|
|
(v1-63 int)
|
|
(v1-64 int)
|
|
(v1-65 int)
|
|
(v1-66 symbol)
|
|
(v1-68 symbol)
|
|
(v1-69 symbol)
|
|
(v1-70 symbol)
|
|
(v1-71 symbol)
|
|
(v1-72 int)
|
|
(v1-73 int)
|
|
(v1-74 bsp-header)
|
|
(v1-75 bsp-header)
|
|
(v1-76 bsp-header)
|
|
(v1-77 uint)
|
|
(v1-78 bsp-header)
|
|
(v1-79 uint)
|
|
(v1-81 none)
|
|
(v1-82 symbol)
|
|
(v1-83 symbol)
|
|
(v1-84 symbol)
|
|
(v1-86 bsp-header)
|
|
(v1-87 bsp-header)
|
|
(v1-88 bsp-header)
|
|
(v1-89 uint)
|
|
(v1-91 none)
|
|
(v1-92 none)
|
|
(v1-93 none)
|
|
(v1-94 none)
|
|
(v1-95 none)
|
|
(v1-96 none)
|
|
(v1-97 none)
|
|
(v1-98 none)
|
|
(v1-99 none)
|
|
(v1-102 none)
|
|
(v1-103 none)
|
|
(v1-105 none)
|
|
(v1-106 none)
|
|
(v1-107 none)
|
|
(v1-108 none)
|
|
(v1-109 none)
|
|
(v1-111 none)
|
|
(v1-112 none)
|
|
(v1-115 level-group)
|
|
(v1-116 int)
|
|
(a0-1 level-group)
|
|
(a0-2 symbol)
|
|
(a0-4 bsp-header)
|
|
(a0-5 (inline-array bsp-node))
|
|
(a0-6 symbol)
|
|
(a0-7 symbol)
|
|
(a0-9 bsp-header)
|
|
(a0-11 level-group)
|
|
(a0-12 symbol)
|
|
(a0-13 pointer)
|
|
(a0-14 symbol)
|
|
(a0-15 basic)
|
|
(a0-17 int)
|
|
(a0-18 int)
|
|
(a0-19 int)
|
|
(a0-20 uint)
|
|
(a0-23 symbol)
|
|
(a0-24 level)
|
|
(a0-25 int)
|
|
(a0-26 int)
|
|
(a0-27 level-vis-info)
|
|
(a0-28 symbol)
|
|
(a0-29 symbol)
|
|
(a0-30 pointer)
|
|
(a0-31 pointer)
|
|
(a0-32 cpad-list)
|
|
(a0-33 cpad-info)
|
|
(a0-34 pad-buttons)
|
|
(a0-35 pad-buttons)
|
|
(a0-36 level-group)
|
|
(a0-37 symbol)
|
|
(a0-38 int)
|
|
(a0-39 int)
|
|
(a0-40 string)
|
|
(a0-41 int)
|
|
(a0-42 int)
|
|
(a0-43 none)
|
|
(a0-45 none)
|
|
(a0-47 none)
|
|
(a0-49 none)
|
|
(a0-50 none)
|
|
(a0-51 none)
|
|
(a0-52 none)
|
|
(a0-53 none)
|
|
(a0-54 none)
|
|
(a0-55 none)
|
|
(a0-56 none)
|
|
(a0-57 none)
|
|
(a0-58 none)
|
|
(a0-59 none)
|
|
(a0-60 none)
|
|
(a0-61 none)
|
|
(a0-62 none)
|
|
(a0-63 none)
|
|
(a0-64 none)
|
|
(a0-65 none)
|
|
(a0-66 none)
|
|
(a0-67 none)
|
|
(a0-68 none)
|
|
(a0-69 none)
|
|
(a0-70 none)
|
|
(a0-71 none)
|
|
(a0-72 none)
|
|
(a0-73 none)
|
|
(a0-74 none)
|
|
(a0-75 none)
|
|
(a0-76 none)
|
|
(a0-77 none)
|
|
(a0-78 none)
|
|
(a0-79 none)
|
|
(a0-80 none)
|
|
(a0-81 none)
|
|
(a0-82 none)
|
|
(a0-83 none)
|
|
(a1-0 symbol)
|
|
(a1-1 vector)
|
|
(a1-2 (pointer uint16))
|
|
(a1-3 vis-info-flag)
|
|
(a1-4 bsp-header)
|
|
(a1-5 uint)
|
|
(a1-9 int)
|
|
(a1-10 (pointer uint16))
|
|
(a1-11 (pointer uint16))
|
|
(a1-12 int)
|
|
(a1-13 int)
|
|
(a1-14 string)
|
|
(a1-15 int)
|
|
(a1-16 int)
|
|
(a1-17 none)
|
|
(a1-18 none)
|
|
(a1-19 none)
|
|
(a1-20 none)
|
|
(a1-21 none)
|
|
(a1-22 none)
|
|
(a1-23 none)
|
|
(a1-24 none)
|
|
(a1-25 none)
|
|
(a1-26 none)
|
|
(a1-27 none)
|
|
(a1-28 none)
|
|
(a1-29 none)
|
|
(a1-30 none)
|
|
(a1-31 none)
|
|
(a1-32 none)
|
|
(a1-33 none)
|
|
(a1-34 none)
|
|
(a1-35 none)
|
|
(a1-36 none)
|
|
(a1-37 none)
|
|
(a1-38 none)
|
|
(a1-39 none)
|
|
(a1-40 none)
|
|
(a1-41 none)
|
|
(a2-0 int)
|
|
(a2-1 uint)
|
|
(a2-2 int)
|
|
(a2-4 symbol)
|
|
(a2-5 int)
|
|
(a2-7 none)
|
|
(a2-8 none)
|
|
(a2-9 none)
|
|
(a3-0 uint)
|
|
(a3-1 int)
|
|
(a3-2 int)
|
|
(a3-3 int)
|
|
(a3-4 none)
|
|
(a3-5 none)
|
|
(a3-6 none)
|
|
(t0-0 int)
|
|
(t0-2 uint)
|
|
(t0-3 none)
|
|
(t0-4 none)
|
|
(t0-5 none)
|
|
(t1-0 uint)
|
|
(t2-0 string)
|
|
(t3-0 string)
|
|
(s2-0 int)
|
|
(s3-0 uint)
|
|
(s4-0 level-vis-info)
|
|
(s4-1 uint)
|
|
(s5-0 int)
|
|
(s5-1 level)
|
|
(s5-2 level)
|
|
(t9-0 (function bsp-header vector none))
|
|
(t9-1 (function pointer pointer int none))
|
|
(t9-2 (function none))
|
|
(t9-3 (function pointer pointer int none))
|
|
(t9-4 (function pointer pointer int none))
|
|
(t9-5 (function _varargs_ object))
|
|
(t9-6 none)
|
|
(t9-7 none)
|
|
(t9-8 none)
|
|
(gp-1 int)
|
|
(gp-2 int)
|
|
(sp-0 none)
|
|
(f0-0 none)
|
|
(f0-1 none)
|
|
(f0-2 none)
|
|
(f0-3 none)
|
|
(f0-4 none)
|
|
(f0-5 none)
|
|
(f0-6 none)
|
|
(f0-7 none)
|
|
(f0-8 none)
|
|
(f0-9 none)
|
|
(f0-10 none)
|
|
(f0-11 none)
|
|
(f0-12 none)
|
|
(f0-13 none)
|
|
(f0-14 none)
|
|
(f0-15 none)
|
|
(f0-16 none)
|
|
(f0-17 none)
|
|
(f0-18 none)
|
|
(f0-19 none)
|
|
(f0-20 none)
|
|
(f0-21 none)
|
|
(f0-22 none)
|
|
(f0-23 none)
|
|
(f0-24 none)
|
|
(f0-25 none)
|
|
(f1-0 none)
|
|
(f1-1 none)
|
|
(f1-2 none)
|
|
(f1-3 none)
|
|
(f1-4 none)
|
|
(f1-5 none)
|
|
(f1-6 none)
|
|
(f1-7 none)
|
|
(f1-8 none)
|
|
(f1-9 none)
|
|
(f1-10 none)
|
|
(f1-11 none)
|
|
(f1-12 none)
|
|
(f1-13 none)
|
|
(f1-14 none)
|
|
(f1-15 none)
|
|
(f1-16 none)
|
|
(f1-17 none)
|
|
(f1-18 none)
|
|
(f1-19 none)
|
|
(f1-20 none)
|
|
(f1-21 none)
|
|
(f1-22 none)
|
|
(f1-23 none)
|
|
(f1-24 none)
|
|
(f1-25 none)
|
|
(f1-26 none)
|
|
(f1-27 none)
|
|
(f1-28 none)
|
|
(f1-29 none)
|
|
(f1-30 none)
|
|
(f1-31 none)
|
|
(f1-32 none)
|
|
(f1-33 none)
|
|
(f1-34 none)
|
|
(f1-35 none)
|
|
(f1-36 none)
|
|
(f1-37 none)
|
|
(f1-38 none)
|
|
(f1-39 none)
|
|
(f1-40 none)
|
|
(f1-41 none)
|
|
(f1-42 none)
|
|
(f1-43 none)
|
|
(f1-44 none)
|
|
(f1-45 none)
|
|
(f1-46 none)
|
|
(f1-47 none)
|
|
)
|
|
(when (begin (set! v1-0 *artist-fix-visible*) (not v1-0))
|
|
(set! s5-0 0)
|
|
(while (begin (set! v1-6 *level*) (set! v1-7 (-> v1-6 length)) (<.si s5-0 v1-7))
|
|
(when (begin
|
|
(set! v1-2 5232)
|
|
(set! v1-3 (*.si v1-2 s5-0))
|
|
(set! v1-4 (+ v1-3 256))
|
|
(set! a0-1 *level*)
|
|
(set! v1-5 (+ v1-4 a0-1))
|
|
(set! a0-2 'active)
|
|
(set! a1-0 (-> v1-5 status))
|
|
(= a1-0 a0-2)
|
|
)
|
|
(when (begin
|
|
(and (begin (set! a0-4 (-> v1-5 bsp)) (set! a0-5 (-> a0-4 nodes)) (nonzero? a0-5))
|
|
(or (begin (set! a0-7 *update-leaf-when-outside-bsp*) a0-7) (set! a0-6 (-> v1-5 inside-boxes)))
|
|
)
|
|
a0-6
|
|
)
|
|
(set! t9-0 bsp-camera-asm)
|
|
(set! a0-9 (-> v1-5 bsp))
|
|
(set! a1-1 (-> a0-0 trans))
|
|
(call! a0-9 a1-1)
|
|
(set! a0-10 v0-0)
|
|
)
|
|
)
|
|
(set! s5-0 (+ s5-0 1))
|
|
)
|
|
(set! gp-1 0)
|
|
(while (begin (set! v1-52 *level*) (set! v1-53 (-> v1-52 length)) (<.si gp-1 v1-53))
|
|
(when (begin
|
|
(set! v1-10 5232)
|
|
(set! v1-11 (*.si v1-10 gp-1))
|
|
(set! v1-12 (+ v1-11 256))
|
|
(set! a0-11 *level*)
|
|
(set! s5-1 (+ v1-12 a0-11))
|
|
(set! v1-13 'active)
|
|
(set! a0-12 (-> s5-1 status))
|
|
(= a0-12 v1-13)
|
|
)
|
|
(cond
|
|
((begin
|
|
(or (begin
|
|
(if (begin
|
|
(set! v1-15 (-> s5-1 bsp))
|
|
(set! v1-16 (-> v1-15 visible-list-length))
|
|
(set! v1-17 (+ v1-16 15))
|
|
(set! a2-0 (sra v1-17 4))
|
|
(set! v1-18 (-> s5-1 all-visible?))
|
|
v1-18
|
|
)
|
|
(set! v1-19 (-> s5-1 all-visible?))
|
|
(set! v1-19 #t)
|
|
)
|
|
(set! (-> s5-1 all-visible?) v1-19)
|
|
(set! v1-20 (-> s5-1 force-all-visible?))
|
|
(not v1-20)
|
|
)
|
|
(set! v1-21 (-> s5-1 inside-boxes))
|
|
)
|
|
v1-21
|
|
)
|
|
(cond
|
|
((begin
|
|
(or (begin (set! v1-22 *artist-all-visible*) v1-22)
|
|
(begin (set! v1-24 (-> s5-1 vis-info 0)) (set! v1-23 (not v1-24)))
|
|
)
|
|
v1-23
|
|
)
|
|
(when (begin
|
|
(set! t9-1 quad-copy!)
|
|
(set! a0-13 (-> s5-1 vis-bits))
|
|
(set! v1-25 (-> s5-1 bsp))
|
|
(set! a1-2 (-> v1-25 all-visible-list))
|
|
(call! a0-13 a1-2 a2-0)
|
|
(set! v1-26 'loading)
|
|
(set! a0-14 (-> s5-1 all-visible?))
|
|
(= a0-14 v1-26)
|
|
)
|
|
(set! v1-28 #t)
|
|
(set! (-> s5-1 all-visible?) v1-28)
|
|
)
|
|
)
|
|
((begin
|
|
(when (begin
|
|
(and (begin
|
|
(set! v1-29 (-> s5-1 vis-self-index))
|
|
(set! v1-30 (sll v1-29 2))
|
|
(set! v1-31 (+ v1-30 s5-1))
|
|
(set! s4-0 (dynamic-array-field-access v1-31 vis-info PLACEHOLDER))
|
|
(set! v1-32 #f)
|
|
s4-0
|
|
)
|
|
(set! a0-15 (-> s4-0 from-bsp))
|
|
)
|
|
a0-15
|
|
)
|
|
(when (begin
|
|
(set! v1-33 #t)
|
|
(set! a0-17 #x8000)
|
|
(set! a0-18 (sll a0-17 16))
|
|
(set! a1-3 (-> s4-0 flags))
|
|
(set! a0-19 (logand a0-18 a1-3))
|
|
(cmove-#f-zero v1-32 a0-19 v1-33)
|
|
(set! a0-20 (-> s4-0 length))
|
|
(set! a1-4 (-> s4-0 from-bsp))
|
|
(set! a1-5 (-> a1-4 current-leaf-idx))
|
|
(<.ui a0-20 a1-5)
|
|
)
|
|
(set! v1-32 #f)
|
|
(set! a0-22 v1-32)
|
|
)
|
|
)
|
|
v1-32
|
|
)
|
|
(when (begin
|
|
(if (begin (set! v1-34 'loading) (set! a0-23 (-> s5-1 all-visible?)) (!= a0-23 v1-34))
|
|
(set! (-> s5-1 all-visible?) #f)
|
|
)
|
|
(set! a0-24 s5-1)
|
|
(set! v1-37 (-> a0-24 type))
|
|
(set! t9-2 (method-of-type v1-37 level-method-16))
|
|
(set! a1-6 s4-0)
|
|
(set! a2-1 (-> s4-0 ramdisk))
|
|
(set! a3-0 (-> s4-0 string-block))
|
|
(set! v0-2 (call!))
|
|
(set! v1-38 v0-2)
|
|
v1-38
|
|
)
|
|
(set! v1-40 8)
|
|
(while (nonzero? v1-40)
|
|
(when (begin
|
|
(set! v1-40 (+ v1-40 -1))
|
|
(set! a0-25 (sll v1-40 2))
|
|
(set! a0-26 (+ a0-25 s5-1))
|
|
(set! a0-27 (dynamic-array-field-access a0-26 vis-info PLACEHOLDER))
|
|
a0-27
|
|
)
|
|
(when (!= a0-27 s4-0)
|
|
(set! a1-9 -1)
|
|
(set! (-> a0-27 current-vis-string) (the-as uint a1-9))
|
|
)
|
|
)
|
|
)
|
|
(set! (-> s5-1 all-visible?) #f)
|
|
)
|
|
)
|
|
(else
|
|
(and (begin (set! v1-44 (-> s5-1 all-visible?)) (set! a0-28 'loading) (set! a0-29 (= v1-44 a0-28)) a0-29)
|
|
(begin (set! v1-46 *level*) (set! v1-45 (-> v1-46 play?)))
|
|
)
|
|
(cond
|
|
(v1-45
|
|
)
|
|
(else
|
|
(set! t9-3 quad-copy!)
|
|
(set! a0-30 (-> s5-1 vis-bits))
|
|
(set! v1-48 (-> s5-1 bsp))
|
|
(set! a1-10 (-> v1-48 all-visible-list))
|
|
(call! a0-30 a1-10 a2-0)
|
|
(set! v1-49 v0-3)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(else
|
|
(set! t9-4 quad-copy!)
|
|
(set! a0-31 (-> s5-1 vis-bits))
|
|
(set! v1-50 (-> s5-1 bsp))
|
|
(set! a1-11 (-> v1-50 all-visible-list))
|
|
(call! a0-31 a1-11 a2-0)
|
|
(set! v1-51 v0-4)
|
|
)
|
|
)
|
|
)
|
|
(set! gp-1 (+ gp-1 1))
|
|
)
|
|
)
|
|
(when (begin
|
|
(and (begin (set! v1-56 *artist-fix-visible*) v1-56) (begin
|
|
(set! v1-58 #t)
|
|
(set! a0-32 *cpad-list*)
|
|
(set! a0-33 (-> a0-32 cpads 0))
|
|
(set! a0-34 (-> a0-33 button0-rel 0))
|
|
(set! a0-35 (logand a0-34 512))
|
|
(cmove-#f-zero v1-57 a0-35 v1-58)
|
|
)
|
|
)
|
|
v1-57
|
|
)
|
|
(set! v1-60 *fix-visible-level-mask*)
|
|
(set! v1-61 (+ v1-60 1))
|
|
(set! v1-62 (logand v1-61 63))
|
|
(set! *fix-visible-level-mask* v1-62)
|
|
)
|
|
(set! gp-2 0)
|
|
(while (begin (set! v1-115 *level*) (set! v1-116 (-> v1-115 length)) (<.si gp-2 v1-116))
|
|
(when (begin
|
|
(set! v1-63 5232)
|
|
(set! v1-64 (*.si v1-63 gp-2))
|
|
(set! v1-65 (+ v1-64 256))
|
|
(set! a0-36 *level*)
|
|
(set! s5-2 (+ v1-65 a0-36))
|
|
(set! v1-66 'active)
|
|
(set! a0-37 (-> s5-2 status))
|
|
(= a0-37 v1-66)
|
|
)
|
|
(when (begin
|
|
(cond
|
|
((begin (or (begin (set! v1-68 *artist-fix-visible*) v1-68) (set! v1-69 *stats-bsp*)) v1-69)
|
|
(set! v1-70 #t)
|
|
(set! a0-38 *fix-visible-level-mask*)
|
|
(set! a1-12 1)
|
|
(set! a2-2 (-> s5-2 index))
|
|
(set! a1-13 (ash.si a1-12 a2-2))
|
|
(set! a0-39 (logand a0-38 a1-13))
|
|
(cmove-#f-nonzero v1-71 a0-39 v1-70)
|
|
(set! (-> s5-2 render?) v1-71)
|
|
(set! t9-5 format)
|
|
(set! a0-40 *stdcon*)
|
|
(set! a1-14 L105)
|
|
(set! a2-4 (-> s5-2 name))
|
|
(set! v1-72 *fix-visible-level-mask*)
|
|
(set! a3-1 1)
|
|
(set! t0-0 (-> s5-2 index))
|
|
(set! a3-2 (ash.si a3-1 t0-0))
|
|
(if (begin (set! v1-73 (logand v1-72 a3-2)) (zero? v1-73))
|
|
(set! a3-3 88)
|
|
(set! a3-3 (the-as int 32))
|
|
)
|
|
(if (begin
|
|
(set! v1-74 (-> s5-2 bsp))
|
|
(set! t0-2 (-> v1-74 current-leaf-idx))
|
|
(set! v1-75 (-> s5-2 bsp))
|
|
(set! t1-0 (-> v1-75 cam-box-idx))
|
|
(set! v1-76 (-> s5-2 bsp))
|
|
(set! v1-77 (-> v1-76 cam-using-back))
|
|
(zero? v1-77)
|
|
)
|
|
(set! t2-0 L104)
|
|
(set! t2-0 (the-as string L103))
|
|
)
|
|
(if (begin (set! v1-78 (-> s5-2 bsp)) (set! v1-79 (-> v1-78 cam-outside-bsp)) (nonzero? v1-79))
|
|
(set! t3-0 L102)
|
|
(set! t3-0 (the-as string L101))
|
|
)
|
|
(call! a0-40 a1-14 a2-4 a3-3 t0-2 t1-0 t2-0 t3-0)
|
|
(set! v1-80 v0-5)
|
|
)
|
|
(else
|
|
(set! v1-81 (the-as none #t))
|
|
(set! (-> s5-2 render?) (the-as symbol v1-81))
|
|
)
|
|
)
|
|
(and (begin (set! v1-82 *artist-fix-visible*) v1-82) (begin
|
|
(set! v1-84 #t)
|
|
(set! a0-41 *fix-visible-level-mask*)
|
|
(set! a1-15 1)
|
|
(set! a2-5 (-> s5-2 index))
|
|
(set! a1-16 (ash.si a1-15 a2-5))
|
|
(set! a0-42 (logand a0-41 a1-16))
|
|
(cmove-#f-nonzero v1-83 a0-42 v1-84)
|
|
)
|
|
)
|
|
v1-83
|
|
)
|
|
(when (begin
|
|
(set! v1-86 (-> s5-2 bsp))
|
|
(set! s4-1 (-> v1-86 current-leaf-idx))
|
|
(set! v1-87 (-> s5-2 bsp))
|
|
(set! s3-0 (-> v1-87 unk-data 9))
|
|
(set! v1-88 (-> s5-2 bsp))
|
|
(set! v1-89 (-> v1-88 unk-data 17))
|
|
(nonzero? s3-0)
|
|
)
|
|
(set! s2-0 0)
|
|
(while (begin (set! v1-99 (the-as none (l.w s3-0))) (<.si s2-0 v1-99))
|
|
(when (begin
|
|
(set! v1-91 (the-as none (sll s2-0 4)))
|
|
(set! v1-92 (the-as none (+ s3-0 v1-91)))
|
|
(set! f0-0 (the-as none (l.f (+ v1-92 24))))
|
|
(set! f0-1 (the-as none (f2i f0-0)))
|
|
(set! v1-93 (the-as none (fpr->gpr f0-1)))
|
|
(set! a0-43 (the-as none v1-93))
|
|
(set! a0-43 (the-as none (abs a0-43)))
|
|
(= a0-43 s4-1)
|
|
)
|
|
(cond
|
|
((>=0.si v1-93)
|
|
(set! t9-6 (the-as none add-debug-sphere))
|
|
(set! a0-45 (the-as none #t))
|
|
(set! a1-17 (the-as none 324))
|
|
(set! v1-94 (the-as none (sll s2-0 4)))
|
|
(set! v1-95 (the-as none (+ v1-94 12)))
|
|
(set! a2-7 (the-as none (+ v1-95 s3-0)))
|
|
(set! a3-4 (the-as none #x45800000))
|
|
(set! v1-96 (the-as none #x80ff))
|
|
(set! t0-3 (the-as none (sll v1-96 16)))
|
|
(call!)
|
|
(set! a0-46 (the-as none v0-6))
|
|
)
|
|
(else
|
|
(set! t9-7 (the-as none add-debug-sphere))
|
|
(set! a0-47 (the-as none #t))
|
|
(set! a1-18 (the-as none 324))
|
|
(set! v1-97 (the-as none (sll s2-0 4)))
|
|
(set! v1-98 (the-as none (+ v1-97 12)))
|
|
(set! a2-8 (the-as none (+ v1-98 s3-0)))
|
|
(set! a3-5 (the-as none #x45800000))
|
|
(set! t0-4 (the-as none (the-as uint #x800000ff)))
|
|
(call!)
|
|
(set! a0-48 (the-as none v0-7))
|
|
)
|
|
)
|
|
)
|
|
(set! s2-0 (the-as int (+ s2-0 1)))
|
|
)
|
|
)
|
|
(when (begin
|
|
(set! v1-102 (the-as none (-> s5-2 bsp)))
|
|
(set! v1-103 (the-as none (l.wu (+ v1-102 116))))
|
|
(nonzero? v1-103)
|
|
)
|
|
(cond
|
|
((begin
|
|
(set! v1-105 (the-as none (l.wu (+ s5-2 92))))
|
|
(set! v1-106 (the-as none (l.wu (+ v1-105 116))))
|
|
(set! a0-49 (the-as none 20))
|
|
(set! a1-19 (the-as none (l.wu (+ s5-2 92))))
|
|
(set! a1-20 (the-as none (l.hu (+ a1-19 150))))
|
|
(set! a0-50 (the-as none (*.ui a0-49 a1-20)))
|
|
(set! v1-107 (the-as none (+ v1-106 a0-50)))
|
|
(set! a2-9 (the-as none (+ sp-0 16)))
|
|
(set! a0-51 (the-as none (l.wu (+ s5-2 92))))
|
|
(set! a0-52 (the-as none (+ a0-51 300)))
|
|
(set! a0-53 (the-as none (l.q a0-52)))
|
|
(s.q! a2-9 a0-53)
|
|
(set! a3-6 (the-as none (+ sp-0 32)))
|
|
(set! a0-54 (the-as none (l.wu (+ s5-2 92))))
|
|
(set! a0-55 (the-as none (+ a0-54 300)))
|
|
(set! a0-56 (the-as none (l.q a0-55)))
|
|
(s.q! a3-6 a0-56)
|
|
(set! a0-57 (the-as none (l.wu (+ s5-2 92))))
|
|
(set! a0-58 (the-as none (l.bu (+ a0-57 149))))
|
|
(zero? a0-58)
|
|
)
|
|
(set! f0-2 (the-as none (l.f a2-9)))
|
|
(set! a0-59 (the-as none (l.b (+ v1-107 4))))
|
|
(set! a1-21 (the-as none (l.wu (+ s5-2 92))))
|
|
(set! f1-0 (the-as none (l.f (+ a1-21 284))))
|
|
(set! f1-1 (the-as none (f2i f1-0)))
|
|
(set! a1-22 (the-as none (fpr->gpr f1-1)))
|
|
(set! a0-60 (the-as none (*.si a0-59 a1-22)))
|
|
(set! f1-2 (the-as none (gpr->fpr a0-60)))
|
|
(set! f1-3 (the-as none (i2f f1-2)))
|
|
(set! f0-3 (the-as none (+.s f0-2 f1-3)))
|
|
(s.f! a2-9 f0-3)
|
|
(set! f0-4 (the-as none (l.f (+ a2-9 4))))
|
|
(set! a0-61 (the-as none (l.b (+ v1-107 5))))
|
|
(set! a1-23 (the-as none (l.wu (+ s5-2 92))))
|
|
(set! f1-4 (the-as none (l.f (+ a1-23 288))))
|
|
(set! f1-5 (the-as none (f2i f1-4)))
|
|
(set! a1-24 (the-as none (fpr->gpr f1-5)))
|
|
(set! a0-62 (the-as none (*.si a0-61 a1-24)))
|
|
(set! f1-6 (the-as none (gpr->fpr a0-62)))
|
|
(set! f1-7 (the-as none (i2f f1-6)))
|
|
(set! f0-5 (the-as none (+.s f0-4 f1-7)))
|
|
(s.f! (+ a2-9 4) f0-5)
|
|
(set! f0-6 (the-as none (l.f (+ a2-9 8))))
|
|
(set! a0-63 (the-as none (l.b (+ v1-107 6))))
|
|
(set! a1-25 (the-as none (l.wu (+ s5-2 92))))
|
|
(set! f1-8 (the-as none (l.f (+ a1-25 292))))
|
|
(set! f1-9 (the-as none (f2i f1-8)))
|
|
(set! a1-26 (the-as none (fpr->gpr f1-9)))
|
|
(set! a0-64 (the-as none (*.si a0-63 a1-26)))
|
|
(set! f1-10 (the-as none (gpr->fpr a0-64)))
|
|
(set! f1-11 (the-as none (i2f f1-10)))
|
|
(set! f0-7 (the-as none (+.s f0-6 f1-11)))
|
|
(s.f! (+ a2-9 8) f0-7)
|
|
(set! f0-8 (the-as none (l.f a3-6)))
|
|
(set! a0-65 (the-as none (l.b (+ v1-107 8))))
|
|
(set! a1-27 (the-as none (l.wu (+ s5-2 92))))
|
|
(set! f1-12 (the-as none (l.f (+ a1-27 284))))
|
|
(set! f1-13 (the-as none (f2i f1-12)))
|
|
(set! a1-28 (the-as none (fpr->gpr f1-13)))
|
|
(set! a0-66 (the-as none (*.si a0-65 a1-28)))
|
|
(set! f1-14 (the-as none (gpr->fpr a0-66)))
|
|
(set! f1-15 (the-as none (i2f f1-14)))
|
|
(set! f0-9 (the-as none (+.s f0-8 f1-15)))
|
|
(s.f! a3-6 f0-9)
|
|
(set! f0-10 (the-as none (l.f (+ a3-6 4))))
|
|
(set! a0-67 (the-as none (l.b (+ v1-107 9))))
|
|
(set! a1-29 (the-as none (l.wu (+ s5-2 92))))
|
|
(set! f1-16 (the-as none (l.f (+ a1-29 288))))
|
|
(set! f1-17 (the-as none (f2i f1-16)))
|
|
(set! a1-30 (the-as none (fpr->gpr f1-17)))
|
|
(set! a0-68 (the-as none (*.si a0-67 a1-30)))
|
|
(set! f1-18 (the-as none (gpr->fpr a0-68)))
|
|
(set! f1-19 (the-as none (i2f f1-18)))
|
|
(set! f0-11 (the-as none (+.s f0-10 f1-19)))
|
|
(s.f! (+ a3-6 4) f0-11)
|
|
(set! f0-12 (the-as none (l.f (+ a3-6 8))))
|
|
(set! v1-108 (the-as none (l.b (+ v1-107 10))))
|
|
(set! a0-69 (the-as none (l.wu (+ s5-2 92))))
|
|
(set! f1-20 (the-as none (l.f (+ a0-69 292))))
|
|
(set! f1-21 (the-as none (f2i f1-20)))
|
|
(set! a0-70 (the-as none (fpr->gpr f1-21)))
|
|
(set! v1-109 (the-as none (*.si v1-108 a0-70)))
|
|
(set! f1-22 (the-as none (gpr->fpr v1-109)))
|
|
(set! f1-23 (the-as none (i2f f1-22)))
|
|
(set! f0-13 (the-as none (+.s f0-12 f1-23)))
|
|
(s.f! (+ a3-6 8) f0-13)
|
|
(set! v1-110 (the-as none (fpr->gpr f0-13)))
|
|
)
|
|
(else
|
|
(set! f0-14 (the-as none (l.f a2-9)))
|
|
(set! a0-71 (the-as none (l.b (+ v1-107 12))))
|
|
(set! a1-31 (the-as none (l.wu (+ s5-2 92))))
|
|
(set! f1-24 (the-as none (l.f (+ a1-31 284))))
|
|
(set! f1-25 (the-as none (f2i f1-24)))
|
|
(set! a1-32 (the-as none (fpr->gpr f1-25)))
|
|
(set! a0-72 (the-as none (*.si a0-71 a1-32)))
|
|
(set! f1-26 (the-as none (gpr->fpr a0-72)))
|
|
(set! f1-27 (the-as none (i2f f1-26)))
|
|
(set! f0-15 (the-as none (+.s f0-14 f1-27)))
|
|
(s.f! a2-9 f0-15)
|
|
(set! f0-16 (the-as none (l.f (+ a2-9 4))))
|
|
(set! a0-73 (the-as none (l.b (+ v1-107 13))))
|
|
(set! a1-33 (the-as none (l.wu (+ s5-2 92))))
|
|
(set! f1-28 (the-as none (l.f (+ a1-33 288))))
|
|
(set! f1-29 (the-as none (f2i f1-28)))
|
|
(set! a1-34 (the-as none (fpr->gpr f1-29)))
|
|
(set! a0-74 (the-as none (*.si a0-73 a1-34)))
|
|
(set! f1-30 (the-as none (gpr->fpr a0-74)))
|
|
(set! f1-31 (the-as none (i2f f1-30)))
|
|
(set! f0-17 (the-as none (+.s f0-16 f1-31)))
|
|
(s.f! (+ a2-9 4) f0-17)
|
|
(set! f0-18 (the-as none (l.f (+ a2-9 8))))
|
|
(set! a0-75 (the-as none (l.b (+ v1-107 14))))
|
|
(set! a1-35 (the-as none (l.wu (+ s5-2 92))))
|
|
(set! f1-32 (the-as none (l.f (+ a1-35 292))))
|
|
(set! f1-33 (the-as none (f2i f1-32)))
|
|
(set! a1-36 (the-as none (fpr->gpr f1-33)))
|
|
(set! a0-76 (the-as none (*.si a0-75 a1-36)))
|
|
(set! f1-34 (the-as none (gpr->fpr a0-76)))
|
|
(set! f1-35 (the-as none (i2f f1-34)))
|
|
(set! f0-19 (the-as none (+.s f0-18 f1-35)))
|
|
(s.f! (+ a2-9 8) f0-19)
|
|
(set! f0-20 (the-as none (l.f a3-6)))
|
|
(set! a0-77 (the-as none (l.b (+ v1-107 16))))
|
|
(set! a1-37 (the-as none (l.wu (+ s5-2 92))))
|
|
(set! f1-36 (the-as none (l.f (+ a1-37 284))))
|
|
(set! f1-37 (the-as none (f2i f1-36)))
|
|
(set! a1-38 (the-as none (fpr->gpr f1-37)))
|
|
(set! a0-78 (the-as none (*.si a0-77 a1-38)))
|
|
(set! f1-38 (the-as none (gpr->fpr a0-78)))
|
|
(set! f1-39 (the-as none (i2f f1-38)))
|
|
(set! f0-21 (the-as none (+.s f0-20 f1-39)))
|
|
(s.f! a3-6 f0-21)
|
|
(set! f0-22 (the-as none (l.f (+ a3-6 4))))
|
|
(set! a0-79 (the-as none (l.b (+ v1-107 17))))
|
|
(set! a1-39 (the-as none (l.wu (+ s5-2 92))))
|
|
(set! f1-40 (the-as none (l.f (+ a1-39 288))))
|
|
(set! f1-41 (the-as none (f2i f1-40)))
|
|
(set! a1-40 (the-as none (fpr->gpr f1-41)))
|
|
(set! a0-80 (the-as none (*.si a0-79 a1-40)))
|
|
(set! f1-42 (the-as none (gpr->fpr a0-80)))
|
|
(set! f1-43 (the-as none (i2f f1-42)))
|
|
(set! f0-23 (the-as none (+.s f0-22 f1-43)))
|
|
(s.f! (+ a3-6 4) f0-23)
|
|
(set! f0-24 (the-as none (l.f (+ a3-6 8))))
|
|
(set! v1-111 (the-as none (l.b (+ v1-107 18))))
|
|
(set! a0-81 (the-as none (l.wu (+ s5-2 92))))
|
|
(set! f1-44 (the-as none (l.f (+ a0-81 292))))
|
|
(set! f1-45 (the-as none (f2i f1-44)))
|
|
(set! a0-82 (the-as none (fpr->gpr f1-45)))
|
|
(set! v1-112 (the-as none (*.si v1-111 a0-82)))
|
|
(set! f1-46 (the-as none (gpr->fpr v1-112)))
|
|
(set! f1-47 (the-as none (i2f f1-46)))
|
|
(set! f0-25 (the-as none (+.s f0-24 f1-47)))
|
|
(s.f! (+ a3-6 8) f0-25)
|
|
(set! v1-113 (the-as none (fpr->gpr f0-25)))
|
|
)
|
|
)
|
|
(set! t9-8 (the-as none add-debug-box))
|
|
(set! a0-83 (the-as none #t))
|
|
(set! a1-41 (the-as none 324))
|
|
(set! t0-5 (the-as none (the-as uint #x80ffff00)))
|
|
(call!)
|
|
(set! v1-114 (the-as none v0-8))
|
|
)
|
|
)
|
|
)
|
|
(set! gp-2 (the-as int (+ gp-2 1)))
|
|
)
|
|
(set! v0-9 #f)
|
|
(ret-value v0-9)
|
|
)
|
|
|
|
;; definition for symbol *save-camera-inv-rot*, type matrix
|
|
(define *save-camera-inv-rot* (new 'global 'matrix))
|
|
|
|
;; failed to figure out what this is:
|
|
(matrix-identity! *save-camera-inv-rot*)
|
|
|
|
;; definition for function move-camera-from-pad
|
|
;; INFO: Used lq/sq
|
|
(defun move-camera-from-pad ((arg0 math-camera))
|
|
(let ((v1-0 *external-cam-mode*)
|
|
(s5-0 0)
|
|
)
|
|
(cond
|
|
((= v1-0 'locked)
|
|
(set! v1-0 #f)
|
|
)
|
|
((= v1-0 'pad-1)
|
|
(set! s5-0 1)
|
|
)
|
|
((not *camera-combiner*)
|
|
(set! v1-0 'pad-0)
|
|
)
|
|
)
|
|
(when v1-0
|
|
(let ((a2-1
|
|
(vector-negate-in-place! (vector-normalize-copy! (new-stack-vector0) (-> *standard-dynamics* gravity) 1.0))
|
|
)
|
|
)
|
|
(if (= (vector-length a2-1) 0.0)
|
|
(set! (-> a2-1 y) -1.0)
|
|
)
|
|
(if (logtest? *external-cam-options* (external-cam-option allow-z))
|
|
(set! a2-1 (the-as vector #f))
|
|
)
|
|
(cam-free-floating-move *save-camera-inv-rot* (-> arg0 trans) a2-1 s5-0)
|
|
)
|
|
)
|
|
)
|
|
(let* ((a2-2 (-> *math-camera* inv-camera-rot))
|
|
(a3-1 *save-camera-inv-rot*)
|
|
(v1-14 (-> a3-1 vector 0 quad))
|
|
(a0-13 (-> a3-1 vector 1 quad))
|
|
(a1-2 (-> a3-1 vector 2 quad))
|
|
(a3-2 (-> a3-1 trans quad))
|
|
)
|
|
(set! (-> a2-2 vector 0 quad) v1-14)
|
|
(set! (-> a2-2 vector 1 quad) a0-13)
|
|
(set! (-> a2-2 vector 2 quad) a1-2)
|
|
(set! (-> a2-2 trans quad) a3-2)
|
|
)
|
|
arg0
|
|
)
|
|
|
|
;; definition for function external-cam-reset!
|
|
;; INFO: Used lq/sq
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defun external-cam-reset! ()
|
|
(when (not (movie?))
|
|
(vector-reset! (-> *math-camera* trans))
|
|
(matrix-identity! (-> *math-camera* inv-camera-rot))
|
|
(when *camera-combiner*
|
|
(let* ((v1-7 (-> *math-camera* inv-camera-rot))
|
|
(a3-0 (-> *camera-combiner* inv-camera-rot))
|
|
(a0-2 (-> a3-0 vector 0 quad))
|
|
(a1-0 (-> a3-0 vector 1 quad))
|
|
(a2-0 (-> a3-0 vector 2 quad))
|
|
(a3-1 (-> a3-0 trans quad))
|
|
)
|
|
(set! (-> v1-7 vector 0 quad) a0-2)
|
|
(set! (-> v1-7 vector 1 quad) a1-0)
|
|
(set! (-> v1-7 vector 2 quad) a2-0)
|
|
(set! (-> v1-7 trans quad) a3-1)
|
|
)
|
|
(set! (-> *math-camera* trans quad) (-> *camera-combiner* trans quad))
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for symbol *start-timer*, type int
|
|
(define *start-timer* (the-as int #f))
|
|
|
|
;; definition for symbol *timer-value*, type int
|
|
(define *timer-value* 0)
|
|
|
|
;; definition for symbol *start-pos*, type vector
|
|
(define *start-pos* (new 'global 'vector))
|
|
|
|
;; definition for function update-camera
|
|
;; INFO: Used lq/sq
|
|
(defun update-camera ()
|
|
(with-pp
|
|
(let ((gp-0 *math-camera*))
|
|
(let* ((a2-0 (-> gp-0 prev-inv-camera-rot))
|
|
(a3-0 (-> gp-0 inv-camera-rot))
|
|
(v1-0 (-> a3-0 vector 0 quad))
|
|
(a0-0 (-> a3-0 vector 1 quad))
|
|
(a1-0 (-> a3-0 vector 2 quad))
|
|
(a3-1 (-> a3-0 trans quad))
|
|
)
|
|
(set! (-> a2-0 vector 0 quad) v1-0)
|
|
(set! (-> a2-0 vector 1 quad) a0-0)
|
|
(set! (-> a2-0 vector 2 quad) a1-0)
|
|
(set! (-> a2-0 trans quad) a3-1)
|
|
)
|
|
(set! (-> gp-0 prev-trans quad) (-> gp-0 trans quad))
|
|
(when *start-timer*
|
|
(when (= *timer-value* 180)
|
|
(format
|
|
#t
|
|
"Player pos = ~F ~F ~F~%"
|
|
(-> *target* control trans x)
|
|
(-> *target* control trans y)
|
|
(-> *target* control trans z)
|
|
)
|
|
(set! (-> *start-pos* quad) (-> *target* control trans quad))
|
|
)
|
|
(when (= *timer-value* 480)
|
|
(format
|
|
#t
|
|
"Player pos = ~F ~F ~F~%"
|
|
(-> *target* control trans x)
|
|
(-> *target* control trans y)
|
|
(-> *target* control trans z)
|
|
)
|
|
(format
|
|
#t
|
|
"Dist = ~F~%"
|
|
(* 0.00024414062 (vector-vector-xz-distance (-> *target* control trans) *start-pos*))
|
|
)
|
|
(set! *start-timer* (the-as int #f))
|
|
)
|
|
(if (< 179 *timer-value*)
|
|
(format *stdcon* "~%~%Time = ~D~%" *timer-value*)
|
|
)
|
|
(set! *timer-value* (+ *timer-value* 1))
|
|
)
|
|
(when (not *start-timer*)
|
|
(set! *timer-value* 0)
|
|
0
|
|
)
|
|
(let ((f0-9 (if (-> *blit-displays-work* menu-mode)
|
|
11650.845
|
|
(-> gp-0 fov)
|
|
)
|
|
)
|
|
)
|
|
(update-math-camera
|
|
gp-0
|
|
(-> *setting-control* user-current video-mode)
|
|
(-> *setting-control* user-current aspect-ratio)
|
|
f0-9
|
|
)
|
|
)
|
|
(cond
|
|
((or (= *master-mode* 'pause) (or (= *master-mode* 'freeze) (= *master-mode* 'progress) *progress-process*))
|
|
)
|
|
((>= *camera-look-through-other* 2)
|
|
(set! *camera-look-through-other* 1)
|
|
)
|
|
((and (= *camera-look-through-other* 1) (!= *master-mode* 'menu))
|
|
(set! *camera-look-through-other* 0)
|
|
0
|
|
)
|
|
)
|
|
0.0
|
|
(let ((s5-1 (-> pp clock)))
|
|
(set! (-> pp clock) (-> *display* camera-clock))
|
|
(update! *camera-smush-control*)
|
|
(let ((f0-11 (get-no-update *camera-smush-control*)))
|
|
f0-11
|
|
(set! (-> pp clock) s5-1)
|
|
(cond
|
|
(*external-cam-mode*
|
|
(move-camera-from-pad gp-0)
|
|
)
|
|
((nonzero? *camera-look-through-other*)
|
|
(set! (-> gp-0 fov) (-> *camera-other-fov* data))
|
|
(set! (-> gp-0 trans quad) (-> *camera-other-trans* quad))
|
|
(+! (-> gp-0 trans y) f0-11)
|
|
(let* ((a2-6 (-> gp-0 inv-camera-rot))
|
|
(a3-5 *camera-other-matrix*)
|
|
(v1-68 (-> a3-5 vector 0 quad))
|
|
(a0-29 (-> a3-5 vector 1 quad))
|
|
(a1-7 (-> a3-5 vector 2 quad))
|
|
(a3-6 (-> a3-5 trans quad))
|
|
)
|
|
(set! (-> a2-6 vector 0 quad) v1-68)
|
|
(set! (-> a2-6 vector 1 quad) a0-29)
|
|
(set! (-> a2-6 vector 2 quad) a1-7)
|
|
(set! (-> a2-6 trans quad) a3-6)
|
|
)
|
|
(let* ((v1-69 *save-camera-inv-rot*)
|
|
(a3-7 *camera-other-matrix*)
|
|
(a0-30 (-> a3-7 vector 0 quad))
|
|
(a1-8 (-> a3-7 vector 1 quad))
|
|
(a2-7 (-> a3-7 vector 2 quad))
|
|
(a3-8 (-> a3-7 trans quad))
|
|
)
|
|
(set! (-> v1-69 vector 0 quad) a0-30)
|
|
(set! (-> v1-69 vector 1 quad) a1-8)
|
|
(set! (-> v1-69 vector 2 quad) a2-7)
|
|
(set! (-> v1-69 trans quad) a3-8)
|
|
)
|
|
)
|
|
((and *camera-combiner* (not *external-cam-mode*))
|
|
(set! (-> gp-0 fov) (-> *camera-combiner* fov))
|
|
(set! (-> gp-0 trans quad) (-> *camera-combiner* trans quad))
|
|
(+! (-> gp-0 trans y) f0-11)
|
|
(let* ((v1-76 (-> gp-0 inv-camera-rot))
|
|
(a3-9 (-> *camera-combiner* inv-camera-rot))
|
|
(a0-35 (-> a3-9 vector 0 quad))
|
|
(a1-9 (-> a3-9 vector 1 quad))
|
|
(a2-8 (-> a3-9 vector 2 quad))
|
|
(a3-10 (-> a3-9 trans quad))
|
|
)
|
|
(set! (-> v1-76 vector 0 quad) a0-35)
|
|
(set! (-> v1-76 vector 1 quad) a1-9)
|
|
(set! (-> v1-76 vector 2 quad) a2-8)
|
|
(set! (-> v1-76 trans quad) a3-10)
|
|
)
|
|
(let* ((v1-77 *save-camera-inv-rot*)
|
|
(a3-11 (-> *camera-combiner* inv-camera-rot))
|
|
(a0-37 (-> a3-11 vector 0 quad))
|
|
(a1-10 (-> a3-11 vector 1 quad))
|
|
(a2-9 (-> a3-11 vector 2 quad))
|
|
(a3-12 (-> a3-11 trans quad))
|
|
)
|
|
(set! (-> v1-77 vector 0 quad) a0-37)
|
|
(set! (-> v1-77 vector 1 quad) a1-10)
|
|
(set! (-> v1-77 vector 2 quad) a2-9)
|
|
(set! (-> v1-77 trans quad) a3-12)
|
|
)
|
|
)
|
|
(*camera*
|
|
(move-camera-from-pad gp-0)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(matrix-transpose! (-> gp-0 camera-rot) (-> gp-0 inv-camera-rot))
|
|
(cond
|
|
(*camera-no-mip-correction*
|
|
(set! (-> gp-0 fov-correction-factor) 1.0)
|
|
)
|
|
(else
|
|
(let ((f0-16 (fmin 11650.845 (-> gp-0 fov))))
|
|
(set! (-> gp-0 fov-correction-factor) (* 0.00008583069 f0-16))
|
|
)
|
|
)
|
|
)
|
|
(if (< 0.0 (-> gp-0 smooth-t))
|
|
(set! (-> gp-0 smooth-t) (- (-> gp-0 smooth-t) (-> gp-0 smooth-step)))
|
|
)
|
|
(cond
|
|
((< 0.0 (-> gp-0 smooth-t))
|
|
(let ((s5-2 (new-stack-quaternion0)))
|
|
(matrix->quaternion s5-2 (-> gp-0 inv-camera-rot))
|
|
(quaternion-slerp! s5-2 s5-2 (-> gp-0 inv-camera-rot-smooth-from) (-> gp-0 smooth-t))
|
|
(quaternion->matrix (-> gp-0 inv-camera-rot-smooth) s5-2)
|
|
)
|
|
)
|
|
(else
|
|
(let* ((a2-11 (-> gp-0 inv-camera-rot-smooth))
|
|
(a3-14 (-> gp-0 inv-camera-rot))
|
|
(v1-90 (-> a3-14 vector 0 quad))
|
|
(a0-43 (-> a3-14 vector 1 quad))
|
|
(a1-15 (-> a3-14 vector 2 quad))
|
|
(a3-15 (-> a3-14 trans quad))
|
|
)
|
|
(set! (-> a2-11 vector 0 quad) v1-90)
|
|
(set! (-> a2-11 vector 1 quad) a0-43)
|
|
(set! (-> a2-11 vector 2 quad) a1-15)
|
|
(set! (-> a2-11 trans quad) a3-15)
|
|
)
|
|
)
|
|
)
|
|
(when (and (!= *master-mode* 'menu) *display-camera-info*)
|
|
(format *stdcon* "cam pos ~M ~M ~M~%" (-> gp-0 trans x) (-> gp-0 trans y) (-> gp-0 trans z))
|
|
(let ((v1-95 (-> *setting-control* cam-current)))
|
|
(format
|
|
*stdcon*
|
|
"string info min-l ~M max-l ~M min-h ~M max-h ~M~%"
|
|
(-> v1-95 string-min-length)
|
|
(-> v1-95 string-max-length)
|
|
(-> v1-95 string-min-height)
|
|
(-> v1-95 string-max-height)
|
|
)
|
|
)
|
|
)
|
|
(when (zero? (-> gp-0 reset))
|
|
(let* ((a2-14 (-> gp-0 prev-camera-temp))
|
|
(a3-18 (-> gp-0 camera-temp))
|
|
(v1-99 (-> a3-18 vector 0 quad))
|
|
(a0-48 (-> a3-18 vector 1 quad))
|
|
(a1-18 (-> a3-18 vector 2 quad))
|
|
(a3-19 (-> a3-18 trans quad))
|
|
)
|
|
(set! (-> a2-14 vector 0 quad) v1-99)
|
|
(set! (-> a2-14 vector 1 quad) a0-48)
|
|
(set! (-> a2-14 vector 2 quad) a1-18)
|
|
(set! (-> a2-14 trans quad) a3-19)
|
|
)
|
|
)
|
|
(let ((s3-1 (-> gp-0 camera-temp))
|
|
(s2-0 (-> gp-0 camera-rot))
|
|
(s5-3 (-> gp-0 inv-camera-rot))
|
|
(s4-1 (-> gp-0 trans))
|
|
)
|
|
(let ((s1-0 (new-stack-vector0)))
|
|
(set! (-> s1-0 x) (- (-> s4-1 x)))
|
|
(set! (-> s1-0 y) (- (-> s4-1 y)))
|
|
(set! (-> s1-0 z) (- (-> s4-1 z)))
|
|
(set! (-> s1-0 w) 1.0)
|
|
(vector-matrix*! s1-0 s1-0 s2-0)
|
|
(set! (-> s2-0 trans quad) (-> s1-0 quad))
|
|
)
|
|
(matrix*! s3-1 s2-0 (-> gp-0 perspective))
|
|
(set! (-> s5-3 trans quad) (-> s4-1 quad))
|
|
)
|
|
(when (nonzero? (-> gp-0 reset))
|
|
(let* ((a2-17 (-> gp-0 prev-camera-temp))
|
|
(a3-20 (-> gp-0 camera-temp))
|
|
(v1-105 (-> a3-20 vector 0 quad))
|
|
(a0-51 (-> a3-20 vector 1 quad))
|
|
(a1-21 (-> a3-20 vector 2 quad))
|
|
(a3-21 (-> a3-20 trans quad))
|
|
)
|
|
(set! (-> a2-17 vector 0 quad) v1-105)
|
|
(set! (-> a2-17 vector 1 quad) a0-51)
|
|
(set! (-> a2-17 vector 2 quad) a1-21)
|
|
(set! (-> a2-17 trans quad) a3-21)
|
|
)
|
|
(set! (-> gp-0 reset) 0)
|
|
0
|
|
)
|
|
(let ((f1-10 (-> gp-0 fog-min))
|
|
(f0-37 (-> gp-0 fog-max))
|
|
)
|
|
(let ((f2-0 (-> gp-0 d)))
|
|
(set! (-> *instance-tie-work* hmge-d x) f1-10)
|
|
(set! (-> *instance-tie-work* hmge-d y) f0-37)
|
|
(set! (-> *instance-tie-work* hmge-d z) (* 32.0 f2-0))
|
|
(set! (-> *instance-tie-work* hmge-d w) (* f2-0 (-> gp-0 hmge-scale w)))
|
|
(let ((v1-112 (-> gp-0 hvdf-off quad)))
|
|
(set! (-> *instance-tie-work* hvdf-offset quad) v1-112)
|
|
)
|
|
(set! (-> *instance-shrub-work* hmge-d x) f1-10)
|
|
(set! (-> *instance-shrub-work* hmge-d y) f0-37)
|
|
(set! (-> *instance-shrub-work* hmge-d z) (* 3.0 f2-0))
|
|
(set! (-> *instance-shrub-work* hmge-d w) (* f2-0 (-> gp-0 hmge-scale w)))
|
|
(set! (-> *instance-shrub-work* billboard-const x) (/ (-> gp-0 x-pix) (* f2-0 (-> gp-0 x-ratio))))
|
|
(set! (-> *instance-shrub-work* billboard-const y) (/ (-> gp-0 y-pix) (* f2-0 (-> gp-0 y-ratio))))
|
|
)
|
|
(set! (-> *instance-shrub-work* billboard-const z) f1-10)
|
|
(set! (-> *instance-shrub-work* billboard-const w) f0-37)
|
|
)
|
|
(set! (-> *instance-shrub-work* constants w) (the-as float (-> gp-0 vis-gifs 0 fog0)))
|
|
(let ((a0-53 (-> gp-0 hvdf-off quad)))
|
|
(set! (-> *instance-shrub-work* hvdf-offset quad) a0-53)
|
|
)
|
|
(update-view-planes gp-0 (-> gp-0 plane) 1.0 (-> gp-0 inv-camera-rot))
|
|
(update-view-planes gp-0 (-> gp-0 guard-plane) 4.0 (-> gp-0 inv-camera-rot))
|
|
(shrub-make-perspective-matrix (-> gp-0 shrub-mat) (-> gp-0 camera-temp))
|
|
(update-visible gp-0)
|
|
(when (-> *time-of-day-context* use-camera-other)
|
|
(let ((s5-4 (-> gp-0 camera-rot))
|
|
(s4-2 (-> gp-0 camera-rot-other))
|
|
(s3-2 (-> gp-0 inv-camera-rot-other))
|
|
(s2-1 (-> gp-0 camera-temp-other))
|
|
)
|
|
(quaternion->matrix s4-2 (-> gp-0 quat-other))
|
|
(set! (-> s4-2 trans quad) (-> gp-0 trans-other quad))
|
|
(set! (-> s4-2 trans w) 1.0)
|
|
(matrix*! s4-2 s4-2 s5-4)
|
|
(matrix-inverse-of-rot-trans! s3-2 s4-2)
|
|
(matrix*! s2-1 s4-2 (-> gp-0 perspective))
|
|
(update-view-planes gp-0 (-> gp-0 plane-other) 1.0 s3-2)
|
|
(update-view-planes gp-0 (-> gp-0 guard-plane-other) 4.0 s3-2)
|
|
(shrub-make-perspective-matrix (-> gp-0 shrub-mat-other) s2-1)
|
|
)
|
|
)
|
|
)
|
|
#f
|
|
)
|
|
)
|
|
|
|
;; definition (debug) for function move-level-by-name
|
|
(defun-debug move-level-by-name ((arg0 symbol) (arg1 float) (arg2 float) (arg3 float))
|
|
(let ((v1-1 (level-get *level* arg0)))
|
|
(when v1-1
|
|
(set! (-> v1-1 info use-camera-other) #t)
|
|
(let ((v0-1 (-> *math-camera* trans-other)))
|
|
(set! (-> v0-1 x) (* 4096.0 arg1))
|
|
(set! (-> v0-1 y) (* 4096.0 arg2))
|
|
(set! (-> v0-1 z) (* 4096.0 arg3))
|
|
(set! (-> v0-1 w) 1.0)
|
|
v0-1
|
|
)
|
|
)
|
|
)
|
|
)
|