jak-project/goal_src/jak2/engine/game/settings.gc
ManDude cd68cb671e
deftype and defmethod syntax major changes (#3094)
Major change to how `deftype` shows up in our code:
- the decompiler will no longer emit the `offset-assert`,
`method-count-assert`, `size-assert` and `flag-assert` parameters. There
are extremely few cases where having this in the decompiled code is
helpful, as the types there come from `all-types` which already has
those parameters. This also doesn't break type consistency because:
  - the asserts aren't compared.
- the first step of the test uses `all-types`, which has the asserts,
which will throw an error if they're bad.
- the decompiler won't emit the `heap-base` parameter unless necessary
now.
- the decompiler will try its hardest to turn a fixed-offset field into
an `overlay-at` field. It falls back to the old offset if all else
fails.
- `overlay-at` now supports field "dereferencing" to specify the offset
that's within a field that's a structure, e.g.:
```lisp
(deftype foobar (structure)
  ((vec    vector  :inline)
   (flags  int32   :overlay-at (-> vec w))
   )
  )
```
in this structure, the offset of `flags` will be 12 because that is the
final offset of `vec`'s `w` field within this structure.
- **removed ID from all method declarations.** IDs are only ever
automatically assigned now. Fixes #3068.
- added an `:overlay` parameter to method declarations, in order to
declare a new method that goes on top of a previously-defined method.
Syntax is `:overlay <method-name>`. Please do not ever use this.
- added `state-methods` list parameter. This lets you quickly specify a
list of states to be put in the method table. Same syntax as the
`states` list parameter. The decompiler will try to put as many states
in this as it can without messing with the method ID order.

Also changes `defmethod` to make the first type definition (before the
arguments) optional. The type can now be inferred from the first
argument. Fixes #3093.

---------

Co-authored-by: Hat Kid <6624576+Hat-Kid@users.noreply.github.com>
2023-10-30 03:20:02 +00:00

1643 lines
59 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: settings.gc
;; name in dgo: settings
;; dgos: ENGINE, GAME
;; NOTE - for text
(define-extern *setting-control* setting-control)
;; DECOMP BEGINS
(defun get-current-language ()
"Returns the current [[language-enum]]"
(-> *setting-control* user-current language)
)
(defmethod user-setting-data-method-9 ((this user-setting-data) (arg0 engine) (arg1 engine-pers) (arg2 engine))
(let ((s3-0 (-> arg1 alive-list)))
(while s3-0
(user-setting-data-method-10
this
(-> s3-0 param 0)
(the-as symbol (-> s3-0 param 1))
(the-as float (-> s3-0 param 2))
(the-as uint (-> s3-0 param 3))
)
(set! s3-0 (-> s3-0 next))
)
)
(let ((s3-1 (-> arg0 alive-list-end))
(s2-0 (-> arg0 alive-list-end prev0))
)
(while (!= s3-1 (-> arg0 alive-list))
(let ((s1-0 (-> (the-as connection s3-1) param0)))
(case s1-0
(('sfx-volume)
(if (or (not (logtest? (-> *kernel-context* prevent-from-run) (process-mask progress)))
(= ((method-of-type connection get-process) (the-as connection s3-1)) (ppointer->process *progress-process*))
)
(user-setting-data-method-10
this
s1-0
(the-as symbol (-> (the-as connection s3-1) param1))
(the-as float (-> (the-as connection s3-1) param2))
(the-as uint (-> (the-as connection s3-1) param3))
)
)
)
(else
(user-setting-data-method-10
this
s1-0
(the-as symbol (-> (the-as connection s3-1) param1))
(the-as float (-> (the-as connection s3-1) param2))
(the-as uint (-> (the-as connection s3-1) param3))
)
)
)
)
(set! s3-1 s2-0)
(set! s2-0 (-> s3-1 prev0))
)
)
(let* ((v1-21 (-> arg2 alive-list next0))
(s4-1 (-> v1-21 next0))
)
(while (!= v1-21 (-> arg2 alive-list-end))
(user-setting-data-method-10
this
(-> (the-as connection v1-21) param0)
(the-as symbol (-> (the-as connection v1-21) param1))
(the-as float (-> (the-as connection v1-21) param2))
(the-as uint (-> (the-as connection v1-21) param3))
)
(set! v1-21 s4-1)
(set! s4-1 (-> s4-1 next0))
)
)
this
)
(defmethod user-setting-data-method-10 ((this user-setting-data) (arg0 object) (arg1 symbol) (arg2 float) (arg3 uint))
"set-defaults! perhaps?"
(case arg0
(('border-mode)
(set! (-> this border-mode) arg1)
)
(('region-mode)
(set! (-> this region-mode) arg1)
)
(('allow-look-around)
(set! (-> this allow-look-around) arg1)
)
(('ocean-off)
(set! (-> this ocean-off) arg1)
)
(('weather)
(set! (-> this weather) arg1)
)
(('mouse)
(set! (-> this mouse) arg1)
)
(('cursor)
(set! (-> this cursor) arg1)
)
(('music)
(set! (-> this music) arg1)
)
(('extra-bank)
(set! (-> this extra-bank) (the-as pair arg1))
)
(('process-mask)
(case arg1
(('set)
(logior! (-> this process-mask) arg3)
)
(('clear)
(logclear! (-> this process-mask) arg3)
)
(('abs)
(set! (-> this process-mask) (the-as process-mask arg3))
)
)
)
(('task-mask)
(case arg1
(('set)
(logior! (-> this task-mask) arg3)
)
(('clear)
(logclear! (-> this task-mask) arg3)
)
(('abs)
(set! (-> this task-mask) (the-as task-mask arg3))
)
)
)
(('task-manager)
(set! (-> this task-manager) (the-as (pointer process) arg1))
)
(('task)
(set! (-> this task) arg1)
)
(('exclusive-task)
(set! (-> this exclusive-task) (the-as int arg3))
)
(('exclusive-load)
(set! (-> this exclusive-load) arg1)
)
(('sfx-volume)
(case arg1
(('rel)
(set! (-> this sfx-volume) (* (-> this sfx-volume) arg2))
)
(else
(set! (-> this sfx-volume) arg2)
)
)
)
(('music-volume)
(case arg1
(('rel)
(set! (-> this music-volume) (* (-> this music-volume) arg2))
)
(else
(set! (-> this music-volume) arg2)
)
)
)
(('ambient-volume)
(case arg1
(('rel)
(set! (-> this ambient-volume) (* (-> this ambient-volume) arg2))
)
(else
(set! (-> this ambient-volume) arg2)
)
)
)
(('dialog-volume)
(case arg1
(('rel)
(set! (-> this dialog-volume) (* (-> this dialog-volume) arg2))
)
(else
(set! (-> this dialog-volume) arg2)
)
)
)
(('sfx-volume-movie)
(case arg1
(('rel)
(set! (-> this sfx-movie-volume) (* (-> this sfx-movie-volume) arg2))
)
(else
(set! (-> this sfx-movie-volume) arg2)
)
)
)
(('music-volume-movie)
(case arg1
(('rel)
(set! (-> this music-volume-movie) (* (-> this music-volume-movie) arg2))
)
(else
(set! (-> this music-volume-movie) arg2)
)
)
)
(('ambient-volume-movie)
(case arg1
(('rel)
(set! (-> this ambient-volume-move) (* (-> this ambient-volume-move) arg2))
)
(else
(set! (-> this ambient-volume-move) arg2)
)
)
)
(('dialog-volume-hint)
(case arg1
(('rel)
(set! (-> this dialog-volume-hint) (* (-> this dialog-volume-hint) arg2))
)
(else
(set! (-> this dialog-volume-hint) arg2)
)
)
)
(('sound-flava)
(when (>= arg2 (-> this sound-flava-priority))
(set! (-> this sound-flava) arg3)
(set! (-> this sound-flava-priority) arg2)
)
)
(('sound-mode)
(set! (-> this sound-mode) arg3)
)
(('sound-tune)
(set! (-> this sound-tune) arg3)
)
(('sound-excitement)
(case arg1
(('rel)
(set! (-> this sound-excitement) (* (-> this sound-excitement) arg2))
)
(('add)
(+! (-> this sound-excitement) arg2)
)
(else
(set! (-> this sound-excitement) arg2)
)
)
)
(('sound-reverb)
(case arg1
(('rel)
(set! (-> this sound-reverb) (* (-> this sound-reverb) arg2))
)
(('add)
(+! (-> this sound-reverb) arg2)
)
(else
(set! (-> this sound-reverb) arg2)
)
)
)
(('mode-sound-bank)
(set! (-> this mode-sound-bank) (the-as uint arg1))
)
(('spotlight-color)
(set! (-> this spotlight-color) (the-as rgba arg3))
)
(('bg-r)
(set! (-> this bg-r) arg2)
)
(('bg-g)
(set! (-> this bg-g) arg2)
)
(('bg-b)
(set! (-> this bg-b) arg2)
)
(('bg-a)
(set! (-> this bg-a) arg2)
)
(('bg-a-speed)
(set! (-> this bg-a-speed) arg2)
)
(('bg-a-force)
(set! (-> this bg-a-force) arg2)
)
(('allow-blackout)
(set! (-> this allow-blackout) arg1)
)
(('rain)
(set! (-> this rain) arg2)
)
(('snow)
(set! (-> this snow) arg2)
)
(('language)
(set! (-> this language) (the-as language-enum arg3))
)
(('subtitle-language)
(set! (-> this subtitle-language) (the-as language-enum arg3))
)
(('vibration)
(set! (-> this vibration) arg1)
)
(('auto-save)
(set! (-> this auto-save) arg1)
)
(('allow-pause)
(set! (-> this allow-pause) arg1)
)
(('allow-progress)
(set! (-> this allow-progress) arg1)
)
(('allow-continue)
(set! (-> this allow-continue) arg1)
)
(('allow-timeout)
(set! (-> this allow-timeout) arg1)
)
(('allow-error)
(set! (-> this allow-error) arg1)
)
(('under-water-pitch-mod)
(set! (-> this under-water-pitch-mod) arg2)
)
(('sound-bank-load)
(set! (-> this sound-bank-load) arg1)
)
(('play-hints)
(set! (-> this play-hints) arg1)
)
(('subtitle)
(set! (-> this subtitle) arg1)
)
(('mirror)
(set! (-> this mirror) arg1)
)
(('movie)
(set! (-> this movie) (the-as (pointer process) arg1))
)
(('movie-name)
(set! (-> this movie-name) arg1)
)
(('movie-skip-frame)
(set! (-> this movie-skip-frame) arg2)
)
(('talking)
(set! (-> this talking) (the-as (pointer process) arg1))
)
(('spooling)
(set! (-> this spooling) (the-as (pointer process) arg1))
)
(('spool-anim)
(set! (-> this spool-anim) (the-as spool-anim arg1))
)
(('hint)
(set! (-> this hint) (the-as (pointer process) arg1))
)
(('ambient)
(set! (-> this ambient) (the-as (pointer process) arg1))
)
(('common-page)
(case arg1
(('set)
(logior! (-> this unknown-int32-00) arg3)
)
(('clear)
(logclear! (-> this unknown-int32-00) arg3)
)
)
)
(('duck)
(set! (-> this duck) arg1)
)
(('jump)
(set! (-> this jump) arg1)
)
(('double-jump)
(set! (-> this double-jump) arg1)
)
(('darkjak)
(set! (-> this darkjak) arg1)
)
(('endlessfall)
(set! (-> this endlessfall) arg1)
)
(('pilot)
(set! (-> this pilot) arg1)
)
(('pilot-exit)
(set! (-> this pilot-exit) arg1)
)
(('attack)
(set! (-> this attack) arg1)
)
(('board)
(set! (-> this board) arg1)
)
(('gun)
(set! (-> this gun) arg1)
)
(('doorway)
(set! (-> this doorway) arg1)
)
(('calm)
(set! (-> this attack) (not arg1))
(set! (-> this gun) (not arg1))
(set! (-> this board) (not arg1))
(set! (-> this jump) (not arg1))
(set! (-> this double-jump) (not arg1))
(set! (-> this darkjak) (not arg1))
(set! (-> this pilot) (not arg1))
(case arg1
((#t)
(set! (-> this speed-mult) 0.5)
)
)
)
(('airlock)
(set! (-> this airlock) arg1)
)
(('gun-buoy)
(set! (-> this gun-buoy) arg1)
)
(('ignore-target)
(set! (-> this ignore-target) arg1)
)
(('speech-control)
(set! (-> this speech-control) arg1)
)
(('vehicle-hijacking)
(set! (-> this vehicle-hijacking) arg1)
)
(('features)
(case arg1
(('set)
(logior! (-> this features) arg3)
)
(('clear)
(logclear! (-> this features) arg3)
)
(('abs)
(set! (-> this features) (the-as game-feature arg3))
)
)
)
(('gem)
(set! (-> this gem) arg1)
)
(('minimap)
(case arg1
(('set)
(logior! (-> this minimap) arg3)
)
(('clear)
(logclear! (-> this minimap) arg3)
)
(('abs)
(set! (-> this minimap) arg3)
)
)
)
(('race-minimap)
(set! (-> this race-minimap) (the-as int arg3))
)
(('borrow)
(set! (-> this borrow) (the-as pair arg1))
)
(('half-speed)
(set! (-> this half-speed) arg1)
)
(('render)
(set! (-> this render) arg1)
)
)
this
)
(defmethod cam-setting-data-method-9 ((this cam-setting-data) (arg0 engine) (arg1 engine-pers) (arg2 engine))
(let ((s3-0 (-> arg1 alive-list)))
(while s3-0
(cam-setting-data-method-10
this
(-> s3-0 param 0)
(the-as (pointer process) (-> s3-0 param 1))
(the-as float (-> s3-0 param 2))
(the-as int (-> s3-0 param 3))
)
(set! s3-0 (-> s3-0 next))
)
)
(let ((s3-1 (-> arg0 alive-list-end))
(s2-0 (-> arg0 alive-list-end prev0))
)
(while (!= s3-1 (-> arg0 alive-list))
(let ((s1-0 (-> (the-as connection s3-1) param0)))
(case s1-0
(('sfx-volume)
(if (or (not (logtest? (-> *kernel-context* prevent-from-run) (process-mask progress)))
(= ((method-of-type connection get-process) (the-as connection s3-1)) (ppointer->process *progress-process*))
)
(cam-setting-data-method-10
this
s1-0
(the-as (pointer process) (-> (the-as connection s3-1) param1))
(the-as float (-> (the-as connection s3-1) param2))
(-> (the-as connection s3-1) param3)
)
)
)
(else
(cam-setting-data-method-10
this
s1-0
(the-as (pointer process) (-> (the-as connection s3-1) param1))
(the-as float (-> (the-as connection s3-1) param2))
(-> (the-as connection s3-1) param3)
)
)
)
)
(set! s3-1 s2-0)
(set! s2-0 (-> s3-1 prev0))
)
)
(let* ((v1-21 (-> arg2 alive-list next0))
(s4-1 (-> v1-21 next0))
)
(while (!= v1-21 (-> arg2 alive-list-end))
(cam-setting-data-method-10
this
(-> (the-as connection v1-21) param0)
(the-as (pointer process) (-> (the-as connection v1-21) param1))
(the-as float (-> (the-as connection v1-21) param2))
(-> (the-as connection v1-21) param3)
)
(set! v1-21 s4-1)
(set! s4-1 (-> s4-1 next0))
)
)
this
)
(defmethod cam-setting-data-method-10 ((this cam-setting-data) (arg0 object) (arg1 (pointer process)) (arg2 float) (arg3 int))
(case arg0
(('fov)
(if (= arg1 'rel)
(set! (-> this fov) (* (-> this fov) arg2))
(set! (-> this fov) arg2)
)
)
(('pov-handle)
(let ((a0-6 (new 'static 'handle :process arg1 :pid arg3)))
(when (handle->process a0-6)
(set! (-> this pov-handle) a0-6)
(set! (-> this pov-bone) (the int arg2))
)
)
)
(('pov-offset)
(set! (-> this pov-offset quad) (-> (the-as vector arg2) quad))
)
(('string-max-length)
(case arg1
(('low)
(if (-> this string-max-length-default)
(set! (-> this string-max-length) arg2)
)
)
(('rel)
(set! (-> this string-max-length) (* (-> this string-max-length) arg2))
)
(else
(set! (-> this string-max-length) arg2)
)
)
(set! (-> this string-default) #f)
(set! (-> this string-max-length-default) #f)
)
(('string-min-length)
(case arg1
(('low)
(if (-> this string-min-length-default)
(set! (-> this string-min-length) arg2)
)
)
(('rel)
(set! (-> this string-min-length) (* (-> this string-min-length) arg2))
)
(else
(set! (-> this string-min-length) arg2)
)
)
(set! (-> this string-default) #f)
(set! (-> this string-min-length-default) #f)
)
(('string-max-height)
(case arg1
(('low)
(if (-> this string-max-height-default)
(set! (-> this string-max-height) arg2)
)
)
(('rel)
(set! (-> this string-max-height) (* (-> this string-max-height) arg2))
)
(else
(set! (-> this string-max-height) arg2)
)
)
(set! (-> this string-default) #f)
(set! (-> this string-max-height-default) #f)
)
(('string-min-height)
(case arg1
(('low)
(if (-> this string-min-height-default)
(set! (-> this string-min-height) arg2)
)
)
(('rel)
(set! (-> this string-min-height) (* (-> this string-min-height) arg2))
)
(else
(set! (-> this string-min-height) arg2)
)
)
(set! (-> this string-default) #f)
(set! (-> this string-min-height-default) #f)
)
(('string-cliff-height)
(set! (-> this string-cliff-height) arg2)
(set! (-> this string-default) #f)
)
(('string-camera-ceiling)
(set! (-> this string-camera-ceiling) arg2)
(set! (-> this string-default) #f)
)
(('gun-max-height)
(set! (-> this gun-max-height) arg2)
)
(('gun-min-height)
(set! (-> this gun-min-height) arg2)
)
(('string-local-down)
(vector-normalize-copy! (-> this string-local-down) (the-as vector arg2) 1.0)
)
(('slave-options)
(case arg1
(('set)
(logior! (-> this slave-options) arg3)
)
(('clear)
(logclear! (-> this slave-options) arg3)
)
(('abs)
(set! (-> this slave-options) (the-as cam-slave-options arg3))
)
)
)
(('rapid-tracking)
(logior! (-> this slave-options) (cam-slave-options RAPID_TRACKING))
)
(('bike-mode)
(logior! (-> this slave-options) (cam-slave-options BIKE_MODE))
)
(('vertical-follow-matches-camera)
(logior! (-> this slave-options) (cam-slave-options VERTICAL_FOLLOW_MATCHES_CAMERA))
)
(('matrix-blend-max-angle)
(set! (-> this matrix-blend-max-angle) arg2)
)
(('matrix-blend-max-partial)
(set! (-> this matrix-blend-max-partial) arg2)
)
;; og:preserve-this fixed copypasta bug from original game
(('string-spline-max-move)
(set! (-> this string-spline-max-move) arg2)
)
(('string-spline-accel)
(set! (-> this string-spline-accel) arg2)
)
(('string-spline-max-move-player)
(set! (-> this string-spline-max-move-player) arg2)
)
(('string-spline-accel-player)
(set! (-> this string-spline-accel-player) arg2)
)
(('target-height)
(set! (-> this target-height) arg2)
)
(('head-offset)
(set! (-> this head-offset) arg2)
)
(('foot-offset)
(set! (-> this foot-offset) arg2)
)
(('teleport-on-entity-change)
(set! (-> this teleport-on-entity-change) (the-as symbol arg2))
)
(('entity-name)
(when (or *target* (and *camera* (not (send-event *camera* 'query-state cam-free-floating))))
(set! (-> this entity-name) (the-as string arg1))
(set! arg3 (cond
((= arg3 -1)
0
)
(else
(empty)
arg3
)
)
)
(set! (-> this entity-mask) (the-as uint arg3))
(set! (-> this mode-name) #f)
)
)
(('mode-name)
(set! (-> this mode-name) (the-as symbol arg1))
(set! (-> this entity-name) #f)
)
(('master-options)
(case arg1
(('set)
(logior! (-> this master-options) arg3)
)
(('clear)
(logclear! (-> this master-options) arg3)
)
(('abs)
(set! (-> this master-options) (the-as cam-master-options arg3))
)
)
)
(('immediate-string-min-max)
(logior! (-> this master-options) (cam-master-options IMMEDIATE_STRING_MIN_MAX))
)
(('no-intro)
(set! (-> this no-intro) (the-as symbol arg2))
)
(('mouse-input)
(set! (-> this mouse-input) (the-as symbol arg2))
)
(('cpad1-skip-buttons)
(set! (-> this cpad1-skip-buttons) (the-as symbol arg2))
)
(('interp-time)
(let* ((v1-91 arg1)
(f0-34 (if (= v1-91 'hi)
1.0
0.0
)
)
)
(when (>= f0-34 (the float (-> this interp-time-priority)))
(set! (-> this interp-time) (the-as uint (the int arg2)))
(set! (-> this interp-time-priority) (the-as uint (the int f0-34)))
)
)
)
(('string-startup-vector)
(set! (-> this string-use-startup-vector) #t)
(set! (-> this string-startup-vector quad) (-> (the-as vector arg2) quad))
)
(('look-at-point)
(set! (-> this use-look-at-point) #t)
(set! (-> this look-at-point quad) (-> (the-as vector arg2) quad))
)
(('point-of-interest)
(set! (-> this use-point-of-interest) #t)
(set! (-> this point-of-interest quad) (-> (the-as vector arg2) quad))
(set! (-> this handle-of-interest) (the-as handle #f))
)
(('mouse-tumble-point)
(set! (-> this use-mouse-tumble-point) #t)
(set! (-> this mouse-tumble-point quad) (-> (the-as vector arg2) quad))
)
(('handle-of-interest)
(let ((a0-118 (new 'static 'handle :process arg1 :pid arg3)))
(when (handle->process a0-118)
(set! (-> this use-point-of-interest) #f)
(set! (-> this handle-of-interest) a0-118)
)
)
)
(('butt-handle)
(let ((a0-122 (new 'static 'handle :process arg1 :pid arg3)))
(when (handle->process a0-122)
(set! (-> this butt-handle) a0-122)
(set! (-> this butt-angle) arg2)
)
)
)
(('extra-follow-height)
(set! (-> this extra-follow-height) arg2)
)
)
this
)
(defmethod add-setting ((this setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object))
"Originally called `setting-set` see (anon-function 48 script)"
(add-connection (-> this engine) arg0 arg1 arg2 arg3 arg4)
0
(none)
)
(defmethod set-setting ((this setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object))
(remove-setting this arg0 arg1)
(add-connection (-> this engine) arg0 arg1 arg2 arg3 arg4)
0
(none)
)
(defmethod persist-with-delay ((this setting-control) (arg0 symbol) (arg1 time-frame) (arg2 symbol) (arg3 symbol) (arg4 float) (arg5 int))
"Originally called `setting-pers` see (anon-function 46 script)"
(let ((v1-1 (schedule-callback (-> this engine-pers) arg0 arg1)))
(when v1-1
(set! (-> v1-1 param 0) arg2)
(set! (-> v1-1 param 1) arg3)
(set! (-> v1-1 param 2) arg4)
(set! (-> v1-1 param 3) arg5)
)
)
0
(none)
)
(defmethod remove-setting ((this setting-control) (arg0 process) (arg1 symbol))
(when arg0
(let ((s5-0 (-> this engine))
(s4-0 (-> arg0 connection-list next1))
)
(while s4-0
(if (and ((method-of-type connection belongs-to-engine?) (the-as connection s4-0) s5-0)
(or (= arg1 #t) (= arg1 (-> (the-as connection s4-0) param0)))
)
((method-of-type connection move-to-dead) (the-as connection s4-0))
)
(set! s4-0 (-> s4-0 next1))
)
)
)
0
(none)
)
(defmethod kill-persister ((this setting-control) (arg0 engine-pers) (arg1 object))
"Calls [[engine-pers::kill-matching]]"
(kill-matching
(-> this engine-pers)
(lambda ((arg0 engine-pers) (arg1 connection-pers) (arg2 object) (arg3 object))
(and (= (-> arg1 key) arg2) (= (-> arg1 param 0) arg3))
)
arg0
arg1
)
0
(none)
)
(defmethod setting-control-method-14 ((this setting-control) (arg0 object))
(let ((v1-1 (-> this engine-hi alive-list next0)))
(-> this engine-hi)
(let ((a2-2 (-> v1-1 next0)))
(while (!= v1-1 (-> this engine-hi alive-list-end))
(if (= (-> (the-as connection v1-1) param0) arg0)
(return v1-1)
)
(set! v1-1 a2-2)
(-> this engine-hi)
(set! a2-2 (-> a2-2 next0))
)
)
)
(the-as connectable #f)
)
(defmethod remove-setting-by-arg0 ((this setting-control) (arg0 object))
"Calls [[engine::remove-by-param0]] on `engine-hi`"
(remove-by-param0 (-> this engine-hi) arg0)
0
(none)
)
(defmethod set-setting-by-param ((this setting-control) (arg0 symbol) (arg1 object) (arg2 object) (arg3 object))
"Same as [[setting-control::set-setting]] but will [[engine::remove-by-param0]] using the symbol provided"
(remove-by-param0 (-> this engine-hi) arg0)
(add-connection (-> this engine-hi) *dproc* arg0 arg1 arg2 arg3)
)
(defmethod apply-settings ((this setting-control))
(speech-control-method-11 *speech-control*)
(let ((s5-0 (-> this user-current)))
(let ((s4-0 (-> this user-target)))
(mem-copy! (the-as pointer s4-0) (the-as pointer (-> this user-default)) 528)
(set! (-> s4-0 ambient-volume) (* (-> this user-default sfx-volume) (-> this user-default ambient-volume)))
(user-setting-data-method-9 s4-0 (-> this engine) (-> this engine-pers) (-> this engine-hi))
;; og:preserve-this check for target sound mode and music instead of current sound mode
(when (= (-> s4-0 sound-mode) 1)
(case (-> s4-0 music)
(('sewer)
(set! (-> s4-0 music-volume) (* 1.2 (-> s4-0 music-volume)))
)
(else
(set! (-> s4-0 music-volume) (* 1.111111 (-> s4-0 music-volume)))
)
)
)
(set! (-> s5-0 border-mode) (-> s4-0 border-mode))
(when (!= (-> s5-0 borrow) (-> s4-0 borrow))
(set! (-> s5-0 borrow) (-> s4-0 borrow))
(update-task-masks 'event)
)
(set! (-> s5-0 region-mode) (-> s4-0 region-mode))
(set! (-> s5-0 unknown-int32-00) (-> s4-0 unknown-int32-00))
(set! (-> s5-0 vibration) (-> s4-0 vibration))
(set! (-> s5-0 auto-save) (-> s4-0 auto-save))
(set! (-> s5-0 play-hints) (-> s4-0 play-hints))
(set! (-> s5-0 sound-bank-load) (-> s4-0 sound-bank-load))
(set! (-> s5-0 subtitle) (-> s4-0 subtitle))
(set! (-> s5-0 beard) (if (logtest? (-> *game-info* secrets) (game-secrets toggle-beard))
(not (-> s4-0 beard))
(-> s4-0 beard)
)
)
(set! (-> s5-0 movie) (-> s4-0 movie))
(set! (-> s5-0 movie-name) (-> s4-0 movie-name))
(set! (-> s5-0 talking) (-> s4-0 talking))
(set! (-> s5-0 spooling) (-> s4-0 spooling))
(set! (-> s5-0 spool-anim) (-> s4-0 spool-anim))
(set! (-> s5-0 hint) (-> s4-0 hint))
(set! (-> s5-0 ambient) (-> s4-0 ambient))
(set! (-> s5-0 allow-pause) (-> s4-0 allow-pause))
(set! (-> s5-0 allow-progress) (-> s4-0 allow-progress))
(set! (-> s5-0 allow-look-around) (-> s4-0 allow-look-around))
(set! (-> s5-0 allow-continue) (-> s4-0 allow-continue))
(set! (-> s5-0 allow-timeout) (-> s4-0 allow-timeout))
(set! (-> s5-0 allow-error) (-> s4-0 allow-error))
(set! (-> s5-0 under-water-pitch-mod) (-> s4-0 under-water-pitch-mod))
(if (and (-> s4-0 mirror) (= (level-status *level* 'ctywide) 'active))
(set! (-> s5-0 mirror) #f)
(set! (-> s5-0 mirror) (-> s4-0 mirror))
)
(set! (-> s5-0 ocean-off) (-> s4-0 ocean-off))
(set! (-> s5-0 weather) (-> s4-0 weather))
(set! (-> s5-0 mouse) (-> s4-0 mouse))
(set! (-> s5-0 cursor) (-> s4-0 cursor))
(set! (-> s5-0 ambient-volume-move) (-> s4-0 ambient-volume-move))
(set! (-> s5-0 music-volume-movie) (-> s4-0 music-volume-movie))
(set! (-> s5-0 sfx-movie-volume) (-> s4-0 sfx-movie-volume))
(set! (-> s5-0 dialog-volume-hint) (-> s4-0 dialog-volume-hint))
(set! (-> s5-0 process-mask) (-> s4-0 process-mask))
(set! (-> s5-0 movie-skip-frame) (-> s4-0 movie-skip-frame))
(set! (-> s5-0 extra-bank) (-> s4-0 extra-bank))
(set! (-> s5-0 task-mask) (-> s4-0 task-mask))
(set! (-> s5-0 task) (-> s4-0 task))
(set! (-> s5-0 task-manager) (-> s4-0 task-manager))
(when (!= (-> s5-0 exclusive-task) (-> s4-0 exclusive-task))
(set! (-> s5-0 exclusive-task) (-> s4-0 exclusive-task))
(update-task-masks 'event)
)
(set! (-> s5-0 exclusive-load) (-> s4-0 exclusive-load))
(set! (-> s5-0 duck) (-> s4-0 duck))
(set! (-> s5-0 jump) (-> s4-0 jump))
(set! (-> s5-0 double-jump) (-> s4-0 double-jump))
(set! (-> s5-0 darkjak) (-> s4-0 darkjak))
(set! (-> s5-0 endlessfall) (-> s4-0 endlessfall))
(set! (-> s5-0 pilot) (-> s4-0 pilot))
(set! (-> s5-0 pilot-exit) (-> s4-0 pilot-exit))
(set! (-> s5-0 attack) (-> s4-0 attack))
(set! (-> s5-0 board) (-> s4-0 board))
(set! (-> s5-0 gun) (-> s4-0 gun))
(set! (-> s5-0 doorway) (-> s4-0 doorway))
(set! (-> s5-0 airlock) (-> s4-0 airlock))
(set! (-> s5-0 gun-buoy) (-> s4-0 gun-buoy))
(set! (-> s5-0 ignore-target) (-> s4-0 ignore-target))
(set! (-> s5-0 speech-control) (-> s4-0 speech-control))
(set! (-> s5-0 vehicle-hijacking) (-> s4-0 vehicle-hijacking))
(set! (-> s5-0 speed-mult) (-> s4-0 speed-mult))
(set! (-> s5-0 features) (-> s4-0 features))
(set! (-> s5-0 rain) (-> s4-0 rain))
(set! (-> s5-0 snow) (-> s4-0 snow))
(set! (-> s5-0 gem) (-> s4-0 gem))
(set! (-> s5-0 minimap) (-> s4-0 minimap))
(set! (-> s5-0 race-minimap) (-> s4-0 race-minimap))
(set! (-> s5-0 half-speed) (-> s4-0 half-speed))
(set! (-> s5-0 render) (-> s4-0 render))
)
(set! (-> *kernel-context* prevent-from-run) (-> s5-0 process-mask))
(let ((v1-84 (task-mask)))
(dotimes (a0-13 (-> *level* length))
(let ((a1-6 (-> *level* level a0-13)))
(if (= (-> a1-6 status) 'active)
(set! v1-84
(the-as task-mask (logior (the-as int v1-84) (logand (-> a1-6 info base-task-mask) (task-mask primary0))))
)
)
)
)
(dotimes (a0-16 (-> *level* length))
(let ((a1-15 (-> *level* level a0-16)))
(if (= (-> a1-15 status) 'active)
(set! (-> a1-15 task-mask)
(logior (logior (logand (-> a1-15 task-mask) (task-mask task0 task1 task2 task3 task4 task5 task6 task7 done))
(logand (task-mask ctywide never movie0 movie1 movie2) (-> s5-0 task-mask))
)
(logclear 8192 (the-as int v1-84))
)
)
)
)
)
)
(set! (-> *level* border?) (-> s5-0 border-mode))
(when *target*
(if (-> s5-0 duck)
(logclear! (-> *target* state-flags) (state-flags prevent-duck))
(logior! (-> *target* state-flags) (state-flags prevent-duck))
)
(if (-> s5-0 jump)
(logclear! (-> *target* state-flags) (state-flags prevent-jump))
(logior! (-> *target* state-flags) (state-flags prevent-jump))
)
(if (-> s5-0 double-jump)
(logclear! (-> *target* state-flags) (state-flags prevent-double-jump))
(logior! (-> *target* state-flags) (state-flags prevent-double-jump))
)
(if (-> s5-0 attack)
(logclear! (-> *target* state-flags) (state-flags prevent-attack))
(logior! (-> *target* state-flags) (state-flags prevent-attack))
)
(if (-> s5-0 board)
(logclear! (-> *target* state-flags) (state-flags prevent-board))
(logior! (-> *target* state-flags) (state-flags prevent-board))
)
(if (-> s5-0 gun)
(logclear! (-> *target* state-flags) (state-flags prevent-gun))
(logior! (-> *target* state-flags) (state-flags prevent-gun))
)
)
)
(-> this cam-current)
(let ((s4-1 (-> this cam-target)))
(mem-copy! (the-as pointer s4-1) (the-as pointer (-> this cam-default)) 780)
(cam-setting-data-method-9 s4-1 (-> this engine) (-> this engine-pers) (-> this engine-hi))
)
(-> this user-current)
)
(defmethod update ((this setting-control))
(local-vars (v1-41 symbol))
(run-pending-updates! (-> this engine-pers) (-> *display* base-clock frame-counter))
(apply-settings this)
(let ((s5-0 (-> this user-current)))
(let ((s4-0 (-> this user-target)))
(when *sound-player-enable*
(when (!= (-> s5-0 sfx-volume) (-> s4-0 sfx-volume))
(seek! (-> s5-0 sfx-volume) (-> s4-0 sfx-volume) (seconds-per-frame))
(sound-set-volume (sound-group sfx) (-> s5-0 sfx-volume))
)
(when (!= (-> s5-0 music-volume) (-> s4-0 music-volume))
(seek! (-> s5-0 music-volume) (-> s4-0 music-volume) (seconds-per-frame))
(sound-set-volume (sound-group music) (* 0.75 (-> s5-0 music-volume)))
)
(when (!= (-> s5-0 dialog-volume) (-> s4-0 dialog-volume))
(seek! (-> s5-0 dialog-volume) (-> s4-0 dialog-volume) (seconds-per-frame))
(sound-set-volume (sound-group dialog dialog2) (-> s5-0 dialog-volume))
)
(when (!= (-> s5-0 ambient-volume) (-> s4-0 ambient-volume))
(seek! (-> s5-0 ambient-volume) (-> s4-0 ambient-volume) (seconds-per-frame))
(sound-set-volume (sound-group ambient) (-> s5-0 ambient-volume))
)
)
(when (!= (-> s5-0 language) (-> s4-0 language))
(set! (-> s5-0 language) (-> s4-0 language))
(case (-> s5-0 language)
(((language-enum uk-english))
(set-language (language-enum english))
)
(else
(set-language (-> s5-0 language))
)
)
)
(set! (-> s5-0 subtitle-language) (-> s4-0 subtitle-language))
(when (!= (-> s5-0 stereo-mode) (-> s4-0 stereo-mode))
(set! (-> s5-0 stereo-mode) (-> s4-0 stereo-mode))
(sound-set-stereo-mode (the-as stereo-mode (-> s5-0 stereo-mode)))
)
(when (and (!= (-> s4-0 music) (-> s5-0 music))
(and (zero? (rpc-busy? 1))
(or (not (-> s4-0 music))
(and (< 0.0 (-> s5-0 music-volume)) (not (load-in-progress? *level*)) (not (-> s5-0 movie)))
)
(begin
(countdown (v1-40 3)
(when (not (-> *level* sound-bank v1-40))
(set! v1-41 #f)
(goto cfg-37)
)
)
(set! v1-41 #t)
(label cfg-37)
(and v1-41 (not *master-exit*))
)
)
)
(cond
((-> s4-0 music)
(format 0 "Load music ~A~%" (-> s4-0 music))
(set! (-> s5-0 sound-flava) (the-as uint 0))
(sound-music-load (string->sound-name (symbol->string (-> s4-0 music))))
)
(else
(format 0 "Unload music~%")
(sound-music-unload)
)
)
(set! (-> s5-0 music) (-> s4-0 music))
)
(set! (-> s4-0 sound-excitement) (fmax 0.0 (fmin 0.99 (-> s4-0 sound-excitement))))
(set! (-> s4-0 sound-reverb) (fmax 0.0 (fmin 1.0 (-> s4-0 sound-reverb))))
(when (and (nonzero? (-> this user-default sound-stinger))
(>= (- (-> *display* base-clock frame-counter) (-> this sound-stinger-time)) (seconds 0.5))
)
(set! (-> this user-default sound-stinger) 0)
0
)
(when *sound-player-enable*
;; og:preserve-this
;; 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.
;; it also only changed the registers when the settings changed, but this is undesirable as the sound driver itself
;; can modify these registers and they can be stuck with stale or wrong values.
;; flava
(set! (-> s5-0 sound-flava) (-> s4-0 sound-flava))
(sound-set-midi-reg 14 (the-as int (-> s5-0 sound-flava)))
;; reverb
(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))
)
;; mode
(set! (-> s5-0 sound-mode) (-> s4-0 sound-mode))
(sound-set-midi-reg 3 (the-as int (-> s5-0 sound-mode)))
;; 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! (-> this sound-stinger-time) (-> *display* base-clock frame-counter))
)
(when (!= (the int (* 4.0 (-> s4-0 sound-excitement))) (the int (* 4.0 (-> this sound-excitement-targ))))
(let ((v1-87 (max 0 (min 3 (the int (* 4.0 (-> s4-0 sound-excitement)))))))
(when (and (< (-> this sound-excitement-targ) (-> s4-0 sound-excitement))
(< (the-as int (-> this sound-excitement-level)) v1-87)
(zero? (-> this user-default sound-stinger))
)
(set! (-> this sound-stinger-time) (-> *display* base-clock frame-counter))
(set! (-> this sound-stinger-change-time v1-87) (-> *display* base-clock frame-counter))
(set! (-> this user-default sound-stinger) (+ v1-87 9))
)
(cond
((< (the-as int (-> this sound-excitement-level)) v1-87)
(set! (-> this sound-excitement-level) (the-as uint v1-87))
)
((< v1-87 (the-as int (+ (-> this sound-excitement-level) -1)))
(set! (-> this sound-excitement-level) (the-as uint (+ v1-87 1)))
)
((zero? v1-87)
(set! (-> this sound-excitement-level) (the-as uint v1-87))
)
)
)
(set! (-> this sound-excitement-change-time) (-> *display* base-clock frame-counter))
(set! (-> this sound-excitement-targ) (-> s4-0 sound-excitement))
)
(when (and (!= (the int (* 4.0 (-> s5-0 sound-excitement))) (the int (* 4.0 (-> this sound-excitement-targ))))
(>= (- (-> *display* base-clock frame-counter) (-> this sound-excitement-change-time)) (seconds 0.8))
)
(max 0 (min 3 (the int (* 4.0 (-> this sound-excitement-targ)))))
(sound-set-midi-reg 2 (the int (* 100.0 (-> s5-0 sound-excitement))))
(set! (-> s5-0 sound-excitement) (-> this 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))
(when (!= (-> s5-0 aspect-ratio) (-> s4-0 aspect-ratio))
(set! (-> s5-0 aspect-ratio) (-> s4-0 aspect-ratio))
(set-aspect-ratio (-> s5-0 aspect-ratio))
)
(when (!= (-> s5-0 use-progressive-scan) (-> s4-0 use-progressive-scan))
(set! (-> s5-0 use-progressive-scan) (-> s4-0 use-progressive-scan))
(set! (-> *video-params* set-video-mode) #t)
)
(when (!= (-> s5-0 video-mode) (-> s4-0 video-mode))
(set! (-> s5-0 video-mode) (-> s4-0 video-mode))
(set-video-mode (-> s5-0 video-mode))
)
(when (!= (-> s5-0 display-dx) (-> s4-0 display-dx))
(set! (-> s5-0 display-dx) (-> s4-0 display-dx))
(set! (-> *video-params* display-dx) (/ (-> s4-0 display-dx) 2))
)
(when (!= (-> s5-0 display-dy) (-> s4-0 display-dy))
(set! (-> s5-0 display-dy) (-> s4-0 display-dy))
(set! (-> *video-params* display-dy) (* (/ (-> s4-0 display-dy) 2) 2))
)
(set! (-> *blit-displays-work* horizontal-flip-flag)
(logtest? (-> *game-info* secrets) (game-secrets hflip-screen))
)
(set! (-> s5-0 allow-blackout) (-> s4-0 allow-blackout))
(set! (-> s5-0 bg-a-speed) (-> s4-0 bg-a-speed))
(set! (-> s5-0 bg-a-force) (-> s4-0 bg-a-force))
(set! (-> s5-0 bg-r) (-> s4-0 bg-r))
(set! (-> s5-0 bg-g) (-> s4-0 bg-g))
(set! (-> s5-0 bg-b) (-> s4-0 bg-b))
(seek! (-> s5-0 bg-a) (-> s4-0 bg-a) (* (-> s4-0 bg-a-speed) (seconds-per-frame)))
(let ((v1-133 *display*))
(let ((f0-71 (-> s5-0 bg-a)))
(if (!= (-> s5-0 bg-a-force) 0.0)
(set! f0-71 (-> s5-0 bg-a-force))
)
(if (not (-> s5-0 allow-blackout))
(set! f0-71 0.0)
)
(set! (-> v1-133 bgcolor r) (the int (* 255.0 (-> s5-0 bg-r))))
(set! (-> v1-133 bgcolor g) (the int (* 255.0 (-> s5-0 bg-g))))
(set! (-> v1-133 bgcolor b) (the int (* 255.0 (-> s5-0 bg-b))))
(set! (-> v1-133 pmode alp) (the int (* 255.0 (- 1.0 f0-71))))
)
(set! (-> v1-133 run-half-speed) (the-as basic (-> s5-0 half-speed)))
)
(set! (-> s5-0 spotlight-color) (-> s4-0 spotlight-color))
)
(set! (-> *texture-pool* common-page-mask) (-> s5-0 unknown-int32-00))
(set! (-> *cpad-list* cpads 0 buzz) (the-as basic (-> s5-0 vibration)))
(let ((v1-137 *ocean*))
(case (-> s5-0 ocean-off)
((#t)
(set! (-> v1-137 off) #t)
)
(('mid)
(set! (-> v1-137 mid-off) #t)
)
(('near)
(set! (-> v1-137 near-off) #t)
)
)
)
(set! (-> *mouse* active) (-> s5-0 mouse))
(set! (-> *mouse* cursor) (the-as basic (and (-> s5-0 mouse) (-> s5-0 cursor))))
)
(let ((s5-1 (-> this cam-current)))
(let ((s4-1 (-> this cam-target)))
(set! (-> s5-1 entity-or-mode-changed) #f)
(if (and (not (name= (-> s5-1 entity-name) (-> s4-1 entity-name)))
(or (not *target*) (not (logtest? (-> *target* focus-status) (-> s4-1 entity-mask))))
)
(set! (-> s4-1 entity-or-mode-changed) #t)
)
(if (!= (-> s5-1 mode-name) (-> s4-1 mode-name))
(set! (-> s4-1 entity-or-mode-changed) #t)
)
(set! (-> s5-1 teleport-on-entity-change) (-> s4-1 teleport-on-entity-change))
(cam-master-set-entity s4-1)
(cond
((not (-> s4-1 entity-or-mode-changed))
)
((or (= (-> s5-1 cam-mode) cam-eye) (= (-> s4-1 cam-mode) cam-eye))
(set! (-> s4-1 no-intro) #t)
(set! (-> s4-1 interp-time) (the-as uint 60))
(set! (-> s4-1 interp-time-priority) (the-as uint 2))
)
((= (-> s4-1 cam-mode) cam-endlessfall)
(set! (-> s4-1 no-intro) #t)
(set! (-> s4-1 interp-time) (the-as uint 30))
(set! (-> s4-1 interp-time-priority) (the-as uint 2))
)
((or (= (-> s5-1 cam-mode) cam-free-floating) (= (-> s4-1 cam-mode) cam-free-floating))
(set! (-> s4-1 interp-time) (the-as uint 0))
(set! (-> s4-1 interp-time-priority) (the-as uint 2))
)
)
(set! (-> s5-1 entity-name) (-> s4-1 entity-name))
(set! (-> s5-1 entity-mask) (-> s4-1 entity-mask))
(set! (-> s5-1 mode-name) (-> s4-1 mode-name))
(let ((v1-173 (-> s4-1 entity-or-mode-changed)))
(set! (-> s5-1 entity-or-mode-changed) v1-173)
(when v1-173
(set! (-> s5-1 real-entity-name) (-> s4-1 real-entity-name))
(set! (-> s5-1 cam-mode) (-> s4-1 cam-mode))
)
)
(+! (-> s5-1 fov) (fmax -182.04445 (fmin 182.04445 (* 0.1 (- (-> s4-1 fov) (-> s5-1 fov))))))
(set! (-> s5-1 pov-handle) (-> s4-1 pov-handle))
(set! (-> s5-1 pov-bone) (-> s4-1 pov-bone))
(set! (-> s5-1 pov-offset quad) (-> s4-1 pov-offset quad))
(set! (-> s5-1 string-default) (-> s4-1 string-default))
(set! (-> s5-1 string-max-length-default) (-> s4-1 string-max-length-default))
(set! (-> s5-1 string-min-length-default) (-> s4-1 string-min-length-default))
(set! (-> s5-1 string-max-height-default) (-> s4-1 string-max-height-default))
(set! (-> s5-1 string-min-height-default) (-> s4-1 string-min-height-default))
(set! (-> s5-1 string-max-length) (-> s4-1 string-max-length))
(set! (-> s5-1 string-min-length) (-> s4-1 string-min-length))
(set! (-> s5-1 string-max-height) (-> s4-1 string-max-height))
(set! (-> s5-1 string-min-height) (-> s4-1 string-min-height))
(set! (-> s5-1 string-cliff-height) (-> s4-1 string-cliff-height))
(set! (-> s5-1 string-camera-ceiling) (-> s4-1 string-camera-ceiling))
(cond
((-> s5-1 string-default)
(set! (-> s5-1 gun-min-height) (-> s4-1 gun-min-height))
(set! (-> s5-1 gun-max-height) (-> s4-1 gun-max-height))
)
(else
(set! (-> s5-1 gun-min-height) (-> s4-1 string-min-height))
(set! (-> s5-1 gun-max-height) (-> s4-1 string-max-height))
)
)
(set! (-> s5-1 string-local-down quad) (-> s4-1 string-local-down quad))
(set! (-> s5-1 slave-options) (-> s4-1 slave-options))
(seek! (-> s5-1 matrix-blend-max-angle) (-> s4-1 matrix-blend-max-angle) 182.04445)
(seek! (-> s5-1 matrix-blend-max-partial) (-> s4-1 matrix-blend-max-partial) 0.05)
(set! (-> s5-1 string-spline-max-move) (-> s4-1 string-spline-max-move))
(set! (-> s5-1 string-spline-accel) (-> s4-1 string-spline-accel))
(set! (-> s5-1 string-spline-max-move-player) (-> s4-1 string-spline-max-move-player))
(set! (-> s5-1 string-spline-accel-player) (-> s4-1 string-spline-accel-player))
(set! (-> s5-1 target-height) (-> s4-1 target-height))
(set! (-> s5-1 head-offset) (-> s4-1 head-offset))
(set! (-> s5-1 foot-offset) (-> s4-1 foot-offset))
(set! (-> s5-1 master-options) (-> s4-1 master-options))
(set! (-> s5-1 no-intro) (-> s4-1 no-intro))
(set! (-> s5-1 mouse-input) (-> s4-1 mouse-input))
(set! (-> s5-1 cpad1-skip-buttons) (-> s4-1 cpad1-skip-buttons))
(set! (-> s5-1 interp-time) (-> s4-1 interp-time))
(set! (-> s5-1 interp-time-priority) (-> s4-1 interp-time-priority))
(set! (-> s5-1 string-use-startup-vector) (-> s4-1 string-use-startup-vector))
(set! (-> s5-1 string-startup-vector quad) (-> s4-1 string-startup-vector quad))
(set! (-> s5-1 use-look-at-point) (-> s4-1 use-look-at-point))
(set! (-> s5-1 look-at-point quad) (-> s4-1 look-at-point quad))
(set! (-> s5-1 use-point-of-interest) (-> s4-1 use-point-of-interest))
(set! (-> s5-1 point-of-interest quad) (-> s4-1 point-of-interest quad))
(set! (-> s5-1 use-mouse-tumble-point) (-> s4-1 use-mouse-tumble-point))
(set! (-> s5-1 mouse-tumble-point quad) (-> s4-1 mouse-tumble-point quad))
(set! (-> s5-1 handle-of-interest) (-> s4-1 handle-of-interest))
(let* ((s3-1 (handle->process (-> s5-1 handle-of-interest)))
(a0-147 (the-as process-focusable (if (type? s3-1 process-focusable)
(the-as process-focusable s3-1)
)
)
)
)
(when (the-as process a0-147)
(set! (-> s5-1 use-point-of-interest) #t)
(set! (-> s5-1 point-of-interest quad) (-> (get-trans a0-147 4) quad))
)
)
(set! (-> this cam-default point-of-interest quad) (-> s5-1 point-of-interest quad))
(set! (-> s5-1 butt-handle) (-> s4-1 butt-handle))
(set! (-> s5-1 butt-angle) (-> s4-1 butt-angle))
(set! (-> s5-1 extra-follow-height) (-> s4-1 extra-follow-height))
)
(if (-> s5-1 entity-or-mode-changed)
(cam-master-activate-slave #f)
)
)
(-> this user-current)
)
(when (zero? *setting-control*)
(kmemopen global "settings")
(set! *setting-control* (new 'global 'setting-control 64))
(kmemclose)
(let ((gp-0 (-> *setting-control* user-default))
(s5-0 (-> *setting-control* user-current))
)
(let ((f0-1 (the float (scf-get-volume))))
(set! (-> gp-0 ocean-off) #f)
(set! (-> gp-0 weather) #t)
(set! (-> gp-0 cursor) #f)
(set! (-> gp-0 mouse) #f)
(set! (-> gp-0 allow-look-around) #t)
(set! (-> gp-0 border-mode) #f)
(set! (-> gp-0 region-mode) #t)
(set! (-> gp-0 borrow) '())
(set! (-> gp-0 sfx-volume) (* 0.01000001 f0-1))
(set! (-> gp-0 music-volume) (* 0.01000001 f0-1))
(set! (-> gp-0 dialog-volume) (* 0.01000001 f0-1))
(set! (-> gp-0 ambient-volume) (* 0.01000001 f0-1))
(set! (-> gp-0 sfx-movie-volume) (* 0.006000006 f0-1))
(set! (-> gp-0 music-volume-movie) (* 0.0 f0-1))
(set! (-> gp-0 ambient-volume-move) (* 0.006000006 f0-1))
(set! (-> gp-0 dialog-volume-hint) (* 0.008000008 f0-1))
)
(set! (-> gp-0 spotlight-color) (new 'static 'rgba :r #xf0 :g #xf0 :b #xf0 :a #x80))
(set! (-> gp-0 task-mask) (task-mask ctywide never))
(set! (-> gp-0 task-manager) (the-as (pointer process) #f))
(set! (-> gp-0 task) #f)
(set! (-> gp-0 exclusive-task) 0)
(set! (-> gp-0 exclusive-load) #f)
(set! (-> gp-0 minimap) (the-as uint 160))
(set! (-> gp-0 race-minimap) -1)
(set! (-> gp-0 language) (scf-get-language))
(set! (-> gp-0 subtitle-language) (-> gp-0 language))
(set! (-> gp-0 process-mask) (process-mask execute sleep))
(set! (-> gp-0 use-progressive-scan) #f)
(set! (-> gp-0 display-dx) 0)
(set! (-> gp-0 display-dy) 0)
(set! (-> gp-0 vibration)
;; og:preserve-this constant
(if (or (= *kernel-boot-message* 'demo) (= *kernel-boot-message* 'demo-shared) (!= (scf-get-territory) GAME_TERRITORY_SCEA))
#f
#t
)
)
(set! (-> gp-0 camera-stick-dir) #f)
(set! (-> gp-0 auto-save) #f)
(set! (-> gp-0 play-hints) #t)
(set! (-> gp-0 sound-bank-load) #t)
(set! (-> gp-0 subtitle)
;; og:preserve-this constant
(if (or (= *kernel-boot-message* 'demo) (or (= *kernel-boot-message* 'demo-shared) (!= (scf-get-territory) GAME_TERRITORY_SCEE)))
#f
#t
)
)
(let ((v1-31 (scf-get-territory)))
;; og:preserve-this constant
(set! (-> gp-0 beard) (if (or (= v1-31 GAME_TERRITORY_SCEI) (= v1-31 GAME_TERRITORY_SCEK))
#f
#t
)
)
)
(set! (-> gp-0 movie) (the-as (pointer process) #f))
(set! (-> gp-0 movie-name) #f)
(set! (-> gp-0 talking) (the-as (pointer process) #f))
(set! (-> gp-0 spooling) (the-as (pointer process) #f))
(set! (-> gp-0 spool-anim) #f)
(set! (-> gp-0 hint) (the-as (pointer process) #f))
(set! (-> gp-0 ambient) (the-as (pointer process) #f))
(set! (-> gp-0 duck) #t)
(set! (-> gp-0 jump) #t)
(set! (-> gp-0 double-jump) #t)
(set! (-> gp-0 darkjak) #t)
(set! (-> gp-0 endlessfall) #t)
(set! (-> gp-0 pilot) #t)
(set! (-> gp-0 pilot-exit) #t)
(set! (-> gp-0 attack) #t)
(set! (-> gp-0 board) #t)
(set! (-> gp-0 gun) #t)
(set! (-> gp-0 doorway) #f)
(set! (-> gp-0 airlock) #t)
(set! (-> gp-0 gun-buoy) #t)
(set! (-> gp-0 speech-control) #t)
(set! (-> gp-0 vehicle-hijacking) #t)
(set! (-> gp-0 ignore-target) #f)
(set! (-> gp-0 gem) #t)
(set! (-> gp-0 half-speed) #f)
(set! (-> gp-0 render) #t)
(set! (-> gp-0 speed-mult) 1.0)
(set! (-> gp-0 rain) 0.0)
(set! (-> gp-0 snow) 0.0)
(set! (-> gp-0 features) (the-as game-feature -1))
(set! (-> gp-0 sound-flava) (the-as uint 0))
(set! (-> gp-0 sound-flava-priority) 0.0)
(set! (-> gp-0 sound-reverb) 0.0)
(set! (-> gp-0 mode-sound-bank) (the-as uint #f))
(set! (-> gp-0 music) #f)
(set! (-> gp-0 extra-bank) '())
(set! (-> gp-0 bg-a-speed) 8.0)
(set! (-> gp-0 under-water-pitch-mod) 0.0)
(set! (-> gp-0 allow-pause) #t)
(set! (-> gp-0 allow-progress) #t)
(set! (-> gp-0 allow-continue) #t)
(set! (-> gp-0 allow-timeout) #f)
(set! (-> gp-0 allow-error) #t)
(set! (-> gp-0 mirror) #f)
(set! (-> gp-0 unknown-int32-00) 1)
(set! (-> gp-0 stereo-mode) 1)
(set! (-> gp-0 movie-skip-frame) -1.0)
(set! (-> gp-0 allow-blackout) #t)
(set! (-> gp-0 bg-a) 1.0)
(case (scf-get-aspect)
((2)
(set! (-> gp-0 aspect-ratio) 'aspect16x9)
)
(else
(set! (-> gp-0 aspect-ratio) 'aspect4x3)
)
)
(if (zero? *boot-video-mode*)
(set! (-> gp-0 video-mode) 'ntsc)
(set! (-> gp-0 video-mode) 'pal)
)
(set! (-> s5-0 borrow) (-> gp-0 borrow))
(set! (-> s5-0 sfx-volume) (+ -0.01 (-> gp-0 sfx-volume)))
(set! (-> s5-0 music-volume) (+ -0.01 (-> gp-0 music-volume)))
(set! (-> s5-0 dialog-volume) (+ -0.01 (-> gp-0 dialog-volume)))
(set! (-> s5-0 ambient-volume) (+ -0.01 (-> gp-0 ambient-volume)))
(set! (-> s5-0 sfx-movie-volume) (-> gp-0 sfx-movie-volume))
(set! (-> s5-0 music-volume-movie) (-> gp-0 music-volume-movie))
(set! (-> s5-0 ambient-volume-move) (-> gp-0 ambient-volume-move))
(set! (-> s5-0 dialog-volume-hint) (-> gp-0 dialog-volume-hint))
(set! (-> s5-0 spotlight-color) (-> gp-0 spotlight-color))
(set! (-> s5-0 movie) (-> gp-0 movie))
(set! (-> s5-0 movie-name) (-> gp-0 movie-name))
(set! (-> s5-0 talking) (-> gp-0 talking))
(set! (-> s5-0 spooling) (-> gp-0 spooling))
(set! (-> s5-0 spool-anim) (-> gp-0 spool-anim))
(set! (-> s5-0 hint) (-> gp-0 hint))
(set! (-> s5-0 ambient) (-> gp-0 ambient))
(set! (-> s5-0 language) (+ (-> gp-0 language) -1))
(set! (-> s5-0 subtitle-language) (-> gp-0 subtitle-language))
(set! (-> s5-0 aspect-ratio) #f)
(set! (-> s5-0 use-progressive-scan) #f)
(set! (-> s5-0 video-mode) #f)
(set! (-> s5-0 music) #f)
(set! (-> s5-0 extra-bank) '())
(set! (-> s5-0 allow-blackout) (-> gp-0 allow-blackout))
(set! (-> s5-0 bg-a-speed) (-> gp-0 bg-a-speed))
(set! (-> s5-0 under-water-pitch-mod) (-> gp-0 under-water-pitch-mod))
(set! (-> s5-0 allow-pause) (-> gp-0 allow-pause))
(set! (-> s5-0 allow-progress) (-> gp-0 allow-progress))
(set! (-> s5-0 allow-continue) (-> gp-0 allow-continue))
(set! (-> s5-0 allow-look-around) (-> gp-0 allow-look-around))
(set! (-> s5-0 allow-timeout) (-> gp-0 allow-timeout))
(set! (-> s5-0 allow-error) (-> gp-0 allow-error))
(set! (-> s5-0 mirror) (-> gp-0 mirror))
(set! (-> s5-0 ocean-off) (-> gp-0 ocean-off))
(set! (-> s5-0 weather) (-> gp-0 weather))
(set! (-> s5-0 mouse) (-> gp-0 mouse))
(set! (-> s5-0 cursor) (-> gp-0 cursor))
(set! (-> s5-0 mode-sound-bank) (the-as uint #f))
(set! (-> s5-0 sound-reverb) (+ 0.01 (-> gp-0 sound-reverb)))
(set! (-> s5-0 stereo-mode) 1)
(set! (-> s5-0 duck) (-> gp-0 duck))
(set! (-> s5-0 jump) (-> gp-0 jump))
(set! (-> s5-0 double-jump) (-> gp-0 double-jump))
(set! (-> s5-0 darkjak) (-> gp-0 darkjak))
(set! (-> s5-0 endlessfall) (-> gp-0 endlessfall))
(set! (-> s5-0 pilot) (-> gp-0 pilot))
(set! (-> s5-0 pilot-exit) (-> gp-0 pilot-exit))
(set! (-> s5-0 attack) (-> gp-0 attack))
(set! (-> s5-0 gun) (-> gp-0 gun))
(set! (-> s5-0 doorway) (-> gp-0 doorway))
(set! (-> s5-0 board) (-> gp-0 board))
(set! (-> s5-0 gem) (-> gp-0 gem))
(set! (-> s5-0 half-speed) (-> gp-0 half-speed))
(set! (-> s5-0 render) (-> gp-0 render))
(set! (-> s5-0 speed-mult) (-> gp-0 speed-mult))
(set! (-> s5-0 rain) (-> gp-0 rain))
(set! (-> s5-0 snow) (-> gp-0 snow))
(set! (-> s5-0 movie-skip-frame) (-> gp-0 movie-skip-frame))
(set! (-> s5-0 airlock) (-> gp-0 airlock))
(set! (-> s5-0 gun-buoy) (-> gp-0 gun-buoy))
(set! (-> s5-0 ignore-target) (-> gp-0 ignore-target))
(set! (-> s5-0 speech-control) (-> gp-0 speech-control))
(set! (-> s5-0 vehicle-hijacking) (-> gp-0 vehicle-hijacking))
(set! (-> s5-0 features) (-> gp-0 features))
(set! (-> s5-0 task-mask) (-> gp-0 task-mask))
(set! (-> s5-0 task) (-> gp-0 task))
(set! (-> s5-0 exclusive-task) (-> gp-0 exclusive-task))
(set! (-> s5-0 exclusive-load) (-> gp-0 exclusive-load))
(set! (-> s5-0 task-manager) (-> gp-0 task-manager))
(set! (-> s5-0 bg-a) (-> gp-0 bg-a))
)
(let ((v1-127 (-> *setting-control* cam-default)))
(let ((a0-29 (-> *setting-control* cam-current)))
(set! (-> v1-127 fov) 11650.845)
(set! (-> v1-127 pov-handle) (the-as handle #f))
(set! (-> v1-127 pov-bone) 0)
(vector-reset! (-> v1-127 pov-offset))
(set! (-> v1-127 string-default) #t)
(set! (-> v1-127 string-max-length-default) #t)
(set! (-> v1-127 string-min-length-default) #t)
(set! (-> v1-127 string-max-height-default) #t)
(set! (-> v1-127 string-min-height-default) #t)
(set! (-> v1-127 string-max-length) 51200.0)
(set! (-> v1-127 string-min-length) 20480.0)
(set! (-> v1-127 string-max-height) 12288.0)
(set! (-> v1-127 string-min-height) 4096.0)
(set! (-> v1-127 string-cliff-height) 163840.0)
(set! (-> v1-127 string-camera-ceiling) 4096000000.0)
(set! (-> v1-127 gun-min-height) -4096.0)
(set! (-> v1-127 gun-max-height) 32768.0)
(set-vector! (-> v1-127 string-local-down) 0.0 -1.0 0.0 1.0)
(set! (-> v1-127 slave-options) (cam-slave-options JUMP_PITCHES COLLIDE LINE_OF_SIGHT))
(set! (-> v1-127 matrix-blend-max-angle) 364.0889)
(set! (-> v1-127 matrix-blend-max-partial) 0.25)
(set! (-> v1-127 string-spline-max-move) 2457.6)
(set! (-> v1-127 string-spline-accel) 20.48)
(set! (-> v1-127 string-spline-max-move-player) 2457.6)
(set! (-> v1-127 string-spline-accel-player) 102.4)
(set! (-> v1-127 target-height) (-> *CAMERA_MASTER-bank* target-height))
(set! (-> v1-127 head-offset) (-> *CAMERA_MASTER-bank* onscreen-head-height))
(set! (-> v1-127 foot-offset) (-> *CAMERA_MASTER-bank* onscreen-foot-height))
(set! (-> v1-127 teleport-on-entity-change) #f)
(set! (-> v1-127 entity-name) #f)
(set! (-> v1-127 entity-mask) (the-as uint 32))
(set! (-> v1-127 entity-or-mode-changed) #f)
(set! (-> v1-127 master-options) (cam-master-options READ_BUTTONS))
(set! (-> v1-127 mode-name) #f)
(set! (-> v1-127 real-entity-name) #f)
(set! (-> v1-127 cam-mode) #f)
(set! (-> v1-127 no-intro) #f)
(set! (-> v1-127 mouse-input) #f)
(set! (-> v1-127 cpad1-skip-buttons) #f)
(set! (-> v1-127 interp-time) (the-as uint 450))
(set! (-> v1-127 interp-time-priority) (the-as uint 0))
(set! (-> v1-127 string-use-startup-vector) #f)
(set! (-> v1-127 use-look-at-point) #f)
(set! (-> v1-127 use-point-of-interest) #f)
(set! (-> v1-127 use-mouse-tumble-point) #f)
(set! (-> v1-127 handle-of-interest) (the-as handle #f))
(set! (-> a0-29 mouse-input) (-> v1-127 mouse-input))
(set! (-> a0-29 cpad1-skip-buttons) (-> v1-127 cpad1-skip-buttons))
(set! (-> a0-29 teleport-on-entity-change) (-> v1-127 teleport-on-entity-change))
(set! (-> a0-29 entity-name) (-> v1-127 entity-name))
(set! (-> a0-29 entity-mask) (-> v1-127 entity-mask))
(set! (-> a0-29 mode-name) (-> v1-127 mode-name))
(set! (-> a0-29 real-entity-name) (-> v1-127 real-entity-name))
(set! (-> a0-29 cam-mode) (-> v1-127 cam-mode))
(set! (-> a0-29 string-use-startup-vector) (-> v1-127 string-use-startup-vector))
(set! (-> a0-29 use-point-of-interest) (-> v1-127 use-point-of-interest))
(set! (-> a0-29 use-mouse-tumble-point) (-> v1-127 use-mouse-tumble-point))
(set! (-> a0-29 handle-of-interest) (-> v1-127 handle-of-interest))
)
(set! (-> v1-127 butt-handle) (the-as handle #f))
(set! (-> v1-127 butt-angle) 32768.0)
(set! (-> v1-127 extra-follow-height) 0.0)
)
)