From 77adbc580f4b0baa63f24f2383a5bf5c48a85a94 Mon Sep 17 00:00:00 2001 From: Tyler Wilding Date: Mon, 26 Sep 2022 00:15:47 -0400 Subject: [PATCH] d/jak2: add `progress` to gsrc --- goal_src/jak2/engine/data/art-h.gc | 2 +- goal_src/jak2/engine/game/game-info-h.gc | 10 +- .../jak2/engine/game/task/task-control-h.gc | 3 + goal_src/jak2/engine/target/logic-target.gc | 99 +- goal_src/jak2/engine/ui/hud-h.gc | 4 + .../jak2/engine/ui/progress/progress-h.gc | 110 +- .../engine/ui/progress/progress-static.gc | 34 +- goal_src/jak2/engine/ui/progress/progress.gc | 3753 +++++++++++++++++ goal_src/jak2/engine/ui/text-h.gc | 9 + 9 files changed, 3881 insertions(+), 143 deletions(-) diff --git a/goal_src/jak2/engine/data/art-h.gc b/goal_src/jak2/engine/data/art-h.gc index 1736cd1079..431baf08f6 100644 --- a/goal_src/jak2/engine/data/art-h.gc +++ b/goal_src/jak2/engine/data/art-h.gc @@ -390,7 +390,7 @@ (get-skeleton-origin (_type_) vector 9) (draw-control-method-10 () none 10) (draw-control-method-11 () none 11) - (draw-control-method-12 (_type_ int int) none 12) + (draw-control-method-12 (_type_ uint int) none 12) (draw-control-method-13 () none 13) (draw-control-method-14 (_type_ cspace-array joint-control) none 14) ) diff --git a/goal_src/jak2/engine/game/game-info-h.gc b/goal_src/jak2/engine/game/game-info-h.gc index 62ec5cf271..c2e00f46a1 100644 --- a/goal_src/jak2/engine/game/game-info-h.gc +++ b/goal_src/jak2/engine/game/game-info-h.gc @@ -314,7 +314,7 @@ (letterbox-time time-frame :offset-assert 400) (hint-play-time time-frame :offset-assert 408) (display-text-time time-frame :offset-assert 416) - (display-text-handle uint64 :offset-assert 424) + (display-text-handle handle :offset-assert 424) (death-movie-tick int32 :offset-assert 432) (want-auto-save symbol :offset-assert 436) (auto-save-proc handle :offset-assert 440) @@ -322,8 +322,8 @@ (auto-save-card int32 :offset-assert 452) (auto-save-which int32 :offset-assert 456) (auto-save-count int32 :offset-assert 460) - (pov-camera-handle uint64 :offset-assert 464) - (other-camera-handle uint64 :offset-assert 472) + (pov-camera-handle handle :offset-assert 464) + (other-camera-handle handle :offset-assert 472) (controller handle 2 :offset-assert 480) (race-timer uint64 :offset-assert 496) (race-current-lap-count int32 :offset-assert 504) @@ -395,7 +395,3 @@ gp-0 ) ) - - - - diff --git a/goal_src/jak2/engine/game/task/task-control-h.gc b/goal_src/jak2/engine/game/task/task-control-h.gc index b89b5ae8c2..b5ee995f1b 100644 --- a/goal_src/jak2/engine/game/task/task-control-h.gc +++ b/goal_src/jak2/engine/game/task/task-control-h.gc @@ -176,6 +176,9 @@ (define-extern task-node-open? (function game-task symbol)) (define-extern play-task (function game-task symbol symbol string)) +;; NOTE - for progress +(define-extern restart-mission (function int)) + ;; DECOMP BEGINS (defun-debug game-task->string ((arg0 game-task)) diff --git a/goal_src/jak2/engine/target/logic-target.gc b/goal_src/jak2/engine/target/logic-target.gc index c39a6f57ec..48cc7a6220 100644 --- a/goal_src/jak2/engine/target/logic-target.gc +++ b/goal_src/jak2/engine/target/logic-target.gc @@ -30,8 +30,6 @@ ;; DECOMP BEGINS -;; definition for function build-conversions -;; INFO: Used lq/sq (defbehavior build-conversions target ((arg0 vector)) (when (!= (-> self control unknown-surface02) (-> self control surf)) (set! (-> self control unknown-surface02) (-> self control surf)) @@ -86,8 +84,6 @@ ) ) -;; definition for function vector-turn-to -;; INFO: Used lq/sq (defbehavior vector-turn-to target ((arg0 vector)) (forward-up-nopitch->quaternion (-> self control dir-targ) @@ -98,7 +94,6 @@ (build-conversions (-> self control transv)) ) -;; definition for function reverse-conversions ;; WARN: Return type mismatch cshape-moving-flags vs none. (defbehavior reverse-conversions target ((arg0 vector)) (let ((v1-1 (-> self control unknown-vector00))) @@ -109,7 +104,6 @@ (none) ) -;; definition (debug) for function draw-history (defun-debug draw-history ((arg0 control-info)) (when (nonzero? *display-collide-history*) (when (cpad-pressed? 0 l3) @@ -148,11 +142,8 @@ (none) ) -;; definition (debug) for function target-history-print ;; ERROR: function was not converted to expressions. Cannot decompile. -;; definition (debug) for function target-print-stats -;; INFO: Used lq/sq (defun-debug target-print-stats ((arg0 target) (arg1 symbol)) (local-vars (sv-64 int) @@ -536,8 +527,6 @@ ) ) -;; definition for function read-pad -;; INFO: Used lq/sq (defbehavior read-pad target ((arg0 vector)) (when (!= (-> self control unknown-dword01) (-> *display* real-clock frame-counter)) (set! (-> self control unknown-vector13 quad) (-> self control unknown-vector12 quad)) @@ -571,7 +560,6 @@ (vector-matrix*! arg0 arg0 (-> self control unknown-matrix03)) ) -;; definition for function set-pad (defbehavior set-pad target ((arg0 vector)) (set! (-> self control unknown-float12) (vector-length arg0)) (let ((s5-0 vector-matrix*!) @@ -585,16 +573,12 @@ arg0 ) -;; definition for function warp-vector-into-surface! -;; INFO: Used lq/sq (defun warp-vector-into-surface! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 matrix)) (let ((a2-1 (matrix-from-two-vectors! (new-stack-matrix0) (-> arg3 vector 1) arg2))) (vector-matrix*! arg0 arg1 a2-1) ) ) -;; definition for function vector<-pad-in-surface! -;; INFO: Used lq/sq (defbehavior vector<-pad-in-surface! target ((arg0 vector) (arg1 symbol)) (let ((a1-1 (read-pad (new-stack-vector0)))) (warp-vector-into-surface! arg0 a1-1 (-> self control local-normal) (-> self control unknown-matrix03)) @@ -605,7 +589,6 @@ arg0 ) -;; definition for function vector<-pad-in-matrix! ;; WARN: Return type mismatch vector vs none. (defun vector<-pad-in-matrix! ((arg0 vector) (arg1 cpad-info) (arg2 matrix)) (let ((gp-0 (new 'stack-no-clear 'vector)) @@ -628,8 +611,6 @@ (none) ) -;; definition for function local-pad-angle -;; INFO: Used lq/sq (defbehavior local-pad-angle target () (let ((a0-1 (vector<-pad-in-surface! (new-stack-vector0) #f))) (vector-dot @@ -639,8 +620,6 @@ ) ) -;; definition for function turn-around? -;; INFO: Used lq/sq (defbehavior turn-around? target () (let* ((a0-1 (vector<-pad-in-surface! (new-stack-vector0) #f)) (gp-0 (vector-normalize! a0-1 1.0)) @@ -689,8 +668,6 @@ ) ) -;; definition for function wall-hide? -;; INFO: Used lq/sq (defbehavior wall-hide? target () (when (and (< 0.7 (-> self control unknown-float12)) (< 0.7 (-> self control unknown-float27)) @@ -762,9 +739,6 @@ ) ) -;; definition for function target-log-trans -;; INFO: Used lq/sq -;; WARN: Return type mismatch int vs none. (defbehavior target-log-trans target () (let ((v1-1 (-> self control unknown-word00))) (set! (-> self control unknown-time-frame-array00 v1-1) (-> self clock frame-counter)) @@ -775,8 +749,6 @@ (none) ) -;; definition for function target-move-dist -;; INFO: Used lq/sq (defbehavior target-move-dist target ((arg0 time-frame)) (let ((s5-0 (new-stack-vector0)) (f30-0 0.0) @@ -807,8 +779,6 @@ ) ) -;; definition for function turn-to-vector -;; INFO: Used lq/sq (defbehavior turn-to-vector target ((arg0 vector) (arg1 float)) (let ((gp-0 (new-stack-vector0))) (warp-vector-into-surface! gp-0 arg0 (-> self control local-normal) (-> self control unknown-matrix03)) @@ -856,7 +826,6 @@ ) ) -;; definition for function target-bend-vel-turn (defbehavior target-bend-vel-turn target ((arg0 vector)) (cond ((= (-> self control unknown-surface01 vel-turn) 0.0) @@ -884,8 +853,6 @@ arg0 ) -;; definition for function target-add-slide-factor -;; INFO: Used lq/sq (defbehavior target-add-slide-factor target ((arg0 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -973,8 +940,6 @@ ) ) -;; definition for function add-thrust -;; INFO: Used lq/sq (defbehavior add-thrust target () (let ((s5-0 (-> self control unknown-vector01)) (gp-0 (-> self control unknown-vector00)) @@ -1134,8 +1099,6 @@ ) ) -;; definition for function add-gravity -;; INFO: Used lq/sq (defbehavior add-gravity target () (let ((s5-0 (new-stack-vector0)) (gp-0 (new-stack-vector0)) @@ -1178,7 +1141,6 @@ ) ) -;; definition for function target-compute-slopes (defbehavior target-compute-slopes target ((arg0 vector)) (let ((gp-0 (new 'stack-no-clear 'vector)) (s4-0 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control unknown-quaternion00))) @@ -1210,7 +1172,6 @@ 0 ) -;; definition for function do-rotations1 (defbehavior do-rotations1 target () (rotate-toward-orientation! (-> self control) @@ -1223,8 +1184,6 @@ ) ) -;; definition for function do-rotations2 -;; INFO: Used lq/sq (defbehavior do-rotations2 target () (let ((gp-0 (vector-z-quaternion! (new-stack-vector0) (-> self control dir-targ))) (s5-0 @@ -1339,8 +1298,6 @@ (target-compute-slopes (-> self control dynam gravity-normal)) ) -;; definition for function leg-ik-callback -;; INFO: Used lq/sq (defun leg-ik-callback ((arg0 joint-mod-ik) (arg1 object) (arg2 object) (arg3 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1439,9 +1396,6 @@ ) ) -;; definition for function target-update-ik -;; INFO: Used lq/sq -;; WARN: Return type mismatch int vs none. (defbehavior target-update-ik target () (rlet ((acc :class vf) (vf0 :class vf) @@ -1614,9 +1568,6 @@ ) ) -;; definition for function pre-collide-setup -;; INFO: Used lq/sq -;; WARN: Return type mismatch int vs none. (defbehavior pre-collide-setup target () (if (>= (-> self clock frame-counter) (-> self control unknown-time-frame04)) (vector-normalize! @@ -1651,8 +1602,6 @@ (none) ) -;; definition for function level-setup -;; WARN: Return type mismatch int vs none. (defbehavior level-setup target () (let ((gp-0 (-> self current-level))) (set! (-> self current-level) (level-get-target-inside *level*)) @@ -1669,9 +1618,6 @@ (none) ) -;; definition for function flag-setup -;; INFO: Used lq/sq -;; WARN: Return type mismatch int vs none. (defbehavior flag-setup target () (cond ((= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) @@ -1928,11 +1874,11 @@ (when (!= (-> self beard?) v1-248) (cond (v1-248 - (draw-control-method-12 (-> self draw) 2 0) + (draw-control-method-12 (-> self draw) (the-as uint 2) 0) (set! (-> self beard?) #t) ) (else - (draw-control-method-12 (-> self draw) 2 0) + (draw-control-method-12 (-> self draw) (the-as uint 0) 2) (set! (-> self beard?) #f) ) ) @@ -1942,8 +1888,6 @@ (none) ) -;; definition for function post-flag-setup -;; WARN: Return type mismatch int vs none. (defbehavior post-flag-setup target () (if (logtest? (-> self control status) (cshape-moving-flags t-wall t-act)) (set! (-> self control unknown-time-frame07) (-> self clock frame-counter)) @@ -2032,8 +1976,6 @@ (none) ) -;; definition for function bend-gravity -;; INFO: Used lq/sq (defbehavior bend-gravity target () (if (and (logtest? (-> self control root-prim prim-core action) (collide-action no-normal-reset)) (zero? (logand (-> self control status) (cshape-moving-flags on-surface))) @@ -2137,8 +2079,6 @@ ) ) -;; definition for function target-compute-edge -;; INFO: Used lq/sq (defbehavior target-compute-edge target () (let ((s5-0 *edge-grab-info*)) (cond @@ -2288,8 +2228,6 @@ (none) ) -;; definition for function target-compute-edge-rider -;; INFO: Used lq/sq (defbehavior target-compute-edge-rider target () (let ((gp-0 *edge-grab-info*)) (cond @@ -2354,8 +2292,6 @@ (none) ) -;; definition for function target-compute-pole -;; INFO: Used lq/sq (defbehavior target-compute-pole target () (rlet ((acc :class vf) (vf0 :class vf) @@ -2483,9 +2419,6 @@ ) ) -;; definition for function target-calc-camera-pos -;; INFO: Used lq/sq -;; WARN: Return type mismatch int vs none. (defbehavior target-calc-camera-pos target () (let ((s5-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'vector)) @@ -2576,9 +2509,6 @@ (none) ) -;; definition for function joint-points -;; INFO: Used lq/sq -;; WARN: Return type mismatch int vs none. (defbehavior joint-points target () (let ((f0-1 (* 0.00078125 (the float (-> self neck loock-at-count))))) (if (!= f0-1 0.0) @@ -2673,9 +2603,6 @@ (none) ) -;; definition for function do-target-gspot -;; INFO: Used lq/sq -;; WARN: Return type mismatch int vs none. (defbehavior do-target-gspot target () (cond ((and (logtest? (-> self control status) (cshape-moving-flags on-surface)) @@ -2707,8 +2634,6 @@ (none) ) -;; definition for function target-real-post -;; INFO: Used lq/sq (defbehavior target-real-post target () (let ((f30-0 (-> self clock clock-ratio))) (let ((gp-1 (max 1 (the int (-> self clock time-adjust-ratio))))) @@ -2875,14 +2800,11 @@ (none) ) -;; definition for function target-post (defbehavior target-post target () (target-real-post) (none) ) -;; definition for function target-swim-post -;; INFO: Used lq/sq (defbehavior target-swim-post target () (let ((f30-0 (-> self clock clock-ratio))) (let ((gp-1 (max 1 (the int (-> self clock time-adjust-ratio))))) @@ -3010,8 +2932,6 @@ (none) ) -;; definition for function target-no-stick-post -;; INFO: Used lq/sq (defbehavior target-no-stick-post target () (let ((f30-0 (-> self clock clock-ratio))) (let ((gp-1 (max 1 (the int (-> self clock time-adjust-ratio))))) @@ -3140,8 +3060,6 @@ (none) ) -;; definition for function target-no-move-post -;; INFO: Used lq/sq (defbehavior target-no-move-post target () (let ((f30-0 (-> self clock clock-ratio))) (let ((gp-1 (max 1 (the int (-> self clock time-adjust-ratio))))) @@ -3239,7 +3157,6 @@ (none) ) -;; definition for function target-no-ja-move-post (defbehavior target-no-ja-move-post target () (vector-! (-> self control unknown-vector05) @@ -3259,8 +3176,6 @@ (none) ) -;; definition for function reset-target-state -;; INFO: Used lq/sq (defbehavior reset-target-state target ((arg0 symbol)) (when arg0 (vector-identity! (-> self control scale)) @@ -3290,9 +3205,6 @@ self ) -;; definition for method 28 of type target -;; INFO: Used lq/sq -;; WARN: Return type mismatch int vs none. (defmethod init-target target ((obj target) (arg0 continue-point) (arg1 symbol)) (local-vars (s1-0 int) (s2-0 int) (s3-0 int) (s4-0 int) (sv-16 collide-shape-prim-group)) (set! (-> obj tobot?) arg1) @@ -3527,7 +3439,6 @@ (none) ) -;; definition for function target-init ;; WARN: Return type mismatch object vs none. (defbehavior target-init target ((arg0 continue-point)) (init-target self arg0 #f) @@ -3537,7 +3448,6 @@ (none) ) -;; definition for function tobot-init ;; WARN: Return type mismatch object vs none. (defbehavior tobot-init target ((arg0 symbol)) (init-target self (the-as continue-point #f) 'tobot) @@ -3548,7 +3458,6 @@ (none) ) -;; definition for method 10 of type target (defmethod deactivate target ((obj target)) (kill-persister *setting-control* (the-as engine-pers 'bg-a-speed) 'bg-a-speed) (if (nonzero? (-> obj darkjak)) @@ -3560,7 +3469,6 @@ (none) ) -;; definition for function stop (defun stop ((arg0 symbol)) (when *target* (kill-by-name "target" *active-pool*) @@ -3570,7 +3478,6 @@ 0 ) -;; definition for function start (defun start ((arg0 symbol) (arg1 continue-point)) (let ((v1-0 arg0)) (set! (-> *level* play?) (if (= v1-0 'play) @@ -3601,7 +3508,6 @@ *target* ) -;; definition for function tobot-start ;; WARN: Return type mismatch (pointer process) vs target. (defun tobot-start ((arg0 symbol)) (the-as target (process-spawn @@ -3615,7 +3521,6 @@ ) ) -;; definition for function tobot-stop (defun tobot-stop () (kill-by-name "tobot" *active-pool*) 0 diff --git a/goal_src/jak2/engine/ui/hud-h.gc b/goal_src/jak2/engine/ui/hud-h.gc index 3a355e21c8..71da0bbb14 100644 --- a/goal_src/jak2/engine/ui/hud-h.gc +++ b/goal_src/jak2/engine/ui/hud-h.gc @@ -10,6 +10,10 @@ :bitfield #t ) +;; NOTE - for progress +(define-extern hide-hud (function symbol none)) +(define-extern hud-hidden? (function symbol)) + ;; DECOMP BEGINS (deftype hud-string (basic) diff --git a/goal_src/jak2/engine/ui/progress/progress-h.gc b/goal_src/jak2/engine/ui/progress/progress-h.gc index 954c7fd4ea..44f3913a5b 100644 --- a/goal_src/jak2/engine/ui/progress/progress-h.gc +++ b/goal_src/jak2/engine/ui/progress/progress-h.gc @@ -11,6 +11,16 @@ (declare-type menu-option basic) (declare-type menu-option-list basic) +(declare-type progress process-drawable) +(define-extern *progress-process* (pointer progress)) +(define-extern activate-progress (function process symbol none)) + +(define-extern memcard-unlocked-secrets? (function symbol symbol)) +(define-extern progress-selected (function int none :behavior progress)) +(define-extern get-num-highscores (function int)) +(define-extern get-next-highscore (function int int)) +(define-extern get-prev-highscore (function int int)) + ;; DECOMP BEGINS (deftype progress (process-drawable) @@ -50,7 +60,7 @@ (go-away () _type_ :state 22) (gone () _type_ :state 23) (init-defaults (_type_) connection 24) - (progress-method-25 (_type_) none 25) + (progress-method-25 (_type_ object object symbol) none 25) (progress-method-26 (_type_) object 26) (can-go-back? (_type_) symbol 27) (progress-method-28 (_type_ symbol) symbol 28) @@ -61,29 +71,34 @@ ) ) + (deftype menu-option (basic) - ((name uint32 :offset-assert 4) - (scale basic :offset-assert 8) - (box bounding-box 1 :inline :offset-assert 16) + ((name uint32 :offset-assert 4) + (scale basic :offset-assert 8) + (unknown function :offset-assert 12) + (box menu-option 1 :offset-assert 16) + (unknown-options menu-option 7 :offset-assert 20) ) :method-count-assert 12 :size-assert #x30 :flag-assert #xc00000030 (:methods - (respond-progress (_type_ progress object symbol) int 9) - (menu-option-method-10 () none 10) + (respond-progress (_type_ progress object) int :behavior progress 9) + (menu-option-method-10 (_type_ progress font-context int symbol) none 10) (menu-option-method-11 () none 11) ) ) + (deftype menu-on-off-option (menu-option) - ((value-to-modify pointer :offset-assert 48) + ((value-to-modify (pointer symbol) :offset-assert 48) ) :method-count-assert 12 :size-assert #x34 :flag-assert #xc00000034 ) + (deftype menu-yes-no-option (menu-option) ((value-to-modify pointer :offset-assert 48) ) @@ -92,17 +107,19 @@ :flag-assert #xc00000034 ) + (deftype menu-language-option (menu-option) - ((language-selection uint64 :offset-assert 48) - (language-direction basic :offset-assert 56) - (language-transition basic :offset-assert 60) - (language-x-offset int32 :offset-assert 64) + ((language-selection language-enum :offset-assert 48) + (language-direction symbol :offset-assert 56) + (language-transition basic :offset-assert 60) + (language-x-offset int32 :offset-assert 64) ) :method-count-assert 12 :size-assert #x44 :flag-assert #xc00000044 ) + (deftype menu-quit-option (menu-option) () :method-count-assert 12 @@ -110,6 +127,7 @@ :flag-assert #xc00000030 ) + (deftype menu-slider-option (menu-option) ((value-to-modify pointer :offset-assert 48) (sprites hud-sprite 5 :inline :offset-assert 64) @@ -119,6 +137,7 @@ :flag-assert #xc00000180 ) + (deftype menu-sub-menu-option (menu-option) ((next-state basic :offset-assert 48) (pad uint8 44 :offset-assert 52) @@ -128,6 +147,7 @@ :flag-assert #xc00000060 ) + (deftype menu-sub-menu-sound-option (menu-option) ((next-state basic :offset-assert 48) ) @@ -136,6 +156,7 @@ :flag-assert #xc00000034 ) + (deftype menu-stereo-mode-sound-option (menu-option) () :method-count-assert 12 @@ -143,6 +164,7 @@ :flag-assert #xc00000030 ) + (deftype menu-sub-menu-graphic-option (menu-option) ((next-state basic :offset-assert 48) ) @@ -151,6 +173,7 @@ :flag-assert #xc00000034 ) + (deftype menu-unlocked-menu-option (menu-sub-menu-option) () :method-count-assert 12 @@ -158,6 +181,7 @@ :flag-assert #xc00000060 ) + (deftype menu-main-menu-option (menu-option) ((next-state basic :offset-assert 48) ) @@ -166,6 +190,7 @@ :flag-assert #xc00000034 ) + (deftype menu-memcard-slot-option (menu-option) ((sprites hud-sprite 5 :inline :offset-assert 48) (pad uint8 32 :offset-assert 368) @@ -175,6 +200,7 @@ :flag-assert #xc00000190 ) + (deftype menu-loading-option (menu-option) () :method-count-assert 12 @@ -182,6 +208,7 @@ :flag-assert #xc00000030 ) + (deftype menu-insufficient-space-option (menu-option) ((last-move uint64 :offset-assert 48) ) @@ -190,6 +217,7 @@ :flag-assert #xc00000038 ) + (deftype menu-secrets-insufficient-space-option (menu-option) () :method-count-assert 12 @@ -197,6 +225,7 @@ :flag-assert #xc00000030 ) + (deftype menu-insert-card-option (menu-option) () :method-count-assert 12 @@ -204,6 +233,7 @@ :flag-assert #xc00000030 ) + (deftype menu-error-loading-option (menu-option) () :method-count-assert 12 @@ -211,6 +241,7 @@ :flag-assert #xc00000030 ) + (deftype menu-error-auto-saving-option (menu-option) () :method-count-assert 12 @@ -218,6 +249,7 @@ :flag-assert #xc00000030 ) + (deftype menu-card-removed-option (menu-option) () :method-count-assert 12 @@ -225,6 +257,7 @@ :flag-assert #xc00000030 ) + (deftype menu-error-disc-removed-option (menu-option) () :method-count-assert 12 @@ -232,6 +265,7 @@ :flag-assert #xc00000030 ) + (deftype menu-error-reading-option (menu-option) () :method-count-assert 12 @@ -239,6 +273,7 @@ :flag-assert #xc00000030 ) + (deftype menu-icon-info-option (menu-option) ((sprites hud-sprite 2 :inline :offset-assert 48) ) @@ -247,6 +282,7 @@ :flag-assert #xc000000b0 ) + (deftype menu-format-card-option (menu-option) () :method-count-assert 12 @@ -254,6 +290,7 @@ :flag-assert #xc00000030 ) + (deftype menu-already-exists-option (menu-option) () :method-count-assert 12 @@ -261,6 +298,7 @@ :flag-assert #xc00000030 ) + (deftype menu-create-game-option (menu-option) () :method-count-assert 12 @@ -268,6 +306,7 @@ :flag-assert #xc00000030 ) + (deftype menu-video-mode-warning-option (menu-option) () :method-count-assert 12 @@ -275,6 +314,7 @@ :flag-assert #xc00000030 ) + (deftype menu-video-mode-ok-option (menu-option) () :method-count-assert 12 @@ -282,6 +322,7 @@ :flag-assert #xc00000030 ) + (deftype menu-progressive-mode-warning-option (menu-option) () :method-count-assert 12 @@ -289,6 +330,7 @@ :flag-assert #xc00000030 ) + (deftype menu-progressive-mode-ok-option (menu-option) () :method-count-assert 12 @@ -296,6 +338,7 @@ :flag-assert #xc00000030 ) + (deftype menu-select-start-option (menu-option) ((task-index int32 :offset-assert 48) (real-task-index int32 :offset-assert 52) @@ -306,6 +349,7 @@ :flag-assert #xc00000040 ) + (deftype menu-select-scene-option (menu-option) ((task-index int32 :offset-assert 48) (last-move uint64 :offset-assert 56) @@ -315,6 +359,7 @@ :flag-assert #xc00000040 ) + (deftype menu-bigmap-option (menu-option) () :method-count-assert 12 @@ -322,6 +367,7 @@ :flag-assert #xc00000030 ) + (deftype paged-menu-option (menu-option) ((page-index int32 :offset-assert 48) (prev-page-index int32 :offset-assert 52) @@ -333,6 +379,7 @@ :flag-assert #xc00000040 ) + (deftype menu-missions-option (paged-menu-option) ((task-line-index int32 :offset-assert 64) (last-move uint64 :offset-assert 72) @@ -342,6 +389,7 @@ :flag-assert #xc00000050 ) + (deftype menu-highscores-option (paged-menu-option) ((last-move uint64 :offset-assert 64) (sprites hud-sprite 2 :inline :offset-assert 80) @@ -351,6 +399,7 @@ :flag-assert #xc000000d0 ) + (deftype secret-item-option (menu-option) ((cost int32 :offset-assert 48) (can-toggle symbol :offset-assert 52) @@ -362,20 +411,22 @@ :flag-assert #xc0000003e ) + (deftype menu-secret-option (menu-option) - ((item-index int32 :offset-assert 48) - (prev-item-index int32 :offset-assert 52) - (num-items int32 :offset-assert 56) - (num-hero-items int32 :offset-assert 60) - (secret-items basic :offset-assert 64) - (last-move uint64 :offset-assert 72) - (sprites hud-sprite 2 :inline :offset-assert 80) + ((item-index int32 :offset-assert 48) + (prev-item-index int32 :offset-assert 52) + (num-items int32 :offset-assert 56) + (num-hero-items int32 :offset-assert 60) + (secret-items (array secret-item-option) :offset-assert 64) + (last-move uint64 :offset-assert 72) + (sprites hud-sprite 2 :inline :offset-assert 80) ) :method-count-assert 12 :size-assert #xd0 :flag-assert #xc000000d0 ) + (deftype menu-option-list (basic) ((y-center int32 :offset-assert 4) (y-space int32 :offset-assert 8) @@ -387,15 +438,17 @@ :flag-assert #x900000010 ) + (deftype menu-qr-option (menu-option) - ((last-move uint64 :offset-assert 48) - (value-to-modify uint32 :offset 60) + ((last-move uint64 :offset-assert 48) + (value-to-modify function :offset 60) ) :method-count-assert 12 :size-assert #x40 :flag-assert #xc00000040 ) + (deftype menu-restart-mission-qr-option (menu-qr-option) ((next-state basic :offset-assert 64) ) @@ -404,6 +457,7 @@ :flag-assert #xc00000044 ) + (deftype menu-quit-qr-option (menu-qr-option) ((next-state basic :offset-assert 64) ) @@ -412,6 +466,7 @@ :flag-assert #xc00000044 ) + (deftype menu-sub-menu-qr-option (menu-qr-option) ((next-state basic :offset-assert 64) ) @@ -420,6 +475,7 @@ :flag-assert #xc00000044 ) + (deftype menu-graphic-option (menu-option) ((last-move uint64 :offset-assert 48) (value-to-modify pointer :offset 60) @@ -429,6 +485,7 @@ :flag-assert #xc00000040 ) + (deftype menu-on-off-progressive-scan-graphic-option (menu-graphic-option) () :method-count-assert 12 @@ -436,6 +493,7 @@ :flag-assert #xc00000040 ) + (deftype menu-aspect-ratio-option (menu-graphic-option) () :method-count-assert 12 @@ -443,6 +501,7 @@ :flag-assert #xc00000040 ) + (deftype menu-center-screen-graphic-option (menu-graphic-option) ((next-state basic :offset-assert 64) ) @@ -451,6 +510,7 @@ :flag-assert #xc00000044 ) + (deftype menu-video-mode-option (menu-graphic-option) () :method-count-assert 12 @@ -458,6 +518,7 @@ :flag-assert #xc00000040 ) + (deftype menu-game-option (menu-option) ((last-move uint64 :offset-assert 48) (value-to-modify pointer :offset 60) @@ -467,6 +528,7 @@ :flag-assert #xc00000040 ) + (deftype menu-on-off-game-vibrations-option (menu-game-option) () :method-count-assert 12 @@ -474,6 +536,7 @@ :flag-assert #xc00000040 ) + (deftype menu-on-off-game-subtitles-option (menu-game-option) () :method-count-assert 12 @@ -481,6 +544,7 @@ :flag-assert #xc00000040 ) + (deftype menu-sub-menu-game-option (menu-game-option) ((next-state basic :offset-assert 64) ) @@ -489,6 +553,7 @@ :flag-assert #xc00000044 ) + (deftype menu-language-game-option (menu-game-option) ((language-selection uint64 :offset-assert 64) (language-direction basic :offset-assert 72) @@ -500,6 +565,7 @@ :flag-assert #xc00000054 ) + (deftype menu-subtitle-language-game-option (menu-game-option) ((language-selection uint64 :offset-assert 64) (language-direction basic :offset-assert 72) @@ -511,7 +577,3 @@ :flag-assert #xc00000054 ) -;; DECOMP ENDS - -(define-extern *progress-process* (pointer progress)) -(define-extern activate-progress (function process symbol none)) diff --git a/goal_src/jak2/engine/ui/progress/progress-static.gc b/goal_src/jak2/engine/ui/progress/progress-static.gc index 9cac79487a..3af33c2c34 100644 --- a/goal_src/jak2/engine/ui/progress/progress-static.gc +++ b/goal_src/jak2/engine/ui/progress/progress-static.gc @@ -113,15 +113,27 @@ (define *quit-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) -(define *select-start-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) +(define *select-start-options* + "List of [[menu-select-start-option]]" + (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82) + ) -(define *select-scene-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) +(define *select-scene-options* + "List of [[menu-select-scene-option]]" + (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82) + ) (define *bigmap-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) -(define *missions-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) +(define *missions-options* + "List of [[menu-missions-option]]" + (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82) + ) -(define *highscores-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) +(define *highscores-options* + "List of [[menu-highscores-option]]" + (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82) + ) (define *secret-options* (new 'static 'menu-option-list :y-center #xc6 :y-space 30 :scale 0.82)) @@ -132,25 +144,19 @@ ) (define *stereo-mode-name-remap* - (the-as menu-option-list (new 'static 'boxed-array :type uint32 #x104 #x105 #x106)) + (the-as (array uint64) (new 'static 'boxed-array :type uint32 #x104 #x105 #x106)) ) (define *hud-ring-graphic-remap* - (the-as menu-option-list - (new 'static 'boxed-array :type uint64 #x80 #x40 #x10 #x4 #x8 #x400 #x20 #x100 #x200 #x2) - ) + (new 'static 'boxed-array :type uint64 #x80 #x40 #x10 #x4 #x8 #x400 #x20 #x100 #x200 #x2) ) (define *hud-ring-kiosk-graphic-remap* - (the-as menu-option-list - (new 'static 'boxed-array :type uint64 #x40 #x80 #x2 #x200 #x200 #x200 #x200 #x200 #x200 #x200) - ) + (new 'static 'boxed-array :type uint64 #x40 #x80 #x2 #x200 #x200 #x200 #x200 #x200 #x200 #x200) ) (define *hud-ring-demo-graphic-remap* - (the-as menu-option-list - (new 'static 'boxed-array :type uint64 #x80 #x2 #x200 #x200 #x200 #x200 #x200 #x200 #x200 #x200) - ) + (new 'static 'boxed-array :type uint64 #x80 #x2 #x200 #x200 #x200 #x200 #x200 #x200 #x200 #x200) ) (deftype hud-scene-info (basic) diff --git a/goal_src/jak2/engine/ui/progress/progress.gc b/goal_src/jak2/engine/ui/progress/progress.gc index 06b4dd2d49..1c0057c923 100644 --- a/goal_src/jak2/engine/ui/progress/progress.gc +++ b/goal_src/jak2/engine/ui/progress/progress.gc @@ -6,5 +6,3758 @@ ;; dgos: ENGINE, GAME (set! *progress-process* #f) + +;; og:ignore-form:progress-trans + ;; 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 basic :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 #x3800))) + +(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 + (-> (the-as menu-on-off-game-vibrations-option (-> *game-options* options 0)) box 0) + ) + value-to-modify + ) + (&-> *setting-control* user-default vibration) + ) + (set! (-> (the-as + menu-on-off-game-subtitles-option + (-> (the-as menu-on-off-game-subtitles-option (-> *game-options* options 0)) unknown-options 0) + ) + value-to-modify + ) + (&-> *setting-control* user-default subtitle) + ) + (set! (-> (the-as + menu-language-option + (-> (the-as menu-language-option (-> *game-options* options 0)) unknown-options 1) + ) + language-selection + ) + (-> *setting-control* user-current language) + ) + (set! (-> (the-as + menu-language-option + (-> (the-as menu-language-option (-> *game-options* options 0)) unknown-options 1) + ) + language-direction + ) + #t + ) + (set! (-> (the-as + menu-language-option + (-> (the-as menu-language-option (-> *game-options* options 0)) unknown-options 1) + ) + language-transition + ) + #f + ) + (set! (-> (the-as + menu-language-option + (-> (the-as menu-language-option (-> *game-options* options 0)) unknown-options 1) + ) + language-x-offset + ) + 0 + ) + (set! (-> (the-as menu-on-off-option (-> (the-as menu-on-off-option (-> *game-options-japan* options 0)) box 0)) + value-to-modify + ) + (&-> *setting-control* user-default vibration) + ) + (set! (-> (the-as menu-on-off-option (-> (the-as menu-on-off-option (-> *game-options-demo* options 0)) box 0)) + value-to-modify + ) + (&-> *setting-control* user-default vibration) + ) + (set! (-> (the-as + menu-on-off-option + (-> (the-as menu-on-off-option (-> *graphic-options* options 0)) unknown-options 1) + ) + value-to-modify + ) + (&-> *setting-control* user-default use-progressive-scan) + ) + (set! (-> (the-as + menu-on-off-option + (-> (the-as menu-on-off-option (-> *graphic-title-options-pal* options 0)) unknown-options 1) + ) + value-to-modify + ) + (&-> *setting-control* user-default use-progressive-scan) + ) + (set! (-> (the-as menu-slider-option (-> (the-as menu-slider-option (-> *sound-options* options 0)) box 0)) + value-to-modify + ) + (&-> *setting-control* user-default sfx-volume) + ) + (set! (-> (the-as menu-slider-option (-> (the-as menu-slider-option (-> *sound-options* options 0)) unknown-options 0)) + value-to-modify + ) + (&-> *setting-control* user-default music-volume) + ) + (set! (-> (the-as menu-slider-option (-> (the-as menu-slider-option (-> *sound-options* options 0)) unknown-options 1)) + value-to-modify + ) + (&-> *setting-control* user-default dialog-volume) + ) + (set! (-> (the-as menu-missions-option (-> (the-as menu-missions-option (-> *missions-options* options 0)) box 0)) + task-line-index + ) + 0 + ) + (set-setting-by-param *setting-control* 'extra-bank '((force2 menu1)) 0 0) + ) + +(deftype hud-ring-cell (process-drawable) + ((parent-override (pointer progress) :offset 16) + (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-override 0 root trans quad)) + (quaternion-copy! (-> self root quat) (-> self parent-override 0 root quat)) + (quaternion-normalize! (-> self root quat)) + (set! (-> self root scale quad) (-> self parent-override 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)) + (draw-control-method-12 (-> self draw) (the-as uint 1) 0) + (draw-control-method-12 (-> self draw) (the-as uint 0) 2046) + (cond + ((and (= *cheat-mode* #f) (= *kernel-boot-message* 'kiosk)) + (draw-control-method-12 + (-> self draw) + (-> *hud-ring-kiosk-graphic-remap* (mod + (+ (-> self graphic-index) (-> self parent-override 0 graphic-index)) + (-> *hud-ring-kiosk-graphic-remap* length) + ) + ) + 0 + ) + ) + ((and (= *cheat-mode* #f) (demo?)) + (draw-control-method-12 + (-> self draw) + (-> *hud-ring-demo-graphic-remap* (mod + (+ (-> self graphic-index) (-> self parent-override 0 graphic-index)) + (-> *hud-ring-kiosk-graphic-remap* length) + ) + ) + 0 + ) + ) + (else + (draw-control-method-12 + (-> self draw) + (-> *hud-ring-graphic-remap* (mod + (+ (-> self graphic-index) (-> self parent-override 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) (-> self parent-override 0 node-list data (-> self joint-idx))) + (when (-> self parent-override 0 main-menu) + (draw-control-method-12 (-> self draw) (the-as uint 0) 2046) + (cond + ((and (= *cheat-mode* #f) (= *kernel-boot-message* 'kiosk)) + (draw-control-method-12 + (-> self draw) + (-> *hud-ring-kiosk-graphic-remap* (mod + (+ (-> self graphic-index) (-> self parent-override 0 graphic-index)) + (-> *hud-ring-kiosk-graphic-remap* length) + ) + ) + 0 + ) + ) + ((and (= *cheat-mode* #f) (demo?)) + (draw-control-method-12 + (-> self draw) + (-> *hud-ring-demo-graphic-remap* (mod + (+ (-> self graphic-index) (-> self parent-override 0 graphic-index)) + (-> *hud-ring-kiosk-graphic-remap* length) + ) + ) + 0 + ) + ) + (else + (draw-control-method-12 + (-> self draw) + (-> *hud-ring-graphic-remap* (mod + (+ (-> self graphic-index) (-> self parent-override 0 graphic-index)) + (-> *hud-ring-graphic-remap* length) + ) + ) + 0 + ) + ) + ) + ) + (when (= (-> self init-angle) 0.0) + (cond + ((= (-> self parent-override 0 ring-angle) (-> self parent-override 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 (-> self parent-override 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) (-> self parent-override 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 (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)) + ) + (set! (-> s3-0 y) (+ -8.0 (-> s3-0 y))) + (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) (the-as basic #t)) + (set! *progress-process* (process-spawn progress arg1 :to arg0 :stack (&-> *progress-stack* 14336))) + (set-master-mode 'progress) + ) + (else + (set! *progress-process* (process-spawn progress arg1 :to arg0 :stack (&-> *progress-stack* 14336))) + (set-master-mode 'progress) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod deactivate progress ((obj progress)) + (remove-setting-by-arg0 *setting-control* 'extra-bank) + ((method-of-object *bigmap* bigmap-method-15)) + (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 progress-method-26 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 big-head))) + (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 progress-method-28 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 progress-method-29 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 progress-method-30 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) (progress-method-28 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 menu-missions-option (-> *missions-options* options 0)) box 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) #x8000) + (logior! (-> *game-info* secrets) (game-secrets big-head)) + (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 menu-select-start-option (-> *select-start-options* options 0)) box 0) + ) + task-index + ) + 0 + ) + 0 + ) + (('select-scene) + (set! (-> obj current-options) *select-scene-options*) + (set! (-> (the-as + menu-select-scene-option + (-> (the-as menu-select-scene-option (-> *select-scene-options* options 0)) box 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 menu-missions-option (-> *missions-options* options 0)) box 0)) + task-line-index + ) + 0 + ) + (set! (-> obj current-options) *missions-options*) + ) + (('highscores) + (set! (-> (the-as menu-highscores-option (-> (the-as menu-highscores-option (-> *highscores-options* options 0)) box 0)) + page-index + ) + 0 + ) + (set! (-> (the-as menu-highscores-option (-> (the-as menu-highscores-option (-> *highscores-options* options 0)) box 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!!~%") + (progress-method-30 obj) + ) + 0 + ) + +(defmethod progress-method-25 progress ((obj progress) (arg0 object) (arg1 object) (arg2 symbol)) + (mc-get-slot-info 0 *progress-save-info*) + (when (-> obj current-options) + (let ((s5-0 (-> obj current-options options 0))) + (when (and s5-0 (= (-> obj menu-transition) 0.0)) + (respond-progress + (-> (the-as menu-option (+ (* (-> obj option-index) 4) (the-as int s5-0))) box 0) + obj + (and (= (-> obj menu-transition) 0.0) (-> obj selected-option)) + ) + (cond + ((-> obj selected-option) + (cond + ((logtest? (pad-buttons pb24) (-> *cpad-list* cpads 0 button0-rel 0)) + (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 + ((logtest? (pad-buttons up pb16) (-> *cpad-list* cpads 0 button0-rel 0)) + (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) + ) + ) + ) + ((logtest? (pad-buttons down pb18) (-> *cpad-list* cpads 0 button0-rel 0)) + (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) + ) + ) + ) + ((logtest? (pad-buttons pb24) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + (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") + ) + (progress-method-30 obj) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; ERROR: failed type prop at 0: Could not figure out load: (set! v1 (l.wu (+ s6 228))) + +(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)) + (let* ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (gp-0 (-> s5-0 base)) + ) + (hud-box-method-13 arg0 s5-0 arg1) + (let ((a3-0 (-> s5-0 base))) + (let ((v1-8 (the-as object (-> s5-0 base)))) + (set! (-> (the-as dma-packet v1-8) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-8) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-8) vif1) (new 'static 'vif-tag)) + (set! (-> s5-0 base) (the-as pointer (&+ (the-as dma-packet v1-8) 16))) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id bucket-320) + gp-0 + (the-as (pointer dma-tag) a3-0) + ) + ) + ) + 0 + ) + +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 111] +(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 0)) + (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-#cddbcd) + (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)) + (let ((v1-29 sv-144)) + (set! (-> v1-29 width) (the float (the-as float #x163))) + ) + (let ((v1-30 sv-144)) + (set! (-> v1-30 height) (the float (the-as float #x1e))) + ) + (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)) + (the-as font-color (progress-selected 0)) + (font-color #7efbfb) + ) + ) + ) + (menu-option-method-10 + (-> gp-0 box 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) + (let ((t9-8 (method-of-object *bigmap* bigmap-method-11))) + 1792 + 1840 + 2304 + 2256 + (t9-8) + ) + ) + (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)) + (when (and (transform-point-qword! gp-1 s4-2) (transform-point-qword! s5-1 s3-1)) + (let ((t9-13 (method-of-object *bigmap* bigmap-method-11))) + (/ (the-as int (-> s5-1 x)) 16) + (/ (the-as int (-> s5-1 y)) 16) + (/ (the-as int (-> gp-1 x)) 16) + (/ (the-as int (-> gp-1 y)) 16) + (t9-13) + ) + ) + ) + ) + ) + ) + ) + (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 + ) + ) + ) + (when (hud-hidden?) + (set! (-> *blit-displays-work* menu-mode) (the-as basic #t)) + (set! (-> self pos-transition) (seek-ease + (-> self pos-transition) + f30-0 + (* 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 ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (let ((v1-0 arg2)) + (the-as + object + (when (= v1-0 'notify) + (cond + ((= (-> arg3 param 0) 'done) + (let ((t9-0 format) + (a0-3 #t) + (a1-1 "DONE NOTIFY: ~S ~S~%") + (v1-3 (-> arg3 param 1)) + ) + (t9-0 + a0-3 + a1-1 + (cond + ((= v1-3 15) + "bad-version" + ) + ((= v1-3 13) + "no-save" + ) + ((= v1-3 10) + "no-last" + ) + ((= v1-3 14) + "no-space" + ) + ((= v1-3 4) + "internal-error" + ) + ((= v1-3 8) + "no-memory" + ) + ((= v1-3 2) + "bad-handle" + ) + ((zero? v1-3) + "busy" + ) + ((= v1-3 5) + "write-error" + ) + ((= v1-3 6) + "read-error" + ) + ((= v1-3 9) + "no-card" + ) + ((= v1-3 11) + "no-format" + ) + ((= v1-3 1) + "ok" + ) + ((= v1-3 16) + "no-process" + ) + ((= v1-3 17) + "no-auto-save" + ) + ((= v1-3 12) + "no-file" + ) + ((= v1-3 3) + "format-failed" + ) + ((= v1-3 7) + "new-game" + ) + (else + "*unknown*" + ) + ) + (symbol->string (-> self current)) + ) + ) + (case (-> self current) + (('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) #x8000)))) + (set! (-> *setting-control* user-default auto-save) gp-1) + v0-0 + ) + ) + ) + (else + (progress-method-30 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) + ) + ) + ) + ) + ((= (-> arg3 param 0) 'error) + (let ((t9-7 format) + (a0-18 #t) + (a1-5 "ERROR NOTIFY: ~S ~S ~S~%") + (v1-19 (-> arg3 param 1)) + ) + (t9-7 + a0-18 + a1-5 + (cond + ((= v1-19 15) + "bad-version" + ) + ((= v1-19 13) + "no-save" + ) + ((= v1-19 10) + "no-last" + ) + ((= v1-19 14) + "no-space" + ) + ((= v1-19 4) + "internal-error" + ) + ((= v1-19 8) + "no-memory" + ) + ((= v1-19 2) + "bad-handle" + ) + ((zero? v1-19) + "busy" + ) + ((= v1-19 5) + "write-error" + ) + ((= v1-19 6) + "read-error" + ) + ((= v1-19 9) + "no-card" + ) + ((= v1-19 11) + "no-format" + ) + ((= v1-19 1) + "ok" + ) + ((= v1-19 16) + "no-process" + ) + ((= v1-19 17) + "no-auto-save" + ) + ((= v1-19 12) + "no-file" + ) + ((= v1-19 3) + "format-failed" + ) + ((= v1-19 7) + "new-game" + ) + (else + "*unknown*" + ) + ) + (-> self current) + (-> self next) + ) + ) + (case (-> arg3 param 1) + ((14) + (set-next-state self 'insufficient-space 0) + ) + (else + (case (-> self current) + (('formatting 'format-card) + (set-next-state self 'error-formatting 0) + ) + (('creating) + (set-next-state self 'error-creating 0) + ) + (('saving 'select-save 'select-save-title 'select-save-title-hero) + (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 (the-as (function none :behavior progress) + ;; TODO call to progress-trans! + 0) + :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) 0.022222223) + ) + (none) + ) + :trans (behavior () + (seek! (-> self anim-frame) 0.0 (* 0.02 (-> self clock time-adjust-ratio))) + (cond + ((= (-> self anim-frame) 0.0) + (seek! (-> self pos-transition) 1.0 (* 0.02 (-> self clock time-adjust-ratio))) + (if (= (-> self pos-transition) 1.0) + (go-virtual gone) + ) + ) + (else + (seek! (-> self pos-transition) 0.0 (* 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 () + ((method-of-object *bigmap* bigmap-method-15)) + (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 object)) + "Handle progress menu navigation logic." + 0 + ) + +(defmethod respond-progress menu-on-off-option ((obj menu-on-off-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (let ((v1-1 (&-> *progress-state* on-off-choice)) + (gp-0 #f) + ) + (cond + (arg1 + (cond + ((logtest? (pad-buttons left pb19) (-> *cpad-list* cpads 0 button0-rel 0)) + (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) + ) + ) + ((logtest? (pad-buttons right pb17) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (-> v1-1 0)) + (set! (-> v1-1 0) #f) + ) + ((logtest? (pad-buttons pb24) (-> *cpad-list* cpads 0 button0-rel 0)) + (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 pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + (progress-method-29 arg0) + (set-next-state arg0 'progressive-mode-warning 0) + ) + (else + (set! (-> obj value-to-modify 0) (-> *progress-state* on-off-choice)) + ) + ) + ) + ) + ) + (else + (if (logtest? (pad-buttons pb24) (-> *cpad-list* cpads 0 button0-rel 0)) + (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 object)) + "Handle progress menu navigation logic." + (let ((v1-1 (&-> *progress-state* yes-no-choice)) + (gp-0 #f) + ) + (when arg1 + (cond + ((logtest? (pad-buttons left pb19) (-> *cpad-list* cpads 0 button0-rel 0)) + (when (not (-> v1-1 0)) + (set! gp-0 #t) + (set! (-> v1-1 0) #t) + ) + ) + ((logtest? (pad-buttons right pb17) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (-> v1-1 0)) + (set! (-> v1-1 0) #f) + ) + ((logtest? (pad-buttons pb24) (-> *cpad-list* cpads 0 button0-rel 0)) + (cond + ((and (-> v1-1 0) (= (-> obj name) 366)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + (restart-mission) + (set-next-state arg0 'go-away 0) + ) + ((and (-> v1-1 0) (= (-> obj name) 307)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + (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 object)) + "Handle progress menu navigation logic." + (when (-> *bigmap* progress-minimap) + (let ((gp-0 (-> obj value-to-modify)) + (s4-0 #f) + ) + (cond + (arg1 + (cond + ((logtest? (pad-buttons left pb19) (-> *cpad-list* cpads 0 button0-abs 0)) + (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) + ) + ) + ((logtest? (pad-buttons right pb17) (-> *cpad-list* cpads 0 button0-abs 0)) + (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 + ((logtest? (pad-buttons left pb19) (-> *cpad-list* cpads 0 button0-abs 0)) + (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) + ) + ) + ((logtest? (pad-buttons right pb17) (-> *cpad-list* cpads 0 button0-abs 0)) + (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 (logtest? (pad-buttons pb24) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + ) + (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) + ((264 265) + (set! f30-0 (-> (the-as (pointer float) gp-0))) + ) + ) + (when (< (seconds 0.03) (- (-> self clock frame-counter) (-> *progress-state* last-slider-sound))) + (set! (-> *progress-state* last-slider-sound) (-> self clock frame-counter)) + (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 object)) + "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 + ((logtest? (pad-buttons left pb19) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! (-> *setting-control* user-default stereo-mode) (min-max-wrap-around (+ a0-1 -1) 0 a3-0)) + (set! v1-4 #t) + ) + ((logtest? (pad-buttons right pb17) (-> *cpad-list* cpads 0 button0-rel 0)) + (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 (logtest? (pad-buttons pb24) (-> *cpad-list* cpads 0 button0-rel 0)) + (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 object)) + "Handle progress menu navigation logic." + (cond + ((cpad-pressed? 0 start) + ) + ((logtest? (pad-buttons pb24) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + (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) 291) + (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) 346) (= (-> obj name) 347) (= (-> obj name) 348)) + (case (-> obj name) + ((347) + (set! (-> *progress-state* scene-player-act) 2) + ) + ((348) + (set! (-> *progress-state* scene-player-act) 3) + ) + (else + (set! (-> *progress-state* scene-player-act) 1) + ) + ) + (sound-play "window-expand") + (progress-method-29 arg0) + (set-next-state arg0 (the-as symbol (-> obj next-state)) 0) + ) + ((= (-> obj next-state) 'back) + (progress-method-30 arg0) + ) + ((= (-> obj next-state) 'restart) + (sound-volume-off) + (restart-mission) + (progress-method-30 arg0) + ) + (else + (sound-play "window-expand") + (progress-method-29 arg0) + (set-next-state arg0 (the-as symbol (-> obj next-state)) 0) + ) + ) + ) + ) + ((not (-> arg0 selected-option)) + (let ((a0-53 (-> arg0 current-options options 0))) + (cond + ((logtest? (pad-buttons left pb19) (-> *cpad-list* cpads 0 button0-rel 0)) + (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) + ) + ) + ) + ((logtest? (pad-buttons right pb17) (-> *cpad-list* cpads 0 button0-rel 0)) + (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 object)) + "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) 298) + (let ((a1-3 (progress-method-28 arg0 (-> arg0 current)))) + (set-next-state arg0 a1-3 0) + ) + ) + (when (and (= (-> obj name) 339) + (= *title* (-> arg0 current-options)) + (not (memcard-unlocked-secrets? #f)) + (= (-> arg0 option-index) 3) + ) + (set! (-> arg0 option-index) 0) + 0 + ) + (when (logtest? (pad-buttons pb24) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + (cond + ((= (-> obj name) 291) + (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) 298) + (progress-intro-start (logtest? (-> *game-info* purchase-secrets) #x8000)) + ) + ((= (-> obj next-state) 'back) + (progress-method-30 arg0) + ) + (else + (sound-play "generic-beep") + (progress-method-29 arg0) + (set-next-state arg0 (the-as symbol (-> obj next-state)) 0) + ) + ) + ) + 0 + ) + +(defmethod respond-progress menu-unlocked-menu-option ((obj menu-unlocked-menu-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (let ((s4-0 (memcard-unlocked-secrets? #t))) + (set! (-> *game-info* purchase-secrets) (logand -32769 (-> *game-info* purchase-secrets))) + (logclear! (-> *game-info* secrets) (game-secrets big-head)) + (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 + ((logtest? (pad-buttons pb24) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + (cond + ((and (= (-> obj name) 349) (logtest? (the-as int s4-0) 512)) + (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 pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + (initialize! *game-info* 'game (the-as game-save #f) "title-restart") + ) + ) + ) + ((and (= (-> obj name) 350) (logtest? (the-as int s4-0) 1024)) + (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 pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + (initialize! *game-info* 'game (the-as game-save #f) "title-restart") + ) + ) + ) + ((and (= (-> obj name) 351) (logtest? (the-as int s4-0) 2048)) + (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 pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + (initialize! *game-info* 'game (the-as game-save #f) "title-restart") + ) + ) + ) + ((and (= (-> obj name) 346) (logtest? (the-as int s4-0) 32)) + (set! (-> *progress-state* scene-player-act) 1) + (sound-play "generic-beep") + (progress-method-29 arg0) + (set-next-state arg0 'select-scene 0) + ) + ((and (= (-> obj name) 347) (logtest? (the-as int s4-0) 64)) + (set! (-> *progress-state* scene-player-act) 2) + (sound-play "generic-beep") + (progress-method-29 arg0) + (set-next-state arg0 'select-scene 0) + ) + ((and (= (-> obj name) 348) (logtest? (the-as int s4-0) 128)) + (set! (-> *progress-state* scene-player-act) 3) + (sound-play "generic-beep") + (progress-method-29 arg0) + (set-next-state arg0 'select-scene 0) + ) + ((and (= (-> obj name) 345) (logtest? (the-as int s4-0) #x8000)) + (sound-play "generic-beep") + (progress-method-29 arg0) + (set-next-state arg0 'select-save-title-hero 0) + ) + ((and (= (-> obj name) 352) (logtest? (the-as int s4-0) 256)) + (sound-play "generic-beep") + (progress-method-29 arg0) + (set-next-state arg0 'select-start 0) + ) + ((= (-> obj next-state) 'back) + (progress-method-30 arg0) + ) + ) + ) + ((not (-> arg0 selected-option)) + (let ((a0-131 (-> arg0 current-options options 0))) + (cond + ((logtest? (pad-buttons left pb19) (-> *cpad-list* cpads 0 button0-rel 0)) + (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) + ) + ) + ) + ((logtest? (pad-buttons right pb17) (-> *cpad-list* cpads 0 button0-rel 0)) + (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 object)) + "Handle progress menu navigation logic." + (memcard-unlocked-secrets? #t) + (let ((a1-2 (progress-method-28 arg0 (-> arg0 current)))) + (set-next-state arg0 a1-2 0) + ) + (set! (-> arg0 selected-option) #f) + (when (-> *bigmap* progress-minimap) + (cond + ((cpad-pressed? 0 triangle) + ) + ((logtest? (pad-buttons pb24) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + (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 box 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 box 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 object)) + "Handle progress menu navigation logic." + (let ((s4-0 (&-> *progress-state* yes-no-choice)) + (a1-2 (progress-method-28 arg0 'select-save)) + (gp-0 #f) + ) + (if (!= a1-2 'select-save) + (set-next-state arg0 a1-2 0) + ) + (cond + ((logtest? (pad-buttons left pb19) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (not (-> s4-0 0))) + (set! (-> s4-0 0) #t) + ) + ((logtest? (pad-buttons right pb17) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (-> s4-0 0)) + (set! (-> s4-0 0) #f) + ) + ((logtest? (pad-buttons pb24) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + (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 object)) + "Handle progress menu navigation logic." + (let ((s4-0 (&-> *progress-state* yes-no-choice)) + (gp-0 #f) + ) + (let ((a1-2 (progress-method-28 arg0 'select-save))) + (if (!= a1-2 'select-save) + (set-next-state arg0 a1-2 0) + ) + ) + (cond + ((logtest? (pad-buttons left pb19) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (not (-> s4-0 0))) + (set! (-> s4-0 0) #t) + ) + ((logtest? (pad-buttons right pb17) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (-> s4-0 0)) + (set! (-> s4-0 0) #f) + ) + ((logtest? (pad-buttons pb24) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + (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) #x8000)) + ) + (else + (sound-play "generic-beep") + (progress-method-30 arg0) + ) + ) + ) + ) + (if gp-0 + (sound-play "generic-beep") + ) + ) + 0 + ) + +(defmethod respond-progress menu-insufficient-space-option ((obj menu-insufficient-space-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (let ((s5-0 (&-> *progress-state* yes-no-choice)) + (s3-0 (progress-method-28 arg0 'select-save)) + ) + (cond + ((or (= (-> *progress-state* starting-state) 'insufficient-space) + (= (-> *progress-state* starting-state) 'no-memory-card) + ) + (cond + ((logtest? (pad-buttons left pb19) (-> *cpad-list* cpads 0 button0-rel 0)) + (when (and (not (-> s5-0 0)) (not (-> *progress-state* clear-screen))) + (sound-play "generic-beep") + (set! (-> s5-0 0) #t) + ) + ) + ((logtest? (pad-buttons right pb17) (-> *cpad-list* cpads 0 button0-rel 0)) + (when (and (-> s5-0 0) (not (-> *progress-state* clear-screen))) + (sound-play "generic-beep") + (set! (-> s5-0 0) #f) + ) + ) + ((and (logtest? (pad-buttons pb24) (-> *cpad-list* cpads 0 button0-rel 0)) (!= (-> arg0 current) 'none)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + (set! (-> *progress-state* clear-screen) (the-as basic #t)) + (cond + ((-> s5-0 0) + (sound-play "generic-beep") + (progress-method-30 arg0) + ) + ((and (not (-> s5-0 0)) + (!= (progress-method-28 arg0 'select-save) 'insufficient-space) + (!= (progress-method-28 arg0 'select-save) 'no-memory-card) + ) + (progress-method-30 arg0) + ) + (else + (sound-play "generic-beep") + (set! (-> obj last-move) (the-as uint (-> self clock frame-counter))) + (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) (zero? (logand (-> *game-info* purchase-secrets) #x8000))) + (set! a1-9 'select-save) + ) + ((and (= (-> *progress-state* starting-state) 'title) + (zero? (logand (-> *game-info* purchase-secrets) #x8000)) + ) + (set! a1-9 'select-save-title) + ) + ) + (let ((a1-10 (progress-method-28 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)) + ) + ((logtest? (pad-buttons pb24) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + (cond + ((= (-> arg0 state-stack 0) 'title) + (sound-play "generic-beep") + (sound-volume-off) + (progress-intro-start (logtest? (-> *game-info* purchase-secrets) #x8000)) + ) + (else + (sound-play "generic-beep") + (progress-method-30 arg0) + ) + ) + ) + ) + ) + ) + ) + 0 + ) + +(defmethod respond-progress menu-secrets-insufficient-space-option ((obj menu-secrets-insufficient-space-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (&-> *progress-state* yes-no-choice) + (cond + ((logtest? (pad-buttons pb24) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + (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 object)) + "Handle progress menu navigation logic." + (let ((v1-1 (&-> *progress-state* yes-no-choice)) + (gp-0 #f) + ) + (cond + ((logtest? (pad-buttons left pb19) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (not (-> v1-1 0))) + (set! (-> v1-1 0) #t) + ) + ((logtest? (pad-buttons right pb17) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (-> v1-1 0)) + (set! (-> v1-1 0) #f) + ) + ((logtest? (pad-buttons pb24) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + (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) (-> self clock frame-counter)) + (set-next-state arg0 'video-mode-ok 0) + ) + (else + (set! (-> *progress-state* video-mode-choice) 'pal) + (progress-method-30 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 object)) + "Handle progress menu navigation logic." + (let ((v1-1 (&-> *progress-state* yes-no-choice)) + (s5-0 #f) + ) + (cond + ((logtest? (pad-buttons left pb19) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! s5-0 (not (-> v1-1 0))) + (set! (-> v1-1 0) #t) + ) + ((logtest? (pad-buttons right pb17) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! s5-0 (-> v1-1 0)) + (set! (-> v1-1 0) #f) + ) + ((logtest? (pad-buttons pb24) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + (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) + (progress-method-30 arg0) + ) + ) + (if s5-0 + (sound-play "generic-beep") + ) + ) + (when (and (nonzero? (-> *progress-state* video-mode-timeout)) + (< (seconds 10) (- (-> self clock frame-counter) (-> *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)) + (progress-method-30 arg0) + ) + 0 + ) + +(defmethod respond-progress menu-progressive-mode-warning-option ((obj menu-progressive-mode-warning-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (let ((v1-1 (&-> *progress-state* yes-no-choice)) + (gp-0 #f) + ) + (cond + ((logtest? (pad-buttons left pb19) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (not (-> v1-1 0))) + (set! (-> v1-1 0) #t) + (set! (-> *progress-state* graphic-options-progressive-scan) #t) + ) + ((logtest? (pad-buttons right pb17) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (-> v1-1 0)) + (set! (-> *progress-state* graphic-options-progressive-scan) #f) + (set! (-> v1-1 0) #f) + ) + ((logtest? (pad-buttons pb24) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + (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) (-> self clock frame-counter)) + (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) + (progress-method-30 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 object)) + "Handle progress menu navigation logic." + (let ((v1-1 (&-> *progress-state* yes-no-choice)) + (s5-0 #f) + ) + (cond + ((logtest? (pad-buttons left pb19) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! s5-0 (not (-> v1-1 0))) + (set! (-> v1-1 0) #t) + ) + ((logtest? (pad-buttons right pb17) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! s5-0 (-> v1-1 0)) + (set! (-> v1-1 0) #f) + ) + ((logtest? (pad-buttons pb24) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + (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) + (progress-method-30 arg0) + ) + ) + (if s5-0 + (sound-play "generic-beep") + ) + ) + (when (and (nonzero? (-> *progress-state* progressive-mode-timeout)) + (< (seconds 10) (- (-> self clock frame-counter) (-> *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) + (progress-method-30 arg0) + ) + 0 + ) + +(defmethod respond-progress menu-card-removed-option ((obj menu-card-removed-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (when (logtest? (pad-buttons pb24) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + (sound-play "generic-beep") + (progress-method-30 arg0) + ) + 0 + ) + +(defmethod respond-progress menu-insert-card-option ((obj menu-insert-card-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + *progress-save-info* + (cond + ((= (progress-method-28 arg0 'select-load) 'select-load) + (set-next-state arg0 'select-load 0) + ) + ((logtest? (pad-buttons pb24) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + (sound-play "generic-beep") + (progress-method-30 arg0) + ) + ) + 0 + ) + +(defmethod respond-progress menu-error-loading-option ((obj menu-error-loading-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (when (logtest? (pad-buttons pb24) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + (sound-play "generic-beep") + (progress-method-30 arg0) + ) + 0 + ) + +(defmethod respond-progress menu-error-auto-saving-option ((obj menu-error-auto-saving-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (when (logtest? (pad-buttons pb24) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + (sound-play "generic-beep") + (progress-method-30 arg0) + ) + 0 + ) + +(defmethod respond-progress menu-error-disc-removed-option ((obj menu-error-disc-removed-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (when (logtest? (pad-buttons pb24) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + (when (is-cd-in?) + (sound-play "generic-beep") + (progress-method-30 arg0) + ) + ) + 0 + ) + +(defmethod respond-progress menu-error-reading-option ((obj menu-error-reading-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (when (logtest? (pad-buttons pb24) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + (sound-play "generic-beep") + (progress-method-30 arg0) + ) + 0 + ) + +(defmethod respond-progress menu-icon-info-option ((obj menu-icon-info-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (when (logtest? (pad-buttons pb24) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + (sound-play "generic-beep") + (progress-method-30 arg0) + ) + 0 + ) + +(defmethod respond-progress menu-quit-option ((obj menu-quit-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (let ((v1-1 (&-> *progress-state* yes-no-choice)) + (gp-0 #f) + ) + (cond + ((logtest? (pad-buttons left pb19) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (not (-> v1-1 0))) + (set! (-> v1-1 0) #t) + ) + ((logtest? (pad-buttons right pb17) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (-> v1-1 0)) + (set! (-> v1-1 0) #f) + ) + ((logtest? (pad-buttons pb24) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + (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") + (progress-method-30 arg0) + ) + ) + ) + ) + (if gp-0 + (sound-play "generic-beep") + ) + ) + 0 + ) + +(defmethod respond-progress menu-format-card-option ((obj menu-format-card-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (let ((s4-0 (&-> *progress-state* yes-no-choice)) + (gp-0 #f) + ) + (let ((a1-2 (progress-method-28 arg0 (-> arg0 current)))) + (set-next-state arg0 a1-2 0) + ) + (cond + ((logtest? (pad-buttons left pb19) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (not (-> s4-0 0))) + (set! (-> s4-0 0) #t) + ) + ((logtest? (pad-buttons right pb17) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (-> s4-0 0)) + (set! (-> s4-0 0) #f) + ) + ((logtest? (pad-buttons pb24) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + (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) #x8000)) + ) + (else + (sound-play "generic-beep") + (progress-method-30 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 object)) + "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 (logtest? (pad-buttons up pb16) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons up pb16) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> obj last-move))) (seconds 0.2)) + ) + ) + (set! (-> obj last-move) (the-as uint (-> self clock frame-counter))) + (when (> (-> obj task-index) 0) + (set! s4-0 #t) + (+! (-> obj task-index) -1) + (set! (-> arg0 sliding-height) -1.0) + ) + ) + ((or (logtest? (pad-buttons down pb18) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons down pb18) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> obj last-move))) (seconds 0.2)) + ) + ) + (set! (-> obj last-move) (the-as uint (-> self clock frame-counter))) + (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* (the-as game-text-id (-> 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) + ) + ) + ) + ((logtest? (pad-buttons pb24) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + (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 object)) + "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 (logtest? (pad-buttons up pb16) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons up pb16) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> obj last-move))) (seconds 0.2)) + ) + ) + (set! (-> obj last-move) (the-as uint (-> self clock frame-counter))) + (when (> (-> obj task-index) 0) + (set! gp-0 #t) + (+! (-> obj task-index) -1) + (set! (-> arg0 sliding-height) -1.0) + ) + ) + ((or (logtest? (pad-buttons down pb18) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons down pb18) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> obj last-move))) (seconds 0.2)) + ) + ) + (set! (-> obj last-move) (the-as uint (-> self clock frame-counter))) + (when (< (-> obj task-index) (+ (length s4-0) -1)) + (set! gp-0 #t) + (+! (-> obj task-index) 1) + (set! (-> arg0 sliding-height) 1.0) + ) + ) + ((logtest? (pad-buttons pb24) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + (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 options (-> 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 unknown) #t (-> s5-1 scale)) + ) + (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 object)) + "Handle progress menu navigation logic." + ((method-of-object *bigmap* bigmap-method-12)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + 0 + ) + +(defmethod respond-progress menu-missions-option ((obj menu-missions-option) (arg0 progress) (arg1 object)) + "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 (logtest? (pad-buttons up pb16) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons up pb16) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> obj last-move))) (seconds 0.2)) + ) + ) + (set! (-> obj last-move) (the-as uint (-> self clock frame-counter))) + (when (> (-> obj task-line-index) 0) + (set! s5-0 #t) + (+! (-> obj task-line-index) -1) + (set! (-> arg0 sliding-height) -1.0) + ) + ) + ((or (logtest? (pad-buttons down pb18) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons down pb18) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> obj last-move))) (seconds 0.2)) + ) + ) + (set! (-> obj last-move) (the-as uint (-> self clock frame-counter))) + (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) + ) + ) + ((logtest? (pad-buttons triangle pb24) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle pb24)) + (if (!= (-> *progress-state* starting-state) 'title) + (sound-play "window-contract") + (sound-play "generic-beep") + ) + (progress-method-30 arg0) + ) + ) + (if s5-0 + (sound-play "mission-scroll") + ) + ) + 0 + ) + +(defmethod respond-progress menu-highscores-option ((obj menu-highscores-option) (arg0 progress) (arg1 object)) + "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 (logtest? (pad-buttons right pb17) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons right pb17) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> obj last-move))) (seconds 0.2)) + ) + ) + (when (< 1 (get-num-highscores)) + (set! (-> obj last-move) (the-as uint (-> self clock frame-counter))) + (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 (logtest? (pad-buttons left pb19) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons left pb19) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> obj last-move))) (seconds 0.2)) + ) + ) + (when (< 1 (get-num-highscores)) + (set! (-> obj last-move) (the-as uint (-> self clock frame-counter))) + (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) + ) + ) + ((logtest? (pad-buttons triangle pb24) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle pb24)) + (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") + ) + (progress-method-30 arg0) + ) + ) + (if s5-0 + (sound-play "score-slide") + ) + ) + ) + 0 + ) + +(defmethod respond-progress menu-secret-option ((obj menu-secret-option) (arg0 progress) (arg1 object)) + "Handle progress menu navigation logic." + (let* ((s5-1 (logtest? (-> *game-info* secrets) (game-secrets big-head))) + (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 (logtest? (pad-buttons pb24) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + (sound-play "generic-beep") + (set! (-> arg0 selected-option) #f) + ) + ) + (else + (cond + ((or (logtest? (pad-buttons down pb18) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons down pb18) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> obj last-move))) (seconds 0.2)) + ) + ) + (set! (-> obj last-move) (the-as uint (-> self clock frame-counter))) + (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 (logtest? (pad-buttons up pb16) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons up pb16) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> obj last-move))) (seconds 0.2)) + ) + ) + (set! (-> obj last-move) (the-as uint (-> self clock frame-counter))) + (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) + ) + ) + ((logtest? (pad-buttons pb24) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + (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") + ) + (progress-method-30 arg0) + ) + ) + (if s5-2 + (sound-play "secrets-scroll") + ) + ) + ) + ) + ) + ) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + 0 + ) + +(defmethod respond-progress menu-game-option ((obj menu-game-option) (arg0 progress) (arg1 object)) + "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 (logtest? (pad-buttons down pb18) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons down pb18) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> *progress-state* game-options-last-move))) (seconds 0.5)) + ) + ) + (set! (-> *progress-state* game-options-last-move) (the-as uint (-> self clock frame-counter))) + (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 (logtest? (pad-buttons up pb16) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons up pb16) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> *progress-state* game-options-last-move))) (seconds 0.5)) + ) + ) + (set! (-> *progress-state* game-options-last-move) (the-as uint (-> self clock frame-counter))) + (if (> (-> *progress-state* game-options-item-selected) 0) + (+! (-> *progress-state* game-options-item-selected) -1) + (set! (-> *progress-state* game-options-item-selected) 3) + ) + ) + ((logtest? (pad-buttons pb24) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + (set! (-> *progress-state* game-options-last-move) (the-as uint (-> self clock frame-counter))) + (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") + ) + (progress-method-30 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)) + ) + ) + ((logtest? (pad-buttons up pb16) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons up pb16)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons up pb16)) + ) + ((logtest? (pad-buttons down pb18) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons down pb18)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons down pb18)) + ) + ((and (zero? (-> *progress-state* game-options-item-selected)) + (logtest? (pad-buttons left pb19) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (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) + (logtest? (pad-buttons left pb19) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (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) + (logtest? (pad-buttons left pb19) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (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) + (logtest? (pad-buttons left pb19) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (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)) + (logtest? (pad-buttons right pb17) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (sound-play "generic-beep") + (set! (-> *progress-state* game-options-vibrations) #f) + ) + ((and (= (-> *progress-state* game-options-item-selected) 1) + (logtest? (pad-buttons right pb17) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (sound-play "generic-beep") + (set! (-> *progress-state* game-options-subtitles) #f) + ) + ((and (= (-> *progress-state* game-options-item-selected) 2) + (logtest? (pad-buttons right pb17) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (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) + (logtest? (pad-buttons right pb17) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (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) + ) + ) + ) + ((logtest? (pad-buttons pb24) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + (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 () + (with-pp + (let ((v1-0 #f)) + (cond + (#t + (cond + ((logtest? (pad-buttons left pb19) (-> *cpad-list* cpads 0 button0-abs 0)) + (set! (-> *setting-control* user-default display-dx) + (min-max-wrap-around (+ (-> *setting-control* user-default display-dx) -2) -96 96) + ) + (set! v1-0 #t) + ) + ((logtest? (pad-buttons right pb17) (-> *cpad-list* cpads 0 button0-abs 0)) + (set! (-> *setting-control* user-default display-dx) + (min-max-wrap-around (+ (-> *setting-control* user-default display-dx) 2) -96 96) + ) + (set! v1-0 #t) + ) + ((logtest? (pad-buttons up pb16) (-> *cpad-list* cpads 0 button0-abs 0)) + (set! (-> *setting-control* user-default display-dy) + (min-max-wrap-around (+ (-> *setting-control* user-default display-dy) -2) -48 48) + ) + (set! v1-0 #f) + ) + ((logtest? (pad-buttons down pb18) (-> *cpad-list* cpads 0 button0-abs 0)) + (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 (logtest? (pad-buttons pb24) (-> *cpad-list* cpads 0 button0-rel 0)) + (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) (- (-> pp clock frame-counter) (-> *progress-state* last-slider-sound))) + (set! (-> *progress-state* last-slider-sound) (-> pp clock frame-counter)) + (sound-play "roll-over") + ) + ) + ) + 0 + ) + ) + +(defmethod respond-progress menu-graphic-option ((obj menu-graphic-option) (arg0 progress) (arg1 object)) + "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 (logtest? (pad-buttons down pb18) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons down pb18) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> *progress-state* graphic-options-last-move))) + (seconds 0.5) + ) + ) + ) + (set! (-> *progress-state* graphic-options-last-move) (the-as uint (-> self clock frame-counter))) + (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 (logtest? (pad-buttons up pb16) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons up pb16) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> *progress-state* graphic-options-last-move))) + (seconds 0.5) + ) + ) + ) + (set! (-> *progress-state* graphic-options-last-move) (the-as uint (-> self clock frame-counter))) + (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)) + ) + ) + ) + ((logtest? (pad-buttons pb24) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + (set! (-> *progress-state* graphic-options-last-move) (the-as uint (-> self clock frame-counter))) + (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") + ) + (progress-method-30 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)) + (logtest? (pad-buttons up right down left pb16 pb17 pb18 pb19) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (let ((t9-13 update-center-screen)) + #t + (t9-13) + ) + ) + ((and (= (-> *progress-state* graphic-options-item-selected) 1) + (logtest? (pad-buttons left pb19) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (sound-play "generic-beep") + (set! (-> *progress-state* graphic-options-aspect-ratio) 'aspect4x3) + ) + ((and (= (-> *progress-state* graphic-options-item-selected) 2) + (logtest? (pad-buttons left pb19) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (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) + (logtest? (pad-buttons left pb19) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (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) + (logtest? (pad-buttons right pb17) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (sound-play "generic-beep") + (set! (-> *progress-state* graphic-options-aspect-ratio) 'aspect16x9) + ) + ((and (= (-> *progress-state* graphic-options-item-selected) 2) + (logtest? (pad-buttons right pb17) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (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) + (logtest? (pad-buttons right pb17) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (sound-play "generic-beep") + (if (!= (-> *progress-state* video-mode-choice) 'ntsc) + (set! (-> *progress-state* video-mode-choice) 'ntsc) + ) + ) + ((logtest? (pad-buttons pb24) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + (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 pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + (progress-method-29 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) + (progress-method-29 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 + ((logtest? (pad-buttons left pb19) (-> *cpad-list* cpads 0 button0-rel 0)) + (when (not (-> v1-1 0)) + (set! gp-0 #t) + (set! (-> v1-1 0) #t) + ) + ) + ((logtest? (pad-buttons right pb17) (-> *cpad-list* cpads 0 button0-rel 0)) + (set! gp-0 (-> v1-1 0)) + (set! (-> v1-1 0) #f) + (format #t "HL ~A~%" (-> v1-1 0)) + ) + ((logtest? (pad-buttons pb24) (-> *cpad-list* cpads 0 button0-rel 0)) + (cond + ((and (-> v1-1 0) (= (-> arg0 name) 366)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + (restart-mission) + (set-next-state arg1 'go-away 0) + ) + ((and (-> v1-1 0) (= (-> arg0 name) 307)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + (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 object)) + "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 (logtest? (pad-buttons down pb18) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons down pb18) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> *progress-state* qr-options-last-move))) (seconds 0.5)) + ) + ) + (set! (-> *progress-state* qr-options-last-move) (the-as uint (-> self clock frame-counter))) + (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 (logtest? (pad-buttons up pb16) (-> *cpad-list* cpads 0 button0-rel 0)) + (and (logtest? (pad-buttons up pb16) (-> *cpad-list* cpads 0 button0-abs 0)) + (>= (- (-> self clock frame-counter) (the-as int (-> *progress-state* qr-options-last-move))) (seconds 0.5)) + ) + ) + (set! (-> *progress-state* qr-options-last-move) (the-as uint (-> self clock frame-counter))) + (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) + ) + ) + ) + ((logtest? (pad-buttons pb24) (-> *cpad-list* cpads 0 button0-rel 0)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons pb24)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons pb24)) + (set! (-> *progress-state* qr-options-last-move) (the-as uint (-> self clock frame-counter))) + (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") + ) + (progress-method-30 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)) + (logtest? (pad-buttons left pb19) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (sound-play "generic-beep") + (update-restart-quit obj arg0 #t) + ) + ((and (zero? (-> *progress-state* qr-options-item-selected)) + (logtest? (pad-buttons right pb17) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (sound-play "generic-beep") + (update-restart-quit obj arg0 #t) + ) + ((and (= (-> *progress-state* qr-options-item-selected) 1) + (logtest? (pad-buttons left pb19) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (sound-play "generic-beep") + (update-restart-quit obj arg0 #t) + ) + ((and (= (-> *progress-state* qr-options-item-selected) 1) + (logtest? (pad-buttons right pb17) (-> *cpad-list* cpads 0 button0-rel 0)) + ) + (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) + ) + ((logtest? (pad-buttons pb24) (-> *cpad-list* cpads 0 button0-rel 0)) + (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 + ) diff --git a/goal_src/jak2/engine/ui/text-h.gc b/goal_src/jak2/engine/ui/text-h.gc index 279c156f7c..37f19662c8 100644 --- a/goal_src/jak2/engine/ui/text-h.gc +++ b/goal_src/jak2/engine/ui/text-h.gc @@ -5,6 +5,15 @@ ;; name in dgo: text-h ;; dgos: ENGINE, GAME +;; NOTE - for progress +(define-extern disable-level-text-file-loading "Disables [[*level-text-file-load-flag*]]" (function none)) +(define-extern enable-level-text-file-loading "Disables [[*level-text-file-load-flag*]]" (function none)) +(define-extern load-level-text-files + "Load the text files needed for level idx. + This function made more sense back when text files were split up, but in the end they put everything + in a single text group and file." + (function int none)) + ;; DECOMP BEGINS (deftype game-text (structure)