[game] pc port progress menu (#1281)

* fix typo

* more typo

* shorten discord rpc text

* allow expanding enums after the fact (untested)

* make `game_text` work similar to subtitles

* update progress decomp

* update some types + `do-not-decompile` in bitfield

* fixes and fall back to original progress code

* update `progress` decomp with new enums

* update config files

* fix enums and debug menu

* always allocate (but not use) a lot of particles

* small rework to display mode options

* revert resolution/aspect-ratio symbol mess

* begin the override stuff

* make `progress-draw` more readable

* more fixes

* codacy good boy points

* first step overriding code

* finish progress overrides, game options menu fully functional!

* minor fixes

* Update game.gp

* Update sparticle-launcher.gc

* clang

* change camera controls text

* oops

* some cleanup

* derp

* nice job

* implement menu scrolling lol

* make scrollable menus less cramped, fix arrows

* make some carousell things i guess

* add msaa carousell to test

* oops

* Update progress-pc.gc

* make `pc-get-screen-size` (untested)

* resolution menu

* input fixes

* return when selecting resolution

* scroll fixes

* Update progress-pc.gc

* add "fit to screen" button

* bug

* complete resolutions menu

* aspect ratio menu

* subtitles language

* subtitle speaker

* final adjustments

* ref test

* fix tests

* fix ref!

* reduce redundancy a bit

* fix mem leaks?

* save settings on progress exit

* fix init reorder

* remove unused code

* rename goal project-like files to the project extension

* sha display toggle

* aspect ratio settings fixes

* dont store text db's in compiler

* properly save+load native aspect stuff
This commit is contained in:
ManDude
2022-04-11 23:38:54 +01:00
committed by GitHub
parent b408c78698
commit a7eee4fdc9
185 changed files with 6172 additions and 11465 deletions
+210 -210
View File
@@ -1579,7 +1579,7 @@
(sv-464 int)
(sv-480 int)
(sv-496 int)
(sv-512 uint)
(sv-512 int)
(sv-528 (function _varargs_ object))
(sv-544 string)
(sv-560 string)
@@ -1629,7 +1629,7 @@
(set! sv-144 s2-1)
(let ((v1-18 (-> s3-0 s0-0 option-type)))
(cond
((= v1-18 7)
((= v1-18 (game-option-type yes-no))
(cond
((-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify)))
(set! sv-160 format)
@@ -1655,7 +1655,7 @@
)
)
)
((or (= v1-18 6) (= v1-18 8))
((or (= v1-18 (game-option-type menu)) (= v1-18 (game-option-type button)))
(cond
((nonzero? (-> s3-0 s0-0 name))
(set! sv-912 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f))
@@ -1673,7 +1673,7 @@
)
(set! (-> sv-112 origin x) (the float (- sv-128 (-> obj left-x-offset))))
(case (-> s3-0 s0-0 option-type)
((3)
(((game-option-type center-screen))
(set! (-> sv-112 origin y) (the float (+ s2-1 -20)))
)
(else
@@ -1693,7 +1693,7 @@
(sv-288 a0-23 a1-11 a2-10 a3-4 t0-1)
)
(case (-> s3-0 s0-0 option-type)
((3)
(((game-option-type center-screen))
(set! sv-144 (+ s2-1 3))
sv-144
)
@@ -1702,243 +1702,243 @@
sv-144
)
)
(let ((v1-81 (-> s3-0 s0-0 option-type)))
(cond
((zero? v1-81)
(let* ((v1-82 (the-as uint #x8000ffff))
(f0-12 (* 0.01 (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify)))))
(a0-34 (logior (logand v1-82 -256) (shr (shl (the int (+ 64.0 (* 191.0 f0-12))) 56) 56)))
(a3-5 (logior (logand a0-34 -65281) (shr (shl (shr (shl a0-34 56) 56) 56) 48)))
)
(draw-percent-bar (- 75 (-> obj left-x-offset)) (+ s2-1 8) f0-12 (the-as int a3-5))
)
(set! sv-304 format)
(let ((a0-42 (clear *temp-string*))
(a1-13 "~D")
(a2-12 (the int (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify)))))
)
(sv-304 a0-42 a1-13 a2-12)
)
(set! sv-912 *temp-string*)
(set! sv-128 (+ (the int (* 2.5 (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify))))) -100))
sv-128
)
((= v1-81 2)
(cond
((-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify)))
(set! sv-320 format)
(set! sv-336 (clear *temp-string*))
(set! sv-352 "~30L~S~0L ~S")
(set! sv-368 (lookup-text! *common-text* (game-text-id on) #f))
(let ((a3-6 (lookup-text! *common-text* (game-text-id off) #f)))
(sv-320 sv-336 sv-352 sv-368 a3-6)
(case (-> s3-0 s0-0 option-type)
(((game-option-type slider))
(let* ((v1-82 (the-as uint #x8000ffff))
(f0-12 (* 0.01 (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify)))))
(a0-34 (logior (logand v1-82 -256) (shr (shl (the int (+ 64.0 (* 191.0 f0-12))) 56) 56)))
(a3-5 (logior (logand a0-34 -65281) (shr (shl (shr (shl a0-34 56) 56) 56) 48)))
)
(set! sv-912 *temp-string*)
sv-912
)
(else
(set! sv-384 format)
(set! sv-400 (clear *temp-string*))
(set! sv-416 "~0L~S ~30L~S~1L")
(set! sv-432 (lookup-text! *common-text* (game-text-id on) #f))
(let ((a3-7 (lookup-text! *common-text* (game-text-id off) #f)))
(sv-384 sv-400 sv-416 sv-432 a3-7)
)
(set! sv-912 *temp-string*)
sv-912
(draw-percent-bar (- 75 (-> obj left-x-offset)) (+ s2-1 8) f0-12 (the-as int a3-5))
)
(set! sv-304 format)
(let ((a0-42 (clear *temp-string*))
(a1-13 "~D")
(a2-12 (the int (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify)))))
)
(sv-304 a0-42 a1-13 a2-12)
)
(set! sv-912 *temp-string*)
(set! sv-128 (+ (the int (* 2.5 (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify))))) -100))
sv-128
)
(((game-option-type on-off))
(cond
((-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify)))
(set! sv-320 format)
(set! sv-336 (clear *temp-string*))
(set! sv-352 "~30L~S~0L ~S")
(set! sv-368 (lookup-text! *common-text* (game-text-id on) #f))
(let ((a3-6 (lookup-text! *common-text* (game-text-id off) #f)))
(sv-320 sv-336 sv-352 sv-368 a3-6)
)
(set! sv-912 *temp-string*)
sv-912
)
(else
(set! sv-384 format)
(set! sv-400 (clear *temp-string*))
(set! sv-416 "~0L~S ~30L~S~1L")
(set! sv-432 (lookup-text! *common-text* (game-text-id on) #f))
(let ((a3-7 (lookup-text! *common-text* (game-text-id off) #f)))
(sv-384 sv-400 sv-416 sv-432 a3-7)
)
(set! sv-912 *temp-string*)
sv-912
)
)
((= v1-81 1)
(set! sv-512 (-> obj language-selection))
(set! sv-448 (-> (the-as (pointer uint64) (-> s3-0 s0-0 value-to-modify))))
(if (and (zero? (scf-get-territory))
(not (and (= *progress-cheat* 'language) (cpad-hold? 0 l2) (cpad-hold? 0 r2)))
)
(set! sv-464 5)
(set! sv-464 6)
)
(if (-> obj language-transition)
(set! (-> obj language-x-offset)
(seekl (-> obj language-x-offset) 200 (the int (* 10.0 (-> *display* time-adjust-ratio))))
)
)
(when (>= (-> obj language-x-offset) 100)
(set! (-> obj language-selection) sv-448)
(set! sv-512 sv-448)
(set! (-> obj language-transition) #f)
(set! (-> obj language-x-offset) 0)
0
)
(((game-option-type language))
(set! sv-512 (the-as int (-> obj language-selection)))
(set! sv-448 (-> (the-as (pointer uint64) (-> s3-0 s0-0 value-to-modify))))
(if (and (zero? (scf-get-territory))
(not (and (= *progress-cheat* 'language) (cpad-hold? 0 l2) (cpad-hold? 0 r2)))
)
(set! sv-464 5)
(set! sv-464 6)
)
(set! (-> sv-112 origin y) (the float (+ s2-1 3)))
(let ((a0-62 sv-112))
(set! (-> a0-62 color) (font-color lighter-lighter-blue))
(if (-> obj language-transition)
(set! (-> obj language-x-offset)
(seekl (-> obj language-x-offset) 200 (the int (* 10.0 (-> *display* time-adjust-ratio))))
)
)
(when (>= (-> obj language-x-offset) 100)
(set! (-> obj language-selection) (the-as language-enum sv-448))
(set! sv-512 (the-as int sv-448))
(set! (-> obj language-transition) #f)
(set! (-> obj language-x-offset) 0)
0
(set! sv-480 (mod (the-as int (+ sv-512 1)) sv-464))
(let ((a0-66 (mod (+ sv-464 -1 sv-512) sv-464))
(v1-153 (mod (the-as int (+ sv-512 2)) sv-464))
)
(set! sv-496 (mod (+ sv-464 -2 sv-512) sv-464))
(cond
((-> obj language-direction)
(let ((a2-22 (- 200 (+ (-> obj language-x-offset) 100))))
(print-language-name a0-66 sv-112 a2-22 #f)
)
(let ((a2-23 (+ (-> obj language-x-offset) 100)))
(cond
((< a2-23 150)
(let ((t9-27 print-language-name)
(a1-30 sv-112)
(a3-9 #t)
)
(t9-27 sv-480 a1-30 a2-23 a3-9)
)
)
(set! (-> sv-112 origin y) (the float (+ s2-1 3)))
(let ((a0-62 sv-112))
(set! (-> a0-62 color) (font-color lighter-lighter-blue))
)
0
(set! sv-480 (mod (+ sv-512 1) sv-464))
(let ((a0-66 (mod (+ sv-464 -1 sv-512) sv-464))
(v1-153 (mod (+ sv-512 2) sv-464))
)
(set! sv-496 (mod (+ sv-464 -2 sv-512) sv-464))
(cond
((-> obj language-direction)
(let ((a2-22 (- 200 (+ (-> obj language-x-offset) 100))))
(print-language-name a0-66 sv-112 a2-22 #f)
)
(let ((a2-23 (+ (-> obj language-x-offset) 100)))
(cond
((< a2-23 150)
(let ((t9-27 print-language-name)
(a1-30 sv-112)
(a3-9 #t)
)
(t9-27 sv-480 a1-30 a2-23 a3-9)
)
(else
(let ((a2-24 (- 200 (-> obj language-x-offset)))
(t9-28 print-language-name)
(a1-31 sv-112)
(a3-10 #f)
)
(t9-28 sv-496 a1-31 a2-24 a3-10)
)
)
(else
(let ((a2-24 (- 200 (-> obj language-x-offset)))
(t9-28 print-language-name)
(a1-31 sv-112)
(a3-10 #f)
)
(t9-28 sv-496 a1-31 a2-24 a3-10)
)
)
)
)
(else
(let ((a2-25 (+ (-> obj language-x-offset) 100)))
(cond
((< a2-25 150)
(print-language-name a0-66 sv-112 a2-25 #f)
)
(else
(let ((a2-26 (- 200 (-> obj language-x-offset))))
(print-language-name v1-153 sv-112 a2-26 #t)
)
)
(else
(let ((a2-25 (+ (-> obj language-x-offset) 100)))
(cond
((< a2-25 150)
(print-language-name a0-66 sv-112 a2-25 #f)
)
(else
(let ((a2-26 (- 200 (-> obj language-x-offset))))
(print-language-name v1-153 sv-112 a2-26 #t)
)
)
)
(let ((a2-27 (- 200 (+ (-> obj language-x-offset) 100))))
(print-language-name sv-480 sv-112 a2-27 #t)
)
)
(let ((a2-27 (- 200 (+ (-> obj language-x-offset) 100))))
(print-language-name sv-480 sv-112 a2-27 #t)
)
)
)
(when (not (-> obj language-transition))
(let ((a0-75 sv-112))
(set! (-> a0-75 color) (font-color yellow-green-2))
)
(when (not (-> obj language-transition))
(let ((a0-75 sv-112))
(set! (-> a0-75 color) (font-color yellow-green-2))
)
)
(let ((t9-32 print-language-name)
(a1-37 sv-112)
(a2-28 (-> obj language-x-offset))
(a3-14 (-> obj language-direction))
)
)
(let ((t9-32 print-language-name)
(a1-37 sv-112)
(a2-28 (-> obj language-x-offset))
(a3-14 (-> obj language-direction))
)
(t9-32 (the-as int sv-512) a1-37 a2-28 (the-as symbol a3-14))
)
(t9-32 sv-512 a1-37 a2-28 a3-14)
)
((= v1-81 3)
(set! sv-912 (lookup-text! *common-text* (game-text-id move-dpad) #f))
sv-912
)
((= v1-81 4)
(cond
((= (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) 'aspect4x3)
(set! sv-528 format)
(set! sv-544 (clear *temp-string*))
(set! sv-560 "~30L~S~0L ~S")
(set! sv-576 (lookup-text! *common-text* (game-text-id 4x3) #f))
(let ((a3-15 (lookup-text! *common-text* (game-text-id 16x9) #f)))
(sv-528 sv-544 sv-560 sv-576 a3-15)
)
(set! sv-912 *temp-string*)
sv-912
)
(((game-option-type center-screen))
(set! sv-912 (lookup-text! *common-text* (game-text-id move-dpad) #f))
sv-912
)
(((game-option-type aspect-ratio))
(cond
((= (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) 'aspect4x3)
(set! sv-528 format)
(set! sv-544 (clear *temp-string*))
(set! sv-560 "~30L~S~0L ~S")
(set! sv-576 (lookup-text! *common-text* (game-text-id 4x3) #f))
(let ((a3-15 (lookup-text! *common-text* (game-text-id 16x9) #f)))
(sv-528 sv-544 sv-560 sv-576 a3-15)
)
(else
(set! sv-592 format)
(set! sv-608 (clear *temp-string*))
(set! sv-624 "~0L~S ~30L~S~1L")
(set! sv-640 (lookup-text! *common-text* (game-text-id 4x3) #f))
(let ((a3-16 (lookup-text! *common-text* (game-text-id 16x9) #f)))
(sv-592 sv-608 sv-624 sv-640 a3-16)
)
(set! sv-912 *temp-string*)
sv-912
(set! sv-912 *temp-string*)
sv-912
)
(else
(set! sv-592 format)
(set! sv-608 (clear *temp-string*))
(set! sv-624 "~0L~S ~30L~S~1L")
(set! sv-640 (lookup-text! *common-text* (game-text-id 4x3) #f))
(let ((a3-16 (lookup-text! *common-text* (game-text-id 16x9) #f)))
(sv-592 sv-608 sv-624 sv-640 a3-16)
)
(set! sv-912 *temp-string*)
sv-912
)
)
((= v1-81 5)
(cond
((= (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) 'ntsc)
(set! sv-656 format)
(set! sv-672 (clear *temp-string*))
(set! sv-688 "~0L~S ~30L~S~1L")
(set! sv-704 (lookup-text! *common-text* (game-text-id 50hz) #f))
(let ((a3-17 (lookup-text! *common-text* (game-text-id 60hz) #f)))
(sv-656 sv-672 sv-688 sv-704 a3-17)
)
(set! sv-912 *temp-string*)
sv-912
)
(((game-option-type video-mode))
(cond
((= (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify))) 'ntsc)
(set! sv-656 format)
(set! sv-672 (clear *temp-string*))
(set! sv-688 "~0L~S ~30L~S~1L")
(set! sv-704 (lookup-text! *common-text* (game-text-id 50hz) #f))
(let ((a3-17 (lookup-text! *common-text* (game-text-id 60hz) #f)))
(sv-656 sv-672 sv-688 sv-704 a3-17)
)
(else
(set! sv-720 format)
(set! sv-736 (clear *temp-string*))
(set! sv-752 "~30L~S~0L ~S")
(set! sv-768 (lookup-text! *common-text* (game-text-id 50hz) #f))
(let ((a3-18 (lookup-text! *common-text* (game-text-id 60hz) #f)))
(sv-720 sv-736 sv-752 sv-768 a3-18)
)
(set! sv-912 *temp-string*)
sv-912
(set! sv-912 *temp-string*)
sv-912
)
(else
(set! sv-720 format)
(set! sv-736 (clear *temp-string*))
(set! sv-752 "~30L~S~0L ~S")
(set! sv-768 (lookup-text! *common-text* (game-text-id 50hz) #f))
(let ((a3-18 (lookup-text! *common-text* (game-text-id 60hz) #f)))
(sv-720 sv-736 sv-752 sv-768 a3-18)
)
(set! sv-912 *temp-string*)
sv-912
)
)
)
)
)
)
(else
(let ((v1-195 (-> s3-0 s0-0 option-type)))
(cond
((or (zero? v1-195) (= v1-195 3) (= v1-195 4) (= v1-195 5))
(set! sv-912 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f))
sv-912
)
((= v1-195 2)
(set! sv-784 format)
(set! sv-800 (clear *temp-string*))
(set! sv-816 "~S: ~S")
(set! sv-832 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f))
(let ((a3-19 (if (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify)))
(lookup-text! *common-text* (game-text-id on) #f)
(lookup-text! *common-text* (game-text-id off) #f)
)
)
)
(sv-784 sv-800 sv-816 sv-832 a3-19)
)
(set! sv-912 *temp-string*)
sv-912
)
((= v1-195 1)
(set! sv-848 format)
(set! sv-864 (clear *temp-string*))
(set! sv-880 "~S: ~S")
(set! sv-896 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f))
(let ((a3-20 (lookup-text!
*common-text*
(-> *language-name-remap* (-> (the-as (pointer uint64) (-> s3-0 s0-0 value-to-modify))))
#f
)
)
)
(sv-848 sv-864 sv-880 sv-896 a3-20)
)
(set! sv-912 *temp-string*)
sv-912
)
(case (-> s3-0 s0-0 option-type)
(((game-option-type slider)
(game-option-type center-screen)
(game-option-type aspect-ratio)
(game-option-type video-mode)
)
(set! sv-912 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f))
sv-912
)
(((game-option-type on-off))
(set! sv-784 format)
(set! sv-800 (clear *temp-string*))
(set! sv-816 "~S: ~S")
(set! sv-832 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f))
(let ((a3-19 (if (-> (the-as (pointer uint32) (-> s3-0 s0-0 value-to-modify)))
(lookup-text! *common-text* (game-text-id on) #f)
(lookup-text! *common-text* (game-text-id off) #f)
)
)
)
(sv-784 sv-800 sv-816 sv-832 a3-19)
)
(set! sv-912 *temp-string*)
sv-912
)
(((game-option-type language))
(set! sv-848 format)
(set! sv-864 (clear *temp-string*))
(set! sv-880 "~S: ~S")
(set! sv-896 (lookup-text! *common-text* (-> s3-0 s0-0 name) #f))
(let ((a3-20 (lookup-text!
*common-text*
(-> *language-name-remap* (-> (the-as (pointer uint64) (-> s3-0 s0-0 value-to-modify))))
#f
)
)
)
(sv-848 sv-864 sv-880 sv-896 a3-20)
)
(set! sv-912 *temp-string*)
sv-912
)
)
)
)
File diff suppressed because it is too large Load Diff
+134 -144
View File
@@ -10,7 +10,7 @@
(starting-state progress-screen :offset-assert 24)
(last-slot-saved int32 :offset-assert 32)
(slider-backup float :offset-assert 36)
(language-backup int64 :offset-assert 40)
(language-backup language-enum :offset-assert 40)
(on-off-backup symbol :offset-assert 48)
(center-x-backup int32 :offset-assert 52)
(center-y-backup int32 :offset-assert 56)
@@ -1065,7 +1065,7 @@
)
;; definition for method 32 of type progress
(defmethod dummy-32 progress ((obj progress))
(defmethod can-go-back? progress ((obj progress))
(let ((v1-2 (-> *progress-process* 0 display-state))
(a1-1 (-> *progress-state* starting-state))
)
@@ -1095,7 +1095,7 @@
;; definition for method 19 of type progress
;; INFO: Return type mismatch object vs symbol.
(defmethod dummy-19 progress ((obj progress))
(defmethod visible? progress ((obj progress))
(the-as symbol (and *progress-process* (zero? (-> *progress-process* 0 in-out-position))))
)
@@ -1147,7 +1147,7 @@
)
;; definition for method 53 of type progress
(defmethod dummy-53 progress ((obj progress) (arg0 progress-screen))
(defmethod set-memcard-screen progress ((obj progress) (arg0 progress-screen))
(let ((s4-0 (-> obj card-info))
(gp-0 arg0)
)
@@ -1250,7 +1250,7 @@
;; definition for method 31 of type progress
;; INFO: Return type mismatch int vs none.
(defmethod dummy-31 progress ((obj progress))
(defmethod respond-memcard progress ((obj progress))
(let ((s5-0 (-> obj card-info)))
(when (and s5-0 (not (-> obj in-transition)))
(when (or (cpad-pressed? 0 x) (cpad-pressed? 0 circle))
@@ -1307,14 +1307,12 @@
(sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t)
(set! (-> obj next-display-state) (progress-screen memcard-saving))
)
((begin
(sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t)
(= (-> obj display-state-stack 0) (progress-screen title))
)
(set! (-> obj next-display-state) (progress-screen save-game-title))
)
(else
(set! (-> obj next-display-state) (progress-screen save-game))
(sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t)
(if (= (-> obj display-state-stack 0) (progress-screen title))
(set! (-> obj next-display-state) (progress-screen save-game-title))
(set! (-> obj next-display-state) (progress-screen save-game))
)
)
)
)
@@ -1443,7 +1441,7 @@
;; definition for method 29 of type progress
;; INFO: Return type mismatch int vs none.
(defmethod dummy-29 progress ((obj progress))
(defmethod respond-common progress ((obj progress))
(mc-get-slot-info 0 *progress-save-info*)
(set! (-> obj card-info) *progress-save-info*)
(let ((s5-0 (-> *options-remap* (-> obj display-state))))
@@ -1467,7 +1465,7 @@
(when (-> obj selected-option)
(let ((v1-34 #f))
(case (-> s5-0 (-> obj option-index) option-type)
((3)
(((game-option-type center-screen))
(when (< -48 (-> *setting-control* current screeny))
(set! v1-34 #t)
(+! (-> *setting-control* default screeny) -1)
@@ -1508,7 +1506,7 @@
(when (-> obj selected-option)
(let ((v1-69 #f))
(case (-> s5-0 (-> obj option-index) option-type)
((3)
(((game-option-type center-screen))
(when (< (-> *setting-control* current screeny) 48)
(set! v1-69 #t)
(+! (-> *setting-control* default screeny) 1)
@@ -1529,10 +1527,10 @@
((cpad-hold? 0 left)
(cond
((cpad-pressed? 0 left)
(when (or (-> obj selected-option) (= (-> s5-0 (-> obj option-index) option-type) 7))
(when (or (-> obj selected-option) (= (-> s5-0 (-> obj option-index) option-type) (game-option-type yes-no)))
(let ((s4-5 #f))
(case (-> s5-0 (-> obj option-index) option-type)
((2 7)
(((game-option-type on-off) (game-option-type yes-no))
(when (not (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify))))
(set! s4-5 #t)
(if (= (-> s5-0 (-> obj option-index) value-to-modify) (&-> *setting-control* current vibration))
@@ -1541,15 +1539,15 @@
)
(set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) #t)
)
((4)
(((game-option-type aspect-ratio))
(set! s4-5 (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'aspect16x9))
(set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'aspect4x3)
)
((5)
(((game-option-type video-mode))
(set! s4-5 (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'ntsc))
(set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'pal)
)
((1)
(((game-option-type language))
(if (> (the-as int (-> (the-as (pointer uint64) (-> s5-0 (-> obj option-index) value-to-modify)))) 0)
(+! (-> (the-as (pointer uint64) (-> s5-0 (-> obj option-index) value-to-modify))) -1)
(set! (-> (the-as (pointer int64) (-> s5-0 (-> obj option-index) value-to-modify)))
@@ -1575,35 +1573,33 @@
(else
(when (-> obj selected-option)
(let ((v1-157 #f))
(let ((a0-101 (-> s5-0 (-> obj option-index) option-type)))
(cond
((zero? a0-101)
(cond
((>= (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))
(+ 1.0 (-> s5-0 (-> obj option-index) param1))
(case (-> s5-0 (-> obj option-index) option-type)
(((game-option-type slider))
(cond
((>= (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))
(+ 1.0 (-> s5-0 (-> obj option-index) param1))
)
(set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))
(+ -1.0 (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))))
)
(set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))
(+ -1.0 (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))))
)
(set! v1-157 #t)
)
((< (-> s5-0 (-> obj option-index) param1)
(-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))
)
(set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))
(-> s5-0 (-> obj option-index) param1)
)
(set! v1-157 #t)
)
)
(set! v1-157 #t)
)
((< (-> s5-0 (-> obj option-index) param1)
(-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))
)
(set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))
(-> s5-0 (-> obj option-index) param1)
)
(set! v1-157 #t)
)
)
((= a0-101 3)
(when (< -96 (-> *setting-control* default screenx))
(set! v1-157 #t)
(+! (-> *setting-control* default screenx) -1)
)
)
(((game-option-type center-screen))
(when (< -96 (-> *setting-control* default screenx))
(set! v1-157 #t)
(+! (-> *setting-control* default screenx) -1)
)
)
)
)
(when v1-157
(let ((f30-0 100.0))
@@ -1626,22 +1622,22 @@
((cpad-hold? 0 right)
(cond
((cpad-pressed? 0 right)
(when (or (-> obj selected-option) (= (-> s5-0 (-> obj option-index) option-type) 7))
(when (or (-> obj selected-option) (= (-> s5-0 (-> obj option-index) option-type) (game-option-type yes-no)))
(let ((v1-217 (the-as object #f)))
(case (-> s5-0 (-> obj option-index) option-type)
((2 7)
(((game-option-type on-off) (game-option-type yes-no))
(set! v1-217 (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify))))
(set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) #f)
)
((4)
(((game-option-type aspect-ratio))
(set! v1-217 (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'aspect4x3))
(set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'aspect16x9)
)
((5)
(((game-option-type video-mode))
(set! v1-217 (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'pal))
(set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'ntsc)
)
((1)
(((game-option-type language))
(let ((v1-243 (if (and (zero? (scf-get-territory))
(not (and (= *progress-cheat* 'language) (cpad-hold? 0 l2) (cpad-hold? 0 r2)))
)
@@ -1674,35 +1670,33 @@
(else
(when (-> obj selected-option)
(let ((v1-263 #f))
(let ((a0-177 (-> s5-0 (-> obj option-index) option-type)))
(cond
((zero? a0-177)
(cond
((>= (+ -1.0 (-> s5-0 (-> obj option-index) param2))
(-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))
(case (-> s5-0 (-> obj option-index) option-type)
(((game-option-type slider))
(cond
((>= (+ -1.0 (-> s5-0 (-> obj option-index) param2))
(-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))
)
(set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))
(+ 1.0 (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))))
)
(set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))
(+ 1.0 (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))))
)
(set! v1-263 #t)
)
((< (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))
(-> s5-0 (-> obj option-index) param2)
)
(set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))
(-> s5-0 (-> obj option-index) param2)
)
(set! v1-263 #t)
)
)
(set! v1-263 #t)
)
((< (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))
(-> s5-0 (-> obj option-index) param2)
)
(set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))
(-> s5-0 (-> obj option-index) param2)
)
(set! v1-263 #t)
)
)
((= a0-177 3)
(when (< (-> *setting-control* default screenx) 96)
(set! v1-263 #t)
(+! (-> *setting-control* default screenx) 1)
)
)
(((game-option-type center-screen))
(when (< (-> *setting-control* default screenx) 96)
(set! v1-263 #t)
(+! (-> *setting-control* default screenx) 1)
)
)
)
)
(when v1-263
(let ((f30-1 100.0))
@@ -1725,38 +1719,36 @@
((or (cpad-pressed? 0 square) (cpad-pressed? 0 triangle))
(cond
((-> obj selected-option)
(let ((v1-319 (-> s5-0 (-> obj option-index) option-type)))
(cond
((zero? v1-319)
(set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))
(-> *progress-state* slider-backup)
)
)
((= v1-319 1)
(set! (-> (the-as (pointer int64) (-> s5-0 (-> obj option-index) value-to-modify)))
(-> *progress-state* language-backup)
)
)
((= v1-319 2)
(set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0)
(-> *progress-state* on-off-backup)
)
)
((= v1-319 3)
(set! (-> *setting-control* default screenx) (-> *progress-state* center-x-backup))
(set! (-> *setting-control* default screeny) (-> *progress-state* center-y-backup))
)
((or (= v1-319 4) (= v1-319 5))
(set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0)
(-> *progress-state* aspect-ratio-backup)
)
)
)
(case (-> s5-0 (-> obj option-index) option-type)
(((game-option-type slider))
(set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))
(-> *progress-state* slider-backup)
)
)
(((game-option-type language))
(set! (-> (the-as (pointer language-enum) (-> s5-0 (-> obj option-index) value-to-modify)) 0)
(-> *progress-state* language-backup)
)
)
(((game-option-type on-off))
(set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0)
(-> *progress-state* on-off-backup)
)
)
(((game-option-type center-screen))
(set! (-> *setting-control* default screenx) (-> *progress-state* center-x-backup))
(set! (-> *setting-control* default screeny) (-> *progress-state* center-y-backup))
)
(((game-option-type aspect-ratio) (game-option-type video-mode))
(set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0)
(-> *progress-state* aspect-ratio-backup)
)
)
)
(sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t)
(set! (-> obj selected-option) #f)
)
((or (dummy-32 obj)
((or (can-go-back? obj)
(= (-> obj display-state) (progress-screen load-game))
(= (-> obj display-state) (progress-screen save-game))
(= (-> obj display-state) (progress-screen save-game-title))
@@ -1778,7 +1770,7 @@
(cond
((not (-> obj selected-option))
(cond
((= (-> s5-0 (-> obj option-index) option-type) 6)
((= (-> s5-0 (-> obj option-index) option-type) (game-option-type menu))
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons x))
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons x))
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons circle))
@@ -1788,11 +1780,11 @@
(set! (-> obj next-display-state) (the-as progress-screen (-> s5-0 (-> obj option-index) param3)))
(case (-> obj next-display-state)
(((progress-screen load-game) (progress-screen save-game) (progress-screen save-game-title))
(set! (-> obj next-display-state) (dummy-53 obj (-> obj next-display-state)))
(set! (-> obj next-display-state) (set-memcard-screen obj (-> obj next-display-state)))
)
)
)
((= (-> s5-0 (-> obj option-index) option-type) 8)
((= (-> s5-0 (-> obj option-index) option-type) (game-option-type button))
(cond
((= (-> s5-0 (-> obj option-index) name) (game-text-id exit-demo))
(set! *master-exit* 'force)
@@ -1808,34 +1800,32 @@
)
)
)
((!= (-> s5-0 (-> obj option-index) option-type) 7)
(let ((v1-427 (-> s5-0 (-> obj option-index) option-type)))
(cond
((zero? v1-427)
(set! (-> *progress-state* slider-backup)
(-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))
)
)
((= v1-427 1)
(set! (-> *progress-state* language-backup)
(the-as int (-> (the-as (pointer uint64) (-> s5-0 (-> obj option-index) value-to-modify))))
)
)
((= v1-427 2)
(set! (-> *progress-state* on-off-backup)
(the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify))))
)
)
((= v1-427 3)
(set! (-> *progress-state* center-x-backup) (-> *setting-control* default screenx))
(set! (-> *progress-state* center-y-backup) (-> *setting-control* default screeny))
)
((or (= v1-427 4) (= v1-427 5))
(set! (-> *progress-state* aspect-ratio-backup)
(the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify))))
)
)
)
((!= (-> s5-0 (-> obj option-index) option-type) (game-option-type yes-no))
(case (-> s5-0 (-> obj option-index) option-type)
(((game-option-type slider))
(set! (-> *progress-state* slider-backup)
(-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))
)
)
(((game-option-type language))
(set! (-> *progress-state* language-backup)
(the-as language-enum (-> (the-as (pointer uint64) (-> s5-0 (-> obj option-index) value-to-modify))))
)
)
(((game-option-type on-off))
(set! (-> *progress-state* on-off-backup)
(the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify))))
)
)
(((game-option-type center-screen))
(set! (-> *progress-state* center-x-backup) (-> *setting-control* default screenx))
(set! (-> *progress-state* center-y-backup) (-> *setting-control* default screeny))
)
(((game-option-type aspect-ratio) (game-option-type video-mode))
(set! (-> *progress-state* aspect-ratio-backup)
(the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify))))
)
)
)
(sound-play-by-name (static-sound-name "select-option") (new-sound-id) 1024 0 0 1 #t)
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons x))
@@ -1843,8 +1833,8 @@
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons circle))
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons circle))
(set! (-> obj selected-option) #t)
(when (= (-> s5-0 (-> obj option-index) option-type) 1)
(set! (-> obj language-selection) (the-as uint (-> *setting-control* current language)))
(when (= (-> s5-0 (-> obj option-index) option-type) (game-option-type language))
(set! (-> obj language-selection) (-> *setting-control* current language))
(set! (-> obj language-direction) #t)
(set! (-> obj language-transition) #f)
(set! (-> obj language-x-offset) 0)
@@ -1857,12 +1847,12 @@
(sound-play-by-name (static-sound-name "start-options") (new-sound-id) 1024 0 0 1 #t)
(set! (-> obj selected-option) #f)
(case (-> s5-0 (-> obj option-index) option-type)
((4)
(((game-option-type aspect-ratio))
(set! (-> *setting-control* default aspect-ratio)
(the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify))))
)
)
((5)
(((game-option-type video-mode))
(case (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))
(('pal)
(set! (-> *setting-control* default video-mode)
@@ -1875,7 +1865,7 @@
)
)
)
((1)
(((game-option-type language))
(if (not (-> obj language-transition))
(load-level-text-files (-> obj display-level-index))
)
@@ -2238,8 +2228,8 @@
)
)
)
(dummy-29 self)
(set! (-> self next-display-state) (dummy-53 self (-> self next-display-state)))
(respond-common self)
(set! (-> self next-display-state) (set-memcard-screen self (-> self next-display-state)))
(let ((v1-74 (-> self display-state)))
(cond
((or (= v1-74 (progress-screen fuel-cell))
@@ -2270,7 +2260,7 @@
(= v1-74 (progress-screen bad-disc))
(= v1-74 (progress-screen quit))
)
(dummy-31 self)
(respond-memcard self)
)
)
)