mirror of
https://github.com/open-goal/jak-project
synced 2026-05-31 01:16:12 -04:00
1079 lines
38 KiB
Common Lisp
Vendored
Generated
1079 lines
38 KiB
Common Lisp
Vendored
Generated
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; definition of type logo
|
|
(deftype logo (process-drawable)
|
|
((camera handle :offset-assert 176)
|
|
(camera-anim handle :offset-assert 184)
|
|
(volumes handle :offset-assert 192)
|
|
(black handle :offset-assert 200)
|
|
(target handle :offset-assert 208)
|
|
(sidekick handle :offset-assert 216)
|
|
(main-joint joint-mod :offset-assert 224)
|
|
(anim spool-anim :offset-assert 228)
|
|
(next-anim spool-anim :offset-assert 232)
|
|
(done? symbol :offset-assert 236)
|
|
)
|
|
:heap-base #x80
|
|
:method-count-assert 24
|
|
:size-assert #xf0
|
|
:flag-assert #x18008000f0
|
|
(:methods
|
|
(idle () _type_ :state 20)
|
|
(startup () _type_ :state 21)
|
|
(hidden () _type_ :state 22)
|
|
(ndi () _type_ :state 23)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type logo
|
|
(defmethod inspect logo ((obj logo))
|
|
(let ((t9-0 (method-of-type process-drawable inspect)))
|
|
(t9-0 obj)
|
|
)
|
|
(format #t "~T~Tcamera: ~D~%" (-> obj camera))
|
|
(format #t "~T~Tcamera-anim: ~D~%" (-> obj camera-anim))
|
|
(format #t "~T~Tvolumes: ~D~%" (-> obj volumes))
|
|
(format #t "~T~Tblack: ~D~%" (-> obj black))
|
|
(format #t "~T~Ttarget: ~D~%" (-> obj target))
|
|
(format #t "~T~Tsidekick: ~D~%" (-> obj sidekick))
|
|
(format #t "~T~Tmain-joint: ~A~%" (-> obj main-joint))
|
|
(format #t "~T~Tanim: ~A~%" (-> obj anim))
|
|
(format #t "~T~Tnext-anim: ~A~%" (-> obj next-anim))
|
|
(format #t "~T~Tdone?: ~A~%" (-> obj done?))
|
|
obj
|
|
)
|
|
|
|
;; definition for method 7 of type logo
|
|
;; INFO: Return type mismatch process-drawable vs logo.
|
|
(defmethod relocate logo ((obj logo) (arg0 int))
|
|
(if (nonzero? (-> obj main-joint))
|
|
(&+! (-> obj main-joint) arg0)
|
|
)
|
|
(the-as logo ((method-of-type process-drawable relocate) obj arg0))
|
|
)
|
|
|
|
;; definition of type logo-slave
|
|
(deftype logo-slave (process-drawable)
|
|
((parent-process (pointer logo) :offset 12)
|
|
(main-joint joint-mod :offset-assert 176)
|
|
)
|
|
:heap-base #x50
|
|
:method-count-assert 21
|
|
:size-assert #xb4
|
|
:flag-assert #x15005000b4
|
|
(:methods
|
|
(idle () _type_ :state 20)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type logo-slave
|
|
(defmethod inspect logo-slave ((obj logo-slave))
|
|
(let ((t9-0 (method-of-type process-drawable inspect)))
|
|
(t9-0 obj)
|
|
)
|
|
(format #t "~T~Tmain-joint: ~A~%" (-> obj main-joint))
|
|
obj
|
|
)
|
|
|
|
;; definition for method 7 of type logo-slave
|
|
;; INFO: Return type mismatch process-drawable vs logo-slave.
|
|
(defmethod relocate logo-slave ((obj logo-slave) (arg0 int))
|
|
(if (nonzero? (-> obj main-joint))
|
|
(&+! (-> obj main-joint) arg0)
|
|
)
|
|
(the-as logo-slave ((method-of-type process-drawable relocate) obj arg0))
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defskelgroup *logo-sg* logo
|
|
0
|
|
4
|
|
((1 (meters 999999)))
|
|
:bounds (static-spherem 0 0 0 10)
|
|
:longest-edge (meters 0)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defskelgroup *logo-japan-sg* logo
|
|
2
|
|
4
|
|
((3 (meters 999999)))
|
|
:bounds (static-spherem 0 0 0 5)
|
|
:longest-edge (meters 0)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defskelgroup *logo-volumes-sg* logo-volumes
|
|
0
|
|
4
|
|
((1 (meters 999999)))
|
|
:bounds (static-spherem 0 0 0 5.5)
|
|
:longest-edge (meters 0)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defskelgroup *logo-volumes-japan-sg* logo-volumes
|
|
2
|
|
4
|
|
((3 (meters 999999)))
|
|
:bounds (static-spherem 0 0 0 5.5)
|
|
:longest-edge (meters 0)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defskelgroup *logo-black-sg* logo-black
|
|
0
|
|
2
|
|
((1 (meters 999999)))
|
|
:bounds (static-spherem 0 0 0 5.5)
|
|
:longest-edge (meters 0)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defskelgroup *logo-cam-sg* logo-cam
|
|
0
|
|
2
|
|
((1 (meters 999999)))
|
|
:bounds (static-spherem 0 0 0 5.5)
|
|
:longest-edge (meters 0)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defskelgroup *ndi-sg* ndi
|
|
0
|
|
2
|
|
((1 (meters 999999)))
|
|
:bounds (static-spherem 0 10 0 30)
|
|
:longest-edge (meters 0)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defskelgroup *ndi-volumes-sg* ndi-volumes
|
|
0
|
|
2
|
|
((1 (meters 999999)))
|
|
:bounds (static-spherem 0 0 0 5.5)
|
|
:longest-edge (meters 0)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defskelgroup *ndi-cam-sg* ndi-cam
|
|
0
|
|
2
|
|
((1 (meters 999999)))
|
|
:bounds (static-spherem 0 0 0 5.5)
|
|
:longest-edge (meters 0)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate idle (logo-slave)
|
|
:virtual #t
|
|
:event
|
|
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
|
(local-vars (v0-0 uint))
|
|
(let ((v1-0 arg2))
|
|
(the-as object (cond
|
|
((= v1-0 'blend-shape)
|
|
(cond
|
|
((-> arg3 param 0)
|
|
(set! v0-0 (the-as uint (logior (-> self skel status) (janim-status blerc eye))))
|
|
(set! (-> self skel status) (the-as janim-status v0-0))
|
|
)
|
|
(else
|
|
(set! v0-0 (the-as uint (logclear (-> self skel status) (janim-status blerc eye))))
|
|
(set! (-> self skel status) (the-as janim-status v0-0))
|
|
)
|
|
)
|
|
v0-0
|
|
)
|
|
((= v1-0 'origin-joint-index)
|
|
(set! v0-0 (-> arg3 param 0))
|
|
(set! (-> self draw origin-joint-index) v0-0)
|
|
v0-0
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
:code
|
|
(behavior ()
|
|
(ja-post)
|
|
(while #t
|
|
(clone-anim-once
|
|
(ppointer->handle (-> self parent-process))
|
|
(the-as int (-> self draw origin-joint-index))
|
|
#t
|
|
""
|
|
)
|
|
(if (nonzero? (-> self main-joint))
|
|
(set-trs!
|
|
(-> self main-joint)
|
|
(-> self parent-process 0 main-joint trans)
|
|
(the-as quaternion #f)
|
|
(-> self parent-process 0 main-joint scale)
|
|
)
|
|
)
|
|
(suspend)
|
|
)
|
|
(none)
|
|
)
|
|
)
|
|
|
|
;; definition for function logo-slave-init-by-other
|
|
;; INFO: Return type mismatch object vs none.
|
|
(defbehavior logo-slave-init-by-other logo-slave ((arg0 entity) (arg1 skeleton-group))
|
|
(set! (-> self entity) arg0)
|
|
(set! (-> self root) (new 'process 'trsqv))
|
|
(initialize-skeleton self arg1 '())
|
|
(logior! (-> self skel status) (janim-status inited))
|
|
(set! (-> self draw origin-joint-index) (the-as uint 3))
|
|
(set! (-> self draw shadow-mask) (the-as uint 255))
|
|
(set! (-> self draw global-effect) (draw-effect title))
|
|
(when (or (string= (-> self draw art-group name) "logo-volumes")
|
|
(string= (-> self draw art-group name) "logo-volumes-japan")
|
|
(string= (-> self draw art-group name) "logo-black")
|
|
)
|
|
(set! (-> self main-joint) (new 'process 'joint-mod (joint-mod-handler-mode joint-set*) self 3))
|
|
(set! (-> self main-joint max-dist) (the-as meters #t))
|
|
)
|
|
(set! (-> self event-hook) (-> (method-of-object self idle) event))
|
|
(go-virtual idle)
|
|
(none)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate startup (logo)
|
|
:virtual #t
|
|
:event
|
|
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
|
(let ((v1-0 arg2))
|
|
(the-as object (if (= v1-0 'update)
|
|
(clear-pending-settings-from-process *setting-control* self 'process-mask)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
:exit
|
|
(behavior ()
|
|
(let ((a0-0 (-> self anim)))
|
|
(when (nonzero? a0-0)
|
|
(ja-abort-spooled-anim a0-0 (the-as art-joint-anim #f) -1)
|
|
(ja-channel-set! 0)
|
|
(ja-post)
|
|
(let ((a0-3 (handle->process (-> self camera))))
|
|
(if a0-3
|
|
(deactivate a0-3)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(none)
|
|
)
|
|
:trans
|
|
(behavior ()
|
|
(if (not (none-reserved? *art-control*))
|
|
(go-virtual hidden)
|
|
)
|
|
(if (nonzero? (-> self next-anim))
|
|
(spool-push *art-control* (-> self next-anim name) 0 self -1.0)
|
|
)
|
|
(none)
|
|
)
|
|
:code
|
|
(behavior ()
|
|
(while (!= (file-status *art-control* (-> self next-anim name) 0) 'active)
|
|
(set-blackout-frames (seconds 0.05))
|
|
(suspend)
|
|
)
|
|
(set! (-> *setting-control* current bg-a) 1.0)
|
|
(set-setting! *setting-control* self 'bg-a 'abs 0.0 0)
|
|
(let ((gp-1 (get-process *default-dead-pool* logo-slave #x4000)))
|
|
(set! (-> self camera-anim)
|
|
(ppointer->handle (when gp-1
|
|
(let ((t9-4 (method-of-type logo-slave activate)))
|
|
(t9-4 (the-as logo-slave gp-1) self 'logo-slave (the-as pointer #x70004000))
|
|
)
|
|
(run-now-in-process gp-1 logo-slave-init-by-other (-> self entity) *logo-cam-sg*)
|
|
(-> gp-1 ppointer)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(let ((gp-2 (get-process *default-dead-pool* othercam #x4000)))
|
|
(set! (-> self camera)
|
|
(ppointer->handle
|
|
(when gp-2
|
|
(let ((t9-7 (method-of-type othercam activate)))
|
|
(t9-7 (the-as othercam gp-2) (handle->process (-> self camera-anim)) 'othercam (the-as pointer #x70004000))
|
|
)
|
|
(run-now-in-process gp-2 othercam-init-by-other (handle->process (-> self camera-anim)) 4 #t 'logo)
|
|
(-> gp-2 ppointer)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(send-event (handle->process (-> self camera)) 'mask 0)
|
|
(case (scf-get-territory)
|
|
((2)
|
|
(let ((gp-3 (get-process *default-dead-pool* logo-slave #x4000)))
|
|
(set! (-> self volumes)
|
|
(ppointer->handle
|
|
(when gp-3
|
|
(let ((t9-12 (method-of-type logo-slave activate)))
|
|
(t9-12 (the-as logo-slave gp-3) self 'logo-slave (the-as pointer #x70004000))
|
|
)
|
|
(run-now-in-process gp-3 logo-slave-init-by-other (-> self entity) *logo-volumes-japan-sg*)
|
|
(-> gp-3 ppointer)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(else
|
|
(let ((gp-4 (get-process *default-dead-pool* logo-slave #x4000)))
|
|
(set! (-> self volumes)
|
|
(ppointer->handle (when gp-4
|
|
(let ((t9-15 (method-of-type logo-slave activate)))
|
|
(t9-15 (the-as logo-slave gp-4) self 'logo-slave (the-as pointer #x70004000))
|
|
)
|
|
(run-now-in-process gp-4 logo-slave-init-by-other (-> self entity) *logo-volumes-sg*)
|
|
(-> gp-4 ppointer)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(send-event (handle->process (-> self volumes)) 'origin-joint-index 3)
|
|
(let ((gp-5 (get-process *default-dead-pool* logo-slave #x4000)))
|
|
(set! (-> self black)
|
|
(ppointer->handle (when gp-5
|
|
(let ((t9-19 (method-of-type logo-slave activate)))
|
|
(t9-19 (the-as logo-slave gp-5) self 'logo-slave (the-as pointer #x70004000))
|
|
)
|
|
(run-now-in-process gp-5 logo-slave-init-by-other (-> self entity) *logo-black-sg*)
|
|
(-> gp-5 ppointer)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(send-event (handle->process (-> self black)) 'origin-joint-index 3)
|
|
(set! (-> self anim) (-> self next-anim))
|
|
(set! (-> self next-anim)
|
|
(new 'static 'spool-anim
|
|
:name "logo-intro-2"
|
|
:index 7
|
|
:parts 15
|
|
:command-list
|
|
'((260 want-force-inside village1 #t)
|
|
(261 kill "sage-23")
|
|
(261 kill "assistant-11")
|
|
(261 kill "explorer-4")
|
|
((new 'static 'bfloat :data 261.5) kill "farmer-3")
|
|
((new 'static 'bfloat :data 261.5) kill "oracle-1")
|
|
((new 'static 'bfloat :data 261.5) kill "warp-gate-switch-3")
|
|
(262 kill "sharkey-12")
|
|
(262 kill "fishermans-boat-2")
|
|
(262 kill "evilplant-2")
|
|
((new 'static 'bfloat :data 262.5) kill "revcycle-8")
|
|
((new 'static 'bfloat :data 262.5) kill "revcycleprop-2")
|
|
((new 'static 'bfloat :data 262.5) kill "water-vol-8")
|
|
(263 kill "water-vol-9")
|
|
(263 kill "water-vol-10")
|
|
(263 kill "reflector-middle-2")
|
|
(400 want-force-inside village1 #f)
|
|
(400 display-level village1 display)
|
|
(400 save)
|
|
(500 set! *spawn-actors* #t)
|
|
)
|
|
)
|
|
)
|
|
(ja-play-spooled-anim
|
|
(-> self anim)
|
|
(the-as art-joint-anim #f)
|
|
(the-as art-joint-anim #f)
|
|
(the-as (function process-drawable symbol) false-func)
|
|
)
|
|
(set! *spawn-actors* #f)
|
|
(push-setting! *setting-control* self 'process-mask 'set 0.0 16)
|
|
(copy-settings-from-target! *setting-control*)
|
|
(deactivate (handle->process (-> self black)))
|
|
(deactivate (handle->process (-> self volumes)))
|
|
(send-event (ppointer->process (-> self parent)) 'wait)
|
|
(send-event self 'update)
|
|
(ja-channel-set! 1)
|
|
(let ((a0-60 (-> self skel root-channel 0)))
|
|
(set! (-> a0-60 frame-group) (the-as art-joint-anim (-> self draw art-group data 6)))
|
|
(set! (-> a0-60 param 0)
|
|
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) data 0 length) -1))
|
|
)
|
|
(set! (-> a0-60 param 1) 1.0)
|
|
(set! (-> a0-60 frame-num) 0.0)
|
|
(joint-control-channel-group! a0-60 (the-as art-joint-anim (-> self draw art-group data 6)) num-func-seek!)
|
|
)
|
|
(until (ja-done? 0)
|
|
(logior! (-> self skel status) (janim-status spool))
|
|
(suspend)
|
|
(let ((a0-62 (-> self skel root-channel 0)))
|
|
(set! (-> a0-62 param 0) (the float (+ (-> a0-62 frame-group data 0 length) -1)))
|
|
(set! (-> a0-62 param 1) 1.0)
|
|
(joint-control-channel-group-eval! a0-62 (the-as art-joint-anim #f) num-func-seek!)
|
|
)
|
|
)
|
|
(set! (-> self anim) (-> self next-anim))
|
|
(set! (-> self next-anim)
|
|
(new 'static 'spool-anim
|
|
:name "logo-loop"
|
|
:index 9
|
|
:parts 17
|
|
:command-list
|
|
'((61 kill "sage-23")
|
|
(61 kill "assistant-11")
|
|
(61 kill "explorer-4")
|
|
((new 'static 'bfloat :data 61.5) kill "farmer-3")
|
|
((new 'static 'bfloat :data 61.5) kill "oracle-1")
|
|
((new 'static 'bfloat :data 61.5) kill "warp-gate-switch-3")
|
|
(62 kill "sharkey-12")
|
|
(62 kill "fishermans-boat-2")
|
|
(62 kill "evilplant-2")
|
|
((new 'static 'bfloat :data 62.5) kill "revcycle-8")
|
|
((new 'static 'bfloat :data 62.5) kill "revcycleprop-2")
|
|
((new 'static 'bfloat :data 62.5) kill "water-vol-8")
|
|
(63 kill "water-vol-9")
|
|
(63 kill "water-vol-10")
|
|
(63 kill "reflector-middle-2")
|
|
)
|
|
)
|
|
)
|
|
(ja-play-spooled-anim
|
|
(-> self anim)
|
|
(the-as art-joint-anim #f)
|
|
(the-as art-joint-anim #f)
|
|
(the-as (function process-drawable symbol) false-func)
|
|
)
|
|
(remove-exit)
|
|
(go-virtual idle)
|
|
(none)
|
|
)
|
|
:post
|
|
(behavior ()
|
|
(if *progress-process*
|
|
(logior! (-> self draw status) (draw-status skip-bones))
|
|
(logclear! (-> self draw status) (draw-status skip-bones))
|
|
)
|
|
(let ((a3-0 (new-stack-vector0))
|
|
(a1-0 (new-stack-vector0))
|
|
)
|
|
(let ((f0-0 (if (= (-> *setting-control* current aspect-ratio) 'aspect16x9)
|
|
0.87
|
|
1.0
|
|
)
|
|
)
|
|
)
|
|
(set-vector! a3-0 f0-0 f0-0 1.0 1.0)
|
|
)
|
|
(set-vector!
|
|
a1-0
|
|
(if (= (-> *setting-control* current aspect-ratio) 'aspect16x9)
|
|
2048.0
|
|
0.0
|
|
)
|
|
(if (= (-> *setting-control* current aspect-ratio) 'aspect16x9)
|
|
-1228.8
|
|
0.0
|
|
)
|
|
0.0
|
|
1.0
|
|
)
|
|
(set-trs! (-> self main-joint) a1-0 (the-as quaternion #f) a3-0)
|
|
)
|
|
(ja-post)
|
|
(none)
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate idle (logo)
|
|
:virtual #t
|
|
:exit
|
|
(-> (method-of-type logo startup) exit)
|
|
:trans
|
|
(-> (method-of-type logo startup) trans)
|
|
:code
|
|
(behavior ()
|
|
(while #t
|
|
(set! (-> self anim) (-> self next-anim))
|
|
(when (not (handle->process (-> self camera)))
|
|
(let ((gp-0 (get-process *default-dead-pool* othercam #x4000)))
|
|
(set! (-> self camera)
|
|
(ppointer->handle
|
|
(when gp-0
|
|
(let ((t9-1 (method-of-type othercam activate)))
|
|
(t9-1 (the-as othercam gp-0) (handle->process (-> self camera-anim)) 'othercam (the-as pointer #x70004000))
|
|
)
|
|
(run-now-in-process gp-0 othercam-init-by-other (handle->process (-> self camera-anim)) 4 #t 'logo)
|
|
(-> gp-0 ppointer)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(set! *spawn-actors* #f)
|
|
(ja-channel-set! 1)
|
|
(let ((a0-11 (-> self skel root-channel 0)))
|
|
(set! (-> a0-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 8)))
|
|
(set! (-> a0-11 param 0)
|
|
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) data 0 length) -1))
|
|
)
|
|
(set! (-> a0-11 param 1) 1.0)
|
|
(set! (-> a0-11 frame-num) 0.0)
|
|
(joint-control-channel-group! a0-11 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!)
|
|
)
|
|
(until (ja-done? 0)
|
|
(logior! (-> self skel status) (janim-status spool))
|
|
(suspend)
|
|
(let ((a0-13 (-> self skel root-channel 0)))
|
|
(set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1)))
|
|
(set! (-> a0-13 param 1) 1.0)
|
|
(joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-seek!)
|
|
)
|
|
)
|
|
(set! *spawn-actors* #t)
|
|
(ja-play-spooled-anim
|
|
(-> self anim)
|
|
(the-as art-joint-anim #f)
|
|
(the-as art-joint-anim #f)
|
|
(the-as (function process-drawable symbol) false-func)
|
|
)
|
|
)
|
|
(none)
|
|
)
|
|
:post
|
|
(-> (method-of-type logo startup) post)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate hidden (logo)
|
|
:virtual #t
|
|
:trans
|
|
(behavior ()
|
|
(if (nonzero? (-> self next-anim))
|
|
(spool-push *art-control* (-> self next-anim name) 0 self -1.0)
|
|
)
|
|
(none)
|
|
)
|
|
:code
|
|
(behavior ()
|
|
(ja-channel-set! 0)
|
|
(ja-post)
|
|
(let ((gp-0 *master-mode*))
|
|
(set! *master-mode* 'game)
|
|
(clear-rec *art-control*)
|
|
(set! *master-mode* gp-0)
|
|
)
|
|
(while #t
|
|
(when (and (none-reserved? *art-control*) (not (paused?)))
|
|
(let ((gp-1 (-> *display* base-frame-counter)))
|
|
(until (>= (- (-> *display* base-frame-counter) gp-1) (seconds 0.1))
|
|
(set! *camera-look-through-other* 2)
|
|
(suspend)
|
|
)
|
|
)
|
|
(go-virtual idle)
|
|
)
|
|
(set! *camera-look-through-other* 2)
|
|
(suspend)
|
|
)
|
|
(none)
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate ndi (logo)
|
|
:virtual #t
|
|
:event
|
|
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
|
(let ((v1-0 arg2))
|
|
(the-as object (if (= v1-0 'blackout)
|
|
(set-setting! *setting-control* self 'bg-a 'abs 1.0 0)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
:enter
|
|
(behavior ()
|
|
(set-setting! *setting-control* self 'bg-a 'abs 0.0 0)
|
|
(copy-settings-from-target! *setting-control*)
|
|
(set! (-> self state-time) (-> *display* base-frame-counter))
|
|
(if *time-of-day-proc*
|
|
(set! (-> *time-of-day-proc* 0 hour) 12)
|
|
)
|
|
(set! (-> self done?) #f)
|
|
(none)
|
|
)
|
|
:exit
|
|
(behavior ()
|
|
((-> (method-of-type logo startup) exit))
|
|
(set-blackout-frames (seconds 0.033333335))
|
|
(none)
|
|
)
|
|
:trans
|
|
(behavior ()
|
|
((-> (method-of-type logo startup) trans))
|
|
(if (and *debug-segment*
|
|
(cpad-pressed? 0 start circle x)
|
|
(member (level-status *level* 'village1) '(loaded active))
|
|
)
|
|
(set-setting! *setting-control* self 'bg-a 'abs 1.0 0)
|
|
)
|
|
(when (and (= (-> *setting-control* current bg-a) 1.0)
|
|
(and (member (level-status *level* 'village1) '(active loaded))
|
|
(>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3))
|
|
(let ((gp-2 (level-get *level* 'village1)))
|
|
(when gp-2
|
|
(load-state-want-levels 'title 'village1)
|
|
(load-state-want-display-level 'village1 'display-self)
|
|
(load-state-want-vis 'vi1)
|
|
(set-force-inside! *load-state* 'village1 #t)
|
|
(!= (-> gp-2 all-visible?) 'loading)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(load-state-want-display-level 'village1 'special)
|
|
(if (not (-> self done?))
|
|
(ja-abort-spooled-anim (-> self anim) (the-as art-joint-anim #f) -1)
|
|
)
|
|
(set! (-> self done?) #t)
|
|
(deactivate self)
|
|
)
|
|
(if *time-of-day-proc*
|
|
(set! (-> *time-of-day-proc* 0 hour) 12)
|
|
)
|
|
(none)
|
|
)
|
|
:code
|
|
(behavior ()
|
|
(while (!= (file-status *art-control* (-> self next-anim name) 0) 'active)
|
|
(set-blackout-frames (seconds 0.05))
|
|
(suspend)
|
|
)
|
|
(set! (-> *setting-control* current bg-a) 1.0)
|
|
(let ((gp-1 (get-process *default-dead-pool* logo-slave #x4000)))
|
|
(set! (-> self camera-anim)
|
|
(ppointer->handle (when gp-1
|
|
(let ((t9-3 (method-of-type logo-slave activate)))
|
|
(t9-3 (the-as logo-slave gp-1) self 'logo-slave (the-as pointer #x70004000))
|
|
)
|
|
(run-now-in-process gp-1 logo-slave-init-by-other (-> self entity) *ndi-cam-sg*)
|
|
(-> gp-1 ppointer)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(let ((gp-2 (get-process *default-dead-pool* othercam #x4000)))
|
|
(set! (-> self camera)
|
|
(ppointer->handle
|
|
(when gp-2
|
|
(let ((t9-6 (method-of-type othercam activate)))
|
|
(t9-6 (the-as othercam gp-2) (handle->process (-> self camera-anim)) 'othercam (the-as pointer #x70004000))
|
|
)
|
|
(run-now-in-process gp-2 othercam-init-by-other (handle->process (-> self camera-anim)) 3 #t 'logo)
|
|
(-> gp-2 ppointer)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(send-event (handle->process (-> self camera)) 'mask 0)
|
|
(let ((gp-3 (get-process *default-dead-pool* logo-slave #x4000)))
|
|
(set! (-> self volumes)
|
|
(ppointer->handle (when gp-3
|
|
(let ((t9-10 (method-of-type logo-slave activate)))
|
|
(t9-10 (the-as logo-slave gp-3) self 'logo-slave (the-as pointer #x70004000))
|
|
)
|
|
(run-now-in-process gp-3 logo-slave-init-by-other (-> self entity) *ndi-volumes-sg*)
|
|
(-> gp-3 ppointer)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(send-event (handle->process (-> self volumes)) 'origin-joint-index 3)
|
|
(let ((gp-4 (get-process *default-dead-pool* logo-slave #x4000)))
|
|
(set! (-> self target)
|
|
(ppointer->handle (when gp-4
|
|
(let ((t9-14 (method-of-type logo-slave activate)))
|
|
(t9-14 (the-as logo-slave gp-4) self 'logo-slave (the-as pointer #x70004000))
|
|
)
|
|
(run-now-in-process gp-4 logo-slave-init-by-other #f *jchar-sg*)
|
|
(-> gp-4 ppointer)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(send-event (handle->process (-> self target)) 'blend-shape #t)
|
|
(send-event (handle->process (-> self target)) 'origin-joint-index 33)
|
|
(let ((gp-5 (get-process *default-dead-pool* logo-slave #x4000)))
|
|
(set! (-> self sidekick)
|
|
(ppointer->handle (when gp-5
|
|
(let ((t9-19 (method-of-type logo-slave activate)))
|
|
(t9-19 (the-as logo-slave gp-5) self 'logo-slave (the-as pointer #x70004000))
|
|
)
|
|
(run-now-in-process gp-5 logo-slave-init-by-other #f *sidekick-sg*)
|
|
(-> gp-5 ppointer)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(send-event (handle->process (-> self sidekick)) 'blend-shape #t)
|
|
(send-event (handle->process (-> self sidekick)) 'origin-joint-index 6)
|
|
(set! (-> self anim) (-> self next-anim))
|
|
(set! (-> self next-anim) (new 'static 'spool-anim :name "logo-intro" :index 5 :parts 3 :command-list '()))
|
|
(ja-play-spooled-anim
|
|
(-> self anim)
|
|
(the-as art-joint-anim #f)
|
|
(the-as art-joint-anim #f)
|
|
(the-as (function process-drawable symbol) false-func)
|
|
)
|
|
(set! (-> self done?) #t)
|
|
(set-setting! *setting-control* self 'bg-a 'abs 1.0 0)
|
|
(anim-loop)
|
|
(none)
|
|
)
|
|
:post
|
|
(behavior ()
|
|
(ja-post)
|
|
(none)
|
|
)
|
|
)
|
|
|
|
;; definition for function logo-init-by-other
|
|
;; INFO: Return type mismatch object vs none.
|
|
;; Used lq/sq
|
|
(defbehavior logo-init-by-other logo ((arg0 entity) (arg1 vector) (arg2 symbol))
|
|
(stack-size-set! (-> self main-thread) 512)
|
|
(logclear! (-> self mask) (process-mask progress))
|
|
(set! (-> self entity) arg0)
|
|
(set! (-> self root) (new 'process 'trsqv))
|
|
(set! (-> self root trans quad) (-> arg1 quad))
|
|
(case arg2
|
|
(('logo)
|
|
(set! (-> *time-of-day-context* title-light-group dir1 levels x) 0.0)
|
|
(set! (-> *time-of-day-context* title-light-group ambi levels x) 0.444)
|
|
(case (scf-get-territory)
|
|
((2)
|
|
(initialize-skeleton self *logo-japan-sg* '())
|
|
)
|
|
(else
|
|
(initialize-skeleton self *logo-sg* '())
|
|
)
|
|
)
|
|
(set! (-> self main-joint) (new 'process 'joint-mod (joint-mod-handler-mode joint-set*) self 3))
|
|
(set! (-> self main-joint max-dist) (the-as meters #t))
|
|
(set! (-> self next-anim) (new 'static 'spool-anim
|
|
:name "logo-intro"
|
|
:index 5
|
|
:parts 3
|
|
:command-list
|
|
'((0 want-levels title village1)
|
|
(5 display-level village1 special)
|
|
(5 want-vis vi1)
|
|
(5 want-force-inside village1 #t)
|
|
(115 display-level village1 display-self)
|
|
(115 save)
|
|
(115 kill "sage-23")
|
|
(115 kill "assistant-11")
|
|
(115 kill "explorer-4")
|
|
(115 kill "farmer-3")
|
|
(115 kill "oracle-1")
|
|
(115 kill "warp-gate-switch-3")
|
|
(115 kill "sharkey-12")
|
|
(115 kill "fishermans-boat-2")
|
|
(115 kill "evilplant-2")
|
|
(115 kill "revcycle-8")
|
|
(115 kill "revcycleprop-2")
|
|
(115 kill "water-vol-8")
|
|
(115 kill "water-vol-9")
|
|
(115 kill "water-vol-10")
|
|
(115 kill "reflector-middle-2")
|
|
)
|
|
)
|
|
)
|
|
(set! (-> self draw origin-joint-index) (the-as uint 3))
|
|
)
|
|
(('ndi)
|
|
(set! (-> *time-of-day-context* title-light-group dir1 levels x) 1.0)
|
|
(set! (-> *time-of-day-context* title-light-group ambi levels x) 1.0)
|
|
(initialize-skeleton self *ndi-sg* '())
|
|
(set! (-> self draw origin-joint-index) (the-as uint 3))
|
|
(set! (-> self next-anim)
|
|
(new 'static 'spool-anim :name "ndi-intro" :index 3 :parts 4 :command-list '((0 want-levels title village1)
|
|
(5 want-vis vi1)
|
|
(5 want-force-inside village1 #t)
|
|
(6 save)
|
|
(453 send-event self blackout)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(logior! (-> self skel status) (janim-status inited))
|
|
(set! (-> self draw global-effect) (draw-effect title))
|
|
(set! (-> self draw shadow-mask) (the-as uint 255))
|
|
(set! (-> self camera) (the-as handle #f))
|
|
(set! (-> self volumes) (the-as handle #f))
|
|
(set! (-> self black) (the-as handle #f))
|
|
(cond
|
|
((= arg2 'logo)
|
|
(go-virtual startup)
|
|
)
|
|
((= arg2 'ndi)
|
|
(go-virtual ndi)
|
|
)
|
|
)
|
|
(none)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate target-title (target)
|
|
:event
|
|
target-generic-event-handler
|
|
:enter
|
|
(behavior ()
|
|
(set-setting! *setting-control* self 'music-volume 'abs 0.0 0)
|
|
(set-setting! *setting-control* self 'sfx-volume 'abs 0.0 0)
|
|
(set-setting! *setting-control* self 'ambient-volume 'abs 0.0 0)
|
|
(set-setting! *setting-control* self 'allow-pause #f 0.0 0)
|
|
(set-setting! *setting-control* self 'allow-progress #f 0.0 0)
|
|
(set-setting! *setting-control* self 'border-mode #f 0.0 0)
|
|
(copy-settings-from-target! *setting-control*)
|
|
(set! (-> self state-time) (-> *display* base-frame-counter))
|
|
(set! (-> self manipy) (the-as (pointer manipy) #f))
|
|
(ja-channel-set! 0)
|
|
(ja-post)
|
|
(send-event *camera* 'change-state cam-fixed 0)
|
|
(none)
|
|
)
|
|
:exit
|
|
(behavior ()
|
|
(when (not (or (= (-> self next-state name) 'target-title-play) (= (-> self next-state name) 'target-title-wait)))
|
|
(if (-> self manipy)
|
|
(deactivate (-> self manipy 0))
|
|
)
|
|
)
|
|
(none)
|
|
)
|
|
:trans
|
|
(behavior ()
|
|
(hide-hud-quick)
|
|
(spool-push *art-control* "ndi-intro" 0 self -1.0)
|
|
(sound-group-pause (the-as uint 2))
|
|
(none)
|
|
)
|
|
:code
|
|
(behavior ()
|
|
(let ((gp-0 (the-as handle #f)))
|
|
(case (scf-get-territory)
|
|
((2)
|
|
(set! gp-0 (ppointer->handle (static-screen-spawn 5 #x64900000 #x64900100 #x64900200 900 #f self)))
|
|
)
|
|
(else
|
|
(while (!= (file-status *art-control* "ndi-intro" 0) 'active)
|
|
(set-blackout-frames (seconds 0.05))
|
|
(suspend)
|
|
)
|
|
(let ((s5-1 (-> *display* base-frame-counter)))
|
|
(until (>= (- (-> *display* base-frame-counter) s5-1) (seconds 0.25))
|
|
(set-blackout-frames (seconds 0.05))
|
|
(suspend)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(label cfg-8)
|
|
(let ((s5-2 (new 'stack-no-clear 'mc-slot-info)))
|
|
(mc-get-slot-info 0 s5-2)
|
|
(when (or (zero? (-> s5-2 known)) (handle->process (the-as int gp-0)))
|
|
(if (not (handle->process (the-as int gp-0)))
|
|
(set-blackout-frames (seconds 0.05))
|
|
)
|
|
(suspend)
|
|
(goto cfg-8)
|
|
)
|
|
(set! (-> *setting-control* default bg-a) 0.0)
|
|
(when (or (zero? (-> s5-2 handle))
|
|
(and (nonzero? (-> s5-2 formatted)) (zero? (-> s5-2 inited)) (< (-> s5-2 mem-actual) (-> s5-2 mem-required)))
|
|
)
|
|
(mem-copy! (the-as pointer *auto-save-info*) (the-as pointer s5-2) 300)
|
|
(set-blackout-frames 0)
|
|
(let ((gp-1 7))
|
|
(if (zero? (-> s5-2 handle))
|
|
(set! gp-1 8)
|
|
)
|
|
(set-setting! *setting-control* self 'allow-progress #t 0.0 0)
|
|
(set-blackout-frames 0)
|
|
(set! (-> *setting-control* default bg-a-force) 0.0)
|
|
(copy-settings-from-target! *setting-control*)
|
|
(set! (-> *setting-control* current bg-a) 0.0)
|
|
(set! (-> *setting-control* current bg-a-force) 0.0)
|
|
(activate-progress *dproc* (the-as progress-screen gp-1))
|
|
)
|
|
(set-setting! *setting-control* self 'allow-progress #f 0.0 0)
|
|
(copy-settings-from-target! *setting-control*)
|
|
(while *progress-process*
|
|
(suspend)
|
|
)
|
|
(let ((gp-2 (-> *display* base-frame-counter)))
|
|
(until (>= (- (-> *display* base-frame-counter) gp-2) (seconds 0.01))
|
|
(suspend)
|
|
)
|
|
)
|
|
(goto cfg-41)
|
|
)
|
|
)
|
|
)
|
|
(label cfg-41)
|
|
(let ((gp-3 (entity-by-name "logo-1")))
|
|
(let* ((s5-3 (get-process *default-dead-pool* logo #x4000))
|
|
(v1-53 (when s5-3
|
|
(let ((t9-17 (method-of-type logo activate)))
|
|
(t9-17 (the-as logo s5-3) self 'logo (the-as pointer #x70004000))
|
|
)
|
|
(run-now-in-process s5-3 logo-init-by-other gp-3 (-> gp-3 extra trans) 'ndi)
|
|
(-> s5-3 ppointer)
|
|
)
|
|
)
|
|
)
|
|
(set! (-> self manipy) (the-as (pointer manipy) v1-53))
|
|
(let ((s5-4 (ppointer->handle v1-53)))
|
|
(while (handle->process (the-as handle s5-4))
|
|
(suspend)
|
|
)
|
|
)
|
|
)
|
|
(let ((s5-5 (get-process *default-dead-pool* logo #x4000)))
|
|
(set! (-> self manipy)
|
|
(the-as (pointer manipy) (when s5-5
|
|
(let ((t9-20 (method-of-type logo activate)))
|
|
(t9-20 (the-as logo s5-5) self 'logo (the-as pointer #x70004000))
|
|
)
|
|
(run-now-in-process s5-5 logo-init-by-other gp-3 (-> gp-3 extra trans) 'logo)
|
|
(-> s5-5 ppointer)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(go target-title-play)
|
|
(none)
|
|
)
|
|
:post
|
|
target-no-move-post
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate target-title-play (target)
|
|
:event
|
|
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
|
(let ((v1-0 arg2))
|
|
(the-as object (cond
|
|
((= v1-0 'wait)
|
|
(go target-title-wait)
|
|
)
|
|
((= v1-0 'reset)
|
|
(deactivate (-> self manipy 0))
|
|
)
|
|
(else
|
|
(target-generic-event-handler arg0 arg1 arg2 arg3)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
:enter
|
|
(behavior ()
|
|
(set-setting! *setting-control* self 'allow-pause #f 0.0 0)
|
|
(set-setting! *setting-control* self 'allow-progress #f 0.0 0)
|
|
(none)
|
|
)
|
|
:exit
|
|
(-> target-title exit)
|
|
:trans
|
|
(the-as (function none :behavior target) hide-hud-quick)
|
|
:code
|
|
(the-as (function none :behavior target) anim-loop)
|
|
:post
|
|
target-no-move-post
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate target-title-wait (target)
|
|
:event
|
|
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
|
(let ((v1-0 arg2))
|
|
(the-as object (cond
|
|
((= v1-0 'play)
|
|
(go target-title-play)
|
|
)
|
|
((= v1-0 'reset)
|
|
(deactivate (-> self manipy 0))
|
|
)
|
|
(else
|
|
(target-generic-event-handler arg0 arg1 arg2 arg3)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
:enter
|
|
(behavior ()
|
|
(clear-pending-settings-from-process *setting-control* self 'ambient-volume)
|
|
(clear-pending-settings-from-process *setting-control* self 'sfx-volume)
|
|
(clear-pending-settings-from-process *setting-control* self 'music-volume)
|
|
(clear-pending-settings-from-process *setting-control* self 'allow-progress)
|
|
(sound-group-continue (the-as uint 2))
|
|
(when *time-of-day-proc*
|
|
(set! (-> *time-of-day-proc* 0 time-ratio) 18000.0)
|
|
(set! *time-of-day-fast* #t)
|
|
)
|
|
(none)
|
|
)
|
|
:exit
|
|
(behavior ()
|
|
(when *time-of-day-proc*
|
|
(set! (-> *time-of-day-proc* 0 time-ratio) 300.0)
|
|
(set! *time-of-day-fast* #f)
|
|
)
|
|
(clear-pending-settings-from-process *setting-control* self 'allow-pause)
|
|
((-> target-title exit))
|
|
(none)
|
|
)
|
|
:trans
|
|
(behavior ()
|
|
(hide-hud-quick)
|
|
(if (cpad-pressed? 0 start)
|
|
(activate-progress *dproc* (progress-screen title))
|
|
)
|
|
(when (and (< (mod (-> *display* real-frame-counter) 300) 270) (not *progress-process*))
|
|
(let ((gp-0
|
|
(new 'stack 'font-context *font-default-matrix* 80 170 0.0 (font-color default) (font-flags shadow kerning))
|
|
)
|
|
)
|
|
(let ((v1-12 gp-0))
|
|
(set! (-> v1-12 width) (the float 352))
|
|
)
|
|
(let ((v1-13 gp-0))
|
|
(set! (-> v1-13 height) (the float 40))
|
|
)
|
|
(set! (-> gp-0 flags) (font-flags shadow kerning middle left large))
|
|
(print-game-text (lookup-text! *common-text* (game-text-id press-start) #f) gp-0 #f 128 22)
|
|
)
|
|
)
|
|
(none)
|
|
)
|
|
:code
|
|
(the-as (function none :behavior target) anim-loop)
|
|
:post
|
|
target-no-move-post
|
|
)
|