mirror of
https://github.com/open-goal/jak-project
synced 2026-06-07 03:58:11 -04:00
05b7b571c8
Lots of manual fixes to make the text and other UI elements in the progress fit within the small 4x3 view.         I've also changed the select start menus to not have that giant space in each option. It's behind a toggle in the code right now.  Additionally: - fixed city billboard particles - fix stadium crash from original game - fix an accidental regression
3809 lines
141 KiB
Common Lisp
3809 lines
141 KiB
Common Lisp
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; name: progress.gc
|
|
;; name in dgo: progress
|
|
;; dgos: ENGINE, GAME
|
|
|
|
;; DECOMP BEGINS
|
|
|
|
(deftype progress-global-state (basic)
|
|
((aspect-ratio-choice symbol :offset-assert 4)
|
|
(video-mode-choice symbol :offset-assert 8)
|
|
(yes-no-choice symbol :offset-assert 12)
|
|
(on-off-choice symbol :offset-assert 16)
|
|
(which-slot int32 :offset-assert 20)
|
|
(starting-state symbol :offset-assert 24)
|
|
(last-slot-saved int32 :offset-assert 28)
|
|
(slider-backup float :offset-assert 32)
|
|
(language-backup language-enum :offset-assert 40)
|
|
(center-x-backup int32 :offset-assert 48)
|
|
(center-y-backup int32 :offset-assert 52)
|
|
(aspect-ratio-backup symbol :offset-assert 56)
|
|
(last-slider-sound time-frame :offset-assert 64)
|
|
(video-mode-timeout time-frame :offset-assert 72)
|
|
(progressive-mode-timeout time-frame :offset-assert 80)
|
|
(current-task-index int32 :offset-assert 88)
|
|
(current-line-index int32 :offset-assert 92)
|
|
(first-closed-line-index int32 :offset-assert 96)
|
|
(extra-text-state int32 :offset-assert 100)
|
|
(current-task uint8 :offset-assert 104)
|
|
(num-open-tasks-found int32 :offset-assert 108)
|
|
(num-closed-tasks-found int32 :offset-assert 112)
|
|
(color-flash-counter int32 :offset-assert 116)
|
|
(num-unlocked-secrets int32 :offset-assert 120)
|
|
(game-options-item-selected int32 :offset-assert 124)
|
|
(game-options-item-picked basic :offset-assert 128)
|
|
(game-options-last-move uint64 :offset-assert 136)
|
|
(game-options-vibrations symbol :offset-assert 144)
|
|
(game-options-subtitles symbol :offset-assert 148)
|
|
(game-options-language-index int32 :offset-assert 152)
|
|
(game-options-subtitle-language-index int32 :offset-assert 156)
|
|
(graphic-options-item-selected int32 :offset-assert 160)
|
|
(graphic-options-item-picked basic :offset-assert 164)
|
|
(graphic-options-last-move uint64 :offset-assert 168)
|
|
(graphic-options-aspect-ratio symbol :offset-assert 176)
|
|
(graphic-options-progressive-scan symbol :offset-assert 180)
|
|
(qr-options-item-selected int32 :offset-assert 184)
|
|
(qr-options-item-picked basic :offset-assert 188)
|
|
(qr-options-last-move uint64 :offset-assert 192)
|
|
(qr-options-restart basic :offset-assert 200)
|
|
(qr-options-quit basic :offset-assert 204)
|
|
(total-num-tasks int32 :offset-assert 208)
|
|
(scene-player-act int32 :offset-assert 212)
|
|
(stereo-mode-backup int32 :offset-assert 216)
|
|
(secrets-unlocked symbol :offset-assert 220)
|
|
(missions-total-spacing float :offset-assert 224)
|
|
(clear-screen basic :offset-assert 228)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #xe8
|
|
:flag-assert #x9000000e8
|
|
)
|
|
|
|
|
|
(define *progress-stack* (the-as (pointer uint8) (malloc 'global DPROCESS_STACK_SIZE)))
|
|
|
|
(define *progress-process* (the-as (pointer progress) #f))
|
|
|
|
(define *progress-state* (new 'static 'progress-global-state :which-slot -1 :last-slot-saved -1))
|
|
|
|
(kmemopen global "mc-slot-info")
|
|
|
|
(define *progress-save-info* (new 'global 'mc-slot-info))
|
|
|
|
(kmemclose)
|
|
|
|
(defun min-max-wrap-around ((arg0 int) (arg1 int) (arg2 int))
|
|
(let ((v1-2 (+ (- 1 arg1) arg2)))
|
|
(while (< arg0 arg1)
|
|
(+! arg0 v1-2)
|
|
)
|
|
(while (< arg2 arg0)
|
|
(set! arg0 (- arg0 v1-2))
|
|
)
|
|
)
|
|
arg0
|
|
)
|
|
|
|
(defun progress-intro-start ((arg0 symbol))
|
|
(set! (-> *game-info* mode) 'play)
|
|
(if arg0
|
|
(initialize! *game-info* 'game (the-as game-save #f) "intro-start-hero")
|
|
(initialize! *game-info* 'game (the-as game-save #f) "intro-start")
|
|
)
|
|
(set-master-mode 'game)
|
|
0
|
|
)
|
|
|
|
(defmethod init-defaults progress ((obj progress))
|
|
"Initialize default menu settings."
|
|
(set! (-> *progress-state* aspect-ratio-choice) (get-aspect-ratio))
|
|
(set! (-> *progress-state* video-mode-choice) (get-video-mode))
|
|
(set! (-> *progress-state* yes-no-choice) #f)
|
|
(set! (-> *progress-state* on-off-choice) #f)
|
|
(set! (-> *progress-state* color-flash-counter) 0)
|
|
(set! (-> *progress-state* game-options-item-selected) 0)
|
|
(set! (-> *progress-state* game-options-item-picked) #f)
|
|
(set! (-> *progress-state* game-options-vibrations) (-> *setting-control* user-default vibration))
|
|
(set! (-> *progress-state* game-options-subtitles) (-> *setting-control* user-default subtitle))
|
|
(set! (-> *progress-state* game-options-language-index)
|
|
(the-as int (-> *setting-control* user-default language))
|
|
)
|
|
(set! (-> *progress-state* game-options-subtitle-language-index)
|
|
(the-as int (-> *setting-control* user-default subtitle-language))
|
|
)
|
|
(set! (-> *progress-state* graphic-options-item-selected) 0)
|
|
(set! (-> *progress-state* graphic-options-item-picked) #f)
|
|
(set! (-> *progress-state* graphic-options-aspect-ratio) (get-aspect-ratio))
|
|
(set! (-> *progress-state* graphic-options-progressive-scan)
|
|
(-> *setting-control* user-default use-progressive-scan)
|
|
)
|
|
(set! (-> *progress-state* qr-options-item-selected) 0)
|
|
(set! (-> *progress-state* qr-options-item-picked) #f)
|
|
(set! (-> *progress-state* total-num-tasks) 0)
|
|
(set! (-> *progress-state* secrets-unlocked) #f)
|
|
(set! (-> *progress-state* clear-screen) #f)
|
|
(set! (-> obj sliding) 0.0)
|
|
(set! (-> obj sliding-height) 0.0)
|
|
(set! (-> obj sliding-off) 1.0)
|
|
(set! (-> obj scanlines-alpha) 0.0)
|
|
(set! (-> (the-as menu-on-off-game-vibrations-option (-> *game-options* options 0)) value-to-modify)
|
|
(&-> *setting-control* user-default vibration)
|
|
)
|
|
(set! (-> (the-as menu-on-off-game-subtitles-option (-> *game-options* options 1)) value-to-modify)
|
|
(&-> *setting-control* user-default subtitle)
|
|
)
|
|
(set! (-> (the-as menu-language-option (-> *game-options* options 2)) language-selection)
|
|
(-> *setting-control* user-current language)
|
|
)
|
|
(set! (-> (the-as menu-language-option (-> *game-options* options 2)) language-direction) #t)
|
|
(set! (-> (the-as menu-language-option (-> *game-options* options 2)) language-transition) #f)
|
|
(set! (-> (the-as menu-language-option (-> *game-options* options 2)) language-x-offset) 0)
|
|
(set! (-> (the-as menu-on-off-option (-> *game-options-japan* options 0)) value-to-modify)
|
|
(&-> *setting-control* user-default vibration)
|
|
)
|
|
(set! (-> (the-as menu-on-off-option (-> *game-options-demo* options 0)) value-to-modify)
|
|
(&-> *setting-control* user-default vibration)
|
|
)
|
|
(set! (-> (the-as menu-on-off-option (-> *graphic-options* options 2)) value-to-modify)
|
|
(&-> *setting-control* user-default use-progressive-scan)
|
|
)
|
|
(set! (-> (the-as menu-on-off-option (-> *graphic-title-options-pal* options 2)) value-to-modify)
|
|
(&-> *setting-control* user-default use-progressive-scan)
|
|
)
|
|
(set! (-> (the-as menu-slider-option (-> *sound-options* options 0)) value-to-modify)
|
|
(&-> *setting-control* user-default sfx-volume)
|
|
)
|
|
(set! (-> (the-as menu-slider-option (-> *sound-options* options 1)) value-to-modify)
|
|
(&-> *setting-control* user-default music-volume)
|
|
)
|
|
(set! (-> (the-as menu-slider-option (-> *sound-options* options 2)) value-to-modify)
|
|
(&-> *setting-control* user-default dialog-volume)
|
|
)
|
|
(set! (-> (the-as menu-missions-option (-> *missions-options* options 0)) task-line-index) 0)
|
|
(set-setting-by-param *setting-control* 'extra-bank '((force2 menu1)) 0 0)
|
|
)
|
|
|
|
(deftype hud-ring-cell (process-drawable)
|
|
((parent (pointer progress) :override)
|
|
(joint-idx int32 :offset-assert 200)
|
|
(init-angle degrees :offset-assert 204)
|
|
(graphic-index int32 :offset-assert 208)
|
|
)
|
|
:heap-base #x60
|
|
:method-count-assert 21
|
|
:size-assert #xd4
|
|
:flag-assert #x15006000d4
|
|
(:methods
|
|
(idle () _type_ :state 20)
|
|
)
|
|
)
|
|
|
|
|
|
(defbehavior hud-ring-cell-init-by-other hud-ring-cell ((arg0 int) (arg1 float) (arg2 int))
|
|
(set! (-> self root) (new 'process 'trsqv))
|
|
(initialize-skeleton
|
|
self
|
|
(the-as skeleton-group (art-group-get-by-name *level* "skel-hud-ring-part" (the-as (pointer uint32) #f)))
|
|
(the-as pair 0)
|
|
)
|
|
(logclear! (-> self mask) (process-mask actor-pause))
|
|
(set! (-> self joint-idx) arg0)
|
|
(set! (-> self init-angle) arg1)
|
|
(set! (-> self graphic-index) arg2)
|
|
(set! (-> self root trans quad) (-> self parent 0 root trans quad))
|
|
(quaternion-copy! (-> self root quat) (-> self parent 0 root quat))
|
|
(quaternion-normalize! (-> self root quat))
|
|
(set! (-> self root scale quad) (-> self parent 0 root scale quad))
|
|
(let ((gp-1 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) *z-vector* (-> self init-angle))))
|
|
(quaternion-normalize! gp-1)
|
|
(quaternion*! (-> self root quat) (-> self root quat) gp-1)
|
|
)
|
|
(quaternion-normalize! (-> self root quat))
|
|
(set! (-> self draw color-mult x) 0.8)
|
|
(set! (-> self draw color-mult y) 0.8)
|
|
(set! (-> self draw color-mult z) 0.8)
|
|
(logior! (-> self draw global-effect) (draw-control-global-effect title-light))
|
|
(logior! (-> self draw status) (draw-control-status hud))
|
|
(setup-masks (-> self draw) 1 0)
|
|
(setup-masks (-> self draw) 0 2046)
|
|
(cond
|
|
((and (= *cheat-mode* #f) (= *kernel-boot-message* 'kiosk))
|
|
(setup-masks
|
|
(-> self draw)
|
|
(the-as
|
|
int
|
|
(-> *hud-ring-kiosk-graphic-remap*
|
|
(mod (+ (-> self graphic-index) (-> self parent 0 graphic-index)) (-> *hud-ring-kiosk-graphic-remap* length))
|
|
)
|
|
)
|
|
0
|
|
)
|
|
)
|
|
((and (= *cheat-mode* #f) (demo?))
|
|
(setup-masks
|
|
(-> self draw)
|
|
(the-as
|
|
int
|
|
(-> *hud-ring-demo-graphic-remap*
|
|
(mod (+ (-> self graphic-index) (-> self parent 0 graphic-index)) (-> *hud-ring-kiosk-graphic-remap* length))
|
|
)
|
|
)
|
|
0
|
|
)
|
|
)
|
|
(else
|
|
(setup-masks
|
|
(-> self draw)
|
|
(the-as
|
|
int
|
|
(-> *hud-ring-graphic-remap*
|
|
(mod (+ (-> self graphic-index) (-> self parent 0 graphic-index)) (-> *hud-ring-graphic-remap* length))
|
|
)
|
|
)
|
|
0
|
|
)
|
|
)
|
|
)
|
|
(go-virtual idle)
|
|
)
|
|
|
|
(defstate idle (hud-ring-cell)
|
|
:virtual #t
|
|
:code (behavior ()
|
|
(until #f
|
|
(ja :num-func num-func-identity :frame-num 0.0)
|
|
(suspend)
|
|
)
|
|
#f
|
|
(none)
|
|
)
|
|
:post (behavior ()
|
|
(vector<-cspace!
|
|
(-> self root trans)
|
|
(-> (the-as progress (-> self parent 0)) node-list data (-> self joint-idx))
|
|
)
|
|
(when (-> (the-as progress (-> self parent 0)) main-menu)
|
|
(setup-masks (-> self draw) 0 2046)
|
|
(cond
|
|
((and (= *cheat-mode* #f) (= *kernel-boot-message* 'kiosk))
|
|
(setup-masks
|
|
(-> self draw)
|
|
(the-as int (-> *hud-ring-kiosk-graphic-remap*
|
|
(mod
|
|
(+ (-> self graphic-index) (-> (the-as progress (-> self parent 0)) graphic-index))
|
|
(-> *hud-ring-kiosk-graphic-remap* length)
|
|
)
|
|
)
|
|
)
|
|
0
|
|
)
|
|
)
|
|
((and (= *cheat-mode* #f) (demo?))
|
|
(setup-masks
|
|
(-> self draw)
|
|
(the-as int (-> *hud-ring-demo-graphic-remap*
|
|
(mod
|
|
(+ (-> self graphic-index) (-> (the-as progress (-> self parent 0)) graphic-index))
|
|
(-> *hud-ring-kiosk-graphic-remap* length)
|
|
)
|
|
)
|
|
)
|
|
0
|
|
)
|
|
)
|
|
(else
|
|
(setup-masks
|
|
(-> self draw)
|
|
(the-as int (-> *hud-ring-graphic-remap*
|
|
(mod
|
|
(+ (-> self graphic-index) (-> (the-as progress (-> self parent 0)) graphic-index))
|
|
(-> *hud-ring-graphic-remap* length)
|
|
)
|
|
)
|
|
)
|
|
0
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(when (= (-> self init-angle) 0.0)
|
|
(cond
|
|
((= (-> (the-as progress (-> self parent 0)) ring-angle)
|
|
(-> (the-as progress (-> self parent 0)) ring-want-angle)
|
|
)
|
|
(set! (-> self draw color-mult x) 1.2)
|
|
(set! (-> self draw color-mult y) 1.2)
|
|
(set! (-> self draw color-mult z) 1.2)
|
|
)
|
|
(else
|
|
(set! (-> self draw color-mult x) 0.8)
|
|
(set! (-> self draw color-mult y) 0.8)
|
|
(set! (-> self draw color-mult z) 0.8)
|
|
)
|
|
)
|
|
)
|
|
(let* ((t9-6 quaternion-vector-angle!)
|
|
(a0-8 (new 'stack-no-clear 'quaternion))
|
|
(a1-26 *z-vector*)
|
|
(f0-8 (-> self init-angle))
|
|
(f1-2 (-> (the-as progress (-> self parent 0)) ring-angle))
|
|
(gp-0 (t9-6 a0-8 a1-26 (+ f0-8 (- f1-2 (* (the float (the int (/ f1-2 6553.6))) 6553.6)))))
|
|
)
|
|
(quaternion-normalize! gp-0)
|
|
(quaternion-copy! (-> self root quat) (-> (the-as progress (-> self parent 0)) root quat))
|
|
(quaternion-normalize! (-> self root quat))
|
|
(quaternion*! (-> self root quat) (-> self root quat) gp-0)
|
|
)
|
|
(quaternion-normalize! (-> self root quat))
|
|
(ja-post)
|
|
(none)
|
|
)
|
|
)
|
|
|
|
(defbehavior progress-init-by-other progress ((arg0 symbol))
|
|
(hide-hud #f)
|
|
(disable-level-text-file-loading)
|
|
(logclear! (-> self mask) (process-mask menu progress actor-pause))
|
|
(add-setting! 'process-mask 'set 0.0 (process-mask progress))
|
|
(set! (-> self clock) (-> *display* real-clock))
|
|
(apply-settings *setting-control*)
|
|
(set-blackout-frames 0)
|
|
(set! *pause-lock* #f)
|
|
(set! (-> self root) (new 'process 'trsqv))
|
|
(matrix->quaternion (-> self root quat) (-> *math-camera* inv-camera-rot))
|
|
(let ((a2-2 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) *y-vector* 32768.0)))
|
|
(quaternion*! (-> self root quat) (-> self root quat) a2-2)
|
|
)
|
|
(quaternion-normalize! (-> self root quat))
|
|
(quaternion-copy! (-> self init-quat) (-> self root quat))
|
|
(set-vector! (-> self root scale) 0.09 0.09 0.09 1.0)
|
|
(initialize-skeleton
|
|
self
|
|
(the-as skeleton-group (art-group-get-by-name *level* "skel-hud-ring" (the-as (pointer uint32) #f)))
|
|
(the-as pair 0)
|
|
)
|
|
(logior! (-> self draw global-effect) (draw-control-global-effect title-light))
|
|
(logior! (-> self skel status) (joint-control-status sync-math))
|
|
(set! (-> self state-pos) 0)
|
|
(set! (-> self menu-transition) 1.0)
|
|
(set! (-> self anim-frame) 0.0)
|
|
(set! (-> self pos-transition) 1.0)
|
|
(init-defaults self)
|
|
(set-next-state self arg0 0)
|
|
(set! (-> *progress-state* starting-state) (-> self next))
|
|
(set! (-> self current) (-> self next))
|
|
(if (= arg0 'main)
|
|
(set! (-> self next) 'none)
|
|
)
|
|
(set! (-> self ring-angle) 0.0)
|
|
(set! (-> self ring-want-angle) 0.0)
|
|
(set! (-> self option-index) 0)
|
|
(set! (-> self want-option-index) 0)
|
|
(set! (-> self graphic-index) 0)
|
|
(set! (-> self swing) 0.0)
|
|
(set! (-> self main-menu) #f)
|
|
(set-menu-options self (-> self current))
|
|
(logior! (-> self draw status) (draw-control-status hud))
|
|
(let ((f30-0 -6571.804))
|
|
(process-spawn hud-ring-cell 15 (* 0.0 f30-0) 0 :to self)
|
|
(process-spawn hud-ring-cell 9 f30-0 1 :to self)
|
|
(process-spawn hud-ring-cell 8 (* 2.0 f30-0) 2 :to self)
|
|
(process-spawn hud-ring-cell 7 (* 3.0 f30-0) 3 :to self)
|
|
(process-spawn hud-ring-cell 6 (* 4.0 f30-0) 4 :to self)
|
|
(process-spawn hud-ring-cell 16 (* -5.0 f30-0) 5 :to self)
|
|
(process-spawn hud-ring-cell 14 (* -4.0 f30-0) 6 :to self)
|
|
(process-spawn hud-ring-cell 13 (* -3.0 f30-0) 7 :to self)
|
|
(process-spawn hud-ring-cell 12 (* -2.0 f30-0) 8 :to self)
|
|
(process-spawn hud-ring-cell 11 (* -1.0 f30-0) 9 :to self)
|
|
)
|
|
(bigmap-method-14 *bigmap*)
|
|
(go-virtual come-in)
|
|
)
|
|
|
|
(defun set-ring-position ((arg0 progress))
|
|
(let ((s3-0 (new-stack-vector0))
|
|
(s4-0 (new 'stack-no-clear 'vector))
|
|
(s5-0 (new 'stack-no-clear 'vector))
|
|
)
|
|
(+! (-> s3-0 y) -8.0)
|
|
(case (get-aspect-ratio)
|
|
(('aspect4x3)
|
|
(position-in-front-of-screen! s4-0 12288.0 s3-0)
|
|
(position-in-front-of-screen! s5-0 -4096.0 s3-0)
|
|
)
|
|
(else
|
|
(position-in-front-of-screen! s4-0 16384.0 s3-0)
|
|
(position-in-front-of-screen! s5-0 -18022.4 s3-0)
|
|
)
|
|
)
|
|
(vector-! s5-0 s5-0 s4-0)
|
|
(set! (-> arg0 root trans x) (+ (-> s4-0 x) (* (-> arg0 pos-transition) (-> s5-0 x))))
|
|
(set! (-> arg0 root trans y) (+ (-> s4-0 y) (* (-> arg0 pos-transition) (-> s5-0 y))))
|
|
(set! (-> arg0 root trans z) (+ (-> s4-0 z) (* (-> arg0 pos-transition) (-> s5-0 z))))
|
|
)
|
|
)
|
|
|
|
(defun activate-progress ((arg0 process) (arg1 symbol))
|
|
(when *target*
|
|
(when (progress-allowed?)
|
|
(when (nonzero? (-> *progress-state* video-mode-timeout))
|
|
(set! (-> *progress-state* video-mode-timeout) 0)
|
|
(set! (-> *progress-state* video-mode-choice) 'pal)
|
|
(set! (-> *setting-control* user-default video-mode) (-> *progress-state* video-mode-choice))
|
|
)
|
|
(when (nonzero? (-> *progress-state* progressive-mode-timeout))
|
|
(set! (-> *progress-state* progressive-mode-timeout) 0)
|
|
(set! (-> *setting-control* user-default use-progressive-scan) #f)
|
|
(set! (-> *progress-state* graphic-options-progressive-scan) #f)
|
|
(set-progressive-scan #f)
|
|
)
|
|
(cond
|
|
(*progress-process*
|
|
(deactivate (-> *progress-process* 0))
|
|
(set! (-> *blit-displays-work* menu-mode) #t)
|
|
(set! *progress-process* (process-spawn progress arg1 :to arg0 :stack (&-> *progress-stack* DPROCESS_STACK_SIZE)))
|
|
(set-master-mode 'progress)
|
|
)
|
|
(else
|
|
(set! *progress-process* (process-spawn progress arg1 :to arg0 :stack (&-> *progress-stack* DPROCESS_STACK_SIZE)))
|
|
(set-master-mode 'progress)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
(defmethod deactivate progress ((obj progress))
|
|
(remove-setting-by-arg0 *setting-control* 'extra-bank)
|
|
(bigmap-method-15 *bigmap*)
|
|
(set! (-> *blit-displays-work* menu-mode) #f)
|
|
(set! *progress-process* (the-as (pointer progress) #f))
|
|
(enable-level-text-file-loading)
|
|
(persist-with-delay *setting-control* 'allow-progress (seconds 0.1) 'allow-progress #f 0.0 0)
|
|
(persist-with-delay *setting-control* 'allow-pause (seconds 0.1) 'allow-pause #f 0.0 0)
|
|
((the-as (function progress none) (find-parent-method progress 10)) obj)
|
|
(none)
|
|
)
|
|
|
|
(defun deactivate-progress ()
|
|
(if *progress-process*
|
|
(deactivate (-> *progress-process* 0))
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
(defun hide-progress-screen ()
|
|
(if (and *progress-process* *progress-state* (!= (-> *progress-state* starting-state) 'title))
|
|
(set-next-state (-> *progress-process* 0) 'go-away 0)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
(defmethod gone? progress ((obj progress))
|
|
(and *progress-process*
|
|
(-> *progress-process* 0 next-state)
|
|
(= (-> *progress-process* 0 next-state name) 'gone)
|
|
)
|
|
)
|
|
|
|
(defun progress-allowed? ()
|
|
(not (or (-> *setting-control* user-current talking)
|
|
(-> *setting-control* user-current movie)
|
|
(movie?)
|
|
(handle->process (-> *game-info* pov-camera-handle))
|
|
(handle->process (-> *game-info* other-camera-handle))
|
|
(< (-> *display* base-clock frame-counter) (-> *game-info* letterbox-time))
|
|
(< (-> *display* base-clock frame-counter) (-> *game-info* blackout-time))
|
|
(!= (-> *setting-control* user-current bg-a) 0.0)
|
|
(!= (-> *setting-control* user-current bg-a-force) 0.0)
|
|
(not (-> *setting-control* user-current allow-progress))
|
|
(or (and (handle->process (-> *game-info* auto-save-proc))
|
|
(not (send-event (handle->process (-> *game-info* auto-save-proc)) 'progress-allowed?))
|
|
)
|
|
(not *target*)
|
|
(= *cheat-mode* 'camera)
|
|
(= *master-mode* 'freeze)
|
|
*master-exit*
|
|
(not *common-text*)
|
|
(< (memory-free *nk-dead-pool*) #x8000)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
|
|
(defmethod can-go-back? progress ((obj progress))
|
|
(and (= (-> obj menu-transition) 0.0)
|
|
(not (-> obj selected-option))
|
|
(!= (-> obj current) 'loading)
|
|
(!= (-> obj current) 'saving)
|
|
(!= (-> obj current) 'formatting)
|
|
(!= (-> obj current) 'creating)
|
|
(!= (-> obj current) 'error-disc-removed)
|
|
(!= (-> obj current) 'error-reading)
|
|
(!= (-> obj current) 'card-removed)
|
|
(!= (-> obj current) 'error-auto-saving)
|
|
(!= (-> obj current) 'title)
|
|
(!= (-> obj current) 'insufficient-space)
|
|
(!= (-> obj current) 'secrets-insufficient-space)
|
|
(!= (-> obj current) 'no-memory-card)
|
|
(!= (-> obj current) 'icon-info)
|
|
(!= (-> obj current) 'insert-card)
|
|
(!= (-> obj current) 'progressive-mode-ok)
|
|
(!= (-> obj current) 'video-mode-ok)
|
|
(!= (-> obj current) 'progressive-mode-warning)
|
|
(!= (-> obj current) 'video-mode-warning)
|
|
)
|
|
)
|
|
|
|
;; WARN: Return type mismatch symbol vs none.
|
|
(defun menu-update-purchase-secrets ((arg0 menu-secret-option))
|
|
(let* ((a1-1 (logtest? (-> *game-info* secrets) (game-secrets hero-mode)))
|
|
(v1-3 (if (not a1-1)
|
|
0
|
|
(-> arg0 num-items)
|
|
)
|
|
)
|
|
(a1-3 (if (not a1-1)
|
|
(+ (-> arg0 num-items) -1)
|
|
(+ (-> arg0 num-items) -1 (-> arg0 num-hero-items))
|
|
)
|
|
)
|
|
)
|
|
(while (>= a1-3 v1-3)
|
|
(let* ((a2-1 v1-3)
|
|
(t0-1 (-> arg0 secret-items a2-1 cost))
|
|
(a3-6 (-> arg0 secret-items a2-1 flag))
|
|
(t2-1 (-> arg0 secret-items a2-1 avail-after))
|
|
(t1-5 (the int (-> *game-info* skill-total)))
|
|
)
|
|
(when (and (logtest? (-> *game-info* sub-task-list t2-1 flags) (game-task-node-flag closed)) (>= t1-5 t0-1))
|
|
(logior! (-> *game-info* purchase-secrets) a3-6)
|
|
(if (= (-> arg0 secret-items a2-1 can-toggle) 'auto)
|
|
(logior! (-> *game-info* secrets) a3-6)
|
|
)
|
|
)
|
|
)
|
|
(+! v1-3 1)
|
|
)
|
|
)
|
|
(none)
|
|
)
|
|
|
|
(defmethod get-state-check-card progress ((obj progress) (arg0 symbol))
|
|
(let ((v1-0 *progress-save-info*)
|
|
(v0-0 arg0)
|
|
)
|
|
(when v1-0
|
|
(when (and v1-0 (= (-> obj menu-transition) 0.0))
|
|
(case arg0
|
|
(('insufficient-space 'no-memory-card 'unformatted-card)
|
|
(cond
|
|
((zero? (-> v1-0 handle))
|
|
(set! v0-0 'no-memory-card)
|
|
)
|
|
((zero? (-> v1-0 formatted))
|
|
(cond
|
|
((or (zero? (-> obj state-pos)) (!= (-> *progress-state* starting-state) 'title))
|
|
(set! v0-0 'go-away)
|
|
)
|
|
(else
|
|
(if (!= arg0 'unformatted-card)
|
|
(set! v0-0 'format-card)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
((and (zero? (-> v1-0 inited)) (< (-> v1-0 mem-actual) (-> v1-0 mem-required)))
|
|
(set! v0-0 'insufficient-space)
|
|
)
|
|
((or (zero? (-> obj state-pos)) (!= (-> *progress-state* starting-state) 'title))
|
|
(set! v0-0 'go-away)
|
|
)
|
|
(else
|
|
(set! v0-0 'select-save)
|
|
)
|
|
)
|
|
)
|
|
(('insert-card)
|
|
(if (= (-> v1-0 inited) 1)
|
|
(set! v0-0 'select-load)
|
|
)
|
|
)
|
|
)
|
|
(cond
|
|
((zero? (-> v1-0 handle))
|
|
(cond
|
|
((-> *setting-control* user-current auto-save)
|
|
(set! v0-0 'card-removed)
|
|
)
|
|
(else
|
|
(case arg0
|
|
(('select-load)
|
|
(set! v0-0 'insert-card)
|
|
)
|
|
(('format-card
|
|
'insufficient-space
|
|
'unformatted-card
|
|
'select-save
|
|
'select-save-title
|
|
'select-save-title-hero
|
|
'create-game
|
|
'already-exists
|
|
)
|
|
(set! v0-0 'no-memory-card)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
((zero? (-> v1-0 formatted))
|
|
(case arg0
|
|
(('select-load)
|
|
(set! v0-0 'insert-card)
|
|
)
|
|
(('select-save 'select-save-title 'select-state-title-hero)
|
|
(set! v0-0 'format-card)
|
|
)
|
|
)
|
|
)
|
|
((zero? (-> v1-0 inited))
|
|
(case arg0
|
|
(('select-save 'select-save-title 'select-save-title-hero)
|
|
(if (>= (-> v1-0 mem-actual) (-> v1-0 mem-required))
|
|
(set! v0-0 'create-game)
|
|
(set! v0-0 'insufficient-space)
|
|
)
|
|
)
|
|
(('select-load)
|
|
(set! v0-0 'insert-card)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
v0-0
|
|
)
|
|
)
|
|
|
|
(defmethod push-state progress ((obj progress))
|
|
(let ((v1-0 (-> obj state-pos)))
|
|
(cond
|
|
((< v1-0 5)
|
|
(set! (-> obj state-stack v1-0) (-> obj current))
|
|
(set! (-> obj option-index-stack v1-0) (-> obj option-index))
|
|
(set! (-> obj state-pos) (+ v1-0 1))
|
|
)
|
|
(else
|
|
(format #t "ERROR: Can't push any more states on the state-stack.~%")
|
|
)
|
|
)
|
|
)
|
|
0
|
|
)
|
|
|
|
(defmethod pop-state progress ((obj progress))
|
|
(let ((v1-0 (-> obj state-pos)))
|
|
(cond
|
|
((> v1-0 0)
|
|
(let ((a2-0 (+ v1-0 -1)))
|
|
(set! (-> obj state-pos) a2-0)
|
|
(set-next-state obj (-> obj state-stack a2-0) (-> obj option-index-stack a2-0))
|
|
)
|
|
)
|
|
(else
|
|
(set-next-state obj 'go-away 0)
|
|
)
|
|
)
|
|
)
|
|
(set! (-> *progress-state* game-options-item-selected) 0)
|
|
(set! (-> *progress-state* game-options-item-picked) #f)
|
|
(set! (-> *progress-state* graphic-options-item-selected) 0)
|
|
(set! (-> *progress-state* graphic-options-item-picked) #f)
|
|
(set! (-> *progress-state* qr-options-item-selected) 0)
|
|
(set! (-> *progress-state* qr-options-item-picked) #f)
|
|
0
|
|
)
|
|
|
|
(defmethod set-next-state progress ((obj progress) (arg0 symbol) (arg1 int))
|
|
"Set the next menu state specified by arg0 at the index specified by arg1."
|
|
(set! (-> *progress-state* clear-screen) #f)
|
|
(when (!= arg0 (-> obj current))
|
|
(set! (-> *progress-state* yes-no-choice) #f)
|
|
(set! (-> obj selected-option) #f)
|
|
(set! (-> obj next-option-index) arg1)
|
|
(set! (-> obj next) arg0)
|
|
(case (-> obj next)
|
|
(('select-load 'select-save 'select-save-title 'select-save-title-hero)
|
|
(set! (-> obj next) (get-state-check-card obj (-> obj next)))
|
|
)
|
|
)
|
|
(case (-> obj next)
|
|
(('creating)
|
|
(auto-save-command 'create-file 0 0 obj #f)
|
|
)
|
|
(('loading)
|
|
(set! (-> *progress-state* last-slot-saved) (-> *progress-state* which-slot))
|
|
(auto-save-command 'restore 0 (-> *progress-state* which-slot) obj #f)
|
|
(set! (-> (the-as menu-missions-option (-> (the-as (array menu-option) (-> *missions-options* options)) 0))
|
|
task-line-index
|
|
)
|
|
0
|
|
)
|
|
0
|
|
)
|
|
(('saving)
|
|
(set! (-> *progress-state* last-slot-saved) (-> *progress-state* which-slot))
|
|
(auto-save-command 'save 0 (-> *progress-state* which-slot) obj #f)
|
|
)
|
|
(('formatting)
|
|
(auto-save-command 'format-card 0 0 obj #f)
|
|
)
|
|
(('select-save 'select-load)
|
|
(set! (-> obj next-option-index) (max 0 (-> *progress-state* last-slot-saved)))
|
|
)
|
|
(('card-removed)
|
|
(set! (-> *progress-state* last-slot-saved) 0)
|
|
0
|
|
)
|
|
)
|
|
)
|
|
0
|
|
)
|
|
|
|
(defmethod set-menu-options progress ((obj progress) (arg0 symbol))
|
|
"Set the menu options for the menu state specified by arg0."
|
|
(set! (-> obj current-options) #f)
|
|
(case arg0
|
|
(('go-away)
|
|
(go (method-of-object obj go-away))
|
|
)
|
|
(('main)
|
|
(set! (-> obj current-options) (cond
|
|
(*cheat-mode*
|
|
*main-options*
|
|
)
|
|
((= *kernel-boot-message* 'kiosk)
|
|
*main-kiosk-options*
|
|
)
|
|
((demo?)
|
|
*main-demo-options*
|
|
)
|
|
(else
|
|
*main-options*
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(('game-options)
|
|
(set! (-> obj current-options)
|
|
(cond
|
|
((demo?)
|
|
(if (= (scf-get-territory) 1)
|
|
*game-options*
|
|
*game-options-demo*
|
|
)
|
|
)
|
|
((and (= (scf-get-territory) 2) (not (and (= *progress-cheat* 'language) (cpad-hold? 0 l2) (cpad-hold? 0 r2))))
|
|
*game-options*
|
|
)
|
|
(else
|
|
*game-options*
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(('graphic-options)
|
|
(set! (-> obj current-options)
|
|
(if (or (= (scf-get-territory) 1) (and (= *progress-cheat* 'pal) (cpad-hold? 0 l2) (cpad-hold? 0 r2)))
|
|
*graphic-title-options-pal*
|
|
*graphic-options*
|
|
)
|
|
)
|
|
)
|
|
(('sound-options)
|
|
(set! (-> obj current-options) *sound-options*)
|
|
)
|
|
(('select-load 'select-save)
|
|
(set! (-> obj current-options) *load-save-options*)
|
|
)
|
|
(('select-save-title)
|
|
(set! (-> obj current-options) *save-options-title*)
|
|
)
|
|
(('select-save-title-hero)
|
|
(logior! (-> *game-info* purchase-secrets) (game-secrets hero-mode))
|
|
(logior! (-> *game-info* secrets) (game-secrets hero-mode))
|
|
(set! (-> obj current-options) *save-options-title*)
|
|
)
|
|
(('loading 'saving 'creating 'formatting)
|
|
(set! (-> obj current-options) *loading-options*)
|
|
)
|
|
(('unformatted-card 'insufficient-space 'no-memory-card)
|
|
(set! (-> obj current-options) *insufficient-space-options*)
|
|
)
|
|
(('secrets-insufficient-space 'secrets-no-memory-card)
|
|
(set! (-> obj current-options) *secrets-insufficient-space-options*)
|
|
)
|
|
(('insert-card)
|
|
(set! (-> obj current-options) *insert-card-options*)
|
|
)
|
|
(('error-loading 'error-saving 'error-formatting 'error-creating)
|
|
(set! (-> obj current-options) *error-loading-options*)
|
|
)
|
|
(('error-auto-saving)
|
|
(set! (-> obj current-options) *error-auto-saving-options*)
|
|
)
|
|
(('card-removed)
|
|
(set! (-> obj current-options) *card-removed-options*)
|
|
)
|
|
(('error-disc-removed)
|
|
(set! (-> obj current-options) *error-disc-removed-options*)
|
|
)
|
|
(('error-reading)
|
|
(set! (-> obj current-options) *error-reading-options*)
|
|
)
|
|
(('icon-info)
|
|
(set! (-> obj current-options) *icon-info-options*)
|
|
)
|
|
(('format-card)
|
|
(set! (-> obj current-options) *format-card-options*)
|
|
)
|
|
(('already-exists)
|
|
(set! (-> obj current-options) *already-exists-options*)
|
|
)
|
|
(('create-game)
|
|
(set! (-> obj current-options) *create-game-options*)
|
|
)
|
|
(('video-mode-warning)
|
|
(set! (-> obj current-options) *video-mode-warning-options*)
|
|
)
|
|
(('video-mode-ok)
|
|
(set! (-> obj current-options) *video-mode-ok-options*)
|
|
)
|
|
(('progressive-mode-warning)
|
|
(set! (-> obj current-options) *progressive-mode-warning-options*)
|
|
)
|
|
(('progressive-mode-ok)
|
|
(set! (-> obj current-options) *progressive-mode-ok-options*)
|
|
)
|
|
(('quit)
|
|
(set! (-> obj current-options) *quit-options*)
|
|
)
|
|
(('title)
|
|
(set! (-> obj current-options) *title*)
|
|
)
|
|
(('title-options)
|
|
(set! (-> obj current-options) *options*)
|
|
)
|
|
(('select-start 'select-pre-start 'select-kiosk-start)
|
|
(set! (-> obj current-options) *select-start-options*)
|
|
(set! (-> (the-as menu-select-start-option (-> (the-as (array menu-option) (-> *select-start-options* options)) 0))
|
|
task-index
|
|
)
|
|
0
|
|
)
|
|
0
|
|
)
|
|
(('select-scene)
|
|
(set! (-> obj current-options) *select-scene-options*)
|
|
(set! (-> (the-as menu-select-scene-option (-> (the-as (array menu-option) (-> *select-scene-options* options)) 0))
|
|
task-index
|
|
)
|
|
0
|
|
)
|
|
0
|
|
)
|
|
(('select-scene-special)
|
|
(set! (-> *progress-state* starting-state) 'title)
|
|
(set! (-> obj state-pos) 0)
|
|
(let ((v1-67 (-> obj state-pos)))
|
|
(set! (-> obj state-stack v1-67) 'title)
|
|
(set! (-> obj option-index-stack v1-67) 3)
|
|
(let ((v1-68 (+ v1-67 1)))
|
|
(set! (-> obj state-stack v1-68) 'unlocked-secrets)
|
|
(set! (-> obj option-index-stack v1-68) (-> obj option-index))
|
|
(set! (-> obj state-pos) (+ v1-68 1))
|
|
)
|
|
)
|
|
(dotimes (s5-1 (-> obj state-pos))
|
|
(format
|
|
#t
|
|
"select-scene-special: ~S ~D~%"
|
|
(symbol->string (-> obj state-stack s5-1))
|
|
(-> obj option-index-stack s5-1)
|
|
)
|
|
)
|
|
(set! (-> obj current-options) *select-scene-options*)
|
|
)
|
|
(('bigmap)
|
|
(set! (-> obj current-options) *bigmap-options*)
|
|
)
|
|
(('missions)
|
|
(set! (-> *progress-state* missions-total-spacing) 0.0)
|
|
(set! (-> (the-as menu-missions-option (-> (the-as (array menu-option) (-> *missions-options* options)) 0))
|
|
task-line-index
|
|
)
|
|
0
|
|
)
|
|
(set! (-> obj current-options) *missions-options*)
|
|
)
|
|
(('highscores)
|
|
(set! (-> (the-as menu-highscores-option (-> (the-as (array menu-option) (-> *highscores-options* options)) 0))
|
|
page-index
|
|
)
|
|
0
|
|
)
|
|
(set! (-> (the-as menu-highscores-option (-> (the-as (array menu-option) (-> *highscores-options* options)) 0))
|
|
prev-page-index
|
|
)
|
|
0
|
|
)
|
|
(set! (-> obj current-options) *highscores-options*)
|
|
)
|
|
(('secret)
|
|
(set! (-> obj secret-buying) #f)
|
|
(set! (-> obj current-options) *secret-options*)
|
|
)
|
|
(('quit-restart)
|
|
(set! (-> obj current-options) *quit-restart-options*)
|
|
)
|
|
(('unlocked-secrets)
|
|
(set! (-> obj current-options) *unlocked-secrets*)
|
|
)
|
|
)
|
|
(when (= (-> obj current-options) #f)
|
|
(format #t "Didn't find new menu settings!!~%")
|
|
(pop-state obj)
|
|
)
|
|
0
|
|
)
|
|
|
|
(defmethod respond-to-cpad progress ((obj progress))
|
|
(mc-get-slot-info 0 *progress-save-info*)
|
|
(when (-> obj current-options)
|
|
(let ((s5-0 (-> obj current-options options)))
|
|
(when (and s5-0 (= (-> obj menu-transition) 0.0))
|
|
(respond-progress
|
|
(the-as menu-option (-> s5-0 (-> obj option-index)))
|
|
obj
|
|
(and (= (-> obj menu-transition) 0.0) (-> obj selected-option))
|
|
)
|
|
(cond
|
|
((-> obj selected-option)
|
|
(cond
|
|
((cpad-pressed? 0 confirm)
|
|
(set! (-> obj selected-option) #f)
|
|
)
|
|
((cpad-pressed? 0 triangle)
|
|
(if (= (-> obj current-options) *main-options*)
|
|
(sound-play "window-contract")
|
|
(sound-play "generic-beep")
|
|
)
|
|
(set! (-> obj selected-option) #f)
|
|
)
|
|
)
|
|
)
|
|
(else
|
|
(cond
|
|
((cpad-pressed? 0 up l-analog-up)
|
|
(cond
|
|
((= (-> obj current-options) *main-options*)
|
|
(sound-play "ring-select")
|
|
)
|
|
((!= (length s5-0) 1)
|
|
(sound-play "roll-over")
|
|
)
|
|
)
|
|
(if (and (= *title* (-> obj current-options)) (not (memcard-unlocked-secrets? #f)) (zero? (-> obj option-index)))
|
|
(set! (-> obj option-index) 3)
|
|
)
|
|
(cond
|
|
((> (-> obj want-option-index) 0)
|
|
(set! (-> obj want-option-index) -1)
|
|
)
|
|
((< -2 (-> obj want-option-index))
|
|
(+! (-> obj want-option-index) -1)
|
|
)
|
|
)
|
|
)
|
|
((cpad-pressed? 0 down l-analog-down)
|
|
(cond
|
|
((= (-> obj current-options) *main-options*)
|
|
(sound-play "ring-select")
|
|
)
|
|
((!= (length s5-0) 1)
|
|
(sound-play "roll-over")
|
|
)
|
|
)
|
|
(cond
|
|
((< (-> obj want-option-index) 0)
|
|
(set! (-> obj want-option-index) 1)
|
|
)
|
|
((< (-> obj want-option-index) 2)
|
|
(+! (-> obj want-option-index) 1)
|
|
)
|
|
)
|
|
)
|
|
((cpad-pressed? 0 confirm)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
(if (not (-> *progress-state* clear-screen))
|
|
(sound-play "generic-beep")
|
|
)
|
|
(set! (-> obj selected-option) #t)
|
|
)
|
|
((cpad-pressed? 0 triangle)
|
|
(when (can-go-back? obj)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle))
|
|
(if (and (= (-> *progress-state* starting-state) 'main) (!= (-> obj current-options) *main-options*))
|
|
(sound-play "window-contract")
|
|
(sound-play "generic-beep")
|
|
)
|
|
(pop-state obj)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
(defbehavior progress-trans progress ()
|
|
|
|
;; pc port note : added variable
|
|
(let ((speed-mod (if (-> *pc-settings* fast-progress?) *progress-speed* 1.0)))
|
|
(cond
|
|
((and (= (-> self next) 'none)
|
|
(or (= (-> *progress-state* starting-state) 'main) (= (-> self anim-frame) 1.0))
|
|
)
|
|
(set! (-> self menu-transition)
|
|
(seek-ease
|
|
(-> self menu-transition)
|
|
0.0
|
|
(* speed-mod 0.1 (-> self clock time-adjust-ratio))
|
|
0.4
|
|
(* 0.01 (-> self clock time-adjust-ratio))
|
|
)
|
|
)
|
|
)
|
|
(else
|
|
(seek! (-> self menu-transition) 1.0 (* 0.1 (-> self clock time-adjust-ratio)))
|
|
(when (and (= (-> self menu-transition) 1.0)
|
|
(or (and (nonzero? (-> self state-pos)) (= (-> self anim-frame) 1.0))
|
|
(or (and (zero? (-> self state-pos)) (= (-> self anim-frame) 0.0))
|
|
(and (!= (-> *progress-state* starting-state) 'main) (!= (-> self next) 'none))
|
|
)
|
|
)
|
|
)
|
|
(set! (-> self current) (-> self next))
|
|
(set! (-> self next) 'none)
|
|
(set! (-> self option-index) (-> self next-option-index))
|
|
(set! (-> self want-option-index) 0)
|
|
(set-menu-options self (-> self current))
|
|
(set! (-> self scanlines-alpha) 0.0)
|
|
)
|
|
)
|
|
)
|
|
(set! (-> self main-menu)
|
|
(and (zero? (-> self state-pos)) (and (= (-> self menu-transition) 0.0)
|
|
(= (-> self next) 'none)
|
|
(or (= (-> self state-stack 0) 'main) (= (-> self current) 'main))
|
|
)
|
|
)
|
|
)
|
|
(when *cheat-mode*
|
|
(when (zero? (-> self state-pos))
|
|
(cond
|
|
((and (cpad-hold? 0 l2) (cpad-hold? 0 r1))
|
|
(if (= (-> self current-options) *main-options*)
|
|
(set! (-> self current-options) *main-options-debug*)
|
|
)
|
|
)
|
|
((= (-> self current-options) *main-options-debug*)
|
|
(set! (-> self current-options) *main-options*)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(if (= (-> self ring-angle) (-> self ring-want-angle))
|
|
(respond-to-cpad self)
|
|
)
|
|
(let ((f30-0 (* 0.005 (-> self clock time-adjust-ratio))))
|
|
(cond
|
|
((= (-> self menu-transition) 1.0)
|
|
(if (and (zero? (-> self state-pos)) (= (-> *progress-state* starting-state) 'main))
|
|
(seek! (-> self anim-frame) 0.0 (* 0.02 (-> self clock time-adjust-ratio)))
|
|
(seek! (-> self anim-frame) 1.0 (* 0.02 (-> self clock time-adjust-ratio)))
|
|
)
|
|
(let ((f0-27 (if (and (zero? (-> self state-pos)) (!= (-> *progress-state* starting-state) 'title))
|
|
0.0
|
|
0.2
|
|
)
|
|
)
|
|
)
|
|
(when (= (-> self next) 'bigmap)
|
|
(set! f0-27 0.4)
|
|
(set! f30-0 (* 0.008 (-> self clock time-adjust-ratio)))
|
|
)
|
|
(seek! (-> self pos-transition) f0-27 f30-0)
|
|
)
|
|
)
|
|
((zero? (-> self state-pos))
|
|
(if (= (-> self current) 'bigmap)
|
|
(set! f30-0 (* 0.05 (-> self clock time-adjust-ratio)))
|
|
)
|
|
(if (!= (-> *progress-state* starting-state) 'title)
|
|
(seek! (-> self pos-transition) 0.0 f30-0)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(if (!= (-> *progress-state* starting-state) 'main)
|
|
(set! (-> self pos-transition) 0.2)
|
|
)
|
|
(set-ring-position self)
|
|
(when (= (-> self ring-angle) (-> self ring-want-angle))
|
|
(cond
|
|
((< (-> self want-option-index) 0)
|
|
(cond
|
|
((and (= *cheat-mode* #f) (= *kernel-boot-message* 'kiosk))
|
|
(if (> (-> self option-index) 0)
|
|
(+! (-> self option-index) -1)
|
|
)
|
|
)
|
|
(else
|
|
(set! (-> self option-index)
|
|
(min-max-wrap-around (+ (-> self option-index) -1) 0 (+ (length (-> self current-options options)) -1))
|
|
)
|
|
)
|
|
)
|
|
(set! (-> self graphic-index) (-> self option-index))
|
|
(+! (-> self want-option-index) 1)
|
|
)
|
|
((> (-> self want-option-index) 0)
|
|
(cond
|
|
((and (= *cheat-mode* #f) (= *kernel-boot-message* 'kiosk))
|
|
(if (< (-> self option-index) (+ (length (-> self current-options options)) -1))
|
|
(+! (-> self option-index) 1)
|
|
)
|
|
)
|
|
(else
|
|
(set! (-> self option-index)
|
|
(min-max-wrap-around (+ (-> self option-index) 1) 0 (+ (length (-> self current-options options)) -1))
|
|
)
|
|
)
|
|
)
|
|
(+! (-> self want-option-index) -1)
|
|
)
|
|
)
|
|
)
|
|
(if (= (-> self anim-frame) 0.0)
|
|
(set! (-> self swing) (seek-ease
|
|
(-> self swing)
|
|
4.0
|
|
(* 0.05 (-> self clock time-adjust-ratio))
|
|
0.5
|
|
(* 0.005 (-> self clock time-adjust-ratio))
|
|
)
|
|
)
|
|
(set! (-> self swing) (seek-ease
|
|
(-> self swing)
|
|
0.0
|
|
(* 0.07 (-> self clock time-adjust-ratio))
|
|
0.5
|
|
(* 0.007 (-> self clock time-adjust-ratio))
|
|
)
|
|
)
|
|
)
|
|
(when (-> self main-menu)
|
|
(set! (-> self ring-want-angle) (ceil (* 182.04445 (* 36.0 (the float (-> self option-index))))))
|
|
(if (and (= (-> self ring-want-angle) 0.0) (< 32768.0 (-> self ring-angle)))
|
|
(set! (-> self ring-want-angle) 65536.0)
|
|
)
|
|
(let ((f0-54 (- (-> self ring-want-angle) (-> self ring-angle))))
|
|
(when (< 32768.0 (fabs f0-54))
|
|
(if (< 0.0 f0-54)
|
|
(+! (-> self ring-angle) 65536.0)
|
|
(+! (-> self ring-angle) -65536.0)
|
|
)
|
|
)
|
|
)
|
|
(seek! (-> self ring-angle) (-> self ring-want-angle) (* speed-mod 455.1111 (-> self clock time-adjust-ratio)))
|
|
)
|
|
(let ((gp-4 (quaternion-vector-angle!
|
|
(new 'stack-no-clear 'quaternion)
|
|
*x-vector*
|
|
(* 182.04445 (* (-> self swing) (sin (the float (* 40 (current-time))))))
|
|
)
|
|
)
|
|
(s5-4 (quaternion-vector-angle!
|
|
(new 'stack-no-clear 'quaternion)
|
|
*y-vector*
|
|
(* 182.04445 (* (-> self swing) (sin (the float (* 0 (current-time))))))
|
|
)
|
|
)
|
|
)
|
|
(quaternion*! (-> self root quat) (-> self init-quat) gp-4)
|
|
(quaternion*! (-> self root quat) (-> self root quat) s5-4)
|
|
)
|
|
(quaternion-normalize! (-> self root quat))
|
|
(if (= (-> self ring-angle) (-> self ring-want-angle))
|
|
(set! (-> self graphic-index) (-> self option-index))
|
|
)
|
|
0
|
|
(none)
|
|
))
|
|
|
|
(defun begin-scan ((arg0 hud-box) (arg1 progress))
|
|
(cond
|
|
((or (= (-> arg1 current) 'bigmap) (= (-> arg1 next) 'bigmap))
|
|
(case (get-aspect-ratio)
|
|
(('aspect4x3)
|
|
(set! (-> arg0 min x) 0.0)
|
|
(set! (-> arg0 min y) 0.0)
|
|
(set! (-> arg0 max x) 512.0)
|
|
(set! (-> arg0 max y) 416.0)
|
|
)
|
|
(('aspect16x9)
|
|
(set! (-> arg0 min x) 0.0)
|
|
(set! (-> arg0 min y) 0.0)
|
|
(set! (-> arg0 max x) 512.0)
|
|
(set! (-> arg0 max y) 424.0)
|
|
)
|
|
)
|
|
)
|
|
((= (get-aspect-ratio) 'aspect16x9)
|
|
(set! (-> arg0 min x) 19.0)
|
|
(set! (-> arg0 min y) 38.0)
|
|
(set! (-> arg0 max x) 494.0)
|
|
(set! (-> arg0 max y) 362.0)
|
|
)
|
|
(else
|
|
(set! (-> arg0 min x) 70.0)
|
|
(set! (-> arg0 min y) 70.0)
|
|
(set! (-> arg0 max x) 444.0)
|
|
(set! (-> arg0 max y) 329.0)
|
|
)
|
|
)
|
|
0
|
|
)
|
|
|
|
(defun end-scan ((arg0 hud-box) (arg1 float))
|
|
(with-dma-buffer-add-bucket ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf))
|
|
(bucket-id progress)
|
|
)
|
|
(draw-scan-and-line arg0 s5-0 arg1)
|
|
)
|
|
0
|
|
)
|
|
|
|
(defbehavior progress-post progress ()
|
|
(local-vars (sv-144 font-context) (sv-148 int) (sv-152 hud-box) (sv-156 symbol))
|
|
(when (-> self current-options)
|
|
(let ((gp-0 (-> self current-options options))
|
|
(s4-0 (-> self current-options y-center))
|
|
(s5-0 (-> self current-options y-space))
|
|
)
|
|
(set! sv-144
|
|
(new 'stack 'font-context *font-default-matrix* 0 0 0.0 (font-color default) (font-flags shadow kerning))
|
|
)
|
|
(set! sv-148 (- s4-0 (/ (* s5-0 (length gp-0)) 2)))
|
|
(set! sv-152 (new 'stack-no-clear 'hud-box))
|
|
(set! sv-156 (and (!= (-> self current) 'main) (or (= (-> self next) 'none) (> (-> self state-pos) 0))))
|
|
(if sv-156
|
|
(begin-scan sv-152 self)
|
|
)
|
|
(if (or (= (-> self current-options) *title*) (= (-> self current-options) *options*))
|
|
(+! s5-0 20)
|
|
)
|
|
(dotimes (s4-1 (length gp-0))
|
|
(let ((v1-24 sv-144))
|
|
(set! (-> v1-24 scale) 0.5)
|
|
)
|
|
(set! (-> sv-144 origin x) 79.0)
|
|
(set! (-> sv-144 origin y) (the float sv-148))
|
|
(set-width! sv-144 355)
|
|
(set-height! sv-144 30)
|
|
(set! (-> sv-144 flags) (if (= (-> *setting-control* user-default language) (language-enum japanese))
|
|
(font-flags middle left large)
|
|
(font-flags kerning middle left large)
|
|
)
|
|
)
|
|
(let ((s3-0 sv-144))
|
|
(set! (-> s3-0 color) (if (and (= s4-1 (-> self option-index)) (= (-> self menu-transition) 0.0))
|
|
(progress-selected 0)
|
|
(font-color progress)
|
|
)
|
|
)
|
|
)
|
|
;; added for proper aspect ratio-ing
|
|
(#when PC_PORT
|
|
(when (not (-> *pc-settings* use-vis?))
|
|
(set! (-> sv-144 origin x) (the float (the int (adjust-game-x (-> sv-144 origin x)))))
|
|
(set! (-> sv-144 width) (the float (the int (* (-> sv-144 width) (-> *pc-settings* aspect-ratio-reciprocal)))))
|
|
)
|
|
)
|
|
(draw-option
|
|
(-> gp-0 s4-1)
|
|
self
|
|
sv-144
|
|
s4-1
|
|
(and (= (-> self menu-transition) 0.0) (-> self selected-option) (= s4-1 (-> self option-index)))
|
|
)
|
|
(if (!= (-> self current-options) *unlocked-secrets*)
|
|
(set! sv-148 (+ s5-0 7 sv-148))
|
|
(set! sv-148 (+ sv-148 s5-0))
|
|
)
|
|
)
|
|
)
|
|
(when sv-156
|
|
(set! (-> self scanlines-alpha) (seek-ease
|
|
(-> self scanlines-alpha)
|
|
(- 1.0 (-> self menu-transition))
|
|
(* 0.05 (-> self clock time-adjust-ratio))
|
|
0.3
|
|
(* 0.001 (-> self clock time-adjust-ratio))
|
|
)
|
|
)
|
|
(end-scan sv-152 (-> self scanlines-alpha))
|
|
)
|
|
)
|
|
(when (and (< 0.8 (-> self anim-frame)) (or (= (-> self current) 'bigmap) (= (-> self next) 'bigmap)))
|
|
(cond
|
|
((>= (-> self pos-transition) 0.38)
|
|
(bigmap-method-11 *bigmap* 1792 1840 2304 2256)
|
|
)
|
|
(else
|
|
(let ((s4-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 21)))
|
|
(s3-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 24)))
|
|
(gp-1 (new 'stack-no-clear 'vector4w))
|
|
)
|
|
(set! (-> gp-1 quad) (the-as uint128 0))
|
|
(let ((s5-1 (new 'stack-no-clear 'vector4w)))
|
|
(set! (-> s5-1 quad) (the-as uint128 0))
|
|
(if (and (transform-point-qword! gp-1 s4-2) (transform-point-qword! s5-1 s3-1))
|
|
(bigmap-method-11 *bigmap* (/ (-> s5-1 x) 16) (/ (-> s5-1 y) 16) (/ (-> gp-1 x) 16) (/ (-> gp-1 y) 16))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(ja-post)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
(defstate come-in (progress)
|
|
:virtual #t
|
|
:enter (behavior ()
|
|
(sound-play "ring-appear")
|
|
(set! (-> self pos-transition) 1.0)
|
|
(none)
|
|
)
|
|
:trans (behavior ()
|
|
(let ((f30-0 (if (= (-> *progress-state* starting-state) 'main)
|
|
0.0
|
|
0.2
|
|
)
|
|
)
|
|
;; pc port note : added variable
|
|
(speed-mod (if (-> *pc-settings* fast-progress?) *progress-speed* 1.0))
|
|
)
|
|
(when (hud-hidden?)
|
|
(set! (-> *blit-displays-work* menu-mode) #t)
|
|
(set! (-> self pos-transition) (seek-ease
|
|
(-> self pos-transition)
|
|
f30-0
|
|
(* speed-mod 0.03 (-> self clock time-adjust-ratio))
|
|
0.4
|
|
(* 0.003 (-> self clock time-adjust-ratio))
|
|
)
|
|
)
|
|
)
|
|
(set-ring-position self)
|
|
(if (= (-> self pos-transition) f30-0)
|
|
(go-virtual idle)
|
|
)
|
|
)
|
|
(none)
|
|
)
|
|
:code (behavior ()
|
|
(until #f
|
|
(suspend)
|
|
(ja :num-func num-func-identity :frame-num 0.0)
|
|
(suspend)
|
|
)
|
|
#f
|
|
(none)
|
|
)
|
|
:post (the-as (function none :behavior progress) ja-post)
|
|
)
|
|
|
|
(defstate idle (progress)
|
|
:virtual #t
|
|
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
|
|
(the-as
|
|
object
|
|
(case event-type
|
|
(('notify)
|
|
(cond
|
|
((= (-> event param 0) 'done)
|
|
(let ((t9-0 format)
|
|
(a0-3 #t)
|
|
(a1-1 "DONE NOTIFY: ~S ~S~%")
|
|
(v1-3 (the-as mc-status-code (-> event param 1)))
|
|
)
|
|
(t9-0
|
|
a0-3
|
|
a1-1
|
|
(cond
|
|
((= v1-3 (mc-status-code bad-version))
|
|
"bad-version"
|
|
)
|
|
((= v1-3 (mc-status-code no-save))
|
|
"no-save"
|
|
)
|
|
((= v1-3 (mc-status-code no-last))
|
|
"no-last"
|
|
)
|
|
((= v1-3 (mc-status-code no-space))
|
|
"no-space"
|
|
)
|
|
((= v1-3 (mc-status-code internal-error))
|
|
"internal-error"
|
|
)
|
|
((= v1-3 (mc-status-code no-memory))
|
|
"no-memory"
|
|
)
|
|
((= v1-3 (mc-status-code bad-handle))
|
|
"bad-handle"
|
|
)
|
|
((= v1-3 (mc-status-code busy))
|
|
"busy"
|
|
)
|
|
((= v1-3 (mc-status-code write-error))
|
|
"write-error"
|
|
)
|
|
((= v1-3 (mc-status-code read-error))
|
|
"read-error"
|
|
)
|
|
((= v1-3 (mc-status-code no-card))
|
|
"no-card"
|
|
)
|
|
((= v1-3 (mc-status-code no-format))
|
|
"no-format"
|
|
)
|
|
((= v1-3 (mc-status-code ok))
|
|
"ok"
|
|
)
|
|
((= v1-3 (mc-status-code no-process))
|
|
"no-process"
|
|
)
|
|
((= v1-3 (mc-status-code no-auto-save))
|
|
"no-auto-save"
|
|
)
|
|
((= v1-3 (mc-status-code no-file))
|
|
"no-file"
|
|
)
|
|
((= v1-3 (mc-status-code format-failed))
|
|
"format-failed"
|
|
)
|
|
((= v1-3 (mc-status-code new-game))
|
|
"new-game"
|
|
)
|
|
(else
|
|
"*unknown*"
|
|
)
|
|
)
|
|
(symbol->string (-> self current))
|
|
)
|
|
)
|
|
(case (-> self next) ;; patched to next instead of current because we save synchronously
|
|
(('saving)
|
|
(cond
|
|
((= (-> self state-stack 0) 'title)
|
|
(let ((gp-1 (-> *setting-control* user-default auto-save)))
|
|
(sound-volume-off)
|
|
(let ((v0-0 (progress-intro-start (logtest? (-> *game-info* purchase-secrets) (game-secrets hero-mode)))))
|
|
(set! (-> *setting-control* user-default auto-save) gp-1)
|
|
v0-0
|
|
)
|
|
)
|
|
)
|
|
(else
|
|
(pop-state self)
|
|
)
|
|
)
|
|
)
|
|
(('formatting)
|
|
(set-next-state self 'creating 0)
|
|
)
|
|
(('creating)
|
|
(if (= (-> self state-stack 0) 'title)
|
|
(set-next-state self 'select-save-title 0)
|
|
(set-next-state self 'select-save 0)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
((= (-> event param 0) 'error)
|
|
(let ((t9-7 format)
|
|
(a0-18 #t)
|
|
(a1-5 "ERROR NOTIFY: ~S ~S ~S~%")
|
|
(v1-19 (the-as mc-status-code (-> event param 1)))
|
|
)
|
|
(t9-7
|
|
a0-18
|
|
a1-5
|
|
(cond
|
|
((= v1-19 (mc-status-code bad-version))
|
|
"bad-version"
|
|
)
|
|
((= v1-19 (mc-status-code no-save))
|
|
"no-save"
|
|
)
|
|
((= v1-19 (mc-status-code no-last))
|
|
"no-last"
|
|
)
|
|
((= v1-19 (mc-status-code no-space))
|
|
"no-space"
|
|
)
|
|
((= v1-19 (mc-status-code internal-error))
|
|
"internal-error"
|
|
)
|
|
((= v1-19 (mc-status-code no-memory))
|
|
"no-memory"
|
|
)
|
|
((= v1-19 (mc-status-code bad-handle))
|
|
"bad-handle"
|
|
)
|
|
((= v1-19 (mc-status-code busy))
|
|
"busy"
|
|
)
|
|
((= v1-19 (mc-status-code write-error))
|
|
"write-error"
|
|
)
|
|
((= v1-19 (mc-status-code read-error))
|
|
"read-error"
|
|
)
|
|
((= v1-19 (mc-status-code no-card))
|
|
"no-card"
|
|
)
|
|
((= v1-19 (mc-status-code no-format))
|
|
"no-format"
|
|
)
|
|
((= v1-19 (mc-status-code ok))
|
|
"ok"
|
|
)
|
|
((= v1-19 (mc-status-code no-process))
|
|
"no-process"
|
|
)
|
|
((= v1-19 (mc-status-code no-auto-save))
|
|
"no-auto-save"
|
|
)
|
|
((= v1-19 (mc-status-code no-file))
|
|
"no-file"
|
|
)
|
|
((= v1-19 (mc-status-code format-failed))
|
|
"format-failed"
|
|
)
|
|
((= v1-19 (mc-status-code new-game))
|
|
"new-game"
|
|
)
|
|
(else
|
|
"*unknown*"
|
|
)
|
|
)
|
|
(-> self current)
|
|
(-> self next)
|
|
)
|
|
)
|
|
(case (-> event param 1)
|
|
((14)
|
|
(set-next-state self 'insufficient-space 0)
|
|
)
|
|
(else
|
|
(case (-> self next) ;; patched to next instead of current because we save synchronously
|
|
(('formatting 'format-card)
|
|
(set-next-state self 'error-formatting 0)
|
|
) ;; jp patch
|
|
(('creating 'create-game)
|
|
(set-next-state self 'error-creating 0)
|
|
) ;; jp patch
|
|
(('saving 'select-save 'select-save-title 'select-save-title-hero 'already-exists)
|
|
(set-next-state self 'error-saving 0)
|
|
)
|
|
(('loading 'select-load)
|
|
(set-next-state self 'error-loading 0)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
:enter (behavior ()
|
|
(set! (-> self menu-transition) 1.0)
|
|
(none)
|
|
)
|
|
:trans progress-trans
|
|
:code (behavior ()
|
|
(until #f
|
|
(ja :num-func num-func-identity :frame-num (* 12.0 (-> self anim-frame)))
|
|
(suspend)
|
|
)
|
|
#f
|
|
(none)
|
|
)
|
|
:post progress-post
|
|
)
|
|
|
|
(defstate go-away (progress)
|
|
:virtual #t
|
|
:enter (behavior ()
|
|
(remove-setting-by-arg0 *setting-control* 'extra-bank)
|
|
(let ((v1-2 *blit-displays-work*))
|
|
(set! (-> v1-2 progress-interp-dest) 0.0)
|
|
(set! (-> v1-2 progress-interp-speed) (/ 1.0 45))
|
|
(#when PC_PORT
|
|
(when (-> *pc-settings* fast-progress?)
|
|
(*! (-> v1-2 progress-interp-speed) *progress-speed*)
|
|
)
|
|
)
|
|
)
|
|
(none)
|
|
)
|
|
:trans (behavior ()
|
|
;; pc port note : added variable
|
|
(let ((speed-mod (if (-> *pc-settings* fast-progress?) *progress-speed* 1.0)))
|
|
(seek! (-> self anim-frame) 0.0 (* speed-mod 0.02 (-> self clock time-adjust-ratio)))
|
|
(cond
|
|
((= (-> self anim-frame) 0.0)
|
|
(seek! (-> self pos-transition) 1.0 (* speed-mod 0.02 (-> self clock time-adjust-ratio)))
|
|
(if (= (-> self pos-transition) 1.0)
|
|
(go-virtual gone)
|
|
)
|
|
)
|
|
(else
|
|
(seek! (-> self pos-transition) 0.0 (* speed-mod 0.02 (-> self clock time-adjust-ratio)))
|
|
)
|
|
)
|
|
(set-ring-position self)
|
|
(none)
|
|
))
|
|
:code (behavior ()
|
|
(let ((gp-0 #f))
|
|
(until #f
|
|
(when (and (not gp-0) (= (-> self anim-frame) 0.0))
|
|
(sound-play "ring-disappear")
|
|
(set! gp-0 #t)
|
|
)
|
|
(ja :num-func num-func-identity :frame-num (* 12.0 (-> self anim-frame)))
|
|
(suspend)
|
|
)
|
|
)
|
|
#f
|
|
(none)
|
|
)
|
|
:post (the-as (function none :behavior progress) ja-post)
|
|
)
|
|
|
|
(defstate gone (progress)
|
|
:virtual #t
|
|
:code (behavior ()
|
|
(bigmap-method-15 *bigmap*)
|
|
(set! (-> *blit-displays-work* menu-mode) #f)
|
|
(while (or (-> *blit-displays-work* screen-copied) (nonzero? (-> *blit-displays-work* count-down)))
|
|
(suspend)
|
|
)
|
|
(remove-setting! 'process-mask)
|
|
(set-master-mode *last-master-mode*)
|
|
(logior! (-> self mask) (process-mask sleep))
|
|
(suspend)
|
|
0
|
|
(none)
|
|
)
|
|
)
|
|
|
|
(defmethod respond-progress menu-option ((obj menu-option) (arg0 progress) (arg1 symbol))
|
|
"Handle progress menu navigation logic."
|
|
0
|
|
)
|
|
|
|
(defmethod respond-progress menu-on-off-option ((obj menu-on-off-option) (arg0 progress) (arg1 symbol))
|
|
"Handle progress menu navigation logic."
|
|
(let ((v1-1 (&-> *progress-state* on-off-choice))
|
|
(gp-0 #f)
|
|
)
|
|
(cond
|
|
(arg1
|
|
(cond
|
|
((cpad-pressed? 0 left l-analog-left)
|
|
(when (not (-> v1-1 0))
|
|
(set! gp-0 #t)
|
|
(when (= (-> obj value-to-modify) (&-> *setting-control* user-default vibration))
|
|
(set! (-> *cpad-list* cpads 0 buzz-pause-val 0) (the-as uint 255))
|
|
(set! (-> *cpad-list* cpads 0 buzz-pause-time) (the-as uint 15))
|
|
)
|
|
(set! (-> v1-1 0) #t)
|
|
)
|
|
)
|
|
((cpad-pressed? 0 right l-analog-right)
|
|
(set! gp-0 (-> v1-1 0))
|
|
(set! (-> v1-1 0) #f)
|
|
)
|
|
((cpad-pressed? 0 confirm)
|
|
(cond
|
|
((and (-> v1-1 0) (= (-> obj value-to-modify) (&-> *setting-control* user-default use-progressive-scan)))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
(push-state arg0)
|
|
(set-next-state arg0 'progressive-mode-warning 0)
|
|
)
|
|
(else
|
|
(set! (-> obj value-to-modify 0) (-> *progress-state* on-off-choice))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(else
|
|
(if (cpad-pressed? 0 confirm)
|
|
(set! (-> *progress-state* on-off-choice) (-> obj value-to-modify 0))
|
|
)
|
|
)
|
|
)
|
|
(if gp-0
|
|
(sound-play "generic-beep")
|
|
)
|
|
)
|
|
0
|
|
)
|
|
|
|
(defmethod respond-progress menu-yes-no-option ((obj menu-yes-no-option) (arg0 progress) (arg1 symbol))
|
|
"Handle progress menu navigation logic."
|
|
(let ((v1-1 (&-> *progress-state* yes-no-choice))
|
|
(gp-0 #f)
|
|
)
|
|
(when arg1
|
|
(cond
|
|
((cpad-pressed? 0 left l-analog-left)
|
|
(when (not (-> v1-1 0))
|
|
(set! gp-0 #t)
|
|
(set! (-> v1-1 0) #t)
|
|
)
|
|
)
|
|
((cpad-pressed? 0 right l-analog-right)
|
|
(set! gp-0 (-> v1-1 0))
|
|
(set! (-> v1-1 0) #f)
|
|
)
|
|
((cpad-pressed? 0 confirm)
|
|
(cond
|
|
((and (-> v1-1 0) (= (-> obj name) (text-id progress-root-restart-mission)))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
(restart-mission)
|
|
(set-next-state arg0 'go-away 0)
|
|
)
|
|
((and (-> v1-1 0) (= (-> obj name) (text-id progress-quit)))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
(initialize! *game-info* 'game (the-as game-save #f) "title-restart")
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(if gp-0
|
|
(sound-play "generic-beep")
|
|
)
|
|
)
|
|
0
|
|
)
|
|
|
|
(defmethod respond-progress menu-slider-option ((obj menu-slider-option) (arg0 progress) (arg1 symbol))
|
|
"Handle progress menu navigation logic."
|
|
(when (-> *bigmap* progress-minimap)
|
|
(let ((gp-0 (-> obj value-to-modify))
|
|
(s4-0 #f)
|
|
)
|
|
(cond
|
|
(arg1
|
|
(cond
|
|
((cpad-hold? 0 left l-analog-left)
|
|
(seek! (-> (the-as (pointer float) gp-0)) 0.0 (* 0.02 (-> self clock time-adjust-ratio)))
|
|
(if (!= (-> (the-as (pointer float) gp-0)) 0.0)
|
|
(set! s4-0 #t)
|
|
)
|
|
)
|
|
((cpad-hold? 0 right l-analog-right)
|
|
(seek! (-> (the-as (pointer float) gp-0)) 1.0 (* 0.02 (-> self clock time-adjust-ratio)))
|
|
(if (!= (-> (the-as (pointer float) gp-0)) 1.0)
|
|
(set! s4-0 #t)
|
|
)
|
|
)
|
|
((cpad-pressed? 0 triangle)
|
|
(set! (-> (the-as (pointer float) gp-0)) (-> *progress-state* slider-backup))
|
|
)
|
|
)
|
|
)
|
|
(else
|
|
(cond
|
|
((cpad-hold? 0 left l-analog-left)
|
|
(seek! (-> (the-as (pointer float) gp-0)) 0.0 (* 0.02 (-> self clock time-adjust-ratio)))
|
|
(if (!= (-> (the-as (pointer float) gp-0)) 0.0)
|
|
(set! s4-0 #t)
|
|
)
|
|
)
|
|
((cpad-hold? 0 right l-analog-right)
|
|
(seek! (-> (the-as (pointer float) gp-0)) 1.0 (* 0.02 (-> self clock time-adjust-ratio)))
|
|
(if (!= (-> (the-as (pointer float) gp-0)) 1.0)
|
|
(set! s4-0 #t)
|
|
)
|
|
)
|
|
)
|
|
(when (cpad-pressed? 0 confirm)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
)
|
|
(when (cpad-pressed? 0 triangle)
|
|
(cond
|
|
((!= (-> *progress-state* starting-state) 'title)
|
|
)
|
|
(else
|
|
(sound-play "generic-beep")
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(when s4-0
|
|
(let ((f30-0 1.0))
|
|
(case (-> obj name)
|
|
(((text-id progress-sound-music-volume) (text-id progress-sound-speech-volume))
|
|
(set! f30-0 (-> (the-as (pointer float) gp-0)))
|
|
)
|
|
)
|
|
(when (< (seconds 0.03) (- (current-time) (-> *progress-state* last-slider-sound)))
|
|
(set! (-> *progress-state* last-slider-sound) (current-time))
|
|
(sound-play-by-name
|
|
(static-sound-name "menu-slide")
|
|
(new-sound-id)
|
|
(the int (* 1024.0 f30-0))
|
|
0
|
|
0
|
|
(sound-group sfx)
|
|
#t
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
0
|
|
)
|
|
|
|
(defmethod respond-progress menu-stereo-mode-sound-option ((obj menu-stereo-mode-sound-option) (arg0 progress) (arg1 symbol))
|
|
"Handle progress menu navigation logic."
|
|
(when (-> *bigmap* progress-minimap)
|
|
(let ((a0-1 (-> *setting-control* user-default stereo-mode))
|
|
(v1-4 #f)
|
|
)
|
|
(let ((a3-0 2))
|
|
(cond
|
|
(arg1
|
|
(cond
|
|
((cpad-pressed? 0 left l-analog-left)
|
|
(set! (-> *setting-control* user-default stereo-mode) (min-max-wrap-around (+ a0-1 -1) 0 a3-0))
|
|
(set! v1-4 #t)
|
|
)
|
|
((cpad-pressed? 0 right l-analog-right)
|
|
(set! (-> *setting-control* user-default stereo-mode) (min-max-wrap-around (+ a0-1 1) 0 a3-0))
|
|
(set! v1-4 #t)
|
|
)
|
|
((cpad-pressed? 0 triangle)
|
|
(set! (-> *setting-control* user-default stereo-mode) (-> *progress-state* stereo-mode-backup))
|
|
)
|
|
)
|
|
)
|
|
(else
|
|
(if (cpad-pressed? 0 confirm)
|
|
(set! (-> *progress-state* stereo-mode-backup) (-> *setting-control* user-default stereo-mode))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(if v1-4
|
|
(sound-play "generic-beep")
|
|
)
|
|
)
|
|
)
|
|
0
|
|
)
|
|
|
|
(defmethod respond-progress menu-main-menu-option ((obj menu-main-menu-option) (arg0 progress) (arg1 symbol))
|
|
"Handle progress menu navigation logic."
|
|
(cond
|
|
((cpad-pressed? 0 start)
|
|
)
|
|
((cpad-pressed? 0 confirm)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle))
|
|
(when (and (= (-> arg0 ring-angle) (-> arg0 ring-want-angle)) #t)
|
|
(cond
|
|
((= (-> obj name) (text-id progress-demo-exit))
|
|
(case *kernel-boot-message*
|
|
(('demo-shared)
|
|
(set! *master-exit* 'force)
|
|
(set-master-mode 'game)
|
|
)
|
|
(('demo)
|
|
(set! (-> *game-info* mode) 'play)
|
|
(initialize! *game-info* 'game (the-as game-save #f) "demo-restart")
|
|
)
|
|
)
|
|
)
|
|
((or (= (-> obj name) (text-id progress-main-secrets-sceneplayer-1))
|
|
(= (-> obj name) (text-id progress-main-secrets-sceneplayer-2))
|
|
(= (-> obj name) (text-id progress-main-secrets-sceneplayer-3))
|
|
)
|
|
(case (-> obj name)
|
|
(((text-id progress-main-secrets-sceneplayer-2))
|
|
(set! (-> *progress-state* scene-player-act) 2)
|
|
)
|
|
(((text-id progress-main-secrets-sceneplayer-3))
|
|
(set! (-> *progress-state* scene-player-act) 3)
|
|
)
|
|
(else
|
|
(set! (-> *progress-state* scene-player-act) 1)
|
|
)
|
|
)
|
|
(sound-play "window-expand")
|
|
(push-state arg0)
|
|
(set-next-state arg0 (-> obj next-state) 0)
|
|
)
|
|
((= (-> obj next-state) 'back)
|
|
(pop-state arg0)
|
|
)
|
|
((= (-> obj next-state) 'restart)
|
|
(sound-volume-off)
|
|
(restart-mission)
|
|
(pop-state arg0)
|
|
)
|
|
(else
|
|
(sound-play "window-expand")
|
|
(push-state arg0)
|
|
(set-next-state arg0 (-> obj next-state) 0)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
((not (-> arg0 selected-option))
|
|
(let ((a0-53 (-> arg0 current-options options)))
|
|
(cond
|
|
((cpad-pressed? 0 left l-analog-left)
|
|
(if (!= (length a0-53) 1)
|
|
(sound-play "ring-select")
|
|
)
|
|
(cond
|
|
((> (-> arg0 want-option-index) 0)
|
|
(set! (-> arg0 want-option-index) -1)
|
|
)
|
|
((< -2 (-> arg0 want-option-index))
|
|
(+! (-> arg0 want-option-index) -1)
|
|
)
|
|
)
|
|
)
|
|
((cpad-pressed? 0 right l-analog-right)
|
|
(if (!= (length a0-53) 1)
|
|
(sound-play "ring-select")
|
|
)
|
|
(cond
|
|
((< (-> arg0 want-option-index) 0)
|
|
(set! (-> arg0 want-option-index) 1)
|
|
)
|
|
((< (-> arg0 want-option-index) 2)
|
|
(+! (-> arg0 want-option-index) 1)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
0
|
|
)
|
|
|
|
(defmethod respond-progress menu-sub-menu-option ((obj menu-sub-menu-option) (arg0 progress) (arg1 symbol))
|
|
"Handle progress menu navigation logic."
|
|
(when (and (-> *progress-state* secrets-unlocked)
|
|
(not (memcard-unlocked-secrets? #f))
|
|
(or (= (-> arg0 current-options) *title*)
|
|
(= (-> arg0 current-options) *unlocked-secrets*)
|
|
(= (-> arg0 current-options) *select-scene-options*)
|
|
(= (-> arg0 current-options) *select-start-options*)
|
|
(= (-> arg0 current-options) *save-options-title*)
|
|
)
|
|
)
|
|
(set! (-> *progress-state* secrets-unlocked) #f)
|
|
(set! (-> arg0 state-pos) 0)
|
|
(set-next-state arg0 'secrets-insufficient-space 0)
|
|
)
|
|
(when (= (-> obj name) (text-id progress-continue-without-saving))
|
|
(let ((a1-3 (get-state-check-card arg0 (-> arg0 current))))
|
|
(set-next-state arg0 a1-3 0)
|
|
)
|
|
)
|
|
(when (and (= (-> obj name) (text-id progress-root-secrets))
|
|
(= *title* (-> arg0 current-options))
|
|
(not (memcard-unlocked-secrets? #f))
|
|
(= (-> arg0 option-index) 3)
|
|
)
|
|
(set! (-> arg0 option-index) 0)
|
|
0
|
|
)
|
|
(when (cpad-pressed? 0 confirm)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
(cond
|
|
((= (-> obj name) (text-id progress-demo-exit))
|
|
(case *kernel-boot-message*
|
|
(('demo-shared)
|
|
(set! *master-exit* 'force)
|
|
(set-master-mode 'game)
|
|
)
|
|
(('demo)
|
|
(set! (-> *game-info* mode) 'play)
|
|
(initialize! *game-info* 'game (the-as game-save #f) "demo-restart")
|
|
)
|
|
)
|
|
)
|
|
((= (-> obj name) (text-id progress-continue-without-saving))
|
|
(progress-intro-start (logtest? (-> *game-info* purchase-secrets) (game-secrets hero-mode)))
|
|
)
|
|
((= (-> obj next-state) 'back)
|
|
(pop-state arg0)
|
|
)
|
|
(else
|
|
(sound-play "generic-beep")
|
|
(push-state arg0)
|
|
(set-next-state arg0 (-> obj next-state) 0)
|
|
)
|
|
)
|
|
)
|
|
0
|
|
)
|
|
|
|
(defmethod respond-progress menu-unlocked-menu-option ((obj menu-unlocked-menu-option) (arg0 progress) (arg1 symbol))
|
|
"Handle progress menu navigation logic."
|
|
(let ((s4-0 (memcard-unlocked-secrets? #t)))
|
|
(logclear! (-> *game-info* purchase-secrets) (game-secrets hero-mode))
|
|
(logclear! (-> *game-info* secrets) (game-secrets hero-mode))
|
|
(when (not (-> *progress-state* secrets-unlocked))
|
|
(set! (-> *progress-state* secrets-unlocked) #f)
|
|
(set! (-> arg0 state-pos) 0)
|
|
(set-next-state arg0 'secrets-insufficient-space 0)
|
|
)
|
|
(cond
|
|
((cpad-pressed? 0 confirm)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
(cond
|
|
((and (= (-> obj name) (text-id progress-main-secrets-scrapbook)) (logtest? s4-0 (game-secrets scrap-book-1)))
|
|
(sound-play "generic-beep")
|
|
(cond
|
|
((send-event (handle->process (-> *game-info* controller 0)) 'scrap-book 1)
|
|
(set-next-state arg0 'go-away 0)
|
|
)
|
|
(else
|
|
(set! (-> *game-info* demo-state) (the-as uint 201))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
(initialize! *game-info* 'game (the-as game-save #f) "title-restart")
|
|
)
|
|
)
|
|
)
|
|
((and (= (-> obj name) (text-id progress-main-secrets-mega-scrapbook))
|
|
(logtest? s4-0 (game-secrets scrap-book-2))
|
|
)
|
|
(sound-play "generic-beep")
|
|
(cond
|
|
((send-event (handle->process (-> *game-info* controller 0)) 'scrap-book 2)
|
|
(set-next-state arg0 'go-away 0)
|
|
)
|
|
(else
|
|
(set! (-> *game-info* demo-state) (the-as uint 202))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
(initialize! *game-info* 'game (the-as game-save #f) "title-restart")
|
|
)
|
|
)
|
|
)
|
|
((and (= (-> obj name) (text-id progress-main-secrets-scrapbook-3))
|
|
(logtest? s4-0 (game-secrets scrap-book-3))
|
|
)
|
|
(sound-play "generic-beep")
|
|
(cond
|
|
((send-event (handle->process (-> *game-info* controller 0)) 'scrap-book 3)
|
|
(set-next-state arg0 'go-away 0)
|
|
)
|
|
(else
|
|
(set! (-> *game-info* demo-state) (the-as uint 203))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
(initialize! *game-info* 'game (the-as game-save #f) "title-restart")
|
|
)
|
|
)
|
|
)
|
|
((and (= (-> obj name) (text-id progress-main-secrets-sceneplayer-1))
|
|
(logtest? s4-0 (game-secrets scene-player-1))
|
|
)
|
|
(set! (-> *progress-state* scene-player-act) 1)
|
|
(sound-play "generic-beep")
|
|
(push-state arg0)
|
|
(set-next-state arg0 'select-scene 0)
|
|
)
|
|
((and (= (-> obj name) (text-id progress-main-secrets-sceneplayer-2))
|
|
(logtest? s4-0 (game-secrets scene-player-2))
|
|
)
|
|
(set! (-> *progress-state* scene-player-act) 2)
|
|
(sound-play "generic-beep")
|
|
(push-state arg0)
|
|
(set-next-state arg0 'select-scene 0)
|
|
)
|
|
((and (= (-> obj name) (text-id progress-main-secrets-sceneplayer-3))
|
|
(logtest? s4-0 (game-secrets scene-player-3))
|
|
)
|
|
(set! (-> *progress-state* scene-player-act) 3)
|
|
(sound-play "generic-beep")
|
|
(push-state arg0)
|
|
(set-next-state arg0 'select-scene 0)
|
|
)
|
|
((and (= (-> obj name) (text-id progress-main-secrets-hero-mode)) (logtest? s4-0 (game-secrets hero-mode)))
|
|
(sound-play "generic-beep")
|
|
(push-state arg0)
|
|
(set-next-state arg0 'select-save-title-hero 0)
|
|
)
|
|
((and (= (-> obj name) (text-id progress-main-secrets-levelselect))
|
|
(logtest? s4-0 (game-secrets level-select))
|
|
)
|
|
(sound-play "generic-beep")
|
|
(push-state arg0)
|
|
(set-next-state arg0 'select-start 0)
|
|
)
|
|
((= (-> obj next-state) 'back)
|
|
(pop-state arg0)
|
|
)
|
|
)
|
|
)
|
|
((not (-> arg0 selected-option))
|
|
(let ((a0-131 (-> arg0 current-options options)))
|
|
(cond
|
|
((cpad-pressed? 0 left l-analog-left)
|
|
(when (!= (length a0-131) 1)
|
|
)
|
|
(cond
|
|
((> (-> arg0 want-option-index) 0)
|
|
(set! (-> arg0 want-option-index) -1)
|
|
)
|
|
((< -2 (-> arg0 want-option-index))
|
|
(+! (-> arg0 want-option-index) -1)
|
|
)
|
|
)
|
|
)
|
|
((cpad-pressed? 0 right l-analog-right)
|
|
(when (!= (length a0-131) 1)
|
|
)
|
|
(cond
|
|
((< (-> arg0 want-option-index) 0)
|
|
(set! (-> arg0 want-option-index) 1)
|
|
)
|
|
((< (-> arg0 want-option-index) 2)
|
|
(+! (-> arg0 want-option-index) 1)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
0
|
|
)
|
|
|
|
(defmethod respond-progress menu-memcard-slot-option ((obj menu-memcard-slot-option) (arg0 progress) (arg1 symbol))
|
|
"Handle progress menu navigation logic."
|
|
(memcard-unlocked-secrets? #t)
|
|
(let ((a1-2 (get-state-check-card arg0 (-> arg0 current))))
|
|
(set-next-state arg0 a1-2 0)
|
|
)
|
|
(set! (-> arg0 selected-option) #f)
|
|
(when (-> *bigmap* progress-minimap)
|
|
(cond
|
|
((cpad-pressed? 0 triangle)
|
|
)
|
|
((cpad-pressed? 0 confirm)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
(let ((s5-0 #f))
|
|
*progress-save-info*
|
|
(set! (-> *progress-state* which-slot) (-> arg0 option-index))
|
|
(cond
|
|
((= (-> arg0 current) 'select-load)
|
|
(when (= (-> *progress-save-info* file (-> arg0 option-index) present) 1)
|
|
(set! s5-0 #t)
|
|
(set-next-state arg0 'loading 0)
|
|
)
|
|
)
|
|
((= (-> *progress-save-info* file (-> *progress-state* which-slot) present) 1)
|
|
(set! s5-0 #t)
|
|
(menu-update-purchase-secrets (the-as menu-secret-option (-> *secret-options* options 0)))
|
|
(set-next-state arg0 'already-exists 0)
|
|
)
|
|
(else
|
|
(set! s5-0 #t)
|
|
(menu-update-purchase-secrets (the-as menu-secret-option (-> *secret-options* options 0)))
|
|
(set-next-state arg0 'saving 0)
|
|
)
|
|
)
|
|
(if s5-0
|
|
(sound-play "generic-beep")
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
0
|
|
)
|
|
|
|
(defmethod respond-progress menu-already-exists-option ((obj menu-already-exists-option) (arg0 progress) (arg1 symbol))
|
|
"Handle progress menu navigation logic."
|
|
(let ((s4-0 (&-> *progress-state* yes-no-choice))
|
|
(a1-2 (get-state-check-card arg0 'select-save))
|
|
(gp-0 #f)
|
|
)
|
|
(if (!= a1-2 'select-save)
|
|
(set-next-state arg0 a1-2 0)
|
|
)
|
|
(cond
|
|
((cpad-pressed? 0 left l-analog-left)
|
|
(set! gp-0 (not (-> s4-0 0)))
|
|
(set! (-> s4-0 0) #t)
|
|
)
|
|
((cpad-pressed? 0 right l-analog-right)
|
|
(set! gp-0 (-> s4-0 0))
|
|
(set! (-> s4-0 0) #f)
|
|
)
|
|
((cpad-pressed? 0 confirm)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
(cond
|
|
((-> *progress-state* yes-no-choice)
|
|
(sound-play "generic-beep")
|
|
(set-next-state arg0 'saving 0)
|
|
)
|
|
((begin (sound-play "generic-beep") (= (-> arg0 state-stack 0) 'title))
|
|
(set-next-state arg0 'select-save-title 0)
|
|
)
|
|
(else
|
|
(set-next-state arg0 'select-save 0)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(if gp-0
|
|
(sound-play "generic-beep")
|
|
)
|
|
)
|
|
0
|
|
)
|
|
|
|
(defmethod respond-progress menu-create-game-option ((obj menu-create-game-option) (arg0 progress) (arg1 symbol))
|
|
"Handle progress menu navigation logic."
|
|
(let ((s4-0 (&-> *progress-state* yes-no-choice))
|
|
(gp-0 #f)
|
|
)
|
|
(let ((a1-2 (get-state-check-card arg0 'select-save)))
|
|
(if (!= a1-2 'select-save)
|
|
(set-next-state arg0 a1-2 0)
|
|
)
|
|
)
|
|
(cond
|
|
((cpad-pressed? 0 left l-analog-left)
|
|
(set! gp-0 (not (-> s4-0 0)))
|
|
(set! (-> s4-0 0) #t)
|
|
)
|
|
((cpad-pressed? 0 right l-analog-right)
|
|
(set! gp-0 (-> s4-0 0))
|
|
(set! (-> s4-0 0) #f)
|
|
)
|
|
((cpad-pressed? 0 confirm)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
(cond
|
|
((-> *progress-state* yes-no-choice)
|
|
(set-next-state arg0 'creating 0)
|
|
)
|
|
((= (-> arg0 state-stack 0) 'title)
|
|
(sound-play "generic-beep")
|
|
(sound-volume-off)
|
|
(progress-intro-start (logtest? (-> *game-info* purchase-secrets) (game-secrets hero-mode)))
|
|
)
|
|
(else
|
|
(sound-play "generic-beep")
|
|
(pop-state arg0)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(if gp-0
|
|
(sound-play "generic-beep")
|
|
)
|
|
)
|
|
0
|
|
)
|
|
|
|
(defmethod respond-progress menu-insufficient-space-option ((obj menu-insufficient-space-option) (arg0 progress) (arg1 symbol))
|
|
"Handle progress menu navigation logic."
|
|
(let ((s5-0 (&-> *progress-state* yes-no-choice))
|
|
(s3-0 (get-state-check-card arg0 'select-save))
|
|
)
|
|
(cond
|
|
((or (= (-> *progress-state* starting-state) 'insufficient-space)
|
|
(= (-> *progress-state* starting-state) 'no-memory-card)
|
|
)
|
|
(cond
|
|
((cpad-pressed? 0 left l-analog-left)
|
|
(when (and (not (-> s5-0 0)) (not (-> *progress-state* clear-screen)))
|
|
(sound-play "generic-beep")
|
|
(set! (-> s5-0 0) #t)
|
|
)
|
|
)
|
|
((cpad-pressed? 0 right l-analog-right)
|
|
(when (and (-> s5-0 0) (not (-> *progress-state* clear-screen)))
|
|
(sound-play "generic-beep")
|
|
(set! (-> s5-0 0) #f)
|
|
)
|
|
)
|
|
((and (cpad-pressed? 0 confirm) (!= (-> arg0 current) 'none))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
(set! (-> *progress-state* clear-screen) (the-as basic #t))
|
|
(cond
|
|
((-> s5-0 0)
|
|
(sound-play "generic-beep")
|
|
(pop-state arg0)
|
|
)
|
|
((and (not (-> s5-0 0))
|
|
(!= (get-state-check-card arg0 'select-save) 'insufficient-space)
|
|
(!= (get-state-check-card arg0 'select-save) 'no-memory-card)
|
|
)
|
|
(pop-state arg0)
|
|
)
|
|
(else
|
|
(sound-play "generic-beep")
|
|
(set! (-> obj last-move) (the-as uint (current-time)))
|
|
(set! (-> arg0 current) 'none)
|
|
(set-next-state arg0 s3-0 0)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(else
|
|
(let ((a1-9 'select-save-title-hero))
|
|
'select-save
|
|
(cond
|
|
((and (= (-> *progress-state* starting-state) 'main)
|
|
(not (logtest? (-> *game-info* purchase-secrets) (game-secrets hero-mode)))
|
|
)
|
|
(set! a1-9 'select-save)
|
|
)
|
|
((and (= (-> *progress-state* starting-state) 'title)
|
|
(not (logtest? (-> *game-info* purchase-secrets) (game-secrets hero-mode)))
|
|
)
|
|
(set! a1-9 'select-save-title)
|
|
)
|
|
)
|
|
(let ((a1-10 (get-state-check-card arg0 a1-9)))
|
|
(set-next-state arg0 a1-10 0)
|
|
)
|
|
)
|
|
(cond
|
|
((and (cpad-pressed? 0 triangle)
|
|
(or (= (-> *progress-state* starting-state) 'title) (= (-> *progress-state* starting-state) 'main))
|
|
)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle))
|
|
)
|
|
((cpad-pressed? 0 confirm)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
(cond
|
|
((= (-> arg0 state-stack 0) 'title)
|
|
(sound-play "generic-beep")
|
|
(sound-volume-off)
|
|
(progress-intro-start (logtest? (-> *game-info* purchase-secrets) (game-secrets hero-mode)))
|
|
)
|
|
(else
|
|
(sound-play "generic-beep")
|
|
(pop-state arg0)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
0
|
|
)
|
|
|
|
(defmethod respond-progress menu-secrets-insufficient-space-option ((obj menu-secrets-insufficient-space-option) (arg0 progress) (arg1 symbol))
|
|
"Handle progress menu navigation logic."
|
|
(&-> *progress-state* yes-no-choice)
|
|
(cond
|
|
((cpad-pressed? 0 confirm)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
(sound-play "generic-beep")
|
|
(set-next-state arg0 'title 0)
|
|
)
|
|
((cpad-pressed? 0 triangle)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle))
|
|
)
|
|
)
|
|
0
|
|
)
|
|
|
|
(defmethod respond-progress menu-video-mode-warning-option ((obj menu-video-mode-warning-option) (arg0 progress) (arg1 symbol))
|
|
"Handle progress menu navigation logic."
|
|
(let ((v1-1 (&-> *progress-state* yes-no-choice))
|
|
(gp-0 #f)
|
|
)
|
|
(cond
|
|
((cpad-pressed? 0 left l-analog-left)
|
|
(set! gp-0 (not (-> v1-1 0)))
|
|
(set! (-> v1-1 0) #t)
|
|
)
|
|
((cpad-pressed? 0 right l-analog-right)
|
|
(set! gp-0 (-> v1-1 0))
|
|
(set! (-> v1-1 0) #f)
|
|
)
|
|
((cpad-pressed? 0 confirm)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
(set! (-> *progress-state* video-mode-timeout) 0)
|
|
(cond
|
|
((-> *progress-state* yes-no-choice)
|
|
(set! (-> *setting-control* user-default video-mode) (-> *progress-state* video-mode-choice))
|
|
(set! (-> *progress-state* video-mode-timeout) (current-time))
|
|
(set-next-state arg0 'video-mode-ok 0)
|
|
)
|
|
(else
|
|
(set! (-> *progress-state* video-mode-choice) 'pal)
|
|
(pop-state arg0)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(if gp-0
|
|
(sound-play "generic-beep")
|
|
)
|
|
)
|
|
0
|
|
)
|
|
|
|
(defmethod respond-progress menu-video-mode-ok-option ((obj menu-video-mode-ok-option) (arg0 progress) (arg1 symbol))
|
|
"Handle progress menu navigation logic."
|
|
(let ((v1-1 (&-> *progress-state* yes-no-choice))
|
|
(s5-0 #f)
|
|
)
|
|
(cond
|
|
((cpad-pressed? 0 left l-analog-left)
|
|
(set! s5-0 (not (-> v1-1 0)))
|
|
(set! (-> v1-1 0) #t)
|
|
)
|
|
((cpad-pressed? 0 right l-analog-right)
|
|
(set! s5-0 (-> v1-1 0))
|
|
(set! (-> v1-1 0) #f)
|
|
)
|
|
((cpad-pressed? 0 confirm)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
(cond
|
|
((not (-> *progress-state* yes-no-choice))
|
|
(set! (-> *progress-state* video-mode-choice) 'pal)
|
|
(set! (-> *setting-control* user-default video-mode) (-> *progress-state* video-mode-choice))
|
|
(sound-play "generic-beep")
|
|
)
|
|
(else
|
|
(sound-play "generic-beep")
|
|
)
|
|
)
|
|
(set! (-> *progress-state* video-mode-timeout) 0)
|
|
(pop-state arg0)
|
|
)
|
|
)
|
|
(if s5-0
|
|
(sound-play "generic-beep")
|
|
)
|
|
)
|
|
(when (and (nonzero? (-> *progress-state* video-mode-timeout))
|
|
(< (seconds 10) (- (current-time) (-> *progress-state* video-mode-timeout)))
|
|
)
|
|
(set! (-> *progress-state* video-mode-timeout) 0)
|
|
(set! (-> *progress-state* video-mode-choice) 'pal)
|
|
(set! (-> *setting-control* user-default video-mode) (-> *progress-state* video-mode-choice))
|
|
(pop-state arg0)
|
|
)
|
|
0
|
|
)
|
|
|
|
(defmethod respond-progress menu-progressive-mode-warning-option ((obj menu-progressive-mode-warning-option) (arg0 progress) (arg1 symbol))
|
|
"Handle progress menu navigation logic."
|
|
(let ((v1-1 (&-> *progress-state* yes-no-choice))
|
|
(gp-0 #f)
|
|
)
|
|
(cond
|
|
((cpad-pressed? 0 left l-analog-left)
|
|
(set! gp-0 (not (-> v1-1 0)))
|
|
(set! (-> v1-1 0) #t)
|
|
(set! (-> *progress-state* graphic-options-progressive-scan) #t)
|
|
)
|
|
((cpad-pressed? 0 right l-analog-right)
|
|
(set! gp-0 (-> v1-1 0))
|
|
(set! (-> *progress-state* graphic-options-progressive-scan) #f)
|
|
(set! (-> v1-1 0) #f)
|
|
)
|
|
((cpad-pressed? 0 confirm)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
(set! (-> *progress-state* progressive-mode-timeout) 0)
|
|
(cond
|
|
((-> *progress-state* yes-no-choice)
|
|
(sound-play "generic-beep")
|
|
(set-progressive-scan #t)
|
|
(set! (-> *progress-state* graphic-options-progressive-scan) #t)
|
|
(set! (-> *progress-state* progressive-mode-timeout) (current-time))
|
|
(set-next-state arg0 'progressive-mode-ok 0)
|
|
)
|
|
(else
|
|
(sound-play "generic-beep")
|
|
(set! (-> *progress-state* on-off-choice) #f)
|
|
(set! (-> *progress-state* graphic-options-progressive-scan) #f)
|
|
(set-progressive-scan #f)
|
|
(pop-state arg0)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(if gp-0
|
|
(sound-play "generic-beep")
|
|
)
|
|
)
|
|
0
|
|
)
|
|
|
|
(defmethod respond-progress menu-progressive-mode-ok-option ((obj menu-progressive-mode-ok-option) (arg0 progress) (arg1 symbol))
|
|
"Handle progress menu navigation logic."
|
|
(let ((v1-1 (&-> *progress-state* yes-no-choice))
|
|
(s5-0 #f)
|
|
)
|
|
(cond
|
|
((cpad-pressed? 0 left l-analog-left)
|
|
(set! s5-0 (not (-> v1-1 0)))
|
|
(set! (-> v1-1 0) #t)
|
|
)
|
|
((cpad-pressed? 0 right l-analog-right)
|
|
(set! s5-0 (-> v1-1 0))
|
|
(set! (-> v1-1 0) #f)
|
|
)
|
|
((cpad-pressed? 0 confirm)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
(cond
|
|
((not (-> *progress-state* yes-no-choice))
|
|
(set! (-> *setting-control* user-default use-progressive-scan) #f)
|
|
(set! (-> *progress-state* graphic-options-progressive-scan) #f)
|
|
(sound-play "generic-beep")
|
|
)
|
|
(else
|
|
(sound-play "generic-beep")
|
|
(set! (-> *progress-state* graphic-options-progressive-scan) #t)
|
|
)
|
|
)
|
|
(set! (-> *progress-state* progressive-mode-timeout) 0)
|
|
(pop-state arg0)
|
|
)
|
|
)
|
|
(if s5-0
|
|
(sound-play "generic-beep")
|
|
)
|
|
)
|
|
(when (and (nonzero? (-> *progress-state* progressive-mode-timeout))
|
|
(< (seconds 10) (- (current-time) (-> *progress-state* progressive-mode-timeout)))
|
|
)
|
|
(set! (-> *progress-state* progressive-mode-timeout) 0)
|
|
(set! (-> *setting-control* user-default use-progressive-scan) #f)
|
|
(set! (-> *progress-state* graphic-options-progressive-scan) #f)
|
|
(set-progressive-scan #f)
|
|
(pop-state arg0)
|
|
)
|
|
0
|
|
)
|
|
|
|
(defmethod respond-progress menu-card-removed-option ((obj menu-card-removed-option) (arg0 progress) (arg1 symbol))
|
|
"Handle progress menu navigation logic."
|
|
(when (cpad-pressed? 0 confirm)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
(sound-play "generic-beep")
|
|
(pop-state arg0)
|
|
)
|
|
0
|
|
)
|
|
|
|
(defmethod respond-progress menu-insert-card-option ((obj menu-insert-card-option) (arg0 progress) (arg1 symbol))
|
|
"Handle progress menu navigation logic."
|
|
*progress-save-info*
|
|
(cond
|
|
((= (get-state-check-card arg0 'select-load) 'select-load)
|
|
(set-next-state arg0 'select-load 0)
|
|
)
|
|
((cpad-pressed? 0 confirm)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
(sound-play "generic-beep")
|
|
(pop-state arg0)
|
|
)
|
|
)
|
|
0
|
|
)
|
|
|
|
(defmethod respond-progress menu-error-loading-option ((obj menu-error-loading-option) (arg0 progress) (arg1 symbol))
|
|
"Handle progress menu navigation logic."
|
|
(when (cpad-pressed? 0 confirm)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
(sound-play "generic-beep")
|
|
(pop-state arg0)
|
|
)
|
|
0
|
|
)
|
|
|
|
(defmethod respond-progress menu-error-auto-saving-option ((obj menu-error-auto-saving-option) (arg0 progress) (arg1 symbol))
|
|
"Handle progress menu navigation logic."
|
|
(when (cpad-pressed? 0 confirm)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
(sound-play "generic-beep")
|
|
(pop-state arg0)
|
|
)
|
|
0
|
|
)
|
|
|
|
(defmethod respond-progress menu-error-disc-removed-option ((obj menu-error-disc-removed-option) (arg0 progress) (arg1 symbol))
|
|
"Handle progress menu navigation logic."
|
|
(when (cpad-pressed? 0 confirm)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
(when (is-cd-in?)
|
|
(sound-play "generic-beep")
|
|
(pop-state arg0)
|
|
)
|
|
)
|
|
0
|
|
)
|
|
|
|
(defmethod respond-progress menu-error-reading-option ((obj menu-error-reading-option) (arg0 progress) (arg1 symbol))
|
|
"Handle progress menu navigation logic."
|
|
(when (cpad-pressed? 0 confirm)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
(sound-play "generic-beep")
|
|
(pop-state arg0)
|
|
)
|
|
0
|
|
)
|
|
|
|
(defmethod respond-progress menu-icon-info-option ((obj menu-icon-info-option) (arg0 progress) (arg1 symbol))
|
|
"Handle progress menu navigation logic."
|
|
(when (cpad-pressed? 0 confirm)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
(sound-play "generic-beep")
|
|
(pop-state arg0)
|
|
)
|
|
0
|
|
)
|
|
|
|
(defmethod respond-progress menu-quit-option ((obj menu-quit-option) (arg0 progress) (arg1 symbol))
|
|
"Handle progress menu navigation logic."
|
|
(let ((v1-1 (&-> *progress-state* yes-no-choice))
|
|
(gp-0 #f)
|
|
)
|
|
(cond
|
|
((cpad-pressed? 0 left l-analog-left)
|
|
(set! gp-0 (not (-> v1-1 0)))
|
|
(set! (-> v1-1 0) #t)
|
|
)
|
|
((cpad-pressed? 0 right l-analog-right)
|
|
(set! gp-0 (-> v1-1 0))
|
|
(set! (-> v1-1 0) #f)
|
|
)
|
|
((cpad-pressed? 0 confirm)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
(cond
|
|
((-> *progress-state* yes-no-choice)
|
|
(sound-volume-off)
|
|
(set! (-> *game-info* mode) 'play)
|
|
(case *kernel-boot-message*
|
|
(('demo-shared 'demo)
|
|
(initialize! *game-info* 'game (the-as game-save #f) "demo-start")
|
|
)
|
|
(else
|
|
(initialize! *game-info* 'game (the-as game-save #f) "title-restart")
|
|
)
|
|
)
|
|
)
|
|
(else
|
|
(sound-play "generic-beep")
|
|
(pop-state arg0)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(if gp-0
|
|
(sound-play "generic-beep")
|
|
)
|
|
)
|
|
0
|
|
)
|
|
|
|
(defmethod respond-progress menu-format-card-option ((obj menu-format-card-option) (arg0 progress) (arg1 symbol))
|
|
"Handle progress menu navigation logic."
|
|
(let ((s4-0 (&-> *progress-state* yes-no-choice))
|
|
(gp-0 #f)
|
|
)
|
|
(let ((a1-2 (get-state-check-card arg0 (-> arg0 current))))
|
|
(set-next-state arg0 a1-2 0)
|
|
)
|
|
(cond
|
|
((cpad-pressed? 0 left l-analog-left)
|
|
(set! gp-0 (not (-> s4-0 0)))
|
|
(set! (-> s4-0 0) #t)
|
|
)
|
|
((cpad-pressed? 0 right l-analog-right)
|
|
(set! gp-0 (-> s4-0 0))
|
|
(set! (-> s4-0 0) #f)
|
|
)
|
|
((cpad-pressed? 0 confirm)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
(cond
|
|
((-> *progress-state* yes-no-choice)
|
|
(sound-play "generic-beep")
|
|
(set-next-state arg0 'formatting 0)
|
|
)
|
|
((= (-> arg0 state-stack 0) 'title)
|
|
(sound-play "generic-beep")
|
|
(sound-volume-off)
|
|
(progress-intro-start (logtest? (-> *game-info* purchase-secrets) (game-secrets hero-mode)))
|
|
)
|
|
(else
|
|
(sound-play "generic-beep")
|
|
(pop-state arg0)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(if gp-0
|
|
(sound-play "generic-beep")
|
|
)
|
|
)
|
|
0
|
|
)
|
|
|
|
;; WARN: disable def twice: 110. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare.
|
|
(defmethod respond-progress menu-select-start-option ((obj menu-select-start-option) (arg0 progress) (arg1 symbol))
|
|
"Handle progress menu navigation logic."
|
|
(set! (-> arg0 sliding-height) (seek-ease
|
|
(-> arg0 sliding-height)
|
|
0.0
|
|
(* 0.1 (-> self clock time-adjust-ratio))
|
|
0.3
|
|
(* 0.001 (-> self clock time-adjust-ratio))
|
|
)
|
|
)
|
|
(let ((s4-0 #f))
|
|
(memcard-unlocked-secrets? #t)
|
|
(when (not (-> *progress-state* secrets-unlocked))
|
|
(set! (-> *progress-state* secrets-unlocked) #f)
|
|
(set! (-> arg0 state-pos) 0)
|
|
(set-next-state arg0 'secrets-insufficient-space 0)
|
|
)
|
|
(cond
|
|
((or (cpad-pressed? 0 up l-analog-up)
|
|
(and (cpad-hold? 0 up l-analog-up) (>= (- (current-time) (the-as int (-> obj last-move))) (seconds 0.2)))
|
|
)
|
|
(set! (-> obj last-move) (the-as uint (current-time)))
|
|
(when (> (-> obj task-index) 0)
|
|
(set! s4-0 #t)
|
|
(+! (-> obj task-index) -1)
|
|
(set! (-> arg0 sliding-height) -1.0)
|
|
)
|
|
)
|
|
((or (cpad-pressed? 0 down l-analog-down)
|
|
(and (cpad-hold? 0 down l-analog-down) (>= (- (current-time) (the-as int (-> obj last-move))) (seconds 0.2)))
|
|
)
|
|
(set! (-> obj last-move) (the-as uint (current-time)))
|
|
(let ((s3-0 -1))
|
|
(dotimes (s2-0 (-> *game-info* play-list length))
|
|
(let* ((v1-41 (-> *game-info* play-list s2-0))
|
|
(a0-20 (-> arg0 current))
|
|
(a0-22 (cond
|
|
((= a0-20 'select-pre-start)
|
|
(or (-> v1-41 play-continue) (-> v1-41 pre-play-continue))
|
|
)
|
|
((= a0-20 'select-kiosk-start)
|
|
(-> v1-41 kiosk-play-continue)
|
|
)
|
|
(else
|
|
(-> v1-41 play-continue)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(if (and a0-22 (lookup-text! *common-text* (-> v1-41 text-name) #t))
|
|
(+! s3-0 1)
|
|
)
|
|
)
|
|
)
|
|
(when (< (-> obj task-index) s3-0)
|
|
(set! s4-0 #t)
|
|
(+! (-> obj task-index) 1)
|
|
(set! (-> arg0 sliding-height) 1.0)
|
|
)
|
|
)
|
|
)
|
|
((cpad-pressed? 0 confirm)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
(sound-play "generic-beep")
|
|
(let* ((t9-6 play-task)
|
|
(a0-40 (-> obj real-task-index))
|
|
(a1-8 'debug)
|
|
(v1-64 (-> arg0 current))
|
|
(a1-9 (t9-6 (the-as game-task a0-40) a1-8 (cond
|
|
((= v1-64 'select-pre-start)
|
|
'pre-play
|
|
)
|
|
((= v1-64 'select-kiosk-start)
|
|
'kiosk
|
|
)
|
|
(else
|
|
'play
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(start 'play (get-continue-by-name *game-info* a1-9))
|
|
)
|
|
(set-master-mode 'game)
|
|
)
|
|
)
|
|
(if s4-0
|
|
(sound-play "secrets-scroll")
|
|
)
|
|
)
|
|
0
|
|
)
|
|
|
|
(defmethod respond-progress menu-select-scene-option ((obj menu-select-scene-option) (arg0 progress) (arg1 symbol))
|
|
"Handle progress menu navigation logic."
|
|
(set! (-> arg0 sliding-height) (seek-ease
|
|
(-> arg0 sliding-height)
|
|
0.0
|
|
(* 0.1 (-> self clock time-adjust-ratio))
|
|
0.3
|
|
(* 0.01 (-> self clock time-adjust-ratio))
|
|
)
|
|
)
|
|
(let ((gp-0 #f))
|
|
(let ((s4-0 *hud-select-scene-act1*))
|
|
(memcard-unlocked-secrets? #t)
|
|
(when (not (-> *progress-state* secrets-unlocked))
|
|
(set! (-> *progress-state* secrets-unlocked) #f)
|
|
(set! (-> arg0 state-pos) 0)
|
|
(set-next-state arg0 'secrets-insufficient-space 0)
|
|
)
|
|
(case (-> *progress-state* scene-player-act)
|
|
((1)
|
|
(set! s4-0 *hud-select-scene-act1*)
|
|
)
|
|
((2)
|
|
(set! s4-0 *hud-select-scene-act2*)
|
|
)
|
|
((3)
|
|
(set! s4-0 *hud-select-scene-act3*)
|
|
)
|
|
)
|
|
(cond
|
|
((or (cpad-pressed? 0 up l-analog-up)
|
|
(and (cpad-hold? 0 up l-analog-up) (>= (- (current-time) (the-as int (-> obj last-move))) (seconds 0.2)))
|
|
)
|
|
(set! (-> obj last-move) (the-as uint (current-time)))
|
|
(when (> (-> obj task-index) 0)
|
|
(set! gp-0 #t)
|
|
(+! (-> obj task-index) -1)
|
|
(set! (-> arg0 sliding-height) -1.0)
|
|
)
|
|
)
|
|
((or (cpad-pressed? 0 down l-analog-down)
|
|
(and (cpad-hold? 0 down l-analog-down) (>= (- (current-time) (the-as int (-> obj last-move))) (seconds 0.2)))
|
|
)
|
|
(set! (-> obj last-move) (the-as uint (current-time)))
|
|
(when (< (-> obj task-index) (+ (length s4-0) -1))
|
|
(set! gp-0 #t)
|
|
(+! (-> obj task-index) 1)
|
|
(set! (-> arg0 sliding-height) 1.0)
|
|
)
|
|
)
|
|
((cpad-pressed? 0 confirm)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
(sound-play "generic-beep")
|
|
(let ((s3-2 *display-profile*))
|
|
(play-clean 'debug)
|
|
(set! *display-profile* s3-2)
|
|
)
|
|
(set! (-> *game-info* mode) 'play)
|
|
(let ((s5-1 (-> s4-0 (-> obj task-index))))
|
|
(set! (-> *game-info* demo-state) (the-as uint 100))
|
|
(logior! (-> *game-info* secrets) (game-secrets scene-player-1))
|
|
(process-spawn scene-player :init scene-player-init (-> s5-1 info) #t (-> s5-1 continue))
|
|
)
|
|
(set-master-mode 'game)
|
|
)
|
|
)
|
|
)
|
|
(if gp-0
|
|
(sound-play "secrets-scroll")
|
|
)
|
|
)
|
|
0
|
|
)
|
|
|
|
(defmethod respond-progress menu-bigmap-option ((obj menu-bigmap-option) (arg0 progress) (arg1 symbol))
|
|
"Handle progress menu navigation logic."
|
|
(bigmap-method-12 *bigmap*)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
0
|
|
)
|
|
|
|
(defmethod respond-progress menu-missions-option ((obj menu-missions-option) (arg0 progress) (arg1 symbol))
|
|
"Handle progress menu navigation logic."
|
|
(set! (-> arg0 sliding-height) (seek-ease
|
|
(-> arg0 sliding-height)
|
|
0.0
|
|
(* 0.1 (-> self clock time-adjust-ratio))
|
|
0.3
|
|
(* 0.01 (-> self clock time-adjust-ratio))
|
|
)
|
|
)
|
|
(let ((s5-0 #f))
|
|
(cond
|
|
((or (cpad-pressed? 0 up l-analog-up)
|
|
(and (cpad-hold? 0 up l-analog-up) (>= (- (current-time) (the-as int (-> obj last-move))) (seconds 0.2)))
|
|
)
|
|
(set! (-> obj last-move) (the-as uint (current-time)))
|
|
(when (> (-> obj task-line-index) 0)
|
|
(set! s5-0 #t)
|
|
(+! (-> obj task-line-index) -1)
|
|
(set! (-> arg0 sliding-height) -1.0)
|
|
)
|
|
)
|
|
((or (cpad-pressed? 0 down l-analog-down)
|
|
(and (cpad-hold? 0 down l-analog-down) (>= (- (current-time) (the-as int (-> obj last-move))) (seconds 0.2)))
|
|
)
|
|
(set! (-> obj last-move) (the-as uint (current-time)))
|
|
(when (< (-> obj task-line-index) (+ (-> *progress-state* total-num-tasks) -1))
|
|
(+! (-> obj task-line-index) 1)
|
|
(set! (-> arg0 sliding-height) 1.0)
|
|
(set! s5-0 #t)
|
|
)
|
|
)
|
|
((cpad-pressed? 0 triangle confirm)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle confirm))
|
|
(if (!= (-> *progress-state* starting-state) 'title)
|
|
(sound-play "window-contract")
|
|
(sound-play "generic-beep")
|
|
)
|
|
(pop-state arg0)
|
|
)
|
|
)
|
|
(if s5-0
|
|
(sound-play "mission-scroll")
|
|
)
|
|
)
|
|
0
|
|
)
|
|
|
|
(defmethod respond-progress menu-highscores-option ((obj menu-highscores-option) (arg0 progress) (arg1 symbol))
|
|
"Handle progress menu navigation logic."
|
|
(set! (-> arg0 sliding) (seek-ease
|
|
(-> arg0 sliding)
|
|
0.0
|
|
(* 0.1 (-> self clock time-adjust-ratio))
|
|
0.3
|
|
(* 0.001 (-> self clock time-adjust-ratio))
|
|
)
|
|
)
|
|
(set! (-> arg0 sliding-off) (seek-ease
|
|
(-> arg0 sliding-off)
|
|
1.0
|
|
(* 0.1 (-> self clock time-adjust-ratio))
|
|
-0.3
|
|
(* 0.001 (-> self clock time-adjust-ratio))
|
|
)
|
|
)
|
|
(when (-> *bigmap* progress-minimap)
|
|
(let ((s5-0 #f))
|
|
(cond
|
|
((or (cpad-pressed? 0 right l-analog-right)
|
|
(and (cpad-hold? 0 right l-analog-right)
|
|
(>= (- (current-time) (the-as int (-> obj last-move))) (seconds 0.2))
|
|
)
|
|
)
|
|
(when (< 1 (get-num-highscores))
|
|
(set! (-> obj last-move) (the-as uint (current-time)))
|
|
(set! s5-0 #t)
|
|
(set! (-> obj prev-page-index) (-> obj page-index))
|
|
(set! (-> obj page-index) (get-next-highscore (-> obj page-index)))
|
|
(set! (-> arg0 sliding) 1.0)
|
|
(set! (-> arg0 sliding-off) 0.0)
|
|
(set! (-> obj slide-dir) -1.0)
|
|
)
|
|
)
|
|
((or (cpad-pressed? 0 left l-analog-left)
|
|
(and (cpad-hold? 0 left l-analog-left) (>= (- (current-time) (the-as int (-> obj last-move))) (seconds 0.2)))
|
|
)
|
|
(when (< 1 (get-num-highscores))
|
|
(set! (-> obj last-move) (the-as uint (current-time)))
|
|
(set! (-> obj prev-page-index) (-> obj page-index))
|
|
(set! (-> obj page-index) (get-prev-highscore (-> obj page-index)))
|
|
(set! s5-0 #t)
|
|
(set! (-> arg0 sliding) -1.0)
|
|
(set! (-> arg0 sliding-off) 0.0)
|
|
(set! (-> obj slide-dir) 1.0)
|
|
)
|
|
)
|
|
((cpad-pressed? 0 triangle confirm)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle confirm))
|
|
(set! (-> arg0 sliding) 0.0)
|
|
(set! (-> arg0 sliding-off) 1.0)
|
|
(if (!= (-> *progress-state* starting-state) 'title)
|
|
(sound-play "window-contract")
|
|
(sound-play "generic-beep")
|
|
)
|
|
(pop-state arg0)
|
|
)
|
|
)
|
|
(if s5-0
|
|
(sound-play "score-slide")
|
|
)
|
|
)
|
|
)
|
|
0
|
|
)
|
|
|
|
(defmethod respond-progress menu-secret-option ((obj menu-secret-option) (arg0 progress) (arg1 symbol))
|
|
"Handle progress menu navigation logic."
|
|
(let* ((s5-1 (logtest? (-> *game-info* secrets) (game-secrets hero-mode)))
|
|
(s3-0 (if (not s5-1)
|
|
0
|
|
(-> obj num-items)
|
|
)
|
|
)
|
|
(s2-0 (if (not s5-1)
|
|
(+ (-> obj num-items) -1)
|
|
(+ (-> obj num-items) -1 (-> obj num-hero-items))
|
|
)
|
|
)
|
|
)
|
|
(set! (-> arg0 sliding) (seek-ease
|
|
(-> arg0 sliding)
|
|
0.0
|
|
(* 0.1 (-> self clock time-adjust-ratio))
|
|
0.3
|
|
(* 0.001 (-> self clock time-adjust-ratio))
|
|
)
|
|
)
|
|
(cond
|
|
((and s5-1 (< (-> obj item-index) s3-0))
|
|
(set! (-> obj item-index) s3-0)
|
|
(set! (-> obj prev-item-index) s3-0)
|
|
)
|
|
((and (not s5-1) (< s2-0 (-> obj item-index)))
|
|
(set! (-> obj item-index) s3-0)
|
|
(set! (-> obj prev-item-index) s3-0)
|
|
)
|
|
)
|
|
(menu-update-purchase-secrets obj)
|
|
(when (-> *bigmap* progress-minimap)
|
|
(let ((s5-2 #f))
|
|
(cond
|
|
((= arg1 #t)
|
|
(when (cpad-pressed? 0 confirm)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
(sound-play "generic-beep")
|
|
(set! (-> arg0 selected-option) #f)
|
|
)
|
|
)
|
|
(else
|
|
(cond
|
|
((or (cpad-pressed? 0 down l-analog-down)
|
|
(and (cpad-hold? 0 down l-analog-down) (>= (- (current-time) (the-as int (-> obj last-move))) (seconds 0.2)))
|
|
)
|
|
(set! (-> obj last-move) (the-as uint (current-time)))
|
|
(when (< (-> obj item-index) s2-0)
|
|
(set! (-> obj prev-item-index) (-> obj item-index))
|
|
(set! s5-2 #t)
|
|
(+! (-> obj item-index) 1)
|
|
(set! (-> arg0 sliding) 1.0)
|
|
(set! (-> arg0 sliding-off) 0.0)
|
|
)
|
|
)
|
|
((or (cpad-pressed? 0 up l-analog-up)
|
|
(and (cpad-hold? 0 up l-analog-up) (>= (- (current-time) (the-as int (-> obj last-move))) (seconds 0.2)))
|
|
)
|
|
(set! (-> obj last-move) (the-as uint (current-time)))
|
|
(when (< s3-0 (-> obj item-index))
|
|
(set! (-> obj prev-item-index) (-> obj item-index))
|
|
(+! (-> obj item-index) -1)
|
|
(set! s5-2 #t)
|
|
(set! (-> arg0 sliding) -1.0)
|
|
(set! (-> arg0 sliding-off) 0.0)
|
|
)
|
|
)
|
|
((cpad-pressed? 0 confirm)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
(let ((v1-74 (-> obj item-index)))
|
|
(-> obj secret-items v1-74 cost)
|
|
(let ((a0-54 (-> obj secret-items v1-74 flag))
|
|
(a1-9 (= (-> obj secret-items v1-74 can-toggle) #t))
|
|
)
|
|
(-> obj secret-items v1-74 avail-after)
|
|
(the int (-> *game-info* skill))
|
|
(cond
|
|
((and (logtest? (-> *game-info* purchase-secrets) a0-54) a1-9)
|
|
(set! (-> arg0 selected-option) #t)
|
|
(sound-play "generic-beep")
|
|
)
|
|
((= (-> obj secret-items v1-74 can-toggle) 'auto)
|
|
)
|
|
((logtest? (-> *game-info* purchase-secrets) a0-54)
|
|
(set! (-> arg0 selected-option) #t)
|
|
(sound-play "generic-beep")
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
((cpad-pressed? 0 triangle)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle))
|
|
(if (!= (-> *progress-state* starting-state) 'title)
|
|
(sound-play "window-contract")
|
|
(sound-play "generic-beep")
|
|
)
|
|
(pop-state arg0)
|
|
)
|
|
)
|
|
(if s5-2
|
|
(sound-play "secrets-scroll")
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
0
|
|
)
|
|
|
|
(defmethod respond-progress menu-game-option ((obj menu-game-option) (arg0 progress) (arg1 symbol))
|
|
"Handle progress menu navigation logic."
|
|
(-> *progress-state* game-options-vibrations)
|
|
(-> *progress-state* game-options-subtitles)
|
|
(let ((gp-0 #f))
|
|
(load-level-text-files (the-as int (-> *setting-control* user-current language)))
|
|
(cond
|
|
((= (-> *progress-state* game-options-item-picked) #f)
|
|
(cond
|
|
((or (cpad-pressed? 0 down l-analog-down)
|
|
(and (cpad-hold? 0 down l-analog-down)
|
|
(>= (- (current-time) (the-as int (-> *progress-state* game-options-last-move))) (seconds 0.5))
|
|
)
|
|
)
|
|
(set! (-> *progress-state* game-options-last-move) (the-as uint (current-time)))
|
|
(cond
|
|
((< (-> *progress-state* game-options-item-selected) 3)
|
|
(+! (-> *progress-state* game-options-item-selected) 1)
|
|
)
|
|
(else
|
|
(set! (-> *progress-state* game-options-item-selected) 0)
|
|
0
|
|
)
|
|
)
|
|
)
|
|
((or (cpad-pressed? 0 up l-analog-up)
|
|
(and (cpad-hold? 0 up l-analog-up)
|
|
(>= (- (current-time) (the-as int (-> *progress-state* game-options-last-move))) (seconds 0.5))
|
|
)
|
|
)
|
|
(set! (-> *progress-state* game-options-last-move) (the-as uint (current-time)))
|
|
(if (> (-> *progress-state* game-options-item-selected) 0)
|
|
(+! (-> *progress-state* game-options-item-selected) -1)
|
|
(set! (-> *progress-state* game-options-item-selected) 3)
|
|
)
|
|
)
|
|
((cpad-pressed? 0 confirm)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
(set! (-> *progress-state* game-options-last-move) (the-as uint (current-time)))
|
|
(set! (-> *progress-state* game-options-item-picked) (the-as basic #t))
|
|
(sound-play "generic-beep")
|
|
)
|
|
((cpad-pressed? 0 triangle)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle))
|
|
(if (= (-> *progress-state* starting-state) 'main)
|
|
(sound-play "window-contract")
|
|
(sound-play "generic-beep")
|
|
)
|
|
(pop-state arg0)
|
|
)
|
|
)
|
|
)
|
|
((-> *progress-state* game-options-item-picked)
|
|
(cond
|
|
((cpad-pressed? 0 triangle)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle))
|
|
(set! (-> *progress-state* game-options-item-picked) #f)
|
|
(set! (-> *progress-state* game-options-vibrations) (-> *setting-control* user-default vibration))
|
|
(set! (-> *progress-state* game-options-subtitles) (-> *setting-control* user-default subtitle))
|
|
(set! (-> *progress-state* game-options-language-index)
|
|
(the-as int (-> *setting-control* user-default language))
|
|
)
|
|
(set! (-> *progress-state* game-options-subtitle-language-index)
|
|
(the-as int (-> *setting-control* user-default subtitle-language))
|
|
)
|
|
)
|
|
((cpad-pressed? 0 up l-analog-up)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons up l-analog-up))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons up l-analog-up))
|
|
)
|
|
((cpad-pressed? 0 down l-analog-down)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons down l-analog-down))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons down l-analog-down))
|
|
)
|
|
((and (zero? (-> *progress-state* game-options-item-selected)) (cpad-pressed? 0 left l-analog-left))
|
|
(sound-play "generic-beep")
|
|
(when (not (-> *progress-state* game-options-vibrations))
|
|
(set! (-> *cpad-list* cpads 0 buzz-pause-val 0) (the-as uint 255))
|
|
(set! (-> *cpad-list* cpads 0 buzz-pause-time) (the-as uint 15))
|
|
(set! (-> *progress-state* game-options-vibrations) #t)
|
|
)
|
|
)
|
|
((and (= (-> *progress-state* game-options-item-selected) 1) (cpad-pressed? 0 left l-analog-left))
|
|
(sound-play "generic-beep")
|
|
(if (not (-> *progress-state* game-options-subtitles))
|
|
(set! (-> *progress-state* game-options-subtitles) #t)
|
|
)
|
|
)
|
|
((and (= (-> *progress-state* game-options-item-selected) 2) (cpad-pressed? 0 left l-analog-left))
|
|
(sound-play "generic-beep")
|
|
(if (zero? (-> *progress-state* game-options-subtitle-language-index))
|
|
(set! (-> *progress-state* game-options-subtitle-language-index) 6)
|
|
(+! (-> *progress-state* game-options-subtitle-language-index) -1)
|
|
)
|
|
)
|
|
((and (= (-> *progress-state* game-options-item-selected) 3) (cpad-pressed? 0 left l-analog-left))
|
|
(sound-play "generic-beep")
|
|
(if (zero? (-> *progress-state* game-options-language-index))
|
|
(set! (-> *progress-state* game-options-language-index) 6)
|
|
(+! (-> *progress-state* game-options-language-index) -1)
|
|
)
|
|
)
|
|
((and (zero? (-> *progress-state* game-options-item-selected)) (cpad-pressed? 0 right l-analog-right))
|
|
(sound-play "generic-beep")
|
|
(set! (-> *progress-state* game-options-vibrations) #f)
|
|
)
|
|
((and (= (-> *progress-state* game-options-item-selected) 1) (cpad-pressed? 0 right l-analog-right))
|
|
(sound-play "generic-beep")
|
|
(set! (-> *progress-state* game-options-subtitles) #f)
|
|
)
|
|
((and (= (-> *progress-state* game-options-item-selected) 2) (cpad-pressed? 0 right l-analog-right))
|
|
(sound-play "generic-beep")
|
|
(cond
|
|
((= (-> *progress-state* game-options-subtitle-language-index) 6)
|
|
(set! (-> *progress-state* game-options-subtitle-language-index) 0)
|
|
0
|
|
)
|
|
(else
|
|
(+! (-> *progress-state* game-options-subtitle-language-index) 1)
|
|
)
|
|
)
|
|
)
|
|
((and (= (-> *progress-state* game-options-item-selected) 3) (cpad-pressed? 0 right l-analog-right))
|
|
(sound-play "generic-beep")
|
|
(cond
|
|
((= (-> *progress-state* game-options-language-index) 6)
|
|
(set! (-> *progress-state* game-options-language-index) 0)
|
|
0
|
|
)
|
|
(else
|
|
(+! (-> *progress-state* game-options-language-index) 1)
|
|
)
|
|
)
|
|
)
|
|
((cpad-pressed? 0 confirm)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
(sound-play "generic-beep")
|
|
(if (zero? (-> *progress-state* game-options-item-selected))
|
|
(set! (-> *setting-control* user-default vibration) (-> *progress-state* game-options-vibrations))
|
|
)
|
|
(if (= (-> *progress-state* game-options-item-selected) 1)
|
|
(set! (-> *setting-control* user-default subtitle) (-> *progress-state* game-options-subtitles))
|
|
)
|
|
(if (= (-> *progress-state* game-options-item-selected) 2)
|
|
(set! (-> *setting-control* user-default subtitle-language)
|
|
(the-as language-enum (-> *progress-state* game-options-subtitle-language-index))
|
|
)
|
|
)
|
|
(when (= (-> *progress-state* game-options-item-selected) 3)
|
|
(set! (-> *setting-control* user-default language)
|
|
(the-as language-enum (-> *progress-state* game-options-language-index))
|
|
)
|
|
(load-level-text-files (-> *progress-state* game-options-language-index))
|
|
)
|
|
(set! (-> *progress-state* game-options-item-picked) #f)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(when (and gp-0 (-> *progress-state* game-options-item-picked))
|
|
)
|
|
)
|
|
0
|
|
)
|
|
|
|
(defun update-center-screen ()
|
|
(let ((v1-0 #f))
|
|
(cond
|
|
(#t
|
|
(cond
|
|
((cpad-hold? 0 left l-analog-left)
|
|
(set! (-> *setting-control* user-default display-dx)
|
|
(min-max-wrap-around (+ (-> *setting-control* user-default display-dx) -2) -96 96)
|
|
)
|
|
(set! v1-0 #t)
|
|
)
|
|
((cpad-hold? 0 right l-analog-right)
|
|
(set! (-> *setting-control* user-default display-dx)
|
|
(min-max-wrap-around (+ (-> *setting-control* user-default display-dx) 2) -96 96)
|
|
)
|
|
(set! v1-0 #t)
|
|
)
|
|
((cpad-hold? 0 up l-analog-up)
|
|
(set! (-> *setting-control* user-default display-dy)
|
|
(min-max-wrap-around (+ (-> *setting-control* user-default display-dy) -2) -48 48)
|
|
)
|
|
(set! v1-0 #f)
|
|
)
|
|
((cpad-hold? 0 down l-analog-down)
|
|
(set! (-> *setting-control* user-default display-dy)
|
|
(min-max-wrap-around (+ (-> *setting-control* user-default display-dy) 2) -48 48)
|
|
)
|
|
(set! v1-0 #f)
|
|
)
|
|
((cpad-pressed? 0 triangle)
|
|
(set! (-> *setting-control* user-default display-dx) (-> *progress-state* center-x-backup))
|
|
(set! (-> *setting-control* user-default display-dy) (-> *progress-state* center-y-backup))
|
|
)
|
|
)
|
|
)
|
|
(else
|
|
(when (cpad-pressed? 0 confirm)
|
|
(set! (-> *progress-state* center-x-backup) (-> *setting-control* user-default display-dx))
|
|
(set! (-> *progress-state* center-y-backup) (-> *setting-control* user-default display-dy))
|
|
)
|
|
)
|
|
)
|
|
(when v1-0
|
|
(when (< (seconds 0.3) (- (current-time) (-> *progress-state* last-slider-sound)))
|
|
(set! (-> *progress-state* last-slider-sound) (current-time))
|
|
(sound-play "roll-over")
|
|
)
|
|
)
|
|
)
|
|
0
|
|
)
|
|
|
|
(defmethod respond-progress menu-graphic-option ((obj menu-graphic-option) (arg0 progress) (arg1 symbol))
|
|
"Handle progress menu navigation logic."
|
|
(-> *progress-state* graphic-options-aspect-ratio)
|
|
(-> *progress-state* graphic-options-progressive-scan)
|
|
(-> *progress-state* video-mode-choice)
|
|
(cond
|
|
((= (-> *progress-state* graphic-options-item-picked) #f)
|
|
(cond
|
|
((or (cpad-pressed? 0 down l-analog-down)
|
|
(and (cpad-hold? 0 down l-analog-down)
|
|
(>= (- (current-time) (the-as int (-> *progress-state* graphic-options-last-move))) (seconds 0.5))
|
|
)
|
|
)
|
|
(set! (-> *progress-state* graphic-options-last-move) (the-as uint (current-time)))
|
|
(set! (-> arg0 selected-option) #f)
|
|
(cond
|
|
((< (-> *progress-state* graphic-options-item-selected) (if (= (scf-get-territory) 1)
|
|
3
|
|
2
|
|
)
|
|
)
|
|
(+! (-> *progress-state* graphic-options-item-selected) 1)
|
|
(set! (-> arg0 option-index) (-> *progress-state* graphic-options-item-selected))
|
|
)
|
|
(else
|
|
(set! (-> *progress-state* graphic-options-item-selected) 0)
|
|
(set! (-> arg0 option-index) (-> *progress-state* graphic-options-item-selected))
|
|
)
|
|
)
|
|
)
|
|
((or (cpad-pressed? 0 up l-analog-up)
|
|
(and (cpad-hold? 0 up l-analog-up)
|
|
(>= (- (current-time) (the-as int (-> *progress-state* graphic-options-last-move))) (seconds 0.5))
|
|
)
|
|
)
|
|
(set! (-> *progress-state* graphic-options-last-move) (the-as uint (current-time)))
|
|
(set! (-> arg0 selected-option) #f)
|
|
(cond
|
|
((> (-> *progress-state* graphic-options-item-selected) 0)
|
|
(+! (-> *progress-state* graphic-options-item-selected) -1)
|
|
(set! (-> arg0 option-index) (-> *progress-state* graphic-options-item-selected))
|
|
)
|
|
(else
|
|
(set! (-> *progress-state* graphic-options-item-selected) (if (= (scf-get-territory) 1)
|
|
3
|
|
2
|
|
)
|
|
)
|
|
(set! (-> arg0 option-index) (-> *progress-state* graphic-options-item-selected))
|
|
)
|
|
)
|
|
)
|
|
((cpad-pressed? 0 confirm)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
(set! (-> *progress-state* graphic-options-last-move) (the-as uint (current-time)))
|
|
(set! (-> *progress-state* graphic-options-item-picked) (the-as basic #t))
|
|
(set! (-> arg0 selected-option) #f)
|
|
(sound-play "generic-beep")
|
|
)
|
|
((cpad-pressed? 0 triangle)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle))
|
|
(if (= (-> *progress-state* starting-state) 'main)
|
|
(sound-play "window-contract")
|
|
(sound-play "generic-beep")
|
|
)
|
|
(pop-state arg0)
|
|
)
|
|
)
|
|
)
|
|
((-> *progress-state* graphic-options-item-picked)
|
|
(cond
|
|
((and (cpad-pressed? 0 square) (zero? (-> *progress-state* graphic-options-item-selected)))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons square))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons square))
|
|
(set! (-> *setting-control* user-default display-dx) 0)
|
|
(set! (-> *setting-control* user-default display-dy) 8)
|
|
(sound-play "generic-beep")
|
|
)
|
|
((cpad-pressed? 0 triangle)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle))
|
|
(set! (-> *progress-state* graphic-options-item-picked) #f)
|
|
(set! (-> *progress-state* graphic-options-aspect-ratio) (get-aspect-ratio))
|
|
(set! (-> *progress-state* graphic-options-progressive-scan)
|
|
(-> *setting-control* user-default use-progressive-scan)
|
|
)
|
|
(set! (-> *progress-state* video-mode-choice) (get-video-mode))
|
|
)
|
|
((and (zero? (-> *progress-state* graphic-options-item-selected))
|
|
(cpad-pressed? 0 up right down left l-analog-up l-analog-right l-analog-down l-analog-left)
|
|
)
|
|
(let ((t9-13 update-center-screen))
|
|
#t
|
|
(t9-13)
|
|
)
|
|
)
|
|
((and (= (-> *progress-state* graphic-options-item-selected) 1) (cpad-pressed? 0 left l-analog-left))
|
|
(sound-play "generic-beep")
|
|
(set! (-> *progress-state* graphic-options-aspect-ratio) 'aspect4x3)
|
|
)
|
|
((and (= (-> *progress-state* graphic-options-item-selected) 2) (cpad-pressed? 0 left l-analog-left))
|
|
(sound-play "generic-beep")
|
|
(if (not (-> *progress-state* graphic-options-progressive-scan))
|
|
(set! (-> *progress-state* graphic-options-progressive-scan) #t)
|
|
)
|
|
)
|
|
((and (= (-> *progress-state* graphic-options-item-selected) 3) (cpad-pressed? 0 left l-analog-left))
|
|
(sound-play "generic-beep")
|
|
(if (!= (-> *progress-state* video-mode-choice) 'pal)
|
|
(set! (-> *progress-state* video-mode-choice) 'pal)
|
|
)
|
|
)
|
|
((and (= (-> *progress-state* graphic-options-item-selected) 1) (cpad-pressed? 0 right l-analog-right))
|
|
(sound-play "generic-beep")
|
|
(set! (-> *progress-state* graphic-options-aspect-ratio) 'aspect16x9)
|
|
)
|
|
((and (= (-> *progress-state* graphic-options-item-selected) 2) (cpad-pressed? 0 right l-analog-right))
|
|
(when (-> *progress-state* graphic-options-progressive-scan)
|
|
(sound-play "generic-beep")
|
|
(set! (-> *progress-state* graphic-options-progressive-scan) #f)
|
|
(set! (-> *setting-control* user-default use-progressive-scan) #f)
|
|
)
|
|
)
|
|
((and (= (-> *progress-state* graphic-options-item-selected) 3) (cpad-pressed? 0 right l-analog-right))
|
|
(sound-play "generic-beep")
|
|
(if (!= (-> *progress-state* video-mode-choice) 'ntsc)
|
|
(set! (-> *progress-state* video-mode-choice) 'ntsc)
|
|
)
|
|
)
|
|
((cpad-pressed? 0 confirm)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
(sound-play "generic-beep")
|
|
(when (zero? (-> *progress-state* graphic-options-item-selected))
|
|
(let ((t9-28 update-center-screen))
|
|
#t
|
|
(t9-28)
|
|
)
|
|
)
|
|
(when (= (-> *progress-state* graphic-options-item-selected) 1)
|
|
(if (!= (-> *progress-state* graphic-options-aspect-ratio) (-> *setting-control* user-default aspect-ratio))
|
|
(set! (-> *setting-control* user-default aspect-ratio) (-> *progress-state* graphic-options-aspect-ratio))
|
|
)
|
|
)
|
|
(when (and (= (-> *progress-state* graphic-options-item-selected) 2)
|
|
(-> *progress-state* graphic-options-progressive-scan)
|
|
(not (-> *setting-control* user-default use-progressive-scan))
|
|
)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
(push-state arg0)
|
|
(set-next-state arg0 'progressive-mode-warning 0)
|
|
)
|
|
(when (and (= (-> *progress-state* graphic-options-item-selected) 3)
|
|
(!= (-> *setting-control* user-default video-mode) (-> *progress-state* video-mode-choice))
|
|
)
|
|
(let ((a0-173 (-> *progress-state* video-mode-choice)))
|
|
(case a0-173
|
|
(('pal)
|
|
(set! (-> *setting-control* user-default video-mode) a0-173)
|
|
)
|
|
(('ntsc)
|
|
(push-state arg0)
|
|
(set-next-state arg0 'video-mode-warning 0)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(set! (-> *progress-state* graphic-options-item-picked) #f)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
0
|
|
)
|
|
|
|
(defun update-restart-quit ((arg0 menu-option) (arg1 progress) (arg2 symbol))
|
|
(let ((v1-1 (&-> *progress-state* yes-no-choice))
|
|
(gp-0 #f)
|
|
)
|
|
(when arg2
|
|
(cond
|
|
((cpad-pressed? 0 left l-analog-left)
|
|
(when (not (-> v1-1 0))
|
|
(set! gp-0 #t)
|
|
(set! (-> v1-1 0) #t)
|
|
)
|
|
)
|
|
((cpad-pressed? 0 right l-analog-right)
|
|
(set! gp-0 (-> v1-1 0))
|
|
(set! (-> v1-1 0) #f)
|
|
(format #t "HL ~A~%" (-> v1-1 0))
|
|
)
|
|
((cpad-pressed? 0 confirm)
|
|
(cond
|
|
((and (-> v1-1 0) (= (-> arg0 name) (text-id progress-root-restart-mission)))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
(restart-mission)
|
|
(set-next-state arg1 'go-away 0)
|
|
)
|
|
((and (-> v1-1 0) (= (-> arg0 name) (text-id progress-quit)))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
(initialize! *game-info* 'game (the-as game-save #f) "title-restart")
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(when gp-0
|
|
)
|
|
)
|
|
0
|
|
)
|
|
|
|
(defmethod respond-progress menu-qr-option ((obj menu-qr-option) (arg0 progress) (arg1 symbol))
|
|
"Handle progress menu navigation logic."
|
|
(-> *progress-state* qr-options-restart)
|
|
(-> *progress-state* qr-options-quit)
|
|
(cond
|
|
((= (-> *progress-state* qr-options-item-picked) #f)
|
|
(set! (-> arg0 selected-option) #f)
|
|
(set! (-> arg0 option-index) (-> *progress-state* qr-options-item-selected))
|
|
(cond
|
|
((or (cpad-pressed? 0 down l-analog-down)
|
|
(and (cpad-hold? 0 down l-analog-down)
|
|
(>= (- (current-time) (the-as int (-> *progress-state* qr-options-last-move))) (seconds 0.5))
|
|
)
|
|
)
|
|
(set! (-> *progress-state* qr-options-last-move) (the-as uint (current-time)))
|
|
(cond
|
|
((< (-> *progress-state* qr-options-item-selected) 1)
|
|
(+! (-> *progress-state* qr-options-item-selected) 1)
|
|
(set! (-> arg0 selected-option) #f)
|
|
(set! (-> arg0 option-index) 0)
|
|
0
|
|
)
|
|
(else
|
|
(set! (-> *progress-state* qr-options-item-selected) 0)
|
|
(set! (-> arg0 selected-option) #f)
|
|
(set! (-> arg0 option-index) 0)
|
|
0
|
|
)
|
|
)
|
|
)
|
|
((or (cpad-pressed? 0 up l-analog-up)
|
|
(and (cpad-hold? 0 up l-analog-up)
|
|
(>= (- (current-time) (the-as int (-> *progress-state* qr-options-last-move))) (seconds 0.5))
|
|
)
|
|
)
|
|
(set! (-> *progress-state* qr-options-last-move) (the-as uint (current-time)))
|
|
(cond
|
|
((> (-> *progress-state* qr-options-item-selected) 0)
|
|
(+! (-> *progress-state* qr-options-item-selected) -1)
|
|
(set! (-> arg0 selected-option) #f)
|
|
(set! (-> arg0 option-index) 1)
|
|
)
|
|
(else
|
|
(set! (-> *progress-state* qr-options-item-selected) 1)
|
|
(set! (-> arg0 selected-option) #f)
|
|
(set! (-> arg0 option-index) 1)
|
|
)
|
|
)
|
|
)
|
|
((cpad-pressed? 0 confirm)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
|
|
(set! (-> *progress-state* qr-options-last-move) (the-as uint (current-time)))
|
|
(set! (-> *progress-state* qr-options-item-picked) (the-as basic #t))
|
|
(set! (-> arg0 selected-option) #t)
|
|
(sound-play "generic-beep")
|
|
)
|
|
((cpad-pressed? 0 triangle)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle))
|
|
(if (!= (-> *progress-state* starting-state) 'title)
|
|
(sound-play "window-contract")
|
|
(sound-play "generic-beep")
|
|
)
|
|
(pop-state arg0)
|
|
)
|
|
)
|
|
)
|
|
((-> *progress-state* qr-options-item-picked)
|
|
(cond
|
|
((and (cpad-pressed? 0 triangle) (zero? (-> *progress-state* qr-options-item-selected)))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle))
|
|
(sound-play "generic-beep")
|
|
(set! (-> *progress-state* qr-options-item-picked) #f)
|
|
(set! (-> arg0 selected-option) #f)
|
|
(set! (-> *progress-state* yes-no-choice) #f)
|
|
)
|
|
((and (cpad-pressed? 0 triangle) (= (-> *progress-state* qr-options-item-selected) 1))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle))
|
|
(sound-play "generic-beep")
|
|
(set! (-> *progress-state* qr-options-item-picked) #f)
|
|
(set! (-> arg0 selected-option) #f)
|
|
(set! (-> *progress-state* yes-no-choice) #f)
|
|
)
|
|
((and (zero? (-> *progress-state* qr-options-item-selected)) (cpad-pressed? 0 left l-analog-left))
|
|
(sound-play "generic-beep")
|
|
(update-restart-quit obj arg0 #t)
|
|
)
|
|
((and (zero? (-> *progress-state* qr-options-item-selected)) (cpad-pressed? 0 right l-analog-right))
|
|
(sound-play "generic-beep")
|
|
(update-restart-quit obj arg0 #t)
|
|
)
|
|
((and (= (-> *progress-state* qr-options-item-selected) 1) (cpad-pressed? 0 left l-analog-left))
|
|
(sound-play "generic-beep")
|
|
(update-restart-quit obj arg0 #t)
|
|
)
|
|
((and (= (-> *progress-state* qr-options-item-selected) 1) (cpad-pressed? 0 right l-analog-right))
|
|
(sound-play "generic-beep")
|
|
(update-restart-quit obj arg0 #t)
|
|
)
|
|
((cpad-pressed? 0 triangle)
|
|
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle))
|
|
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle))
|
|
(set! (-> *progress-state* qr-options-item-picked) #f)
|
|
(set! (-> arg0 selected-option) #f)
|
|
(set! (-> *progress-state* yes-no-choice) #f)
|
|
)
|
|
((cpad-pressed? 0 confirm)
|
|
(sound-play "generic-beep")
|
|
(when (zero? (-> *progress-state* qr-options-item-selected))
|
|
(set! (-> arg0 selected-option) #t)
|
|
(set! (-> arg0 option-index) 0)
|
|
(update-restart-quit obj arg0 #t)
|
|
)
|
|
(when (= (-> *progress-state* qr-options-item-selected) 1)
|
|
(set! (-> arg0 selected-option) #t)
|
|
(set! (-> arg0 option-index) 1)
|
|
(update-restart-quit obj arg0 #t)
|
|
)
|
|
(set! (-> *progress-state* qr-options-item-picked) #f)
|
|
(set! (-> *progress-state* yes-no-choice) #f)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
0
|
|
)
|