From d2f104cd43e5dea8e3486e808fe1290ea260d17e Mon Sep 17 00:00:00 2001 From: ManDude <7569514+ManDude@users.noreply.github.com> Date: Tue, 19 Jul 2022 00:54:38 +0100 Subject: [PATCH] implement a cheats menu + a few bug fixes (#1677) * raise particles cap to 10x * change a text line * allow sound bank load during vag * fix default settings and fps setting * keep "auto save disabled" option in menu * cheats menu! * Update game_text_ja.gs * fix battle hud crash * add cheats menu to title * update settings version * Update all-types.gc * disable envmap fade out with hires actor lod setting * disable merc fadeout if not using ps2 actor lods * dont update aspect ratio if game size is bad * set vsync later * increase memory for generic, sprite and dma. * fix issues with aspect ratio not saving * split forcing envmap to a separate toggle * too slow, dont expose to users yet --- decompiler/config/all-types.gc | 6 + game/assets/jak1/text/game_text_en.gs | 22 +- game/assets/jak1/text/game_text_ja.gs | 9 +- .../opengl_renderer/foreground/Generic2.h | 2 +- game/graphics/pipelines/opengl.cpp | 13 +- game/overlord/iso.cpp | 11 +- goal_src/jak1/engine/debug/default-menu.gc | 21 +- goal_src/jak1/engine/draw/drawable.gc | 4 +- goal_src/jak1/engine/gfx/foreground/bones.gc | 10 +- goal_src/jak1/engine/gfx/hw/display.gc | 6 +- .../engine/gfx/sprite/sparticle/sparticle.gc | 2 +- goal_src/jak1/engine/gfx/sprite/sprite-h.gc | 2 +- goal_src/jak1/engine/gfx/sprite/sprite.gc | 4 +- goal_src/jak1/engine/target/sidekick.gc | 4 +- .../jak1/engine/ui/progress/progress-h.gc | 1 + goal_src/jak1/engine/ui/progress/progress.gc | 1 + goal_src/jak1/engine/ui/text-h.gc | 5 + goal_src/jak1/engine/ui/text.gc | 4 +- goal_src/jak1/pc/hud-classes-pc.gc | 2 +- goal_src/jak1/pc/pckernel-h.gc | 33 +- goal_src/jak1/pc/pckernel.gc | 102 ++++--- goal_src/jak1/pc/progress-pc.gc | 284 ++++++++++++------ goal_src/jak1/pc/subtitle.gc | 2 +- 23 files changed, 345 insertions(+), 205 deletions(-) diff --git a/decompiler/config/all-types.gc b/decompiler/config/all-types.gc index 1b20fc59e2..a95758d44b 100644 --- a/decompiler/config/all-types.gc +++ b/decompiler/config/all-types.gc @@ -1448,6 +1448,7 @@ (camera-controls-third-horz #x1005) (camera-controls-third-vert #x1006) (restore-defaults #x1007) + (auto-save-disabled #x100c) (disable-auto-save-query #x100d) (disable-auto-save #x100e) (misc-options #x100f) @@ -1458,6 +1459,9 @@ (ps2-parts #x1022) (music-fadeout #x1023) (music-fadein #x1024) + (force-actors #x1025) + (force-background #x1026) + (force-envmap #x1027) (discord-rpc #x1030) (display-mode #x1031) (windowed #x1032) @@ -1521,6 +1525,7 @@ (cheat-sidekick-alt #x1094) (cheat-invinc #x1095) (cheat-tunes #x1096) + (cheat-sky #x1097) (music-player #x10c0) (scene-player #x10c1) (play-credits #x10c2) @@ -15764,6 +15769,7 @@ (aspect-native) (button-music) (button-flava) + (cheat-toggle) ) (defenum game-option-menu diff --git a/game/assets/jak1/text/game_text_en.gs b/game/assets/jak1/text/game_text_en.gs index 3ffb2e835e..6151e8e070 100644 --- a/game/assets/jak1/text/game_text_en.gs +++ b/game/assets/jak1/text/game_text_en.gs @@ -35,6 +35,8 @@ (#x1007 "RESTORE DEFAULTS" "RESTORE DEFAULTS") +(#x100c "AUTO-SAVE DISABLED" + "AUTO-SAVE DISABLED") (#x100d "ARE YOU SURE YOU WANT TO DISABLE AUTO-SAVE?" "ARE YOU SURE YOU WANT TO DISABLE AUTO-SAVE?") (#x100e "DISABLE AUTO-SAVE" @@ -53,15 +55,19 @@ "PS2 LOAD SPEED") (#x1022 "PARTICLE CULLING" "PARTICLE CULLING") - (#x1023 "MUSIC FADE-OUT" "MUSIC FADE-OUT") (#x1024 "MUSIC FADE-IN" "MUSIC FADE-IN") +(#x1025 "ACTOR CULLING" + "ACTOR CULLING") +(#x1026 "BACKGROUND CULLING" + "BACKGROUND CULLING") +(#x1027 "FORCE ENVIRONMENT MAPPING" + "FORCE ENVIRONMENT MAPPING") (#x1030 "DISCORD RICH-PRESENCE" "DISCORD RICH-PRESENCE") - (#x1031 "DISPLAY MODE" "DISPLAY MODE") (#x1032 "WINDOWED" @@ -70,12 +76,10 @@ "BORDERLESS") (#x1034 "FULLSCREEN" "FULLSCREEN") - (#x1035 "GAME RESOLUTION" "GAME RESOLUTION") (#x1036 "~D X ~D" "~D X ~D") - (#x1037 "PS2 ASPECT RATIO" "PS2 ASPECT RATIO") (#x1038 "WHEN PS2 ASPECT RATIO IS ENABLED, ONLY 4X3 AND 16X9 ASPECT RATIO CAN BE SELECTED. CONTINUE?" @@ -167,8 +171,8 @@ "FINAL BOSS") (#x1085 "CREDITS" "CREDITS") -(#x1086 "LOCKED" - "LOCKED") +(#x1086 "?????" + "?????") (#x1087 "KLAWW" "KLAWW") (#x1088 "FISHING MINI-GAME" @@ -188,8 +192,10 @@ "ALTERNATE DAXTER") (#x1095 "INVINCIBILITY" "INVINCIBILITY") -(#x1096 "PLAY ALL MUSIC TRACKS" - "PLAY ALL MUSIC TRACKS") +(#x1096 "ALL MUSIC TRACKS" + "ALL MUSIC TRACKS") +(#x1097 "REAL TIME OF DAY" + "REAL TIME OF DAY") (#x10c0 "MUSIC PLAYER" "MUSIC PLAYER") diff --git a/game/assets/jak1/text/game_text_ja.gs b/game/assets/jak1/text/game_text_ja.gs index 3615aca19a..358e76b161 100644 --- a/game/assets/jak1/text/game_text_ja.gs +++ b/game/assets/jak1/text/game_text_ja.gs @@ -11,12 +11,12 @@ (#x107f "ヒントロッグ") (#x1080 "チート") - +(#x1081 "シークレット") (#x1082 "レベルをセレクトください") (#x1083 "へんかをセレクトください") (#x1084 "ラスボス") (#x1085 "スタッフロール") -(#x1086 "ロック") +(#x1086 "?????") (#x1087 "ハイブリッドラーカー クロウ") (#x1088 "サカナとりゲームのテーマ") (#x1089 "チャレンジーのテーマ") @@ -27,9 +27,10 @@ (#x1093 "むげんの黄のエコ") (#x1094 "へんかのダックスター") (#x1095 "インヴィンシブル") -(#x1096 "すべてBGMのへんかを エネーブルする") +(#x1096 "すべてBGMのへんか") +(#x1097 "リアルタイムオブデイ") -(#x10c0 "BGMプレイヤー") +(#x10c0 "BGM プレイヤー") (#x10d0 "デフォールト") (#x10d1 "みしよう") diff --git a/game/graphics/opengl_renderer/foreground/Generic2.h b/game/graphics/opengl_renderer/foreground/Generic2.h index dc1107e266..59a7471507 100644 --- a/game/graphics/opengl_renderer/foreground/Generic2.h +++ b/game/graphics/opengl_renderer/foreground/Generic2.h @@ -8,7 +8,7 @@ class Generic2 : public BucketRenderer { BucketId my_id, u32 num_verts = 200000, u32 num_frags = 2000, - u32 num_adgif = 3000, + u32 num_adgif = 6000, u32 num_buckets = 800); ~Generic2(); void render(DmaFollower& dma, SharedRenderState* render_state, ScopedProfilerNode& prof) override; diff --git a/game/graphics/pipelines/opengl.cpp b/game/graphics/pipelines/opengl.cpp index 46f3a7104f..b74001b8f0 100644 --- a/game/graphics/pipelines/opengl.cpp +++ b/game/graphics/pipelines/opengl.cpp @@ -529,12 +529,6 @@ void GLDisplay::render() { ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData()); } - // switch vsync modes, if requested - if (Gfx::g_global_settings.vsync != Gfx::g_global_settings.old_vsync) { - Gfx::g_global_settings.old_vsync = Gfx::g_global_settings.vsync; - glfwSwapInterval(Gfx::g_global_settings.vsync); - } - // actual vsync g_gfx_data->debug_gui.finish_frame(); { @@ -552,6 +546,13 @@ void GLDisplay::render() { glFinish(); } + // switch vsync modes, if requested + if (Gfx::g_global_settings.vsync != Gfx::g_global_settings.old_vsync) { + lg::error("changed vsync"); + Gfx::g_global_settings.old_vsync = Gfx::g_global_settings.vsync; + glfwSwapInterval(Gfx::g_global_settings.vsync); + } + // Start timing for the next frame. g_gfx_data->debug_gui.start_frame(); prof().instant_event("ROOT"); diff --git a/game/overlord/iso.cpp b/game/overlord/iso.cpp index ef52c4749d..3f0acc4882 100644 --- a/game/overlord/iso.cpp +++ b/game/overlord/iso.cpp @@ -398,11 +398,14 @@ u32 ISOThread() { } break; case LOAD_SOUND_BANK: { + // NOTE: this check has been removed. there doesn't seem to be any issues with this, and + // it fixes some other issues. there doesn't appear to be any extra safety from it either + // if there's an in progress vag command, try again. - if (in_progress_vag_command && !in_progress_vag_command->paused) { - SendMbx(iso_mbx, msg_from_mbx); - break; - } + // if (in_progress_vag_command && !in_progress_vag_command->paused) { + // SendMbx(iso_mbx, msg_from_mbx); + // break; + // } auto buff = TryAllocateBuffer(BUFFER_PAGE_SIZE); if (!buff) { diff --git a/goal_src/jak1/engine/debug/default-menu.gc b/goal_src/jak1/engine/debug/default-menu.gc index 95e3c473b5..07592169c3 100644 --- a/goal_src/jak1/engine/debug/default-menu.gc +++ b/goal_src/jak1/engine/debug/default-menu.gc @@ -4504,14 +4504,12 @@ ) (dotimes (j (-> flava-list length)) (let ((flava-name (new 'debug 'string 30 (game-text-id->string (-> flava-list j))))) - (when (and (string= (substring! *temp-string* level-name (- (length level-name) 11) (length level-name)) "-level-name") (string= (substring! *temp-string* flava-name (- (length flava-name) 11) (length flava-name)) "-level-name")) + (when (and (string= (substring! *temp-string* level-name (- (length level-name) 11) (length level-name)) "-level-name") + (string= (substring! *temp-string* flava-name (- (length flava-name) 11) (length flava-name)) "-level-name")) (copy-string<-string flava-name (symbol->string (ref *music-list* i))) ) - (case-str flava-name (("lavatube-level-name") (copy-string<-string flava-name "lavatube"))) (unless (string= flava-name "zero") - (let ((lst (dcons (ref *music-list* i) j))) - (debug-menu-append-item lvl-menu (new 'debug 'debug-menu-item-function flava-name lst (the-as (function object object) dm-music-player-func))) - ) + (debug-menu-append-item lvl-menu (new-dm-func flava-name (dcons (ref *music-list* i) j) dm-music-player-func)) ) ) ) @@ -4660,7 +4658,8 @@ ;(flag "PS2 Hints" #f ,(dm-lambda-boolean-flag (-> *pc-settings* ps2-hints?))) ) (menu "Level of detail" - (flag "PS2 LOD " #f ,(dm-lambda-boolean-flag (-> *pc-settings* ps2-lod-dist?))) + (flag "PS2 LOD " #f ,(dm-lambda-boolean-flag (-> *pc-settings* ps2-lod-dist?))) + (flag "Force Envmap" #f ,(dm-lambda-boolean-flag (-> *pc-settings* force-envmap?))) (int-var "LOD Tfrag" 0 dm-lod-int 0 1 #t 0 2) (int-var "LOD Tie" 1 dm-lod-int 0 1 #t 0 3) ;(int-var "LOD Ocean" 2 dm-lod-int 0 1 #t 0 3) @@ -4777,10 +4776,6 @@ ) -) - -) - (defun bg-custom ((level-name symbol)) "Modified version of bg for the PC Port custom levels." @@ -4846,4 +4841,8 @@ ;(initialize! *game-info* 'game (the-as game-save #f) (the-as string #f)) ) ) - ) \ No newline at end of file + ) + +) + +) diff --git a/goal_src/jak1/engine/draw/drawable.gc b/goal_src/jak1/engine/draw/drawable.gc index 0718b370ba..db4fa3ffc4 100644 --- a/goal_src/jak1/engine/draw/drawable.gc +++ b/goal_src/jak1/engine/draw/drawable.gc @@ -695,7 +695,9 @@ (cond ((>= (-> arg1 force-lod) 0) (set! lod-to-use (-> arg1 force-lod)) - (if (< (-> arg1 lod-set lod (-> arg1 lod-set max-lod) dist) cam-dist) + (if (#if (not PC_PORT) + (< (-> arg1 lod-set lod (-> arg1 lod-set max-lod) dist) cam-dist) + (and (-> *pc-settings* ps2-lod-dist?) (< (-> arg1 lod-set lod (-> arg1 lod-set max-lod) dist) cam-dist))) (return #f) ) ) diff --git a/goal_src/jak1/engine/gfx/foreground/bones.gc b/goal_src/jak1/engine/gfx/foreground/bones.gc index 6f47667f65..8afb69881b 100644 --- a/goal_src/jak1/engine/gfx/foreground/bones.gc +++ b/goal_src/jak1/engine/gfx/foreground/bones.gc @@ -970,7 +970,7 @@ "Main draw function for all bone-related renderers. Will set up merc, generic and shadow. and also add the bones to the calculation list." (local-vars (a0-16 int) (a0-17 int) (a0-62 int) (a2-10 int) (a2-12 int) - (used-merc int) (used-mercneric int) (effect-idx int) (sv-144 ripple-control)) + (used-merc int) (used-mercneric int) (sv-144 ripple-control)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) (vf4 :class vf) (vf5 :class vf) (vf6 :class vf) (vf7 :class vf) (vf8 :class vf) (vf9 :class vf) (acc :class vf)) @@ -1180,8 +1180,7 @@ (pc-force-mercneric #f) ) ;; loop over effects, and set them up/pick renderers. - (set! effect-idx 0) - (while (< effect-idx (the-as int (-> geom header effect-count))) + (dotimes (effect-idx (the-as int (-> geom header effect-count))) ;; check if this "effect" uses texture scrolling (when (logtest? (-> geom effect effect-idx effect-bits) 1) @@ -1299,6 +1298,9 @@ (if (< f0-9 0.0) (set! f0-9 0.0) ) + (with-pc + (if (-> *pc-settings* force-envmap?) + (set! f0-9 1.0))) (cond ;; do envmap stuff if we are using generic anyway, or our strength is > 0. @@ -1359,8 +1361,6 @@ (set! (-> *merc-bucket-info* effect effect-idx use-mercneric) (the-as uint 1)) (set! used-mercneric 1) ) - - (set! effect-idx (+ effect-idx 1)) ) ;; end effect loop ;; draw generic! diff --git a/goal_src/jak1/engine/gfx/hw/display.gc b/goal_src/jak1/engine/gfx/hw/display.gc index 18bb45d134..70a33229d9 100644 --- a/goal_src/jak1/engine/gfx/hw/display.gc +++ b/goal_src/jak1/engine/gfx/hw/display.gc @@ -6,8 +6,10 @@ ;; dgos: GAME, ENGINE -(defconstant DMA_BUFFER_GLOBAL_SIZE (* PROCESS_HEAP_MULT 1712 1024)) -(defconstant DMA_BUFFER_DEBUG_SIZE (* 8 1024 1024)) +(defconstant DMA_BUFFER_GLOBAL_SIZE (#if (not PC_PORT) + (* 1712 1024) ;; 1712K + (* PROCESS_HEAP_MULT 2664 1024))) ;; 2600K x actor heap increase (usually 3x) +(defconstant DMA_BUFFER_DEBUG_SIZE (* 8 1024 1024)) ;; 8M ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; TIME diff --git a/goal_src/jak1/engine/gfx/sprite/sparticle/sparticle.gc b/goal_src/jak1/engine/gfx/sprite/sparticle/sparticle.gc index 7193ae0a8a..9d2254997c 100644 --- a/goal_src/jak1/engine/gfx/sprite/sparticle/sparticle.gc +++ b/goal_src/jak1/engine/gfx/sprite/sparticle/sparticle.gc @@ -64,7 +64,7 @@ arg4: pointer to adgif allocation" (#when PC_BIG_MEMORY (*! arg0 SPRITE_MAX_AMOUNT_MULT) - (*! arg1 SPRITE_MAX_AMOUNT_MULT) + ; (*! arg1 SPRITE_MAX_AMOUNT_MULT) ) (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) (let* ((v1-3 (/ (+ arg0 63) 64)) ;; num blocks diff --git a/goal_src/jak1/engine/gfx/sprite/sprite-h.gc b/goal_src/jak1/engine/gfx/sprite/sprite-h.gc index 166151ea51..d663f0c863 100644 --- a/goal_src/jak1/engine/gfx/sprite/sprite-h.gc +++ b/goal_src/jak1/engine/gfx/sprite/sprite-h.gc @@ -7,7 +7,7 @@ (#if PC_BIG_MEMORY - (defconstant SPRITE_MAX_AMOUNT_MULT 8) + (defconstant SPRITE_MAX_AMOUNT_MULT 12) (none)) diff --git a/goal_src/jak1/engine/gfx/sprite/sprite.gc b/goal_src/jak1/engine/gfx/sprite/sprite.gc index 4c12e2400f..1195ddbc42 100644 --- a/goal_src/jak1/engine/gfx/sprite/sprite.gc +++ b/goal_src/jak1/engine/gfx/sprite/sprite.gc @@ -397,7 +397,7 @@ "Allocate a sprite-array for 2d sprites. There are two groups, each can contain the given number." (#when PC_BIG_MEMORY (*! group-0-size SPRITE_MAX_AMOUNT_MULT) - (*! group-1-size SPRITE_MAX_AMOUNT_MULT) + ; (*! group-1-size SPRITE_MAX_AMOUNT_MULT) ) (let* ((sprite-count (+ group-0-size group-1-size)) (vec-data-size (* 3 sprite-count)) ;; 3 quadwords of vec-data per sprite @@ -424,7 +424,7 @@ Group 1 size is zero in practice for 3d." (#when PC_BIG_MEMORY (*! group-0-size SPRITE_MAX_AMOUNT_MULT) - (*! group-1-size SPRITE_MAX_AMOUNT_MULT) + ; (*! group-1-size SPRITE_MAX_AMOUNT_MULT) ) (let* ((sprite-count (+ group-0-size group-1-size)) (vec-data-size (* 3 sprite-count)) diff --git a/goal_src/jak1/engine/target/sidekick.gc b/goal_src/jak1/engine/target/sidekick.gc index 8eec9b5b38..86a9dbd625 100644 --- a/goal_src/jak1/engine/target/sidekick.gc +++ b/goal_src/jak1/engine/target/sidekick.gc @@ -151,8 +151,8 @@ (set! (-> self draw color-mult quad) v1-22) ) (with-pc ;; duh! - (if (pc-cheats? *pc-settings* sidekick-blue) - (set! (-> self draw color-mult x) (set! (-> self draw color-mult y) 0.0))) + (when (pc-cheats? *pc-settings* sidekick-blue) + (set! (-> self draw color-mult x) (set! (-> self draw color-mult y) 0.1))) ) (let ((v1-26 (-> self parent-override 0 draw color-emissive quad))) (set! (-> self draw color-emissive quad) v1-26) diff --git a/goal_src/jak1/engine/ui/progress/progress-h.gc b/goal_src/jak1/engine/ui/progress/progress-h.gc index 3fbb32ad5f..b0756a68f5 100644 --- a/goal_src/jak1/engine/ui/progress/progress-h.gc +++ b/goal_src/jak1/engine/ui/progress/progress-h.gc @@ -154,6 +154,7 @@ (aspect-native) (button-music) (button-flava) + (cheat-toggle) ) ) ) diff --git a/goal_src/jak1/engine/ui/progress/progress.gc b/goal_src/jak1/engine/ui/progress/progress.gc index 04daef188a..7f61819b01 100644 --- a/goal_src/jak1/engine/ui/progress/progress.gc +++ b/goal_src/jak1/engine/ui/progress/progress.gc @@ -839,6 +839,7 @@ (= v1-2 (progress-screen resolution)) (= v1-2 (progress-screen aspect-ratio)) (= v1-2 (progress-screen secrets)) + (= v1-2 (progress-screen cheats)) (= v1-2 (progress-screen music-player)) (= v1-2 (progress-screen flava-player)) ) diff --git a/goal_src/jak1/engine/ui/text-h.gc b/goal_src/jak1/engine/ui/text-h.gc index d43226fb52..e36e99277c 100644 --- a/goal_src/jak1/engine/ui/text-h.gc +++ b/goal_src/jak1/engine/ui/text-h.gc @@ -598,6 +598,7 @@ (camera-controls-third-horz #x1005) (camera-controls-third-vert #x1006) (restore-defaults #x1007) + (auto-save-disabled #x100c) (disable-auto-save-query #x100d) (disable-auto-save #x100e) (misc-options #x100f) @@ -608,6 +609,9 @@ (ps2-parts #x1022) (music-fadeout #x1023) (music-fadein #x1024) + (force-actors #x1025) + (force-background #x1026) + (force-envmap #x1027) (discord-rpc #x1030) (display-mode #x1031) (windowed #x1032) @@ -671,6 +675,7 @@ (cheat-sidekick-alt #x1094) (cheat-invinc #x1095) (cheat-tunes #x1096) + (cheat-sky #x1097) (music-player #x10c0) (scene-player #x10c1) (play-credits #x10c2) diff --git a/goal_src/jak1/engine/ui/text.gc b/goal_src/jak1/engine/ui/text.gc index a28192dbe0..7b6ee437c3 100644 --- a/goal_src/jak1/engine/ui/text.gc +++ b/goal_src/jak1/engine/ui/text.gc @@ -584,6 +584,8 @@ (none) ) +;; added (defun-debug game-text-id->string ((text game-text-id)) (enum->string game-text-id text) - ) \ No newline at end of file + ) + diff --git a/goal_src/jak1/pc/hud-classes-pc.gc b/goal_src/jak1/pc/hud-classes-pc.gc index 8ec52bae22..c7aba89fcf 100644 --- a/goal_src/jak1/pc/hud-classes-pc.gc +++ b/goal_src/jak1/pc/hud-classes-pc.gc @@ -318,11 +318,11 @@ ) (else ;; we want to be shown! + (false! (-> obj ready?)) ;; progress is open, let's leave. (when (and (not (-> obj kicked)) (= *master-mode* 'progress)) (true! (-> obj kicked)) - (false! (-> obj ready?)) (send-event obj 'hide-quick) ) diff --git a/goal_src/jak1/pc/pckernel-h.gc b/goal_src/jak1/pc/pckernel-h.gc index fa9fb491e6..13dff4c169 100644 --- a/goal_src/jak1/pc/pckernel-h.gc +++ b/goal_src/jak1/pc/pckernel-h.gc @@ -31,7 +31,7 @@ (defglobalconstant PC_KERNEL_VERSION_BUILD #x0001) (defglobalconstant PC_KERNEL_VERSION_REVISION #x0001) -(defglobalconstant PC_KERNEL_VERSION_MINOR #x0007) +(defglobalconstant PC_KERNEL_VERSION_MINOR #x0009) (defglobalconstant PC_KERNEL_VERSION_MAJOR #x0001) (defglobalconstant PC_KERNEL_VERSION (logior (ash PC_KERNEL_VERSION_MAJOR 48) @@ -267,6 +267,7 @@ ;; lod settings (ps2-lod-dist? symbol) ;; use original lod distances + (force-envmap? symbol) ;; dont use envmap fading (force max). (shrub-dist-mod float) ;; shrub render distance modifier (lod-dist-mod float) ;; non-shrub lod distance modifier (lod-force-tfrag int8) ;; tfrag lod tier override. 0 = highest detail @@ -300,12 +301,12 @@ (scenes-seen uint8 PC_SPOOL_LOG_LENGTH) ;; cutscenes that have been seen, by spool-anim (maybe use 8-char name or bits instead?) (discord-rpc? symbol) ;; enable discord rich presence integration - + (cheats pc-cheats) (cheats-known pc-cheats) (flava-hack int64) - + ;; TODO - save/restore original settings (language/sound/etc) ) @@ -416,17 +417,18 @@ (defmethod reset-gfx pc-settings ((obj pc-settings)) "Set the default graphics settings" - (set! (-> obj target-fps) 60) - (pc-get-screen-size -1 (&-> obj width) (&-> obj height)) + (set-frame-rate! obj 60) (set-aspect! obj 4 3) + (set-display-mode! obj 'windowed) + (set-size! obj PC_BASE_WIDTH PC_BASE_HEIGHT) + (set! (-> obj use-vis?) #f) (set! (-> obj aspect-ratio-auto?) #t) (set! (-> obj vsync?) #t) (set! (-> obj letterbox?) #t) + (pc-get-screen-size -1 (&-> obj width) (&-> obj height)) (set-display-mode! obj 'fullscreen) - (set-size! obj PC_BASE_WIDTH PC_BASE_HEIGHT) - (set! (-> obj gfx-msaa) 4) ;; 4x msaa (none)) @@ -460,6 +462,7 @@ (set! (-> obj ps2-hints?) #t) (set! (-> obj ps2-lod-dist?) #f) + (set! (-> obj force-envmap?) #t) (set! (-> obj shrub-dist-mod) 1.0) (set! (-> obj lod-dist-mod) 1.0) (set! (-> obj lod-force-tfrag) 0) @@ -485,7 +488,7 @@ (defmethod reset-original-camera pc-settings ((obj pc-settings)) "Set the original game's camera controls" - + (set! (-> obj first-camera-h-inverted?) #f) ;; first-person horizontal is NOT inverted in original game (set! (-> obj first-camera-v-inverted?) #t) ;; first-person vertical IS inverted in original game (set! (-> obj third-camera-h-inverted?) #t) ;; third person horizontal IS inverted in original game @@ -513,7 +516,7 @@ (set! (-> obj secrets hud-counters?) #t) (set! (-> obj secrets hud-watch?) #f) (set! (-> obj secrets watch-12hr?) #f) - + (set! (-> obj cheats) (pc-cheats)) (set! (-> obj cheats-known) (pc-cheats)) (none)) @@ -558,19 +561,19 @@ (desfun pc-cheat-encode (letters extra) "turn a cheat word into input names." (let ((out '())) - + (dolist (in letters) - + (let ((buttons (cadr (assoc (car in) *pc-cheat-map*)))) (dolist (button buttons) - + (set! out (cons (car button) out)) ) ) ) (dolist (ex extra) - + (set! out (cons (car ex) out)) ) (reverse out) @@ -589,10 +592,10 @@ (if (cpad-pressed? ,pad-idx ,x) ,(if (< i (- (length buttons) 1)) `(1+! ,cheat-var) - + `(begin ,@body (set! ,cheat-var 0)) ) - + (set! ,cheat-var 0) ) ) diff --git a/goal_src/jak1/pc/pckernel.gc b/goal_src/jak1/pc/pckernel.gc index 1674db3f8f..f2f888156d 100644 --- a/goal_src/jak1/pc/pckernel.gc +++ b/goal_src/jak1/pc/pckernel.gc @@ -108,19 +108,17 @@ ((60) (set! (-> obj target-fps) rate) (set! (-> *setting-control* default video-mode) 'ntsc) - (set-video-mode 'ntsc) ) ((100) (set! (-> obj target-fps) rate) (set! (-> *setting-control* default video-mode) '100fps) - (set-video-mode '100fps) ) ((150) (set! (-> obj target-fps) rate) (set! (-> *setting-control* default video-mode) '150fps) - (set-video-mode '150fps) ) ) + (set! (-> *setting-control* current video-mode) #f) rate) @@ -147,6 +145,7 @@ ) ) + (unless (or (zero? (-> obj real-width)) (zero? (-> obj real-height))) (let ((win-aspect (/ (the float (-> obj real-width)) (the float (-> obj real-height))))) (cond ((and (not (-> obj use-vis?)) (-> obj aspect-ratio-auto?)) @@ -171,7 +170,7 @@ (set! (-> obj lbox-height) (-> obj real-height)) ) ) - ) + )) (none)) @@ -397,37 +396,43 @@ (false! *sound-player-enable*) ) - ;; blue eco! - (when (and (pc-cheats? obj eco-blue) - (or (= (-> *target* fact-info-target eco-type) (pickup-type eco-blue)) - (<= (-> *target* fact-info-target eco-level) 0.0))) - (protect ((-> *target* event-hook)) - (set! (-> *target* event-hook) target-generic-event-handler) - (send-event *target* 'get-pickup (pickup-type eco-blue) (-> *FACT-bank* eco-full-inc)) - ) - (send-event *target* 'boost (-> *FACT-bank* eco-single-inc))) - - ;; yellow eco! - (when (and (pc-cheats? obj eco-yellow) - (or (= (-> *target* fact-info-target eco-type) (pickup-type eco-yellow)) - (<= (-> *target* fact-info-target eco-level) 0.0))) - (send-event *target* 'get-pickup (pickup-type eco-yellow) (-> *FACT-bank* eco-full-inc))) - - ;; red eco! - (when (and (pc-cheats? obj eco-red) - (or (= (-> *target* fact-info-target eco-type) (pickup-type eco-red)) - (<= (-> *target* fact-info-target eco-level) 0.0))) - (send-event *target* 'get-pickup (pickup-type eco-red) (-> *FACT-bank* eco-full-inc))) - - ;; green eco! - (when (and (pc-cheats? obj eco-green) - (or (= (-> *target* fact-info-target eco-type) (pickup-type eco-green)) - (<= (-> *target* fact-info-target eco-level) 0.0))) - (define-extern vent type) - (protect ((-> pp type) (-> *target* control root-prim prim-core action)) - (set! (-> pp type) vent) - (logior! (-> *target* control root-prim prim-core action) (collide-action ca-9)) - (send-event *target* 'get-pickup (pickup-type eco-green) (-> *FACT-bank* eco-full-inc))) + (cond + ;; green eco! + ((pc-cheats? obj eco-green) + (when (or (= (-> *target* fact-info-target eco-type) (pickup-type eco-green)) + (<= (-> *target* fact-info-target eco-level) 0.0)) + (define-extern vent type) + (protect ((-> pp type) (-> *target* control root-prim prim-core action)) + (set! (-> pp type) vent) + (logior! (-> *target* control root-prim prim-core action) (collide-action ca-9)) + (send-event *target* 'get-pickup (pickup-type eco-green) (-> *FACT-bank* eco-full-inc))) + ) + ) + ;; red eco! + ((pc-cheats? obj eco-red) + (when (or (= (-> *target* fact-info-target eco-type) (pickup-type eco-red)) + (<= (-> *target* fact-info-target eco-level) 0.0)) + (send-event *target* 'get-pickup (pickup-type eco-red) (-> *FACT-bank* eco-full-inc)) + ) + ) + ;; blue eco! + ((pc-cheats? obj eco-blue) + (when (or (= (-> *target* fact-info-target eco-type) (pickup-type eco-blue)) + (<= (-> *target* fact-info-target eco-level) 0.0)) + (protect ((-> *target* event-hook)) + (set! (-> *target* event-hook) target-generic-event-handler) + (send-event *target* 'get-pickup (pickup-type eco-blue) (-> *FACT-bank* eco-full-inc)) + ) + (send-event *target* 'boost (-> *FACT-bank* eco-single-inc)) + ) + ) + ;; yellow eco! + ((pc-cheats? obj eco-yellow) + (when (or (= (-> *target* fact-info-target eco-type) (pickup-type eco-yellow)) + (<= (-> *target* fact-info-target eco-level) 0.0)) + (send-event *target* 'get-pickup (pickup-type eco-yellow) (-> *FACT-bank* eco-full-inc)) + ) + ) ) )) @@ -757,7 +762,7 @@ ) (dosettings (file) (case-str *pc-temp-string* - (("fps") (set! (-> obj target-fps) (file-stream-read-int file))) + (("fps") (set-frame-rate! obj (file-stream-read-int file))) (("window-size") (set! (-> obj win-width) (file-stream-read-int file)) (set! (-> obj win-height) (file-stream-read-int file)) @@ -767,14 +772,19 @@ (set! (-> obj height) (file-stream-read-int file)) ) (("msaa") (set! (-> obj gfx-msaa) (file-stream-read-int file))) - (("aspect") (set-aspect! obj (file-stream-read-int file) (file-stream-read-int file))) - (("aspect-test") + (("aspect-state") + ;; game aspect + (set! (-> *setting-control* default aspect-ratio) (file-stream-read-symbol file)) + ;; aspect ratio (set! (-> obj aspect-custom-x) (file-stream-read-int file)) (set! (-> obj aspect-custom-y) (file-stream-read-int file)) + ;; aspect auto + (set! (-> obj aspect-ratio-auto?) (file-stream-read-symbol file)) + + (unless (-> obj aspect-ratio-auto?) + (set-aspect! obj (-> obj aspect-custom-x) (-> obj aspect-custom-y)) + ) ) - (("aspect-auto") (set! (-> obj aspect-ratio-auto?) (file-stream-read-symbol file))) - (("aspect-game") (set! (-> *setting-control* default aspect-ratio) (file-stream-read-symbol file))) - (("video-mode") (set! (-> *setting-control* default video-mode) (file-stream-read-symbol file))) (("display-mode") (set-display-mode! obj (file-stream-read-symbol file))) (("letterbox") (set! (-> obj letterbox?) (file-stream-read-symbol file))) (("vsync") (set! (-> obj vsync?) (file-stream-read-symbol file))) @@ -801,6 +811,7 @@ (("ps2-se?") (set! (-> obj ps2-se?) (file-stream-read-symbol file))) (("ps2-hints?") (set! (-> obj ps2-hints?) (file-stream-read-symbol file))) (("ps2-lod-dist?") (set! (-> obj ps2-lod-dist?) (file-stream-read-symbol file))) + (("force-envmap?") (set! (-> obj force-envmap?) (file-stream-read-symbol file))) (("force-actors?") (set! (-> obj force-actors?) (file-stream-read-symbol file))) (("music-fade?") (set! (-> obj music-fade?) (file-stream-read-symbol file))) (("use-vis?") (set! (-> obj use-vis?) (file-stream-read-symbol file))) @@ -888,11 +899,9 @@ (format file " (game-size ~D ~D)~%" (-> obj width) (-> obj height)) (format file " (msaa ~D)~%" (-> obj gfx-msaa)) (format file " (window-size ~D ~D)~%" (-> obj win-width) (-> obj win-height)) - (format file " (aspect ~D ~D)~%" (-> obj width) (-> obj height)) - (format file " (aspect-test ~D ~D)~%" (-> obj aspect-custom-x) (-> obj aspect-custom-y)) - (format file " (aspect-auto ~A)~%" (-> obj aspect-ratio-auto?)) - (format file " (aspect-game ~A)~%" (-> *setting-control* default aspect-ratio)) - (format file " (video-mode ~A)~%" (-> *setting-control* default video-mode)) + (format file " (aspect-state ~A ~D ~D ~A)~%" (-> *setting-control* default aspect-ratio) + (-> obj aspect-custom-x) (-> obj aspect-custom-y) + (-> obj aspect-ratio-auto?)) (format file " (display-mode ~A)~%" (-> obj display-mode)) (format file " (letterbox ~A)~%" (-> obj letterbox?)) (format file " (vsync ~A)~%" (-> obj vsync?)) @@ -921,6 +930,7 @@ (format file " (ps2-se? ~A)~%" (-> obj ps2-se?)) (format file " (ps2-hints? ~A)~%" (-> obj ps2-hints?)) (format file " (ps2-lod-dist? ~A)~%" (-> obj ps2-lod-dist?)) + (format file " (force-envmap? ~A)~%" (-> obj force-envmap?)) (format file " (music-fade? ~A)~%" (-> obj music-fade?)) (format file " (use-vis? ~A)~%" (-> obj use-vis?)) (format file " (skip-movies? ~A)~%" (-> obj skip-movies?)) diff --git a/goal_src/jak1/pc/progress-pc.gc b/goal_src/jak1/pc/progress-pc.gc index 7942473991..9004ee0c36 100644 --- a/goal_src/jak1/pc/progress-pc.gc +++ b/goal_src/jak1/pc/progress-pc.gc @@ -95,7 +95,7 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(define *main-options-auto-save* (new 'static 'boxed-array :type game-option +(define *main-options-pc* (new 'static 'boxed-array :type game-option (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id game-options) :scale #t :param3 (game-option-menu game-settings)) (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id graphic-options) :scale #t :param3 (game-option-menu graphic-settings)) (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id sound-options) :scale #t :param3 (game-option-menu sound-settings)) @@ -107,6 +107,19 @@ ) ) +(define *main-options-secrets* (new 'static 'boxed-array :type game-option + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id game-options) :scale #t :param3 (game-option-menu game-settings)) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id graphic-options) :scale #t :param3 (game-option-menu graphic-settings)) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id sound-options) :scale #t :param3 (game-option-menu sound-settings)) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id load-game) :scale #t :param3 (game-option-menu load-game)) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id save-game) :scale #t :param3 (game-option-menu save-game)) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id disable-auto-save) :scale #t :param3 (game-option-menu memcard-disable-auto-save)) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id secrets) :scale #t :param3 (game-option-menu secrets)) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id quit-game) :scale #t :param3 (game-option-menu quit)) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) + ) + (define *game-options-pc* (new 'static 'boxed-array :type game-option (new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id vibrations) :scale #t) (new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id play-hints) :scale #t) @@ -172,6 +185,8 @@ (new 'static 'game-option :option-type (game-option-type lod-bg) :name (game-text-id lod-bg) :scale #t) (new 'static 'game-option :option-type (game-option-type lod-fg) :name (game-text-id lod-fg) :scale #t) (new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id ps2-parts) :scale #t) + ;(new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id force-envmap) :scale #t) + ;(new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id force-actors) :scale #t) (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) ) ) @@ -190,9 +205,9 @@ ) (define *sound-options-pc* (new 'static 'boxed-array :type game-option - (new 'static 'game-option :name (game-text-id sfx-volume) :scale #t :param2 100.0) - (new 'static 'game-option :name (game-text-id music-volume) :scale #t :param2 100.0) - (new 'static 'game-option :name (game-text-id speech-volume) :scale #t :param2 100.0) + (new 'static 'game-option :name (game-text-id sfx-volume) :scale #t :param1 0.0 :param2 100.0) + (new 'static 'game-option :name (game-text-id music-volume) :scale #t :param1 0.0 :param2 100.0) + (new 'static 'game-option :name (game-text-id speech-volume) :scale #t :param1 0.0 :param2 100.0) ;(new 'static 'game-option :option-type (game-option-type on-off) :name (game-text-id music-fadein) :scale #t) (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) ) @@ -208,8 +223,28 @@ ) ) -(define *secrets-options* (new 'static 'boxed-array :type game-option +(define *secrets-title* (new 'static 'boxed-array :type game-option (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id music-player) :scale #t :param3 (game-option-menu music-player)) + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id cheats) :scale #t :param3 (game-option-menu cheats)) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) + ) + +(define *secrets* (new 'static 'boxed-array :type game-option + (new 'static 'game-option :option-type (game-option-type menu) :name (game-text-id cheats) :scale #t :param3 (game-option-menu cheats)) + (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) + ) + ) + +(define *cheats* (new 'static 'boxed-array :type game-option + (new 'static 'game-option :option-type (game-option-type cheat-toggle) :name (game-text-id cheat-eco-yellow) :scale #t :param1 3.0) + (new 'static 'game-option :option-type (game-option-type cheat-toggle) :name (game-text-id cheat-eco-blue) :scale #t :param1 2.0) + (new 'static 'game-option :option-type (game-option-type cheat-toggle) :name (game-text-id cheat-eco-red) :scale #t :param1 1.0) + (new 'static 'game-option :option-type (game-option-type cheat-toggle) :name (game-text-id cheat-eco-green) :scale #t :param1 0.0) + (new 'static 'game-option :option-type (game-option-type cheat-toggle) :name (game-text-id cheat-invinc) :scale #t :param1 4.0) + (new 'static 'game-option :option-type (game-option-type cheat-toggle) :name (game-text-id cheat-sidekick-alt) :scale #t :param1 5.0) + (new 'static 'game-option :option-type (game-option-type cheat-toggle) :name (game-text-id cheat-tunes) :scale #t :param1 6.0) + (new 'static 'game-option :option-type (game-option-type cheat-toggle) :name (game-text-id cheat-sky) :scale #t :param1 7.0) (new 'static 'game-option :option-type (game-option-type button) :name (game-text-id back) :scale #t) ) ) @@ -403,70 +438,49 @@ ;; get screen size (for capping) (pc-get-screen-size -1 (the (pointer int32) (& sx)) (the (pointer int32) (& sy))) - (case display-mode - #|(('fullscreen) - ;; insert psyched out trollface here - (set! sx 0) - (set! sy 0) - (countdown (i (pc-get-screen-vmode-count)) - (let ((thisx 0) (thisy 0)) - (pc-get-screen-size i (the (pointer int32) (& thisx)) (the (pointer int32) (& thisy))) + ;; extra button when fullscreen + (when (not skip?) + (add-resolution-option sx sy) + (set! (-> *temp-options* (1- (length *temp-options*)) name) (game-text-id fit-to-screen)) + ) - (when (not (and (= thisx sx) (= thisy sy))) - (add-resolution-option thisx thisy) - ) - (set! sx thisx) - (set! sy thisy) - ) - ) - )|# + ;; supersampling in fullscreen and stuff. this results in way too many resolution options lol. + (when (!= display-mode 'windowed) + (*! sx 4) + (*! sy 4) + (*! mult 4) + ) - (else - ;; extra button when fullscreen - (when (not skip?) - (add-resolution-option sx sy) - (set! (-> *temp-options* (1- (length *temp-options*)) name) (game-text-id fit-to-screen)) - ) + ;; game aspect ratio + (let ((aspect (-> *pc-settings* aspect-ratio))) - ;; supersampling in fullscreen and stuff. this results in way too many resolution options lol. - (when (!= display-mode 'windowed) - (*! sx 4) - (*! sy 4) - (*! mult 4) - ) + (until (or done? (= (length *temp-options*) max-options)) + (countdown (i (-> *resolutions* length)) + (let* ((thisr (the int (* mult (the float (-> *resolutions* i))))) + (thisx (the int (* aspect (the float thisr)))) + (thisy thisr) + ) - ;; game aspect ratio - (let ((aspect (-> *pc-settings* aspect-ratio))) + (when (and (not skip?) (< (length *temp-options*) max-options) + (<= thisy sy) (<= thisx sx) + (= aspect (/ (the float thisx) (the float thisy))) + (>= thisx PC_MIN_WIDTH) (>= thisy PC_MIN_HEIGHT)) + (add-resolution-option thisx thisy) + )) + (false! skip?) + ) - (until (or done? (= (length *temp-options*) max-options)) - (countdown (i (-> *resolutions* length)) - (let* ((thisr (the int (* mult (the float (-> *resolutions* i))))) - (thisx (the int (* aspect (the float thisr)))) - (thisy thisr) - ) - - (when (and (not skip?) (< (length *temp-options*) max-options) - (<= thisy sy) (<= thisx sx) - (= aspect (/ (the float thisx) (the float thisy))) - (>= thisx PC_MIN_WIDTH) (>= thisy PC_MIN_HEIGHT)) - (add-resolution-option thisx thisy) - )) - (false! skip?) - ) - - (if (> mult GAME_MIN_RES_MULT) - (/! mult 2) - (true! done?)) - )) - ) - ) + (if (> mult GAME_MIN_RES_MULT) + (/! mult 2) + (true! done?)) + )) ;; extra funny options (when (and (!= display-mode 'windowed) (< (length *temp-options*) (- (-> *temp-options* allocated-length) 3))) (add-resolution-option 512 224) (add-resolution-option 512 448) ) - + (add-back-option) ) @@ -605,7 +619,12 @@ ) ;; set up options for each screen - (set! (-> *options-remap* (progress-screen settings)) *main-options*) + (when (>= (calculate-completion (the progress #f)) 100.0) + (logior! (-> *pc-settings* cheats-known) (pc-cheats eco-blue eco-red eco-green eco-yellow sidekick-blue invinc tunes sky)) + ) + (set! (-> *options-remap* (progress-screen settings)) (if (or *cheat-mode* (nonzero? (-> *pc-settings* cheats-known))) + *main-options-secrets* + *main-options-pc*)) (set! (-> *options-remap* (progress-screen game-settings)) *game-options-pc*) (let ((max-refresh-rate (pc-get-screen-rate -1))) (cond @@ -656,7 +675,8 @@ (set! (-> *options-remap* (progress-screen resolution)) *temp-options*) (set! (-> *options-remap* (progress-screen aspect-ratio)) *aspect-ratio-options*) (set! (-> *options-remap* (progress-screen quit-title)) *yes-no-options*) - (set! (-> *options-remap* (progress-screen secrets)) *secrets-options*) + (set! (-> *options-remap* (progress-screen secrets)) *secrets-title*) + (set! (-> *options-remap* (progress-screen cheats)) *cheats*) (set! (-> *options-remap* (progress-screen music-player)) *music-player-options*) (set! (-> *options-remap* (progress-screen flava-player)) *temp-options*) (set! (-> *options-remap* (progress-screen memcard-disable-auto-save)) *yes-no-options*) @@ -706,14 +726,26 @@ (set! (-> *gfx-ps2-options* 0 value-to-modify) (&-> *progress-carousell* int-backup)) (set! (-> *gfx-ps2-options* 1 value-to-modify) (&-> *progress-carousell* int-backup)) (set! (-> *gfx-ps2-options* 2 value-to-modify) (&-> *pc-settings* ps2-parts?)) + ;(set! (-> *gfx-ps2-options* 3 value-to-modify) (&-> *pc-settings* force-envmap?)) + ;(set! (-> *gfx-ps2-options* 3 value-to-modify) (&-> *pc-settings* force-actors?)) (set! (-> *sound-options-pc* 0 value-to-modify) (&-> *setting-control* default sfx-volume)) (set! (-> *sound-options-pc* 1 value-to-modify) (&-> *setting-control* default music-volume)) (set! (-> *sound-options-pc* 2 value-to-modify) (&-> *setting-control* default dialog-volume)) + (set! (-> *cheats* 0 value-to-modify) (&-> *progress-carousell* symbol-backup)) + (set! (-> *cheats* 1 value-to-modify) (&-> *progress-carousell* symbol-backup)) + (set! (-> *cheats* 2 value-to-modify) (&-> *progress-carousell* symbol-backup)) + (set! (-> *cheats* 3 value-to-modify) (&-> *progress-carousell* symbol-backup)) + (set! (-> *cheats* 4 value-to-modify) (&-> *progress-carousell* symbol-backup)) + (set! (-> *cheats* 5 value-to-modify) (&-> *progress-carousell* symbol-backup)) + (set! (-> *cheats* 6 value-to-modify) (&-> *progress-carousell* symbol-backup)) + (set! (-> *cheats* 7 value-to-modify) (&-> *progress-carousell* symbol-backup)) ;(set! (-> *sound-options-pc* 3 value-to-modify) (&-> *pc-settings* music-fadein?)) + (set! (-> *progress-carousell* aspect-native-choice) (-> *pc-settings* use-vis?)) ;; scroll stuff! (progress-scroll-reset) + (none) ) @@ -735,10 +767,10 @@ (((progress-screen flava-player)) (build-flava-player-options *progress-music*) ) - (((progress-screen settings)) - (if (-> *setting-control* default auto-save) - (set! (-> *options-remap* (progress-screen settings)) *main-options-auto-save*) - (set! (-> *options-remap* (progress-screen settings)) *main-options*)) + (((progress-screen secrets)) + (if (= (-> obj display-state-stack 0) (progress-screen title)) + (set! (-> *options-remap* (-> obj display-state)) *secrets-title*) + (set! (-> *options-remap* (-> obj display-state)) *secrets*)) ) ) ;; run nav code @@ -805,7 +837,8 @@ (((game-option-type on-off) (game-option-type yes-no) (game-option-type normal-inverted) - (game-option-type aspect-native)) + (game-option-type aspect-native) + (game-option-type cheat-toggle)) ;; pressed left on an on/off yes/no option (when (not (-> (the-as (pointer uint32) (-> options (-> obj option-index) value-to-modify)))) ;; it was on 'off' or 'no' @@ -915,7 +948,7 @@ (game-option-type yes-no) (game-option-type normal-inverted) (game-option-type aspect-native) - ) + (game-option-type cheat-toggle)) ;; play sound if it was on 'yes' because we're going to 'no' now (set! sound? (-> (the-as (pointer symbol) (-> options (-> obj option-index) value-to-modify)))) ;; set to no @@ -1020,6 +1053,11 @@ (set! (-> (the-as (pointer symbol) (-> options (-> obj option-index) value-to-modify))) (-> *progress-state* on-off-backup)) ) + (((game-option-type cheat-toggle)) + (if (-> *progress-state* on-off-backup) + (logior! (-> *pc-settings* cheats) (ash 1 (the int (-> options (-> obj option-index) param1)))) + (logclear! (-> *pc-settings* cheats) (ash 1 (the int (-> options (-> obj option-index) param1))))) + ) ) ;; ding (sound-play "cursor-options") @@ -1055,36 +1093,22 @@ ;; go to a menu (cpad-clear! 0 x) (cpad-clear! 0 circle) - (push! obj) - (sound-play "select-option") - (set! (-> obj next-display-state) (the-as progress-screen (-> options (-> 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) (set-memcard-screen obj (-> obj next-display-state))) - ) + (cond + ((and (not (-> *setting-control* default auto-save)) + (= (game-text-id disable-auto-save) (-> options (-> obj option-index) name))) + (sound-play "cursor-options") ) - ) - ((= (-> options (-> obj option-index) option-type) (game-option-type button-music)) - ;; go to the music+flava player - (when (find-music-log (progress-get-music-by-index (-> obj option-index))) - (cpad-clear! 0 x) - (cpad-clear! 0 circle) - (set! *progress-music* (-> obj option-index)) + (else (push! obj) (sound-play "select-option") - (set! (-> obj next-display-state) (progress-screen flava-player)) - ) - ) - ((= (-> options (-> obj option-index) option-type) (game-option-type button-flava)) - ;; set flava - (when (find-flava-log (progress-get-music-by-index *progress-music*) (the int (-> options (-> obj option-index) param1))) - (cpad-clear! 0 x) - (cpad-clear! 0 circle) - (set-setting *setting-control* obj 'music (progress-get-music-by-index *progress-music*) 0.0 0) - (set! *progress-flava* (the int (-> options (-> obj option-index) param1))) - (sound-group-continue (sound-group music)) - (sound-play "select-option") + (set! (-> obj next-display-state) (the-as progress-screen (-> options (-> 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) (set-memcard-screen obj (-> obj next-display-state))) + ) + ) ) + ) ) ((= (-> options (-> obj option-index) option-type) (game-option-type button)) ;; a button. what? @@ -1115,6 +1139,28 @@ (commit-to-file *pc-settings*) ;; other behaviors are hardcoded elsewhere because screw you. ) + ((= (-> options (-> obj option-index) option-type) (game-option-type button-music)) + ;; go to the music+flava player + (when (find-music-log (progress-get-music-by-index (-> obj option-index))) + (cpad-clear! 0 x) + (cpad-clear! 0 circle) + (set! *progress-music* (-> obj option-index)) + (push! obj) + (sound-play "select-option") + (set! (-> obj next-display-state) (progress-screen flava-player)) + ) + ) + ((= (-> options (-> obj option-index) option-type) (game-option-type button-flava)) + ;; set flava + (when (find-flava-log (progress-get-music-by-index *progress-music*) (the int (-> options (-> obj option-index) param1))) + (cpad-clear! 0 x) + (cpad-clear! 0 circle) + (set-setting *setting-control* obj 'music (progress-get-music-by-index *progress-music*) 0.0 0) + (set! *progress-flava* (the int (-> options (-> obj option-index) param1))) + (sound-group-continue (sound-group music)) + (sound-play "select-option") + ) + ) ((= (-> options (-> obj option-index) option-type) (game-option-type resolution)) ;; resolution button. change resolution! (let ((newx (the int (-> options (-> obj option-index) param1))) @@ -1161,6 +1207,12 @@ (commit-to-file *pc-settings*) (set! (-> obj next-display-state) (progress-screen invalid)) ) + ((and (= (-> options (-> obj option-index) option-type) (game-option-type cheat-toggle)) + (not (logtest? (-> *pc-settings* cheats-known) (ash 1 (the int (-> options (-> obj option-index) param1)))))) + (sound-play "cursor-options") + (if (and (= *cheat-mode* 'debug) (cpad-hold? 0 l1) (cpad-hold? 0 r1)) + (logior! (-> *pc-settings* cheats-known) (ash 1 (the int (-> options (-> obj option-index) param1))))) + ) ((!= (-> options (-> obj option-index) option-type) (game-option-type yes-no)) ;; not yes-no ;; set backups! we're entering some toggle or whatever @@ -1177,6 +1229,10 @@ (set! (-> *progress-state* on-off-backup) (-> (the-as (pointer symbol) (-> options (-> obj option-index) value-to-modify)))) ) + (((game-option-type cheat-toggle)) + (set! (-> *progress-state* on-off-backup) (logtest? (-> *pc-settings* cheats) (ash 1 (the int (-> options (-> obj option-index) param1))))) + (set! (-> (the-as (pointer symbol) (-> options (-> obj option-index) value-to-modify))) (-> *progress-state* on-off-backup)) + ) (((game-option-type display-mode)) ;; display-mode just reuses language stuff (case (pc-get-fullscreen) @@ -1272,6 +1328,11 @@ (sound-play "start-options") (set! (-> obj selected-option) #f) (case (-> options (-> obj option-index) option-type) + (((game-option-type cheat-toggle)) + (if (-> (the (pointer symbol) (-> options (-> obj option-index) value-to-modify))) + (logior! (-> *pc-settings* cheats) (ash 1 (the int (-> options (-> obj option-index) param1)))) + (logclear! (-> *pc-settings* cheats) (ash 1 (the int (-> options (-> obj option-index) param1))))) + ) (((game-option-type aspect-ratio)) ;; aspect ratio is first written to the backup. so this is for applying the change if we went through with it. (set! (-> *setting-control* default aspect-ratio) (-> (the-as (pointer symbol) (-> options (-> obj option-index) value-to-modify)))) @@ -1641,6 +1702,9 @@ (set! option-str (lookup-text! *common-text* (-> options index name) #f)) (set! option-str (the-as string #f)) ) + (if (and (not (-> *setting-control* default auto-save)) + (= (game-text-id disable-auto-save) (-> options index name))) + (set! option-str (lookup-text! *common-text* (game-text-id auto-save-disabled) #f))) ) (((game-option-type button-music)) ;; a button for the music player. has the text "locked" sometimes! @@ -1685,7 +1749,9 @@ (set! option-str (string-format "~D" (the int (-> (the-as (pointer float) (-> options index value-to-modify)))))) (set! option-x (+ (the int (* 2.5 (-> (the-as (pointer float) (-> options index value-to-modify))))) -100)) ) - (((game-option-type on-off) (game-option-type normal-inverted) (game-option-type aspect-native)) + (((game-option-type on-off) + (game-option-type normal-inverted) + (game-option-type aspect-native)) ;; on-off option or some other toggle. same logic as yes-no. changed to cut down code duping. (let ( (on-str (case (-> options index option-type) @@ -1707,6 +1773,19 @@ ) ) ) + (((game-option-type cheat-toggle)) + (cond + ((not (logtest? (-> *pc-settings* cheats-known) (ash 1 (the int (-> options index param1))))) + (set! option-str (lookup-text! *common-text* (game-text-id locked) #f)) + ) + (else + (if (-> (the-as (pointer symbol) (-> options index value-to-modify))) + (set! option-str (string-format "~30L~S~0L ~S" (lookup-text! *common-text* (game-text-id on) #f) (lookup-text! *common-text* (game-text-id off) #f))) + (set! option-str (string-format "~0L~S ~30L~S" (lookup-text! *common-text* (game-text-id on) #f) (lookup-text! *common-text* (game-text-id off) #f))) + ) + ) + ) + ) (((game-option-type display-mode) (game-option-type msaa) (game-option-type lod-bg) @@ -1818,6 +1897,20 @@ (lookup-text! *common-text* (game-text-id off) #f) ))) ) + (((game-option-type cheat-toggle)) + (cond + ((not (logtest? (-> *pc-settings* cheats-known) (ash 1 (the int (-> options index param1))))) + (set! option-str (lookup-text! *common-text* (game-text-id locked) #f)) + ) + (else + (set! option-str (string-format "~S: ~S" (lookup-text! *common-text* (-> options index name) #f) + (if (logtest? (-> *pc-settings* cheats) (ash 1 (the int (-> options index param1)))) + (lookup-text! *common-text* (game-text-id on) #f) + (lookup-text! *common-text* (game-text-id off) #f) + ))) + ) + ) + ) (((game-option-type language)) ;; language options show their text + language name (set! option-str (string-format "~S: ~S" (lookup-text! *common-text* (-> options index name) #f) @@ -1867,6 +1960,10 @@ (string= (lookup-text! *common-text* (game-text-id locked) #f) option-str)) ;; hacky.. ;; for "locked" options! (font-color flat-dark-purple)) + ((and (!= index (-> obj option-index)) + (not (-> *setting-control* default auto-save)) + (= (game-text-id disable-auto-save) (-> options index name))) + (font-color flat-dark-purple)) ((and (= index (-> obj option-index)) (not (or (progress-scrolling?) (-> obj in-transition)))) (font-color yellow-green-2)) @@ -2045,6 +2142,7 @@ (progress-screen resolution) (progress-screen aspect-ratio) (progress-screen secrets) + (progress-screen cheats) ) (hide-progress-icons) (draw-options self 115 25 0.82) diff --git a/goal_src/jak1/pc/subtitle.gc b/goal_src/jak1/pc/subtitle.gc index 654faf7892..67b50bc15d 100644 --- a/goal_src/jak1/pc/subtitle.gc +++ b/goal_src/jak1/pc/subtitle.gc @@ -682,7 +682,7 @@ ;; set font settings. (set! (-> self font origin x) (* (- 1.0 (-> *SUBTITLE-bank* width)) 256)) - (set! (-> self font origin y) (* (if (-> self hint-subtitle?) + (set! (-> self font origin y) (* (if (not (movie?)) (-> *SUBTITLE-bank* hint-height) (-> *SUBTITLE-bank* height) ) 224))