Files
jak-project/goal_src/jakx/engine/game/settings-h.gc
T
2026-06-15 09:56:10 -04:00

525 lines
16 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: settings-h.gc
;; name in dgo: settings-h
;; dgos: ENGINE, GAME
(declare-type setting-control structure)
(define-extern *setting-control* setting-control)
;; +++cam-master-options
(defenum cam-master-options
:type uint64
:bitfield #t
(HAVE_TARGET) ;; 1
(SET_COMBINER_AXIS) ;; 2
(FLIP_COMBINER) ;; 4
(HAVE_EASE_TO_POS) ;; 8
(IN_BASE_REGION) ;; 10
(IGNORE_ANALOG) ;; 20
(BLOCK_RIGHT_STICK) ;; 40
(USE_L1_R1) ;; 80
(READ_BUTTONS)
(IMMEDIATE_STRING_MIN_MAX)
)
;; ---cam-master-options
;; +++cam-slave-options
(defenum cam-slave-options
:type uint64
:bitfield #t
(BUTT_CAM)
(SAME_SIDE)
(MOVE_SPHERICAL)
(ALLOW_Z_ROT)
(JUMP_PITCHES)
(COLLIDE)
(FIND_HIDDEN_TARGET)
(DRAG)
(PLAYER_MOVING_CAMERA)
(LINE_OF_SIGHT)
(MOVEMENT_BLOCKED)
(SHRINK_MAX_ANGLE)
(GOTO_GOOD_POINT)
(BIKE_MODE)
(NO_ROTATE)
(STICKY_ANGLE)
(BLOCK_RIGHT_STICK)
(ALLOW_SHIFT_BUTTONS)
(GUN_CAM)
(WIDE_FOV)
(RAPID_TRACKING)
(EASE_SPLINE_IDX)
(VERTICAL_FOLLOW_MATCHES_CAMERA)
(HAVE_BUTT_HANDLE)
(BOMBBOT)
(JUMP_LAG)
)
;; ---cam-slave-options
;; +++game-feature
(defenum game-feature
:type uint64
:bitfield #t
(feature0 0)
(feature1 1)
(feature2 2)
(feature3 3)
(feature4 4)
(gun 5)
(gun-red-1 6)
(gun-red-2 7)
(gun-red-3 8)
(gun-yellow-1 9)
(gun-yellow-2 10)
(gun-yellow-3 11)
(gun-blue-1 12)
(gun-blue-2 13)
(gun-blue-3 14)
(gun-dark-1 15)
(gun-dark-2 16)
(gun-dark-3 17)
(board 18)
(feature19 19)
(sidekick 20)
(feature21 21)
(feature22 22)
(gun-upgrade-yellow-ammo-1 23)
(gun-upgrade-yellow-ammo-2 24)
(gun-upgrade-red-ammo-1 25)
(gun-upgrade-red-ammo-2 26)
(gun-upgrade-blue-ammo-1 27)
(gun-upgrade-blue-ammo-2 28)
(gun-upgrade-dark-ammo-1 29)
(gun-upgrade-dark-ammo-2 30)
(feature31 31)
(feature32 32)
(feature33 33)
(feature34 34)
(feature35 35)
(feature36 36)
(board-launch 37)
(board-trail 38)
(board-zap 39)
(darkjak 40)
(darkjak-smack 41)
(darkjak-bomb0 42)
(darkjak-bomb1 43)
(darkjak-tracking 44)
(darkjak-invinc 45)
(lightjak 46)
(lightjak-regen 47)
(lightjak-swoop 48)
(lightjak-freeze 49)
(lightjak-shield 50)
(artifact-invis 51)
(armor0 52)
(armor1 53)
(armor2 54)
(armor3 55)
(jakc 56)
(lighteco 57)
(darkeco 58)
(feature59 59)
(feature60 60)
(feature61 61)
(feature62 62)
(feature63 63)
)
;; ---game-feature
;; +++game-secrets
(defenum game-secrets
:type uint64
:bitfield #t
(hero-mode 0)
)
;; ---game-secrets
(defmacro setting-control-func! (func s &rest args)
(let ((argb #f)
(argi 0)
(argf 0.0)
(setting (car s)))
(cond
(#t
(set! argb (car args))
(set! argf (cadr args))
(set! argi (caddr args))
)
)
`(,func *setting-control* (with-pp pp) ,s ,argb ,argf ,argi)
)
)
(defmacro add-setting! (s &rest args)
`(setting-control-func! add-setting ,s ,@args)
)
(defmacro set-setting! (s &rest args)
`(setting-control-func! set-setting ,s ,@args)
)
(defmacro remove-setting! (s)
`(remove-setting *setting-control* (with-pp pp) ,s)
)
;; +++game-score
(defenum game-score
:type uint64
(none)
(gs0)
(gs1)
(gs2)
(gs3)
(gs4)
(gs5)
(gs6)
(gs7)
(gs8)
(gs9)
(gs10)
(gs11)
(gs12)
(gs13)
(gs14)
(gs15)
(gs16)
(gs17)
(gs18)
(gs19)
(gs20)
)
;; ---game-score
;; +++game-vehicles
(defenum game-vehicles
:type uint64
:bitfield #t
(v-turtle 0)
(v-snake 1)
(v-scorpion 2)
(v-toad 3)
(v-fox 4)
(v-rhino 5)
(v-mirage 6)
(v-x-ride 7)
)
;; ---game-vehicles
(declare-type resetter-spec structure)
;; +++game-vehicle-u8
(defenum game-vehicle-u8
:type uint8
:bitfield #t
:copy-entries game-vehicles
)
;; ---game-vehicle-u8
(defmacro language? (&rest langs)
"is the current language any of the ones specified?"
`(or ,@(apply (lambda (x) `(= (-> *setting-control* user-default language) (language-enum ,x))) langs)))
(defmacro text-language? (&rest langs)
"is the current language any of the ones specified?"
`(or ,@(apply (lambda (x) `(= (-> *pc-settings* text-language) (pc-language ,x))) langs)))
;; DECOMP BEGINS
(define *settings-dialog-volume* 0.95)
(define *settings-music-volume* 0.7)
(define *settings-sfx-volume* 0.75)
(define *settings-music-seek-speed* 2.0)
(deftype user-setting-data (structure)
((border-mode symbol)
(process-mask process-mask)
(common-page int32)
(language language-enum)
(unknown-usd-1 int32)
(unknown-usd-2 int32)
(unknown-usd-3 int32)
(unknown-usd-4 int32)
(movie (pointer process))
(talking (pointer process))
(spooling (pointer process))
(hint (pointer process))
(ambient (pointer process))
(video-mode symbol)
(aspect-ratio symbol)
(unknown-usd-5 int32)
(unknown-usd-6 int32)
(unknown-usd-7 int32)
(auto-save symbol)
(unknown-usd-8 int32)
(bg-r float)
(bg-g float)
(bg-b float)
(bg-a float)
(bg-a-speed float)
(bg-a-force float)
(blur-a float)
(blur-a-speed float)
(allow-progress symbol)
(allow-in-game-menu basic)
(allow-pause symbol)
(unknown-usd-9 int32)
(unknown-usd-10 int32)
(unknown-usd-11 int32)
(movie-name symbol)
(weather symbol)
(unknown-usd-12 int32)
(unknown-usd-13 int32)
(unknown-usd-14 int32)
(task-mask task-mask)
(unknown-usd-15 int32)
(speed-mult float)
(features uint64)
(vehicles uint64)
(sfx-volume float)
(sfx-volume-movie float)
(music-volume float)
(music-volume-movie float)
(dialog-volume float)
(dialog-volume-talker float)
(ambient-volume float)
(ambient-volume-movie float)
(dynamic-ambient-volume float)
(talker-volume float)
(mode-sound-bank uint32)
(sound-reverb float)
(sound-reverb-mode int32)
(sound-reverb-seek-speed float)
(stereo-mode int32)
(music symbol)
(spool-anim spool-anim)
(task-manager (pointer process))
(task symbol)
(airlock symbol)
(minimap uint32)
(allow-continue symbol)
(unknown-usd-16 int32)
(unknown-usd-17 int32)
(subtitle symbol)
(doorway symbol)
(gem symbol)
(half-speed symbol)
(gun-buoy symbol)
(double-jump symbol)
(pilot symbol)
(pilot-exit symbol)
(pilot-death symbol)
(speech-control symbol)
(vehicle-hijacking symbol)
(endlessfall symbol)
(rain float)
(snow float)
(exclusive-load symbol)
(render symbol)
(allow-timeout symbol)
(mirror symbol)
(movie-skip-frame float)
(allow-blackout symbol)
(race-minimap int32)
(beard symbol)
(ignore-target symbol)
(subtitle-language uint8)
(sound-bank-load symbol)
(allow-error symbol)
(under-water-pitch-mod float)
(unknown-usd-18 int32)
(restart-info resetter-spec)
(fail-info resetter-spec)
(death-info resetter-spec)
(quit-info resetter-spec)
(extra-bank-count uint32)
(extra-bank pair 3)
(borrow-count uint32)
(borrow pair 3)
(exclusive-task-count uint32)
(exclusive-task int32 3)
(level-trans-time int32)
(unknown-usd-19 int32)
(unknown-usd-20 int32)
(unknown-usd-21 int32)
(unknown-usd-22 int32)
(unknown-usd-23 int32)
(letterbox float)
(letterbox-speed float)
(unknown-usd-24 int32)
(unknown-usd-25 int32)
(unknown-usd-26 int32)
(unknown-usd-27 int32)
(unknown-usd-28 int32)
(unknown-usd-29 int32)
(unknown-usd-30 int32)
(unknown-usd-31 int32)
(unknown-usd-32 int32)
(borrow-city-count uint32)
(borrow-city pair 3)
(unknown-usd-33 int32 28)
(audio-language uint8)
(unknown-usd-34 int32 11)
(special-volume float)
(unknown-usd-35 int32 17)
)
(:methods
(user-setting-data-method-9 () none)
(user-setting-data-method-10 () none)
)
)
(deftype cam-setting-data (structure)
((fov degrees)
(pov-handle uint64 :offset 16)
(pov-bone int32)
(pov-offset vector :inline)
(string-default symbol)
(string-max-length meters)
(string-min-length meters)
(string-max-height meters)
(string-min-height meters)
(string-cliff-height meters)
(string-camera-floor meters)
(string-camera-ceiling meters)
(gun-max-height meters)
(gun-min-height meters)
(string-local-down vector :inline)
(slave-options cam-slave-options)
(matrix-blend-max-angle degrees)
(matrix-blend-max-partial float)
(string-spline-max-move meters)
(string-spline-accel meters)
(string-spline-max-move-player meters)
(string-spline-accel-player meters)
(string-startup-vector vector :inline)
(use-string-startup-vector symbol)
(look-at-point vector :inline)
(use-look-at-point symbol)
(target-height meters)
(foot-offset meters)
(head-offset meters)
(teleport-on-entity-change symbol)
(entity-name string)
(cam-slope string)
(entity-or-mode-changed symbol)
(master-options cam-master-options)
(entity-mask uint32)
(mode-name symbol)
(real-entity-name string)
(cam-mode symbol)
(interp-time uint32)
(no-intro symbol)
(use-point-of-interest symbol)
(point-of-interest vector :inline)
(handle-of-interest uint64)
(mouse-tumble-point vector :inline)
(use-mouse-tumble-point symbol)
(mouse-input symbol)
(cpad1-skip-buttons symbol)
(butt-handle uint64)
(butt-angle float)
(extra-follow-height float)
(interp-time-priority uint32)
(string-max-length-default symbol)
(string-min-length-default symbol)
(string-max-height-default symbol)
(string-min-height-default symbol)
(flip-vertical symbol)
(flip-horizontal symbol)
(dummy object 1)
(fov-priority float)
(ocean-off basic)
(ocean-override basic)
(crash-cam-force-freeze basic)
)
(:methods
(cam-setting-data-method-9 () none)
(cam-setting-data-method-10 () none)
)
)
(deftype cam-setting-state (structure)
((current cam-setting-data :inline)
(target cam-setting-data :inline)
(default cam-setting-data :inline)
)
)
(deftype engine-group (structure)
((engine basic)
(engine-pers basic)
(engine-hi basic)
)
)
(deftype setting-control (basic)
((user-current user-setting-data :inline :offset-assert 16)
(user-target user-setting-data :inline :offset-assert 800)
(user-default user-setting-data :inline :offset-assert 1584)
(cam-settings cam-setting-state 4 :inline :offset-assert 2368)
(engine engine :offset-assert 7168) ;; guessed by decompiler
(engine-pers engine-pers :offset-assert 7172) ;; guessed by decompiler
(engine-hi engine :offset-assert 7176) ;; guessed by decompiler
(cam-engines engine-group 4 :offset-assert 7180)
)
:method-count-assert 25
:size-assert #x1c1c
:flag-assert #x1900001c1c
(:methods
(new (symbol type int) _type_) ;; 0
(setting-control-method-9 () none) ;; 9 ;; (add-setting (_type_ process symbol object object object) connection)
(setting-control-method-10 () none) ;; 10 ;; (persist-with-delay (_type_ symbol time-frame symbol symbol float int) none)
(setting-control-method-11 () none) ;; 11 ;; (set-setting (_type_ process symbol object object object) connection)
(setting-control-method-12 () none) ;; 12 ;; (remove-setting (_type_ process symbol) none)
(setting-control-method-13 () none) ;; 13 ;; (kill-persister (_type_ engine-pers object) none)
(setting-control-method-14 (_type_ symbol int symbol symbol float int) none) ;; 14 ;; (setting-control-method-14 (_type_ object) connectable)
(setting-control-method-15 () none) ;; 15 ;; (get-setting (_type_ object) connectable)
(setting-control-method-16 () none) ;; 16 ;; (remove-setting-by-arg0 (_type_ object) none)
(setting-control-method-17 () none) ;; 17 ;; (set-setting-by-param (_type_ symbol object object object) connection)
(setting-control-method-18 () none) ;; 18 ;; (apply-settings (_type_) user-setting-data)
(setting-control-method-19 () none) ;; 19 ;; (update (_type_) user-setting-data)
(setting-control-method-20 () none) ;; 20
(setting-control-method-21 () none) ;; 21
(setting-control-method-22 () none) ;; 22
(setting-control-method-23 () none) ;; 23
(setting-control-method-24 () none) ;; 24
)
)
(defmethod new setting-control ((allocation symbol) (type-to-make type) (arg0 int))
(let ((s4-0 (object-new allocation type-to-make (the-as int (-> type-to-make size)))))
(set! (-> s4-0 engine) ((method-of-type engine new) allocation engine 'setting-control arg0 connection))
(set! (-> s4-0 engine-hi) ((method-of-type engine new) allocation engine 'setting-control arg0 connection))
(set! (-> s4-0 engine-pers)
((method-of-type engine-pers new) allocation engine-pers 'setting-control arg0 connection-pers)
)
(dotimes (s3-0 4)
(set! (-> s4-0 cam-engines s3-0) (new 'global 'engine-group))
(set! (-> s4-0 cam-engines s3-0 engine)
((method-of-type engine new) allocation engine 'setting-control arg0 connection)
)
(set! (-> s4-0 cam-engines s3-0 engine-hi)
((method-of-type engine new) allocation engine 'setting-control arg0 connection)
)
(set! (-> s4-0 cam-engines s3-0 engine-pers)
((method-of-type engine-pers new) allocation engine-pers 'setting-control arg0 connection-pers)
)
)
s4-0
)
)