[jak2] music player cheat menu (#2900)

This commit is contained in:
ManDude
2023-08-16 17:53:38 +01:00
committed by GitHub
parent bf7a2161b3
commit e7f2f2ad49
20 changed files with 1108 additions and 168 deletions
+49 -11
View File
@@ -7260,6 +7260,44 @@
(progress-cheats #x120f)
(progress-aspect-ratio-custom-width #x1210)
(progress-aspect-ratio-custom-height #x1211)
(progress-music-player-locked #x1212)
(progress-music-player-now-playing #x1213)
(progress-music-player-no-track #x1214)
(progress-music-player-flava-default #x1215)
(progress-music-player-flava-gun #x1216)
(progress-music-player-flava-board #x1217)
(progress-music-player-flava-mech #x1218)
(progress-music-player-flava-darkjak #x1219)
(progress-music-player-flava-pilot #x121a)
(progress-music-player-danger #x121b)
(progress-music-player-danger-0 #x121c)
(progress-music-player-danger-1 #x121d)
(progress-music-player-danger-2 #x121e)
(progress-music-player-danger-3 #x121f)
(progress-music-player-city #x1220)
(progress-music-player-city-battle #x1221)
(progress-music-player-battle #x1222)
(progress-music-player-danger2 #x1223)
(progress-music-player-danger3 #x1224)
(progress-music-player-danger4 #x1225)
(progress-music-player-danger6 #x1226)
(progress-music-player-danger7 #x1227)
(progress-music-player-danger9 #x1228)
(progress-music-player-danger10 #x1229)
(progress-music-player-danger11 #x122a)
(progress-music-player-atoll #x122b)
(progress-music-player-atoll-battle #x122c)
(progress-music-player-strip #x122d)
(progress-music-player-forest #x122e)
(progress-music-player-forest-battle #x122f)
(progress-music-player-sewer #x1230)
(progress-music-player-sewer-battle #x1231)
(progress-music-player-mountain #x1232)
(progress-music-player-mountain-battle #x1233)
(progress-music-player-palcab #x1234)
(progress-music-player-palcab-battle #x1235)
(progress-music-player-race #x1236)
(progress-music-player-ruins #x1237)
)
;; ---text-id-h:text-id
@@ -22331,7 +22369,7 @@
)
(deftype menu-insufficient-space-option (menu-option)
((last-move uint64 :offset-assert 48)
((last-move time-frame :offset-assert 48)
)
:method-count-assert 12
:size-assert #x38
@@ -22479,7 +22517,7 @@
(deftype menu-select-start-option (menu-option)
((task-index int32 :offset-assert 48)
(real-task-index int32 :offset-assert 52)
(last-move uint64 :offset-assert 56)
(last-move time-frame :offset-assert 56)
)
:method-count-assert 12
:size-assert #x40
@@ -22490,7 +22528,7 @@
(deftype menu-select-scene-option (menu-option)
((task-index int32 :offset-assert 48)
(last-move uint64 :offset-assert 56)
(last-move time-frame :offset-assert 56)
)
:method-count-assert 12
:size-assert #x40
@@ -22523,7 +22561,7 @@
(deftype menu-missions-option (paged-menu-option)
((task-line-index int32 :offset-assert 64)
(last-move uint64 :offset-assert 72)
(last-move time-frame :offset-assert 72)
)
:method-count-assert 12
:size-assert #x50
@@ -22533,7 +22571,7 @@
)
(deftype menu-highscores-option (paged-menu-option)
((last-move uint64 :offset-assert 64)
((last-move time-frame :offset-assert 64)
(sprites hud-sprite 2 :inline :offset 80)
)
:method-count-assert 12
@@ -22562,7 +22600,7 @@
(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)
(last-move time-frame :offset-assert 72)
(sprites hud-sprite 2 :inline :offset 80)
)
:method-count-assert 12
@@ -22592,7 +22630,7 @@
)
(deftype menu-qr-option (menu-option)
((last-move uint64 :offset-assert 48)
((last-move time-frame :offset-assert 48)
(value-to-modify function :offset 60)
)
:method-count-assert 12
@@ -22633,7 +22671,7 @@
)
(deftype menu-graphic-option (menu-option)
((last-move uint64 :offset-assert 48)
((last-move time-frame :offset-assert 48)
(value-to-modify pointer :offset 60)
)
:method-count-assert 12
@@ -22681,7 +22719,7 @@
)
(deftype menu-game-option (menu-option)
((last-move uint64 :offset-assert 48)
((last-move time-frame :offset-assert 48)
(value-to-modify pointer :offset 60)
)
:method-count-assert 12
@@ -31029,7 +31067,7 @@
(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-last-move time-frame :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)
@@ -31041,7 +31079,7 @@
(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-last-move time-frame :offset-assert 192)
(qr-options-restart basic :offset-assert 200)
(qr-options-quit basic :offset-assert 204)
(total-num-tasks int32 :offset-assert 208)
@@ -24,5 +24,43 @@
"120e": "Text Language",
"120f": "OpenGOAL Secrets",
"1210": "Width",
"1211": "Height"
"1211": "Height",
"1212": "??????????",
"1213": "Now playing...",
"1214": "No Track",
"1215": "Default",
"1216": "Morph Gun",
"1217": "JET-Board",
"1218": "Titan Suit",
"1219": "Dark Jak",
"121a": "Vehicle",
"121b": "Danger",
"121c": "None",
"121d": "Low",
"121e": "Medium",
"121f": "High",
"1220": "Haven Exploration",
"1221": "Guard Pursuit",
"1222": "Ram Head Battle (Alt)",
"1223": "Mar's Tomb",
"1224": "Onin Challenge",
"1225": "Metal Kor",
"1226": "Krew Battle",
"1227": "Baron Battle",
"1228": "Bouncing Boulders",
"1229": "Exploding Eco",
"122a": "Fortress Tank",
"122b": "Pumping Station",
"122c": "Protect Sig",
"122d": "Strip Mine",
"122e": "Haven Forest",
"122f": "Forest Dragons",
"1230": "The Fortress",
"1231": "Escape",
"1232": "Mountain Temple",
"1233": "Ram Head Battle",
"1234": "Praxis Palace",
"1235": "Weapons Factory",
"1236": "Arena Race",
"1237": "Dead Town"
}
+4
View File
@@ -281,6 +281,7 @@ std::pair<bool, u8*> ame_handler::run_ame(midi_handler& midi, u8* stream) {
// auto xmin = m_groups[group].excite_min[i];
// auto xmax = m_groups[group].excite_max[i];
// fmt::print("chan {} excite: {}-{}\n", i, xmin, xmax);
// note : added hack here! :-)
if (!SoundFlavaHack &&
(comp < m_groups[group].excite_min[i] || comp > m_groups[group].excite_max[i])) {
@@ -325,6 +326,9 @@ std::pair<bool, u8*> ame_handler::run_ame(midi_handler& midi, u8* stream) {
case 0x16: {
AME_BEGIN(op)
if (m_register[stream[0]] != stream[1]) {
// if (stream[0] == 3) {
// fmt::print("AME x16 reg[{}] == {}\n", stream[0], stream[1]);
// }
skip = 1;
}
AME_END(2)
+11 -6
View File
@@ -827,15 +827,20 @@
(format 0 "[PC] PC Settings not found at '~S'...initializing with defaults!~%" *pc-temp-string-1*))
0)
(defmethod initialize pc-settings ((obj pc-settings))
"initial initialize method to be run after allocating"
;; load defaults not covered by the file
(reset obj #f)
;; if saved settings are corrupted or not found, the object will be fully reset to use all defaults
(load-settings obj)
;; any post-operations that need to be done after loading
(update-mouse-controls! obj)
obj)
(defmethod new pc-settings ((allocation symbol) (type-to-make type))
"make a new pc-settings"
(let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size)))))
;; load defaults not covered by the file
(reset obj #f)
;; if saved settings are corrupted or not found, the object will be fully reset to use all defaults
(load-settings obj)
;; any post-operations that need to be done after loading
(update-mouse-controls! obj)
(initialize obj)
obj))
+1
View File
@@ -211,6 +211,7 @@
(:methods
(new (symbol type) _type_)
(initialize (_type_) _type_)
(update (_type_) none)
(update-from-os (_type_) none)
(update-to-os (_type_) none)
+49 -49
View File
@@ -1134,61 +1134,61 @@
0
)
(when *sound-player-enable*
(cond
((!= (-> s5-0 sound-flava) (-> s4-0 sound-flava))
(set! (-> s5-0 sound-flava) (-> s4-0 sound-flava))
(sound-set-midi-reg 14 (the-as int (-> s5-0 sound-flava)))
)
((!= (-> s5-0 sound-reverb) (-> s4-0 sound-reverb))
(set! (-> s5-0 sound-reverb) (-> s4-0 sound-reverb))
(sound-set-reverb 4 (-> s5-0 sound-reverb) (-> s5-0 sound-reverb) (the-as uint 3))
)
((!= (-> s5-0 sound-mode) (-> s4-0 sound-mode))
(set! (-> s5-0 sound-mode) (-> s4-0 sound-mode))
(sound-set-midi-reg 3 (the-as int (-> s5-0 sound-mode)))
)
((!= (-> s5-0 sound-tune) (-> s4-0 sound-tune))
(set! (-> s5-0 sound-tune) (-> s4-0 sound-tune))
(sound-set-midi-reg 4 (the-as int (-> s5-0 sound-tune)))
)
((!= (-> s5-0 sound-stinger) (-> s4-0 sound-stinger))
(set! (-> s5-0 sound-stinger) (-> s4-0 sound-stinger))
(sound-set-midi-reg 0 (-> s5-0 sound-stinger))
(set! (-> obj sound-stinger-time) (-> *display* base-clock frame-counter))
)
((!= (the int (* 4.0 (-> s4-0 sound-excitement))) (the int (* 4.0 (-> obj sound-excitement-targ))))
(let ((v1-87 (max 0 (min 3 (the int (* 4.0 (-> s4-0 sound-excitement)))))))
(when (and (< (-> obj sound-excitement-targ) (-> s4-0 sound-excitement))
(< (the-as int (-> obj sound-excitement-level)) v1-87)
(zero? (-> obj user-default sound-stinger))
)
(set! (-> obj sound-stinger-time) (-> *display* base-clock frame-counter))
(set! (-> obj sound-stinger-change-time v1-87) (-> *display* base-clock frame-counter))
(set! (-> obj user-default sound-stinger) (+ v1-87 9))
)
(cond
((< (the-as int (-> obj sound-excitement-level)) v1-87)
;; PC port note : this was a huge cond which is not really the greatest idea since only one of the clauses can run
;; it seems that it's completely safe to change multiple midi registers at once.
(when (!= (-> s5-0 sound-flava) (-> s4-0 sound-flava))
(set! (-> s5-0 sound-flava) (-> s4-0 sound-flava))
(sound-set-midi-reg 14 (the-as int (-> s5-0 sound-flava)))
)
(when (!= (-> s5-0 sound-reverb) (-> s4-0 sound-reverb))
(set! (-> s5-0 sound-reverb) (-> s4-0 sound-reverb))
(sound-set-reverb 4 (-> s5-0 sound-reverb) (-> s5-0 sound-reverb) (the-as uint 3))
)
(when (!= (-> s5-0 sound-mode) (-> s4-0 sound-mode))
(set! (-> s5-0 sound-mode) (-> s4-0 sound-mode))
(sound-set-midi-reg 3 (the-as int (-> s5-0 sound-mode)))
)
(when (!= (-> s5-0 sound-tune) (-> s4-0 sound-tune))
(set! (-> s5-0 sound-tune) (-> s4-0 sound-tune))
(sound-set-midi-reg 4 (the-as int (-> s5-0 sound-tune)))
)
(when (!= (-> s5-0 sound-stinger) (-> s4-0 sound-stinger))
(set! (-> s5-0 sound-stinger) (-> s4-0 sound-stinger))
(sound-set-midi-reg 0 (-> s5-0 sound-stinger))
(set! (-> obj sound-stinger-time) (-> *display* base-clock frame-counter))
)
(when (!= (the int (* 4.0 (-> s4-0 sound-excitement))) (the int (* 4.0 (-> obj sound-excitement-targ))))
(let ((v1-87 (max 0 (min 3 (the int (* 4.0 (-> s4-0 sound-excitement)))))))
(when (and (< (-> obj sound-excitement-targ) (-> s4-0 sound-excitement))
(< (the-as int (-> obj sound-excitement-level)) v1-87)
(zero? (-> obj user-default sound-stinger))
)
(set! (-> obj sound-stinger-time) (-> *display* base-clock frame-counter))
(set! (-> obj sound-stinger-change-time v1-87) (-> *display* base-clock frame-counter))
(set! (-> obj user-default sound-stinger) (+ v1-87 9))
)
(cond
((< (the-as int (-> obj sound-excitement-level)) v1-87)
(set! (-> obj sound-excitement-level) (the-as uint v1-87))
)
((< v1-87 (the-as int (+ (-> obj sound-excitement-level) -1)))
((< v1-87 (the-as int (+ (-> obj sound-excitement-level) -1)))
(set! (-> obj sound-excitement-level) (the-as uint (+ v1-87 1)))
)
((zero? v1-87)
((zero? v1-87)
(set! (-> obj sound-excitement-level) (the-as uint v1-87))
)
)
)
(set! (-> obj sound-excitement-change-time) (-> *display* base-clock frame-counter))
(set! (-> obj sound-excitement-targ) (-> s4-0 sound-excitement))
)
((and (!= (the int (* 4.0 (-> s5-0 sound-excitement))) (the int (* 4.0 (-> obj sound-excitement-targ))))
(>= (- (-> *display* base-clock frame-counter) (-> obj sound-excitement-change-time)) (seconds 0.8))
)
(max 0 (min 3 (the int (* 4.0 (-> obj sound-excitement-targ)))))
(sound-set-midi-reg 2 (the int (* 100.0 (-> s5-0 sound-excitement))))
(set! (-> s5-0 sound-excitement) (-> obj sound-excitement-targ))
(sound-set-midi-reg 16 (the int (* 100.0 (-> s5-0 sound-excitement))))
)
)
)
(set! (-> obj sound-excitement-change-time) (-> *display* base-clock frame-counter))
(set! (-> obj sound-excitement-targ) (-> s4-0 sound-excitement))
)
(when (and (!= (the int (* 4.0 (-> s5-0 sound-excitement))) (the int (* 4.0 (-> obj sound-excitement-targ))))
(>= (- (-> *display* base-clock frame-counter) (-> obj sound-excitement-change-time)) (seconds 0.8))
)
(max 0 (min 3 (the int (* 4.0 (-> obj sound-excitement-targ)))))
(sound-set-midi-reg 2 (the int (* 100.0 (-> s5-0 sound-excitement))))
(set! (-> s5-0 sound-excitement) (-> obj sound-excitement-targ))
(sound-set-midi-reg 16 (the int (* 100.0 (-> s5-0 sound-excitement))))
)
)
(set! (-> s5-0 mode-sound-bank) (-> s4-0 mode-sound-bank))
+7 -2
View File
@@ -2647,8 +2647,13 @@ additionally, some texture pages have a chunk system that allows more specific c
)
)
;; when not debugging, use the "fast" ones.
(when (not *debug-segment*)
;; modified for PC port: never bother with the debug-mode texture login.
;; it will never work on PC, and it causes problems with custom levels, due to the way that it allocates the link
;; array for texture-pages that don't exist, which are never then set to false, causing them to be referenced
;; after the level is unloaded. This probably works fine if you are playing one level at a time, or if the backup
;; texture page loading actually works.
(when (or (not *debug-segment*) PC_PORT)
;; when not debugging, use the "fast" logins. There's no way we can load a texture over the network anyway.
(set! adgif-shader-login adgif-shader-login-fast)
(set! adgif-shader-login-no-remap adgif-shader-login-no-remap-fast)
)
+1 -2
View File
@@ -496,8 +496,7 @@
(defun seek-ease ((arg0 float) (arg1 float) (arg2 float) (arg3 float) (arg4 float))
"Move arg0 toward arg1, and slow down before reaching the end.
When farther than arg3 away, move by at most arg2.
When closer than arg3, linearly ramp down the movement amount from arg2 to 0.
When closer than arg4, just go all the way there."
When closer than arg3, linearly ramp down the movement amount from arg2 to 0 but no lower than arg4."
(let ((f2-0 (- arg1 arg0)))
(when (>= arg3 (fabs f2-0))
(set! arg2 (* arg2 (- 1.0 (/ (- arg3 (fabs f2-0)) arg3))))
@@ -312,8 +312,8 @@
(set! (-> arg0 max x) 444.0)
(set! (-> arg0 max y) 329.0)
(#when PC_PORT
(set! (-> arg0 min x) (the float (the int (adjust-game-x 70.0))))
(set! (-> arg0 max x) (the float (the int (adjust-game-x 444.0))))
(set! (-> arg0 min x) (the float (the int (adjust-game-x (-> arg0 min x)))))
(set! (-> arg0 max x) (the float (the int (adjust-game-x (-> arg0 max x)))))
)
)
)
@@ -210,7 +210,7 @@
(deftype menu-insufficient-space-option (menu-option)
((last-move uint64 :offset-assert 48)
((last-move time-frame :offset-assert 48)
)
:method-count-assert 12
:size-assert #x38
@@ -342,7 +342,7 @@
(deftype menu-select-start-option (menu-option)
((task-index int32 :offset-assert 48)
(real-task-index int32 :offset-assert 52)
(last-move uint64 :offset-assert 56)
(last-move time-frame :offset-assert 56)
)
:method-count-assert 12
:size-assert #x40
@@ -352,7 +352,7 @@
(deftype menu-select-scene-option (menu-option)
((task-index int32 :offset-assert 48)
(last-move uint64 :offset-assert 56)
(last-move time-frame :offset-assert 56)
)
:method-count-assert 12
:size-assert #x40
@@ -382,7 +382,7 @@
(deftype menu-missions-option (paged-menu-option)
((task-line-index int32 :offset-assert 64)
(last-move uint64 :offset-assert 72)
(last-move time-frame :offset-assert 72)
)
:method-count-assert 12
:size-assert #x50
@@ -391,7 +391,7 @@
(deftype menu-highscores-option (paged-menu-option)
((last-move uint64 :offset-assert 64)
((last-move time-frame :offset-assert 64)
(sprites hud-sprite 2 :inline :offset 80)
)
:method-count-assert 12
@@ -418,7 +418,7 @@
(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)
(last-move time-frame :offset-assert 72)
(sprites hud-sprite 2 :inline :offset 80)
)
:method-count-assert 12
@@ -440,7 +440,7 @@
(deftype menu-qr-option (menu-option)
((last-move uint64 :offset-assert 48)
((last-move time-frame :offset-assert 48)
(value-to-modify function :offset 60)
)
:method-count-assert 12
@@ -477,7 +477,7 @@
(deftype menu-graphic-option (menu-option)
((last-move uint64 :offset-assert 48)
((last-move time-frame :offset-assert 48)
(value-to-modify pointer :offset 60)
)
:method-count-assert 12
@@ -520,7 +520,7 @@
(deftype menu-game-option (menu-option)
((last-move uint64 :offset-assert 48)
((last-move time-frame :offset-assert 48)
(value-to-modify pointer :offset 60)
)
:method-count-assert 12
+29 -29
View File
@@ -34,7 +34,7 @@
(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-last-move time-frame :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)
@@ -46,7 +46,7 @@
(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-last-move time-frame :offset-assert 192)
(qr-options-restart basic :offset-assert 200)
(qr-options-quit basic :offset-assert 204)
(total-num-tasks int32 :offset-assert 208)
@@ -2399,7 +2399,7 @@
)
(else
(sound-play "generic-beep")
(set! (-> obj last-move) (the-as uint (current-time)))
(set! (-> obj last-move) (current-time))
(set! (-> arg0 current) 'none)
(set-next-state arg0 s3-0 0)
)
@@ -2843,9 +2843,9 @@
)
(cond
((or (cpad-pressed? 0 up l-analog-up)
(and (cpad-hold? 0 up l-analog-up) (>= (- (current-time) (the-as int (-> obj last-move))) (seconds 0.2)))
(and (cpad-hold? 0 up l-analog-up) (>= (- (current-time) (-> obj last-move)) (seconds 0.2)))
)
(set! (-> obj last-move) (the-as uint (current-time)))
(set! (-> obj last-move) (current-time))
(when (> (-> obj task-index) 0)
(set! s4-0 #t)
(+! (-> obj task-index) -1)
@@ -2853,9 +2853,9 @@
)
)
((or (cpad-pressed? 0 down l-analog-down)
(and (cpad-hold? 0 down l-analog-down) (>= (- (current-time) (the-as int (-> obj last-move))) (seconds 0.2)))
(and (cpad-hold? 0 down l-analog-down) (>= (- (current-time) (-> obj last-move)) (seconds 0.2)))
)
(set! (-> obj last-move) (the-as uint (current-time)))
(set! (-> obj last-move) (current-time))
(let ((s3-0 -1))
(dotimes (s2-0 (-> *game-info* play-list length))
(let* ((v1-41 (-> *game-info* play-list s2-0))
@@ -2950,9 +2950,9 @@
)
(cond
((or (cpad-pressed? 0 up l-analog-up)
(and (cpad-hold? 0 up l-analog-up) (>= (- (current-time) (the-as int (-> obj last-move))) (seconds 0.2)))
(and (cpad-hold? 0 up l-analog-up) (>= (- (current-time) (-> obj last-move)) (seconds 0.2)))
)
(set! (-> obj last-move) (the-as uint (current-time)))
(set! (-> obj last-move) (current-time))
(when (> (-> obj task-index) 0)
(set! gp-0 #t)
(+! (-> obj task-index) -1)
@@ -2960,9 +2960,9 @@
)
)
((or (cpad-pressed? 0 down l-analog-down)
(and (cpad-hold? 0 down l-analog-down) (>= (- (current-time) (the-as int (-> obj last-move))) (seconds 0.2)))
(and (cpad-hold? 0 down l-analog-down) (>= (- (current-time) (-> obj last-move)) (seconds 0.2)))
)
(set! (-> obj last-move) (the-as uint (current-time)))
(set! (-> obj last-move) (current-time))
(when (< (-> obj task-index) (+ (length s4-0) -1))
(set! gp-0 #t)
(+! (-> obj task-index) 1)
@@ -3015,9 +3015,9 @@
(let ((s5-0 #f))
(cond
((or (cpad-pressed? 0 up l-analog-up)
(and (cpad-hold? 0 up l-analog-up) (>= (- (current-time) (the-as int (-> obj last-move))) (seconds 0.2)))
(and (cpad-hold? 0 up l-analog-up) (>= (- (current-time) (-> obj last-move)) (seconds 0.2)))
)
(set! (-> obj last-move) (the-as uint (current-time)))
(set! (-> obj last-move) (current-time))
(when (> (-> obj task-line-index) 0)
(set! s5-0 #t)
(+! (-> obj task-line-index) -1)
@@ -3025,9 +3025,9 @@
)
)
((or (cpad-pressed? 0 down l-analog-down)
(and (cpad-hold? 0 down l-analog-down) (>= (- (current-time) (the-as int (-> obj last-move))) (seconds 0.2)))
(and (cpad-hold? 0 down l-analog-down) (>= (- (current-time) (-> obj last-move)) (seconds 0.2)))
)
(set! (-> obj last-move) (the-as uint (current-time)))
(set! (-> obj last-move) (current-time))
(when (< (-> obj task-line-index) (+ (-> *progress-state* total-num-tasks) -1))
(+! (-> obj task-line-index) 1)
(set! (-> arg0 sliding-height) 1.0)
@@ -3074,11 +3074,11 @@
(cond
((or (cpad-pressed? 0 right l-analog-right)
(and (cpad-hold? 0 right l-analog-right)
(>= (- (current-time) (the-as int (-> obj last-move))) (seconds 0.2))
(>= (- (current-time) (-> obj last-move)) (seconds 0.2))
)
)
(when (< 1 (get-num-highscores))
(set! (-> obj last-move) (the-as uint (current-time)))
(set! (-> obj last-move) (current-time))
(set! s5-0 #t)
(set! (-> obj prev-page-index) (-> obj page-index))
(set! (-> obj page-index) (get-next-highscore (-> obj page-index)))
@@ -3088,10 +3088,10 @@
)
)
((or (cpad-pressed? 0 left l-analog-left)
(and (cpad-hold? 0 left l-analog-left) (>= (- (current-time) (the-as int (-> obj last-move))) (seconds 0.2)))
(and (cpad-hold? 0 left l-analog-left) (>= (- (current-time) (-> obj last-move)) (seconds 0.2)))
)
(when (< 1 (get-num-highscores))
(set! (-> obj last-move) (the-as uint (current-time)))
(set! (-> obj last-move) (current-time))
(set! (-> obj prev-page-index) (-> obj page-index))
(set! (-> obj page-index) (get-prev-highscore (-> obj page-index)))
(set! s5-0 #t)
@@ -3167,9 +3167,9 @@
(else
(cond
((or (cpad-pressed? 0 down l-analog-down)
(and (cpad-hold? 0 down l-analog-down) (>= (- (current-time) (the-as int (-> obj last-move))) (seconds 0.2)))
(and (cpad-hold? 0 down l-analog-down) (>= (- (current-time) (-> obj last-move)) (seconds 0.2)))
)
(set! (-> obj last-move) (the-as uint (current-time)))
(set! (-> obj last-move) (current-time))
(when (< (-> obj item-index) s2-0)
(set! (-> obj prev-item-index) (-> obj item-index))
(set! s5-2 #t)
@@ -3179,9 +3179,9 @@
)
)
((or (cpad-pressed? 0 up l-analog-up)
(and (cpad-hold? 0 up l-analog-up) (>= (- (current-time) (the-as int (-> obj last-move))) (seconds 0.2)))
(and (cpad-hold? 0 up l-analog-up) (>= (- (current-time) (-> obj last-move)) (seconds 0.2)))
)
(set! (-> obj last-move) (the-as uint (current-time)))
(set! (-> obj last-move) (current-time))
(when (< s3-0 (-> obj item-index))
(set! (-> obj prev-item-index) (-> obj item-index))
(+! (-> obj item-index) -1)
@@ -3252,7 +3252,7 @@
(>= (- (current-time) (the-as int (-> *progress-state* game-options-last-move))) (seconds 0.5))
)
)
(set! (-> *progress-state* game-options-last-move) (the-as uint (current-time)))
(set! (-> *progress-state* game-options-last-move) (current-time))
(cond
((< (-> *progress-state* game-options-item-selected) 3)
(+! (-> *progress-state* game-options-item-selected) 1)
@@ -3268,7 +3268,7 @@
(>= (- (current-time) (the-as int (-> *progress-state* game-options-last-move))) (seconds 0.5))
)
)
(set! (-> *progress-state* game-options-last-move) (the-as uint (current-time)))
(set! (-> *progress-state* game-options-last-move) (current-time))
(if (> (-> *progress-state* game-options-item-selected) 0)
(+! (-> *progress-state* game-options-item-selected) -1)
(set! (-> *progress-state* game-options-item-selected) 3)
@@ -3277,7 +3277,7 @@
((cpad-pressed? 0 confirm)
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
(set! (-> *progress-state* game-options-last-move) (the-as uint (current-time)))
(set! (-> *progress-state* game-options-last-move) (current-time))
(set! (-> *progress-state* game-options-item-picked) (the-as basic #t))
(sound-play "generic-beep")
)
@@ -3685,7 +3685,7 @@
(>= (- (current-time) (the-as int (-> *progress-state* qr-options-last-move))) (seconds 0.5))
)
)
(set! (-> *progress-state* qr-options-last-move) (the-as uint (current-time)))
(set! (-> *progress-state* qr-options-last-move) (current-time))
(cond
((< (-> *progress-state* qr-options-item-selected) 1)
(+! (-> *progress-state* qr-options-item-selected) 1)
@@ -3706,7 +3706,7 @@
(>= (- (current-time) (the-as int (-> *progress-state* qr-options-last-move))) (seconds 0.5))
)
)
(set! (-> *progress-state* qr-options-last-move) (the-as uint (current-time)))
(set! (-> *progress-state* qr-options-last-move) (current-time))
(cond
((> (-> *progress-state* qr-options-item-selected) 0)
(+! (-> *progress-state* qr-options-item-selected) -1)
@@ -3723,7 +3723,7 @@
((cpad-pressed? 0 confirm)
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
(set! (-> *progress-state* qr-options-last-move) (the-as uint (current-time)))
(set! (-> *progress-state* qr-options-last-move) (current-time))
(set! (-> *progress-state* qr-options-item-picked) (the-as basic #t))
(set! (-> arg0 selected-option) #t)
(sound-play "generic-beep")
+38
View File
@@ -596,6 +596,44 @@
(progress-cheats #x120f)
(progress-aspect-ratio-custom-width #x1210)
(progress-aspect-ratio-custom-height #x1211)
(progress-music-player-locked #x1212)
(progress-music-player-now-playing #x1213)
(progress-music-player-no-track #x1214)
(progress-music-player-flava-default #x1215)
(progress-music-player-flava-gun #x1216)
(progress-music-player-flava-board #x1217)
(progress-music-player-flava-mech #x1218)
(progress-music-player-flava-darkjak #x1219)
(progress-music-player-flava-pilot #x121a)
(progress-music-player-danger #x121b)
(progress-music-player-danger-0 #x121c)
(progress-music-player-danger-1 #x121d)
(progress-music-player-danger-2 #x121e)
(progress-music-player-danger-3 #x121f)
(progress-music-player-city #x1220)
(progress-music-player-city-battle #x1221)
(progress-music-player-battle #x1222)
(progress-music-player-danger2 #x1223)
(progress-music-player-danger3 #x1224)
(progress-music-player-danger4 #x1225)
(progress-music-player-danger6 #x1226)
(progress-music-player-danger7 #x1227)
(progress-music-player-danger9 #x1228)
(progress-music-player-danger10 #x1229)
(progress-music-player-danger11 #x122a)
(progress-music-player-atoll #x122b)
(progress-music-player-atoll-battle #x122c)
(progress-music-player-strip #x122d)
(progress-music-player-forest #x122e)
(progress-music-player-forest-battle #x122f)
(progress-music-player-sewer #x1230)
(progress-music-player-sewer-battle #x1231)
(progress-music-player-mountain #x1232)
(progress-music-player-mountain-battle #x1233)
(progress-music-player-palcab #x1234)
(progress-music-player-palcab-battle #x1235)
(progress-music-player-race #x1236)
(progress-music-player-ruins #x1237)
)
;; ---text-id
+11 -4
View File
@@ -75,10 +75,13 @@
;; The Jak 2 version of the pc-settings object.
(deftype pc-settings-jak2 (pc-settings)
(
(cheats pc-cheats)
(cheats-revealed pc-cheats)
(cheats-purchased pc-cheats)
(;; cheats
(cheats pc-cheats)
(cheats-revealed pc-cheats)
(cheats-purchased pc-cheats)
;; music
(music-unlocked bit-array)
(flava-unlocked symbol 6)
(fast-airlock? symbol)
(fast-elevator? symbol)
@@ -139,6 +142,10 @@
(set! (-> obj cheats) (pc-cheats))
(set! (-> obj cheats-revealed) (pc-cheats))
(set! (-> obj cheats-purchased) (pc-cheats))
(clear-all! (-> obj music-unlocked))
(dotimes (i 6)
(set! (-> obj flava-unlocked i) #f))
0)
+141
View File
@@ -11,11 +11,83 @@
(define-extern get-active-mission-description (function discord-info string))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; music player stuff
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defenum music-player-flava
:bitfield #t :type uint8
(default)
(gun)
(board)
(mech)
(darkjak)
(pilot)
)
(deftype music-player-track-info (basic)
((text text-id)
(name symbol)
(mode int8)
(icon int16)
(flava music-player-flava)
(avail-after game-task-node)
)
)
(defmacro static-music-track-info (name &key text &key avail-after &key (mode 0) &key icon &key (flava ()))
`(new 'static 'music-player-track-info :text (text-id ,text) :name ,name :icon ,icon :avail-after (game-task-node ,avail-after) :mode ,mode :flava (music-player-flava ,@flava))
)
(define *music-player-tracks* (new 'static 'boxed-array :type music-player-track-info
(static-music-track-info 'city1 :mode 0 :icon 1 :text progress-music-player-city :avail-after fortress-escape-resolution :flava (gun board pilot))
(static-music-track-info 'city1 :mode 1 :icon 1 :text progress-music-player-city-battle :avail-after city-help-kid-resolution)
(static-music-track-info 'ruins :mode 0 :icon 4 :text progress-music-player-ruins :avail-after ruins-tower-resolution :flava (gun board mech darkjak))
(static-music-track-info 'atoll :mode 0 :icon 6 :text progress-music-player-atoll :avail-after atoll-water-resolution :flava (gun darkjak board))
(static-music-track-info 'sewer :mode 0 :icon 3 :text progress-music-player-sewer :avail-after fortress-dump-resolution :flava (gun board mech darkjak))
(static-music-track-info 'sewer :mode 1 :icon 3 :text progress-music-player-sewer-battle :avail-after fortress-dump-resolution)
(static-music-track-info 'danger11 :mode 0 :icon 3 :text progress-music-player-danger11 :avail-after fortress-dump-resolution)
(static-music-track-info 'atoll :mode 1 :icon 6 :text progress-music-player-atoll-battle :avail-after atoll-sig-resolution)
(static-music-track-info 'strip :mode 0 :icon 5 :text progress-music-player-strip :avail-after strip-rescue-resolution :flava (gun board mech darkjak))
(static-music-track-info 'mountain :mode 0 :icon 8 :text progress-music-player-mountain :avail-after mountain-collection-resolution :flava (gun board mech darkjak))
(static-music-track-info 'mountain :mode 1 :icon 8 :text progress-music-player-mountain-battle :avail-after mountain-collection-resolution)
(static-music-track-info 'palcab :mode 0 :icon 11 :text progress-music-player-palcab :avail-after palace-cable-resolution :flava (gun board darkjak))
(static-music-track-info 'forest :mode 0 :icon 9 :text progress-music-player-forest :avail-after forest-scouts-resolution :flava (gun board mech darkjak))
(static-music-track-info 'forest :mode 1 :icon 9 :text progress-music-player-forest-battle :avail-after forest-scouts-resolution)
(static-music-track-info 'danger9 :mode 0 :icon 1 :text progress-music-player-danger9 :avail-after city-intercept-tanker-resolution)
(static-music-track-info 'race :mode 0 :icon 2 :text progress-music-player-race :avail-after stadium-race-class3-resolution)
(static-music-track-info 'danger3 :mode 0 :icon 1 :text progress-music-player-danger3 :avail-after city-play-onin-game-resolution)
(static-music-track-info 'danger1 :mode 0 :icon 8 :text progress-music-player-battle :avail-after canyon-insert-items-resolution)
(static-music-track-info 'danger2 :mode 0 :icon 12 :text progress-music-player-danger2 :avail-after tomb-boss-door)
(static-music-track-info 'danger7 :mode 0 :icon 15 :text progress-music-player-danger7 :avail-after tomb-boss-resolution)
(static-music-track-info 'danger10 :mode 0 :icon 10 :text progress-music-player-danger10 :avail-after drill-mech-resolution)
(static-music-track-info 'palcab :mode 1 :icon 14 :text progress-music-player-palcab-battle :avail-after castle-boss-resolution)
(static-music-track-info 'danger6 :mode 0 :icon 14 :text progress-music-player-danger6 :avail-after castle-boss-resolution)
(static-music-track-info 'danger4 :mode 0 :icon 17 :text progress-music-player-danger4 :avail-after nest-boss-resolution)
))
;; automatically add the default flava to all tracks that had flavas marked
(dotimes (i (-> *music-player-tracks* length))
(if (nonzero? (-> *music-player-tracks* i flava))
(logior! (-> *music-player-tracks* i flava) (music-player-flava default)))
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; methods
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defmethod initialize pc-settings-jak2 ((obj pc-settings-jak2))
"initial initialize method to be run after allocating"
(set! (-> obj music-unlocked) (new 'global 'bit-array (-> *music-player-tracks* length)))
((method-of-type pc-settings initialize) obj)
obj)
(defmethod set-game-setting! pc-settings-jak2 ((obj pc-settings-jak2) (setting symbol) (value symbol))
(case setting
(('video-mode)
@@ -117,6 +189,10 @@
(-> *pc-cheat-state* airlock-close-speed)
1.0))
(defmacro flava-unlocked? (flava)
"return #t if the specified flava is unlocked"
`(-> *pc-settings* flava-unlocked ,flava))
(defmethod update-cheats pc-settings-jak2 ((obj pc-settings-jak2))
"run cheats."
@@ -173,11 +249,56 @@
0)
(defmethod update-music-log pc-settings-jak2 ((obj pc-settings-jak2))
"update the music log"
(dotimes (i (-> *music-player-tracks* length))
(when (or (logtest? (-> *game-info* secrets) (game-secrets hero-mode))
(task-node-closed? (-> *music-player-tracks* i avail-after)))
(set-bit (-> obj music-unlocked) i)
)
)
(true! (-> obj flava-unlocked 0)) ;; default always unlocked
(if (task-node-closed? (game-task-node city-red-gun-training-resolution)) (true! (-> obj flava-unlocked 1))) ;; gun
(if (task-node-closed? (game-task-node forest-scouts-resolution)) (true! (-> obj flava-unlocked 2))) ;; board
(if (task-node-closed? (game-task-node ruins-mech-resolution)) (true! (-> obj flava-unlocked 3))) ;; mech
(if (task-node-closed? (game-task-node city-oracle-introduction)) (true! (-> obj flava-unlocked 4))) ;; darkjak
(if (task-node-closed? (game-task-node city-vehicle-training-resolution)) (true! (-> obj flava-unlocked 5))) ;; pilot
0)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; file I/O
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun bit-array<-int64 ((arr bit-array) (start-offset int) (val int))
"starting from start-offset at arr, fill the next 64 bits of the array from an int64"
(let ((i start-offset)
(end-offset (min (+ start-offset 64) (-> arr length))))
(while (< i end-offset)
(if (nonzero? (logand val (ash 1 (- i start-offset))))
(set-bit arr i))
(1+! i)
)
val)
)
(defun int64<-bit-array ((arr bit-array) (start-offset int))
"starting from start-offset at arr, pack the next 64 bits into a single value and return it"
(let ((val 0)
(i start-offset)
(end-offset (min (+ start-offset 64) (-> arr length))))
(while (< i end-offset)
(if (get-bit arr i)
(logior! val (ash 1 (- i start-offset))))
(1+! i)
)
val)
)
(defmethod handle-input-settings pc-settings-jak2 ((obj pc-settings-jak2) (file file-stream))
"handle the text parsing input for the 'settings' group"
@@ -191,6 +312,16 @@
(("cheats") (set! (-> obj cheats) (the-as pc-cheats (file-stream-read-int file))))
(("cheats-revealed") (set! (-> obj cheats-revealed) (the-as pc-cheats (file-stream-read-int file))))
(("cheats-purchased") (set! (-> obj cheats-purchased) (the-as pc-cheats (file-stream-read-int file))))
(("music-unlocked")
(dotimes (i (/ (align64 (-> obj music-unlocked length)) 64))
(bit-array<-int64 (-> obj music-unlocked) (* i 64) (file-stream-read-int file))
)
)
(("flava-unlocked")
(dotimes (i 6)
(set! (-> obj flava-unlocked i) (file-stream-read-symbol file))
)
)
)
0)
@@ -206,6 +337,16 @@
(format file " (cheats #x~x)~%" (-> obj cheats))
(format file " (cheats-revealed #x~x)~%" (-> obj cheats-revealed))
(format file " (cheats-purchased #x~x)~%" (-> obj cheats-purchased))
(format file " (music-unlocked")
(dotimes (i (/ (align64 (-> obj music-unlocked length)) 64))
(format file " #x~x" (int64<-bit-array (-> obj music-unlocked) (* i 64)))
)
(format file ")~%")
(format file " (flava-unlocked")
(dotimes (i 6)
(format file " ~A" (-> obj flava-unlocked i))
)
(format file ")~%")
0)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -1950,6 +1950,17 @@
)
(defun draw-highlight-music-player ((x int) (y int) (w int) (h int) (alpha float))
"draw the highlight for a number in the music player screen"
(with-dma-buffer-add-bucket ((buf (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id progress)
)
(draw-sprite2d-xy buf x y w h (new 'static 'rgba :r #x40 :g #x80 :b #x80 :a (the int (* 64.0 alpha))))
)
)
(defun draw-up-down-aspect ((font font-context) (y-up float) (y-down float))
(protect ((-> font origin x) (-> font origin y) (-> font scale))
@@ -2075,3 +2086,397 @@
(defun begin-scissor-music-player ((box hud-box))
(cond
((= (get-aspect-ratio) 'aspect16x9)
(set! (-> box min x) 19.0)
(set! (-> box min y) 129.0)
(set! (-> box max x) 274.0)
(set! (-> box max y) 304.0)
)
(else
(set! (-> box min x) 70.0)
(set! (-> box min y) 129.0)
(set! (-> box max x) 268.0)
(set! (-> box max y) 270.0)
)
)
(#when PC_PORT
(set! (-> box min x) (the float (the int (adjust-game-x (-> box min x)))))
(set! (-> box max x) (the float (the int (adjust-game-x (-> box max x)))))
)
(with-dma-buffer-add-bucket ((buf (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id progress)
)
(setup-scissor box buf)
)
0
)
(defun end-scissor-music-player ((box hud-box))
(with-dma-buffer-add-bucket ((buf (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id progress)
)
(restore-scissor box buf)
)
0
)
(defun draw-decoration-music-player ((arg0 menu-option) (arg1 font-context) (arg2 float) (arg3 text-id) (arg5 float) (box hud-box))
(let ((list-x (the int (-> box min x)))
(list-y (the int (-> box min y)))
(title-x 70)
(title-y 80)
(list-w (the int (- (-> box max x) (-> box min x))))
(list-h (the int (- (-> box max y) (-> box min y))))
(full-w 375)
(full-h 199)
)
(case (get-aspect-ratio)
(('aspect16x9)
(set! title-y 69)
(set! full-w 355)
(set! full-h 233)
(*! arg5 1.25)
)
)
(when (not (-> *pc-settings* use-vis?))
(set! title-x (the int (adjust-game-x (the float title-x))))
(set! full-w (the int (* (-> *pc-settings* aspect-ratio-reciprocal) full-w)))
)
(set-scale! arg1 arg5)
(set-origin! arg1 title-x title-y)
(set! (-> arg1 width) 375.0)
(set! (-> arg1 height) 48.0)
(when (not (-> *pc-settings* use-vis?))
(*! (-> arg1 width) (-> *pc-settings* aspect-ratio-reciprocal))
)
(set-color! arg1 (font-color progress))
(set-flags! arg1 (font-flags kerning middle left large))
(print-game-text (lookup-text! *common-text* arg3 #f) arg1 #f 44 (bucket-id progress))
(set-vector! (-> arg0 box 0 color) 64 128 128 (the int (* 128.0 arg2)))
(draw-savegame-box arg0 (the float list-x) (the float (+ list-x full-w)) (the float list-y) (the float list-y))
(draw-savegame-box arg0 (the float list-x) (the float (+ list-x list-w)) (the float (+ list-y list-h)) (the float (+ list-y list-h)))
(draw-savegame-box arg0 (the float (+ list-x list-w)) (the float (+ list-x list-w)) (the float list-y) (the float (+ list-y full-h)))
(with-dma-buffer-add-bucket ((s0-1 (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id particles)
)
(draw-sprite2d-xy
s0-1
list-x
list-y
list-w
list-h
(new 'static 'rgba :r #x40 :g #x40 :b #x40 :a (the int (* 64.0 arg2)))
)
)
)
)
(defun draw-up-down-music-player ((font font-context) (box hud-box))
(protect ((-> font origin x) (-> font origin y) (-> font scale) (-> font width) (-> font height))
(let ((start-y (-> font origin y)))
(set-scale! font 0.5)
(set! (-> font width) (- (-> box max x) (-> box min x)))
(set! (-> font height) 16.0)
(set-flags! font (font-flags kerning large middle))
(set! (-> font origin x) (-> box min x))
(set! (-> font origin y) (- (-> box min y) (-> font height)))
(print-game-text (string-format "~33L~C" 160) font #f 44 (bucket-id progress))
(set! (-> font origin y) (+ 3.0 (-> box max y)))
(print-game-text (string-format "~33L~C" 162) font #f 44 (bucket-id progress))
)
)
0)
(defmacro set-hud-sprite-attributes! (sprite
&key (r 128)
&key (g 128)
&key (b 128)
&key (a 1.0)
&key x
&key y
&key (z #xffffff)
&key (w 1)
&key tex
&key (scale-x 1.0)
&key (scale-y 1.0)
)
(with-gensyms (col)
`(begin
(let ((,col (-> ,sprite color2)))
(set! (-> ,col 0) ,r)
(set! (-> ,col 1) ,g)
(set! (-> ,col 2) ,b)
(set! (-> ,col 3) (the int (* 128.0 ,a)))
)
(set! (-> ,sprite pos z) ,z)
(set! (-> ,sprite pos w) ,w)
(set! (-> ,sprite tex) ,tex)
(set! (-> ,sprite scale-x) ,scale-x)
(set! (-> ,sprite scale-y) ,scale-y)
(set-hud-piece-position! ,sprite ,x ,y)
)))
(defmethod draw-option menu-music-player-option ((obj menu-music-player-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(let* ((alpha (* 2.0 (- 0.5 (-> arg0 menu-transition))))
(y-pad-top 11)
(text-height 23)
(old-y 0.0)
(list-text-y (+ (- (-> obj current-scroll)) y-pad-top))
(max-lines 8)
(tab-music 6.0)
(tab-flava 12.0)
(box (new 'stack 'hud-box))
(flava-text-list (new 'static 'boxed-array :type text-id
(text-id progress-music-player-flava-default)
(text-id progress-music-player-flava-gun)
(text-id progress-music-player-flava-board)
(text-id progress-music-player-flava-mech)
(text-id progress-music-player-flava-darkjak)
(text-id progress-music-player-flava-pilot)
)))
(max! alpha 0.0)
(set! (-> arg1 alpha) alpha)
(when (not (-> *pc-settings* use-vis?))
(*! tab-music (-> *pc-settings* aspect-ratio-reciprocal))
(*! tab-flava (-> *pc-settings* aspect-ratio-reciprocal))
;(set! danger-w (the int (* (-> *pc-settings* aspect-ratio-reciprocal) danger-w)))
)
(set-flags! arg1 (font-flags kerning large))
(set-scale! arg1 0.6)
(set-color! arg1 (font-color progress))
(begin-scissor-music-player box)
(+! list-text-y (-> box min y))
(set-scale! arg1 0.45)
(set! (-> arg1 origin x) (+ (-> box min x) tab-music))
;(format *stdcon* "m: ~D f: ~D scroll: ~f~%" (-> obj music-index) (-> obj flava-index) (-> obj current-scroll))
(dotimes (i (-> *music-player-tracks* length))
(set! (-> arg1 origin y) (set! old-y list-text-y))
(set! (-> arg1 width) (- (-> box max x) (-> box min x)))
(cond
((= i (-> obj music-index))
(+! list-text-y text-height)
(cond
((-> *progress-state-pc* music-player-selected)
;; restore these later
(let* ((flava-bits (the-as int (-> *music-player-tracks* i flava)))
(flava-count (count-bits flava-bits))
(flava-text-height (the int (* (/ 0.42 0.45) text-height))))
;; draw highlight first
(draw-highlight-music-player (the int (-> box min x)) (the int (+ -6.0 (-> arg1 origin y)))
(the int (- (-> box max x) (-> box min x))) (+ text-height (* flava-count flava-text-height))
alpha)
;; draw text for each flava!
(protect ((-> arg1 origin x) (-> arg1 origin y) (-> arg1 scale))
(set-scale! arg1 0.42)
(+! (-> arg1 origin x) tab-flava)
(set! (-> arg1 origin y) list-text-y)
(dotimes (f flava-count)
(if (= f (-> obj flava-index))
(set-color! arg1 (progress-selected 0))
(set-color! arg1 (font-color progress)))
(let ((flava (bit-on-offset flava-bits f)))
(if (flava-unlocked? flava)
(print-game-text (lookup-text! *common-text* (-> flava-text-list (bit-on-offset flava-bits f)) #f) arg1 #f 44 (bucket-id progress))
(print-game-text (lookup-text! *common-text* (text-id progress-music-player-locked) #f) arg1 #f 44 (bucket-id progress)))
)
(+! (-> arg1 origin y) flava-text-height)
)
)
;; advance list height
(+! list-text-y (* flava-count flava-text-height))
;; set color to selected
(set-color! arg1 (font-color progress-force-selected))
))
(else
(set-color! arg1 (progress-selected 0))
(draw-highlight-music-player (the int (-> box min x)) (the int (+ -6.0 (-> arg1 origin y)))
(the int (- (-> box max x) (-> box min x))) text-height
alpha)
))
(when (< (-> arg1 origin y) (+ (-> box min y) y-pad-top))
(set! (-> obj current-scroll) (seek-ease (-> obj current-scroll) (+ (-> obj current-scroll) (- (-> arg1 origin y) (+ (-> box min y) y-pad-top)))
(if (-> *progress-state-pc* music-player-selected) 999999.0 (* 0.1 text-height (-> arg0 clock time-adjust-ratio)))
(* 0.3 text-height)
(* 0.01 text-height (-> arg0 clock time-adjust-ratio)))))
(when (> list-text-y (-> box max y))
(set! (-> obj current-scroll) (seek-ease (-> obj current-scroll) (+ (-> obj current-scroll) (- list-text-y (-> box max y)))
(if (-> *progress-state-pc* music-player-selected) 999999.0 (* 0.1 text-height (-> arg0 clock time-adjust-ratio)))
(* 0.3 text-height)
(* 0.01 text-height (-> arg0 clock time-adjust-ratio)))))
)
(else
(+! list-text-y text-height)
(set-color! arg1 (font-color progress))
)
)
(if (get-bit (-> *pc-settings* music-unlocked) i)
(print-game-text (lookup-text! *common-text* (-> *music-player-tracks* i text) #f) arg1 #f 44 (bucket-id progress))
(print-game-text (lookup-text! *common-text* (text-id progress-music-player-locked) #f) arg1 #f 44 (bucket-id progress)))
)
(if (< (- list-text-y (-> box max y)) 0.0)
(+! (-> obj current-scroll) (- list-text-y (-> box max y))))
(unless (-> *progress-state-pc* music-player-selected)
(max! (-> obj max-scroll) (-> obj current-scroll)))
(end-scissor-music-player box)
;; draw right panel text
(let ((icon-x 0)
(icon-y 174)
(icon-w (if (= (get-aspect-ratio) 'aspect4x3)
64
48))
(icon-h 64)
(icon-scale 0.7)
(icon-id 0)
(danger-pad 8.0)
(danger-w 73)
(arrow-w 14)
(danger-text-list (new 'static 'boxed-array :type text-id
(text-id progress-music-player-danger-0)
(text-id progress-music-player-danger-1)
(text-id progress-music-player-danger-2)
(text-id progress-music-player-danger-3)
)))
(set-flags! arg1 (font-flags kerning middle large))
(case (get-aspect-ratio)
(('aspect16x9)
(set-origin! arg1 281 160)
(set-width! arg1 144)
(set! icon-y 190)
)
(else
(set-origin! arg1 278 144)
(set-width! arg1 158)
)
)
(when (not (-> *pc-settings* use-vis?))
(set! (-> arg1 origin x) (the float (adjust-game-x (-> arg1 origin x))))
(*! danger-pad (-> *pc-settings* aspect-ratio-reciprocal))
(*! (-> arg1 width) (-> *pc-settings* aspect-ratio-reciprocal))
(set! icon-w (the int (* (-> *pc-settings* aspect-ratio-reciprocal) icon-w)))
(set! danger-w (the int (* (-> *pc-settings* aspect-ratio-reciprocal) danger-w)))
(set! arrow-w (the int (* (-> *pc-settings* aspect-ratio-reciprocal) arrow-w)))
)
(set-height! arg1 40)
(set-scale! arg1 0.42)
(set-color! arg1 (font-color progress))
(when (-> *progress-state-pc* music-player-track)
(print-game-text (lookup-text! *common-text* (text-id progress-music-player-now-playing) #f) arg1 #f 44 (bucket-id progress)))
(set-flags! arg1 (font-flags kerning middle left large))
(+! (-> arg1 origin y) 110.0)
(set-scale! arg1 0.48)
(cond
((-> *progress-state-pc* music-player-track)
(set! icon-id (-> *progress-state-pc* music-player-track icon)) ;; use this icon ID
(print-game-text (lookup-text! *common-text* (-> *progress-state-pc* music-player-track text) #f) arg1 #f 44 (bucket-id progress))
;; print flava if needed too
(when (nonzero? (-> *progress-state-pc* music-player-track flava))
(+! (-> arg1 origin y) 36.0)
(set-scale! arg1 0.42)
(print-game-text (lookup-text! *common-text* (-> flava-text-list (-> *progress-state-pc* music-player-flava)) #f) arg1 #f 44 (bucket-id progress))
)
)
(else
(print-game-text (lookup-text! *common-text* (text-id progress-music-player-no-track) #f) arg1 #f 44 (bucket-id progress))
)
)
;; draw right panel icon
(set! icon-x (the int (+ (-> arg1 origin x) (/ (-> arg1 width) 2))))
(set! icon-w (the int (* icon-scale icon-w)))
(set! icon-h (the int (* icon-scale icon-h)))
;; center icon. the icon is 96x96 but each sprite is 64x64, hence 1.5
(-! icon-x (the int (/ (* 1.5 icon-w) 2)))
(set-hud-sprite-attributes! (-> obj sprites 0) :tex (lookup-texture-by-id (get-level-icon-id-01 icon-id)) :a alpha :scale-x icon-scale :scale-y icon-scale :x icon-x :y icon-y)
(set-hud-sprite-attributes! (-> obj sprites 1) :tex (lookup-texture-by-id (get-level-icon-id-02 icon-id)) :a alpha :scale-x icon-scale :scale-y icon-scale :x (+ icon-x icon-w) :y icon-y)
(set-hud-sprite-attributes! (-> obj sprites 2) :tex (lookup-texture-by-id (get-level-icon-id-03 icon-id)) :a alpha :scale-x icon-scale :scale-y icon-scale :x icon-x :y (+ icon-y icon-h))
(set-hud-sprite-attributes! (-> obj sprites 3) :tex (lookup-texture-by-id (get-level-icon-id-04 icon-id)) :a alpha :scale-x icon-scale :scale-y icon-scale :x (+ icon-x icon-w) :y (+ icon-y icon-h))
;; danger scroller
(set-scale! arg1 0.42)
(set! (-> arg1 origin y) (+ 26.0 (-> box max y)))
(set! (-> arg1 origin x) (+ danger-pad (-> box min x)))
(set-width! arg1 danger-w)
(set-flags! arg1 (font-flags kerning large))
(print-game-text (lookup-text! *common-text* (text-id progress-music-player-danger) #f) arg1 #f 44 (bucket-id progress))
(set-color! arg1 (progress-selected (seconds 0.5)))
(+! (-> arg1 origin x) (-> arg1 width))
(set-flags! arg1 (font-flags kerning large right))
(set-width! arg1 arrow-w)
(+! (-> arg1 origin x) (-> arg1 width))
(print-game-text (string-format "~33L~C" 163) arg1 #f 44 (bucket-id progress))
(set-flags! arg1 (font-flags kerning large middle))
(set-width! arg1 (the int (- (-> box max x) (-> box min x) danger-w (* arrow-w 2) (* danger-pad 2))))
(print-game-text (lookup-text! *common-text* (-> danger-text-list (-> obj excitement)) #f) arg1 #f 44 (bucket-id progress))
(+! (-> arg1 origin x) (-> arg1 width))
(set-flags! arg1 (font-flags kerning large))
(set-width! arg1 arrow-w)
(print-game-text (string-format "~33L~C" 161) arg1 #f 44 (bucket-id progress))
(with-dma-buffer-add-bucket ((buf (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id progress)
)
(draw (-> obj sprites 0) buf (-> *level* default-level))
(draw (-> obj sprites 1) buf (-> *level* default-level))
(draw (-> obj sprites 2) buf (-> *level* default-level))
(draw (-> obj sprites 3) buf (-> *level* default-level))
)
)
(when-not-drawn-decoration
(draw-up-down-music-player arg1 box)
(draw-decoration-music-player obj arg1 alpha (-> obj name) 0.7 box))
)
0
(none))
(#when PC_PORT
(defun-debug draw-mouse ()
"draw some extra mouse info"
(let ((mx (+ (the int (-> *mouse* posx)) 256))
(my (+ (the int (-> *mouse* posy)) 208)))
(format *stdcon* "mouse pos: (~D,~D)~%" mx my)
(with-dma-buffer-add-bucket ((buf (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id debug-no-zbuf2)
)
(draw-sprite2d-xy buf 0 my 512 1 (static-rgba #xff #xff #xff #x40))
(draw-sprite2d-xy buf mx 0 1 416 (static-rgba #xff #xff #xff #x40))
)
)
)
(defmacro spawn-draw-mouse-proc ()
`(process-spawn-function process :name "draw-mouse" :to *display-pool*
(lambda :behavior process ()
(loop
(suspend)
(draw-mouse))
)))
)
@@ -36,6 +36,24 @@
)
(deftype menu-music-player-option (menu-option)
((last-move time-frame)
;; player params
(music-index int16)
(flava-index int8)
(excitement int8)
;; scroll
(current-scroll float)
(max-scroll float)
;; sprites 0-3 used to show level icon
(sprites hud-sprite 4 :inline)
)
)
(deftype progress-cheat-info (basic)
((name text-id)
(unlock text-id)
+232 -2
View File
@@ -17,11 +17,15 @@
(aspect-ratio-choice-index int8)
(aspect-ratio-ratio-index int8)
(music-player-track music-player-track-info)
(music-player-flava int8)
(music-player-selected symbol)
)
)
(define *progress-state-pc* (new 'static 'progress-global-state-pc))
(define *progress-state-pc* (new 'static 'progress-global-state-pc :music-player-track #f))
(defmacro when-not-drawn-decoration (&rest body)
@@ -133,6 +137,7 @@
(set-progress-aspect-ratio-pc-index)
(set-progress-display-mode-index)
(set! (-> (the menu-on-off-option (-> *graphic-options-pc* options 2)) value-to-modify) (&-> *pc-settings* vsync?))
(set! (-> *progress-state-pc* music-player-track) #f)
)
@@ -334,6 +339,11 @@
(set! (-> *progress-state-pc* aspect-ratio-ratio-index) 0)
(set! (-> obj current-options) *aspect-ratio-custom-options*)
)
(('music-player)
(set! (-> *progress-state-pc* music-player-selected) #f)
(set! (-> (the-as menu-music-player-option (-> *music-player-options* options 0)) excitement) 0)
(set! (-> obj current-options) *music-player-options*)
)
)
(when (= (-> obj current-options) #f)
(format #t "Didn't find new menu settings!!~%")
@@ -493,4 +503,224 @@
)
))
0
)
)
(defbehavior play-music-player progress ((info music-player-track-info) (flava int))
"play a music track using music player track info."
(set! (-> *progress-state-pc* music-player-track) info)
(set-setting! 'music (-> info name) 0.0 0)
(set-setting! 'sound-flava #f 999999.0 flava)
(sound-set-midi-reg 3 (-> info mode))
(cond
((= (-> info mode) 1)
(case (-> info name)
(('sewer)
(set-setting! 'music-volume 'rel 1.2 0)
)
(else
(set-setting! 'music-volume 'rel 1.111111 0)
)
)
)
(else
(remove-setting! 'music-volume))
)
(apply-settings *setting-control*)
(sound-group-continue (sound-group music))
0)
(defbehavior stop-music-player progress ()
"play a music track using music player track info."
(remove-setting! 'music)
(remove-setting! 'music-volume)
(remove-setting! 'sound-flava)
(sound-set-midi-reg 0 0)
(sound-set-midi-reg 2 0)
(sound-set-midi-reg 16 0)
(set! (-> *progress-state-pc* music-player-track) #f)
;(min! (-> *setting-control* user-current sound-excitement) 0.0)
(sound-set-midi-reg 16 (the int (* 100.0 (-> *setting-control* user-current sound-excitement))))
(set! (-> *setting-control* sound-excitement-change-time) (-> *display* base-clock frame-counter))
(apply-settings *setting-control*)
(sound-group-pause (sound-group music))
0)
(defun count-bits ((val int))
"return the number of bits set to 1."
(let ((bits 0))
(dotimes (i 64)
(if (logtest? val (ash 1 i))
(1+! bits))
)
bits)
)
(defun bit-on-offset ((bits int) (n int))
"return the bit offset of where the n'th bit that is set to 1 is"
(let ((bit-on-i 0))
(dotimes (i 64)
(if (logtest? bits (ash 1 i))
(if (= bit-on-i n)
(return i)
(1+! bit-on-i)))
))
-1)
(defmethod respond-progress menu-music-player-option ((obj menu-music-player-option) (arg0 progress) (arg1 symbol))
"Handle progress menu navigation logic."
;; force sound updates
(when (-> *progress-state-pc* music-player-track)
(sound-set-midi-reg 3 (-> *progress-state-pc* music-player-track mode))
(+! (-> *setting-control* user-current sound-flava) 999999)
)
(if (= 0.0 (-> obj max-scroll))
(set! (-> obj max-scroll) (+ -141.0 (* (-> *music-player-tracks* length) 23))))
;; control logic
(let ((scroll-sound? #f)
(track-max (1- (-> *music-player-tracks* length)))
(flava-max (1- (count-bits (the-as int (-> *music-player-tracks* (-> obj music-index) flava)))))
(old-excitement (-> obj excitement))
(play? #f))
;; excitement controls
(cond
((cpad-pressed? 0 right l-analog-right)
(seekl! (-> obj excitement) 3 1))
((cpad-pressed? 0 left l-analog-left)
(seekl! (-> obj excitement) 0 1))
)
(when (!= (-> obj excitement) old-excitement)
(sound-play "generic-beep")
(sound-set-midi-reg 16 (* 25 (-> obj excitement))) ;; play new excitement track
(unless (or (< (-> obj excitement) old-excitement) (process-by-name "sound-stinger" arg0))
(process-spawn-function process :to arg0 :name "sound-stinger"
(lambda :behavior process ((stinger int))
(let ((state-time (current-time)))
(format 0 "set stinger ~D~%" stinger)
(sound-set-midi-reg 0 stinger)
(until (>= (- (current-time) state-time) (seconds 0.5))
(suspend))
(sound-set-midi-reg 0 0)
)
)
(+ 9 (-> obj excitement)))
)
(unless (process-by-name "sound-excitement" arg0)
(process-spawn-function process :to arg0 :name "sound-excitement"
(lambda :behavior process ((excite-fade int))
(let ((state-time (current-time)))
(format 0 "set excitement fade ~D~%" (* 25 excite-fade))
(sound-set-midi-reg 2 (* 25 excite-fade)) ;; fade out old excitement track
(until (>= (- (current-time) state-time) (seconds 0.8))
(suspend))
)
)
old-excitement)
)
)
(cond
((or (cpad-pressed? 0 down l-analog-down)
(and (cpad-hold? 0 down l-analog-down) (>= (- (current-time) (-> obj last-move)) (seconds 0.2))))
(set! (-> obj last-move) (current-time))
(true! scroll-sound?)
(cond
((-> *progress-state-pc* music-player-selected)
(min-max-wrap-around+! (-> obj flava-index) 1 0 flava-max))
(else
(min-max-wrap-around+! (-> obj music-index) 1 0 track-max)
(if (= (-> obj music-index) 0)
(set! (-> obj current-scroll) 0.0)))
))
((or (cpad-pressed? 0 up l-analog-up)
(and (cpad-hold? 0 up l-analog-up) (>= (- (current-time) (-> obj last-move)) (seconds 0.2))))
(set! (-> obj last-move) (current-time))
(true! scroll-sound?)
(cond
((-> *progress-state-pc* music-player-selected)
(min-max-wrap-around+! (-> obj flava-index) -1 0 flava-max))
(else
(min-max-wrap-around+! (-> obj music-index) -1 0 track-max)
(if (= (-> obj music-index) track-max)
(set! (-> obj current-scroll) (-> obj max-scroll))))
))
((cpad-pressed? 0 confirm)
(cpad-clear! 0 confirm)
(sound-play "generic-beep")
(cond
;; track is locked. do nothing.
((not (get-bit (-> *pc-settings* music-unlocked) (-> obj music-index)))
)
;; we have a track with a submenu selected
((-> *progress-state-pc* music-player-selected)
(let ((flava (bit-on-offset (the-as int (-> *music-player-tracks* (-> obj music-index) flava)) (-> obj flava-index))))
(cond
((flava-unlocked? flava)
(set! (-> *progress-state-pc* music-player-flava) flava)
(true! play?)
;; exit submenu
(false! (-> *progress-state-pc* music-player-selected))
)
(else
;; do nothing.
)
)
)
)
;; we have a track with a submenu that's not open, open it
((nonzero? (-> *music-player-tracks* (-> obj music-index) flava))
;; same track that's currently playing, we can just reuse the flava position that's being used
;; otherwise use zero.
(if (= (-> *progress-state-pc* music-player-track) (-> *music-player-tracks* (-> obj music-index)))
(set! (-> obj flava-index) (count-bits (logand (1- (ash 1 (-> *progress-state-pc* music-player-flava))) (the-as int (-> *music-player-tracks* (-> obj music-index) flava)))))
(set! (-> obj flava-index) 0))
(true! (-> *progress-state-pc* music-player-selected)))
;; no submenu required, just play track.
(else
(set! (-> *progress-state-pc* music-player-flava) 0)
(true! play?))
)
(when play?
(play-music-player (-> *music-player-tracks* (-> obj music-index)) (-> *progress-state-pc* music-player-flava))
)
)
((cpad-pressed? 0 triangle)
(cpad-clear! 0 triangle)
(sound-play "generic-beep")
(cond
((-> *progress-state-pc* music-player-selected)
(false! (-> *progress-state-pc* music-player-selected)))
(else
(stop-music-player)
(pop-state arg0))
)
)
)
(when scroll-sound?
(sound-play "secrets-scroll"))
)
0
)
(defun hide-progress-screen ()
(when (and *progress-process* *progress-state* (!= (-> *progress-state* starting-state) 'title))
(stop-music-player)
(set-next-state (-> *progress-process* 0) 'go-away 0)
)
0
(none)
)
@@ -9,6 +9,8 @@
|#
(set! (-> *main-options-debug* options 9) (new 'static 'menu-main-menu-option :name (text-id progress-music-player) :scale #t :next-state 'music-player))
(define *graphic-options-pc*
(new 'static 'menu-option-list
@@ -36,4 +38,15 @@
)
(define *music-player-options*
(new 'static 'menu-option-list
:y-center 198
:y-space 34
:scale 0.82
:options (new 'static 'boxed-array :type menu-option
(new 'static 'menu-music-player-option :name (text-id progress-music-player))
)
)
)
+16 -16
View File
@@ -440,7 +440,7 @@
;; definition of type menu-insufficient-space-option
(deftype menu-insufficient-space-option (menu-option)
((last-move uint64 :offset-assert 48)
((last-move time-frame :offset-assert 48)
)
:method-count-assert 12
:size-assert #x38
@@ -796,9 +796,9 @@
;; definition of type menu-select-start-option
(deftype menu-select-start-option (menu-option)
((task-index int32 :offset-assert 48)
(real-task-index int32 :offset-assert 52)
(last-move uint64 :offset-assert 56)
((task-index int32 :offset-assert 48)
(real-task-index int32 :offset-assert 52)
(last-move time-frame :offset-assert 56)
)
:method-count-assert 12
:size-assert #x40
@@ -824,8 +824,8 @@
;; definition of type menu-select-scene-option
(deftype menu-select-scene-option (menu-option)
((task-index int32 :offset-assert 48)
(last-move uint64 :offset-assert 56)
((task-index int32 :offset-assert 48)
(last-move time-frame :offset-assert 56)
)
:method-count-assert 12
:size-assert #x40
@@ -902,8 +902,8 @@
;; definition of type menu-missions-option
(deftype menu-missions-option (paged-menu-option)
((task-line-index int32 :offset-assert 64)
(last-move uint64 :offset-assert 72)
((task-line-index int32 :offset-assert 64)
(last-move time-frame :offset-assert 72)
)
:method-count-assert 12
:size-assert #x50
@@ -932,7 +932,7 @@
;; definition of type menu-highscores-option
(deftype menu-highscores-option (paged-menu-option)
((last-move uint64 :offset-assert 64)
((last-move time-frame :offset-assert 64)
(sprites hud-sprite 2 :inline :offset 80)
)
:method-count-assert 12
@@ -997,7 +997,7 @@
(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)
(last-move time-frame :offset-assert 72)
(sprites hud-sprite 2 :inline :offset 80)
)
:method-count-assert 12
@@ -1055,8 +1055,8 @@
;; definition of type menu-qr-option
(deftype menu-qr-option (menu-option)
((last-move uint64 :offset-assert 48)
(value-to-modify function :offset 60)
((last-move time-frame :offset-assert 48)
(value-to-modify function :offset 60)
)
:method-count-assert 12
:size-assert #x40
@@ -1163,8 +1163,8 @@
;; definition of type menu-graphic-option
(deftype menu-graphic-option (menu-option)
((last-move uint64 :offset-assert 48)
(value-to-modify pointer :offset 60)
((last-move time-frame :offset-assert 48)
(value-to-modify pointer :offset 60)
)
:method-count-assert 12
:size-assert #x40
@@ -1292,8 +1292,8 @@
;; definition of type menu-game-option
(deftype menu-game-option (menu-option)
((last-move uint64 :offset-assert 48)
(value-to-modify pointer :offset 60)
((last-move time-frame :offset-assert 48)
(value-to-modify pointer :offset 60)
)
:method-count-assert 12
:size-assert #x40
+33 -35
View File
@@ -29,7 +29,7 @@
(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-last-move time-frame :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)
@@ -41,7 +41,7 @@
(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-last-move time-frame :offset-assert 192)
(qr-options-restart basic :offset-assert 200)
(qr-options-quit basic :offset-assert 204)
(total-num-tasks int32 :offset-assert 208)
@@ -2524,7 +2524,7 @@
)
(else
(sound-play "generic-beep")
(set! (-> obj last-move) (the-as uint (current-time)))
(set! (-> obj last-move) (current-time))
(set! (-> arg0 current) 'none)
(set-next-state arg0 s3-0 0)
)
@@ -2983,9 +2983,9 @@
)
(cond
((or (cpad-pressed? 0 up l-analog-up)
(and (cpad-hold? 0 up l-analog-up) (>= (- (current-time) (the-as int (-> obj last-move))) (seconds 0.2)))
(and (cpad-hold? 0 up l-analog-up) (>= (- (current-time) (-> obj last-move)) (seconds 0.2)))
)
(set! (-> obj last-move) (the-as uint (current-time)))
(set! (-> obj last-move) (current-time))
(when (> (-> obj task-index) 0)
(set! s4-0 #t)
(+! (-> obj task-index) -1)
@@ -2993,9 +2993,9 @@
)
)
((or (cpad-pressed? 0 down l-analog-down)
(and (cpad-hold? 0 down l-analog-down) (>= (- (current-time) (the-as int (-> obj last-move))) (seconds 0.2)))
(and (cpad-hold? 0 down l-analog-down) (>= (- (current-time) (-> obj last-move)) (seconds 0.2)))
)
(set! (-> obj last-move) (the-as uint (current-time)))
(set! (-> obj last-move) (current-time))
(let ((s3-0 -1))
(dotimes (s2-0 (-> *game-info* play-list length))
(let* ((v1-41 (-> *game-info* play-list s2-0))
@@ -3091,9 +3091,9 @@
)
(cond
((or (cpad-pressed? 0 up l-analog-up)
(and (cpad-hold? 0 up l-analog-up) (>= (- (current-time) (the-as int (-> obj last-move))) (seconds 0.2)))
(and (cpad-hold? 0 up l-analog-up) (>= (- (current-time) (-> obj last-move)) (seconds 0.2)))
)
(set! (-> obj last-move) (the-as uint (current-time)))
(set! (-> obj last-move) (current-time))
(when (> (-> obj task-index) 0)
(set! gp-0 #t)
(+! (-> obj task-index) -1)
@@ -3101,9 +3101,9 @@
)
)
((or (cpad-pressed? 0 down l-analog-down)
(and (cpad-hold? 0 down l-analog-down) (>= (- (current-time) (the-as int (-> obj last-move))) (seconds 0.2)))
(and (cpad-hold? 0 down l-analog-down) (>= (- (current-time) (-> obj last-move)) (seconds 0.2)))
)
(set! (-> obj last-move) (the-as uint (current-time)))
(set! (-> obj last-move) (current-time))
(when (< (-> obj task-index) (+ (length s4-0) -1))
(set! gp-0 #t)
(+! (-> obj task-index) 1)
@@ -3158,9 +3158,9 @@
(let ((s5-0 #f))
(cond
((or (cpad-pressed? 0 up l-analog-up)
(and (cpad-hold? 0 up l-analog-up) (>= (- (current-time) (the-as int (-> obj last-move))) (seconds 0.2)))
(and (cpad-hold? 0 up l-analog-up) (>= (- (current-time) (-> obj last-move)) (seconds 0.2)))
)
(set! (-> obj last-move) (the-as uint (current-time)))
(set! (-> obj last-move) (current-time))
(when (> (-> obj task-line-index) 0)
(set! s5-0 #t)
(+! (-> obj task-line-index) -1)
@@ -3168,9 +3168,9 @@
)
)
((or (cpad-pressed? 0 down l-analog-down)
(and (cpad-hold? 0 down l-analog-down) (>= (- (current-time) (the-as int (-> obj last-move))) (seconds 0.2)))
(and (cpad-hold? 0 down l-analog-down) (>= (- (current-time) (-> obj last-move)) (seconds 0.2)))
)
(set! (-> obj last-move) (the-as uint (current-time)))
(set! (-> obj last-move) (current-time))
(when (< (-> obj task-line-index) (+ (-> *progress-state* total-num-tasks) -1))
(+! (-> obj task-line-index) 1)
(set! (-> arg0 sliding-height) 1.0)
@@ -3217,12 +3217,10 @@
(let ((s5-0 #f))
(cond
((or (cpad-pressed? 0 right l-analog-right)
(and (cpad-hold? 0 right l-analog-right)
(>= (- (current-time) (the-as int (-> obj last-move))) (seconds 0.2))
)
(and (cpad-hold? 0 right l-analog-right) (>= (- (current-time) (-> obj last-move)) (seconds 0.2)))
)
(when (< 1 (get-num-highscores))
(set! (-> obj last-move) (the-as uint (current-time)))
(set! (-> obj last-move) (current-time))
(set! s5-0 #t)
(set! (-> obj prev-page-index) (-> obj page-index))
(set! (-> obj page-index) (get-next-highscore (-> obj page-index)))
@@ -3232,10 +3230,10 @@
)
)
((or (cpad-pressed? 0 left l-analog-left)
(and (cpad-hold? 0 left l-analog-left) (>= (- (current-time) (the-as int (-> obj last-move))) (seconds 0.2)))
(and (cpad-hold? 0 left l-analog-left) (>= (- (current-time) (-> obj last-move)) (seconds 0.2)))
)
(when (< 1 (get-num-highscores))
(set! (-> obj last-move) (the-as uint (current-time)))
(set! (-> obj last-move) (current-time))
(set! (-> obj prev-page-index) (-> obj page-index))
(set! (-> obj page-index) (get-prev-highscore (-> obj page-index)))
(set! s5-0 #t)
@@ -3312,9 +3310,9 @@
(else
(cond
((or (cpad-pressed? 0 down l-analog-down)
(and (cpad-hold? 0 down l-analog-down) (>= (- (current-time) (the-as int (-> obj last-move))) (seconds 0.2)))
(and (cpad-hold? 0 down l-analog-down) (>= (- (current-time) (-> obj last-move)) (seconds 0.2)))
)
(set! (-> obj last-move) (the-as uint (current-time)))
(set! (-> obj last-move) (current-time))
(when (< (-> obj item-index) s2-0)
(set! (-> obj prev-item-index) (-> obj item-index))
(set! s5-2 #t)
@@ -3324,9 +3322,9 @@
)
)
((or (cpad-pressed? 0 up l-analog-up)
(and (cpad-hold? 0 up l-analog-up) (>= (- (current-time) (the-as int (-> obj last-move))) (seconds 0.2)))
(and (cpad-hold? 0 up l-analog-up) (>= (- (current-time) (-> obj last-move)) (seconds 0.2)))
)
(set! (-> obj last-move) (the-as uint (current-time)))
(set! (-> obj last-move) (current-time))
(when (< s3-0 (-> obj item-index))
(set! (-> obj prev-item-index) (-> obj item-index))
(+! (-> obj item-index) -1)
@@ -3395,10 +3393,10 @@
(cond
((or (cpad-pressed? 0 down l-analog-down)
(and (cpad-hold? 0 down l-analog-down)
(>= (- (current-time) (the-as int (-> *progress-state* game-options-last-move))) (seconds 0.5))
(>= (- (current-time) (-> *progress-state* game-options-last-move)) (seconds 0.5))
)
)
(set! (-> *progress-state* game-options-last-move) (the-as uint (current-time)))
(set! (-> *progress-state* game-options-last-move) (current-time))
(cond
((< (-> *progress-state* game-options-item-selected) 3)
(+! (-> *progress-state* game-options-item-selected) 1)
@@ -3411,10 +3409,10 @@
)
((or (cpad-pressed? 0 up l-analog-up)
(and (cpad-hold? 0 up l-analog-up)
(>= (- (current-time) (the-as int (-> *progress-state* game-options-last-move))) (seconds 0.5))
(>= (- (current-time) (-> *progress-state* game-options-last-move)) (seconds 0.5))
)
)
(set! (-> *progress-state* game-options-last-move) (the-as uint (current-time)))
(set! (-> *progress-state* game-options-last-move) (current-time))
(if (> (-> *progress-state* game-options-item-selected) 0)
(+! (-> *progress-state* game-options-item-selected) -1)
(set! (-> *progress-state* game-options-item-selected) 3)
@@ -3423,7 +3421,7 @@
((cpad-pressed? 0 confirm)
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
(set! (-> *progress-state* game-options-last-move) (the-as uint (current-time)))
(set! (-> *progress-state* game-options-last-move) (current-time))
(set! (-> *progress-state* game-options-item-picked) (the-as basic #t))
(sound-play "generic-beep")
)
@@ -3832,10 +3830,10 @@
(cond
((or (cpad-pressed? 0 down l-analog-down)
(and (cpad-hold? 0 down l-analog-down)
(>= (- (current-time) (the-as int (-> *progress-state* qr-options-last-move))) (seconds 0.5))
(>= (- (current-time) (-> *progress-state* qr-options-last-move)) (seconds 0.5))
)
)
(set! (-> *progress-state* qr-options-last-move) (the-as uint (current-time)))
(set! (-> *progress-state* qr-options-last-move) (current-time))
(cond
((< (-> *progress-state* qr-options-item-selected) 1)
(+! (-> *progress-state* qr-options-item-selected) 1)
@@ -3853,10 +3851,10 @@
)
((or (cpad-pressed? 0 up l-analog-up)
(and (cpad-hold? 0 up l-analog-up)
(>= (- (current-time) (the-as int (-> *progress-state* qr-options-last-move))) (seconds 0.5))
(>= (- (current-time) (-> *progress-state* qr-options-last-move)) (seconds 0.5))
)
)
(set! (-> *progress-state* qr-options-last-move) (the-as uint (current-time)))
(set! (-> *progress-state* qr-options-last-move) (current-time))
(cond
((> (-> *progress-state* qr-options-item-selected) 0)
(+! (-> *progress-state* qr-options-item-selected) -1)
@@ -3873,7 +3871,7 @@
((cpad-pressed? 0 confirm)
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm))
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm))
(set! (-> *progress-state* qr-options-last-move) (the-as uint (current-time)))
(set! (-> *progress-state* qr-options-last-move) (current-time))
(set! (-> *progress-state* qr-options-item-picked) (the-as basic #t))
(set! (-> arg0 selected-option) #t)
(sound-play "generic-beep")