Files
jak-project/goal_src/jak1/pc/pckernel-impl.gc
Tyler Wilding af6de539b5 jak1/jak2: Persist sound settings, play-hints, subtitles and vibration settings in pc-settings instead of the memory card file (#3612)
In the original game, they had no choice but to use the memory card file
as their method of persisting settings. We are not limited by such
things.

It's inconvenient to have to load your save-file when launching the game
to initialize these settings to your liking, it's also confusing
behaviour to even some players that have played the game heavily for
over a decade. We can do better by globally saving these settings to the
`pc-settings` file instead.

Originally I only migrated the volume settings, then i figured it would
be nice to also have play-hints and subtitles settings persisted. More
could debatably be moved (language is a big one...) but these were the
low hanging fruit.

I also reduced the default volumes as that is something else that has
come up a few times.
2024-07-31 00:01:18 -04:00

180 lines
5.6 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
(require "pc/pckernel-h.gc")
#| This file has the game-specific implementation of the pckernel (see pckernel-h.gc and pckernel.gc). |#
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; constants
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; version: 1.10.4.0
(defconstant PC_KERNEL_VERSION (static-pckernel-version 1 10 4 0))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; types and enums
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; pc enum for languages. this is the game's languages + custom ones.
(defenum pc-language
:type uint16
(english 0)
(french 1)
(german 2)
(spanish 3)
(italian 4)
(japanese 5)
(uk-english 6)
;; custom
(portuguese 7)
(finnish 8)
(swedish 9)
(danish 10)
(norwegian 11)
(dutch 12)
(br-portuguese 13)
(hungarian 14)
(catalan 15)
(icelandic 16)
(korean 17)
(russian 18)
(polish 19)
(lithuanian 20)
(custom 999) ;; temp
)
;; concept arts
(defenum pc-jak1-concept-art
:bitfield #t
:type uint64
(test))
;; secrets and goodies
(deftype pc-game-secrets (structure)
((art pc-jak1-concept-art) ;; concept art unlocked
(music pc-music-log-entry PC_MUSIC_LOG_LENGTH :inline)
(hard-fish-hiscore int32)
(hard-rats? symbol) ;; enable this crap
(hard-rats-hiscore int32)
(hard-rats-hiwave int32)
(hero-mode? symbol) ;; unsure how this should work
(hud-map? symbol) ;; enable map in HUD/progress?
(hud-counters? symbol) ;; enable level orb counter/global buzzer counter?
(hud-watch? symbol) ;; a watch that tells the time of day!
(watch-12hr? symbol) ;; 12-hour clock toggle
)
:pack-me)
;; The Jak 1 version of the pc-settings object.
(deftype pc-settings-jak1 (pc-settings)
((cheats pc-cheats)
(cheats-known pc-cheats)
(skip-movies? symbol) ;; if on, enable cutscene skipping
(subtitles? symbol) ;; if on, cutscene subtitles will show up
(text-language pc-language) ;; language for game text
(subtitle-language pc-language) ;; language for subtitles
(money-starburst? symbol) ;; add a starburst to the money
(extra-hud? symbol) ;; extra hud elements.
(secrets pc-game-secrets :inline) ;; hidden goodies and additional secrets!
(scenes-seen uint8 PC_SPOOL_LOG_LENGTH) ;; cutscenes that have been seen, by spool-anim (maybe use 8-char name or bits instead?)
(memcard-play-hints? symbol)
))
(define *pc-settings* (the pc-settings-jak1 #f))
;; jak 1 discord rpc structure
(deftype discord-info (structure)
((fuel (pointer float))
(money-total (pointer float))
(buzzer-total (pointer float))
(deaths (pointer int32))
(status string)
(level string)
(cutscene? symbol)
(ogreboss? symbol)
(plant-boss? symbol)
(racer? symbol)
(flutflut? symbol)
(time-of-day (pointer float))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; debug settings
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define *fallback-text-lookup?* #t)
(define *display-bug-report* #f)
(define *mood-override-debug* #f)
(define *mood-override-table* (new 'global 'inline-array 'float 8))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; resets
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defmethod reset-misc ((obj pc-settings-jak1) (call-handlers symbol))
"Set the default misc settings"
((method-of-type pc-settings reset-misc) obj call-handlers)
(set! (-> obj text-language) (the pc-language (scf-get-language)))
(set! (-> obj subtitle-language) (the pc-language (scf-get-language)))
(set! (-> obj skip-movies?) #t)
(set! (-> obj subtitles?) *debug-segment*)
(cond
((and (= *default-territory* GAME_TERRITORY_SCEE) (= (-> obj text-language) (pc-language english)))
(set! (-> obj text-language) (pc-language uk-english))
;(set! (-> obj subtitle-language) (pc-language uk-english))
)
((= *default-territory* GAME_TERRITORY_SCEI)
(set! (-> obj text-language) (pc-language japanese))
;(set! (-> obj subtitle-language) (pc-language japanese))
)
(else))
(set! (-> obj money-starburst?) #f)
(set! (-> obj extra-hud?) #f)
;; original settings, minus 25 to be a bit more conservative
(set! (-> obj memcard-volume-sfx) 50.0)
(set! (-> obj memcard-volume-music) 40.0)
(set! (-> obj memcard-volume-dialog) 75.0)
(set! (-> obj memcard-vibration?) #t)
(set! (-> obj memcard-play-hints?) #t)
0)
(defmethod reset-extra ((obj pc-settings-jak1) (call-handlers symbol))
"Set the default goodies settings"
((method-of-type pc-settings reset-extra) obj call-handlers)
(set! (-> obj cheats) (pc-cheats))
(set! (-> obj cheats-known) (pc-cheats))
(dotimes (i PC_SPOOL_LOG_LENGTH)
(set! (-> obj scenes-seen i) 0))
(dotimes (i PC_MUSIC_LOG_LENGTH)
(set! (-> obj secrets music i name) #f)
(set! (-> obj secrets music i flava-mask) 0))
(set! (-> obj secrets art) (pc-jak1-concept-art))
(set! (-> obj secrets hard-fish-hiscore) 0)
(set! (-> obj secrets hard-rats-hiscore) 0)
(set! (-> obj secrets hard-rats-hiwave) 0)
(set! (-> obj secrets hard-rats?) #f)
(set! (-> obj secrets hero-mode?) #f)
(set! (-> obj secrets hud-map?) #t)
(set! (-> obj secrets hud-counters?) #t)
(set! (-> obj secrets hud-watch?) #f)
(set! (-> obj secrets watch-12hr?) #f)
0)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; other
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun get-video-params ()
*video-parms*)
;; for debugging
(defenum pc-pat-skip-hack
:bitfield #t
(noentity 0)
(nocamera 1)
(noedge 2)
(nolineofsight 12)
(unknowncamera 13))