mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 21:27:52 -04:00
61c4fc4b91
Fixes #2983
225 lines
5.6 KiB
Common Lisp
225 lines
5.6 KiB
Common Lisp
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
#|
|
|
This file has the game-specific implementation of the pckernel (see pckernel-h.gc and pckernel.gc).
|
|
|#
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
;;;; constants
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
|
;; version: 1.10.3.1
|
|
(defconstant PC_KERNEL_VERSION (static-pckernel-version 1 10 3 1))
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
;;;; types and enums
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
|
;; cheats
|
|
(defconstant PC_CHEAT_MAX 18) ;; number of cheats
|
|
(defenum pc-cheats
|
|
:bitfield #t
|
|
:type uint64
|
|
(eco-green)
|
|
(eco-red)
|
|
(eco-blue)
|
|
(eco-yellow)
|
|
(invinc)
|
|
(sidekick-blue)
|
|
(tunes)
|
|
(sky)
|
|
(mirror)
|
|
(big-head)
|
|
(small-head)
|
|
(big-fist)
|
|
(no-tex)
|
|
(hard-rats)
|
|
(hero-mode)
|
|
(huge-head)
|
|
(big-head-npc)
|
|
(oh-my-goodness)
|
|
)
|
|
|
|
;; 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)
|
|
|
|
(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?)
|
|
)
|
|
)
|
|
|
|
(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 pc-settings-jak1 ((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)
|
|
0)
|
|
|
|
(defmethod reset-extra pc-settings-jak1 ((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)
|
|
)
|
|
|