Files
jak-project/test/decompiler/reference/jak2/engine/sound/speech_REF.gc
T
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

518 lines
23 KiB
Common Lisp
Vendored
Generated

;;-*-Lisp-*-
(in-package goal)
;; definition for method 12 of type speech-channel
;; WARN: Return type mismatch int vs none.
(defmethod speech-channel-method-12 ((this speech-channel))
(set! (-> this request handle) (the-as handle #f))
(set! (-> this request priority) -10000000000000000000000000000000000000.0)
0
(none)
)
;; definition for method 13 of type speech-channel
;; WARN: Return type mismatch int vs none.
(defmethod speech-channel-method-13 ((this speech-channel))
(set! (-> this id) (new 'static 'sound-id))
(set! (-> this last-request handle) (the-as handle #f))
(set! (-> this last-request priority) -10000000000000000000000000000000000000.0)
0
(none)
)
;; definition for method 11 of type speech-channel
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod speech-channel-method-11 ((this speech-channel))
(local-vars (v1-44 int))
(with-pp
(logclear! (-> this flags) (speech-channel-flag disable))
(if (or (not (-> *setting-control* user-current speech-control))
(load-in-progress? *level*)
(nonzero? (-> this id))
)
(logior! (-> this flags) (speech-channel-flag disable))
)
(set! (-> this target-pos quad) (-> (target-pos 0) quad))
(when (not (logtest? (-> this flags) (speech-channel-flag disable)))
(let ((s5-1 (-> this speech-table (-> this request speech-type))))
(cond
(s5-1
(let ((a0-8 (- (-> this update-time) (-> this request time)))
(v1-20 (handle->process (-> this request handle)))
)
(if (or (< (the-as time-frame (-> s5-1 request-timeout)) a0-8)
(or (not v1-20)
(let ((f0-0 245760.0))
(< (* f0-0 f0-0)
(vector-vector-distance-squared (-> this target-pos) (-> (the-as process-drawable v1-20) root trans))
)
)
)
)
(speech-channel-method-12 this)
)
)
(let ((s4-0 (handle->process (-> this request handle))))
(when s4-0
(when (or (and (>= (-> this request priority) 0.0)
(time-elapsed? (-> this end-time) (the-as time-frame (-> s5-1 delay)))
)
(and (time-elapsed? (-> this end-time) (the-as time-frame (-> s5-1 delay)))
(time-elapsed? (-> this end-time) (the-as time-frame (-> this delay)))
)
)
(let ((s3-0 (-> s5-1 list length))
(v1-43 (-> s5-1 play-index))
)
(when (> s3-0 0)
(cond
((logtest? (-> s5-1 flags) (speech-type-flag random-order))
(set! v1-44 (rand-vu-int-count s3-0))
(when (= v1-44 (-> s5-1 play-index))
(+! v1-44 1)
(if (>= v1-44 s3-0)
(set! v1-44 0)
)
)
)
(else
(set! v1-44 (+ v1-43 1))
(if (>= v1-44 s3-0)
(set! v1-44 0)
)
)
)
(set! (-> s5-1 play-index) v1-44)
(let ((s3-1 (-> s5-1 list v1-44)))
(mem-copy! (the-as pointer (-> this last-request)) (the-as pointer (-> this request)) 21)
(set-time! (-> this start-time))
(set! (-> this delay)
(the-as uint (rand-vu-int-range (the-as int (-> s5-1 min-delay)) (the-as int (-> s5-1 max-delay))))
)
(set! (-> s5-1 delay) (-> this delay))
(set! (-> this id) (add-process *gui-control* s4-0 (-> this gui-channel) (gui-action play) s3-1 -99.0 0))
)
(speech-channel-method-12 this)
(logior! (-> this flags) (speech-channel-flag disable))
)
)
)
)
)
)
(else
(speech-channel-method-12 this)
)
)
)
)
(set-time! (-> this update-time))
(when (nonzero? (-> this id))
(let ((s4-1 (handle->process (-> this last-request handle))))
(cond
((and s4-1 (-> *setting-control* user-current speech-control))
(when *sound-player-enable*
(let ((s5-2 (the-as sound-rpc-set-param (get-sound-buffer-entry))))
(set! (-> s5-2 command) (sound-command set-param))
(set! (-> s5-2 id) (-> this id))
(set! (-> s5-2 params fo-min) 15)
(set! (-> s5-2 params fo-max) 90)
(set! (-> s5-2 params fo-curve) 9)
(let ((a1-12 (-> (the-as process-drawable s4-1) root trans)))
(let ((s4-2 pp))
(when (= a1-12 #t)
(if (and s4-2 (type? s4-2 process-drawable) (nonzero? (-> (the-as process-drawable s4-2) root)))
(set! a1-12 (-> (the-as process-drawable s4-2) root trans))
(set! a1-12 (the-as vector #f))
)
)
)
(sound-trans-convert (the-as vector3w (-> s5-2 params trans)) a1-12)
)
(set! (-> s5-2 params mask) (the-as uint 480))
(-> s5-2 id)
)
)
)
(else
(set-action!
*gui-control*
(gui-action stop)
(-> this id)
(gui-channel none)
(gui-action none)
(the-as string #f)
(the-as (function gui-connection symbol) #f)
(the-as process #f)
)
(set! (-> this id) (new 'static 'sound-id))
0
)
)
)
(case (get-status *gui-control* (-> this id))
(((gui-status pending))
(when (time-elapsed? (-> this start-time) (seconds 1))
(set-action!
*gui-control*
(gui-action stop)
(-> this id)
(gui-channel none)
(gui-action none)
(the-as string #f)
(the-as (function gui-connection symbol) #f)
(the-as process #f)
)
(set! (-> this id) (new 'static 'sound-id))
(set! (-> this end-time) (-> this update-time))
)
)
(((gui-status unknown))
(set! (-> this id) (new 'static 'sound-id))
(set! (-> this last-request handle) (the-as handle #f))
(set! (-> this end-time) (-> this update-time))
)
)
)
0
(none)
)
)
;; definition for method 9 of type speech-channel
;; WARN: Return type mismatch int vs none.
(defmethod speech-channel-method-9 ((this speech-channel) (arg0 process-drawable) (arg1 speech-type))
(let ((f0-0 (vector-vector-distance-squared (-> arg0 root trans) (-> this target-pos)))
(f1-0 245760.0)
)
(when (< f0-0 (* f1-0 f1-0))
(let* ((f1-3 -1.0)
(f2-0 409600.0)
(f0-2 (+ (* f0-0 (/ f1-3 (* f2-0 f2-0))) (the float (-> this speech-table arg1 priority))))
)
(when (< (-> this request priority) f0-2)
(set! (-> this request priority) f0-2)
(set! (-> this request handle) (process->handle arg0))
(set! (-> this request speech-type) arg1)
(set-time! (-> this request time))
)
)
)
)
0
(none)
)
;; definition for method 10 of type speech-channel
;; WARN: Return type mismatch int vs none.
(defmethod speech-channel-method-10 ((this speech-channel) (arg0 handle))
(when (= arg0 (handle->process (-> this last-request handle)))
(set-action!
*gui-control*
(gui-action stop)
(-> this id)
(gui-channel none)
(gui-action none)
(the-as string #f)
(the-as (function gui-connection symbol) #f)
(the-as process #f)
)
(set! (-> this id) (new 'static 'sound-id))
(set! (-> this last-request handle) (the-as handle #f))
)
0
(none)
)
;; definition for method 12 of type speech-control
;; WARN: Return type mismatch int vs none.
(defmethod speech-control-method-12 ((this speech-control) (arg0 process-drawable) (arg1 speech-type))
(let ((v1-2 (-> this speech-table arg1)))
(when v1-2
(let ((a0-1 (-> this channel-array (-> v1-2 channel))))
(if (not (logtest? (-> a0-1 flags) (speech-channel-flag disable)))
(speech-channel-method-9 a0-1 arg0 arg1)
)
)
)
)
0
(none)
)
;; definition for method 11 of type speech-control
;; WARN: Return type mismatch int vs none.
(defmethod speech-control-method-11 ((this speech-control))
(dotimes (s5-0 2)
(speech-channel-method-11 (-> this channel-array s5-0))
)
0
(none)
)
;; definition for method 10 of type speech-control
;; WARN: Return type mismatch int vs none.
(defmethod speech-table-set! ((this speech-control) (arg0 speech-type) (arg1 speech-type-info))
(set! (-> this speech-table arg0) arg1)
0
(none)
)
;; definition for method 13 of type speech-control
;; WARN: Return type mismatch int vs none.
(defmethod speech-control-method-13 ((this speech-control) (arg0 handle))
(dotimes (s4-0 2)
(speech-channel-method-10 (-> this channel-array s4-0) arg0)
)
0
(none)
)
;; definition for method 14 of type speech-control
;; WARN: Return type mismatch int vs none.
(defmethod speech-control-method-14 ((this speech-control))
(speech-control-method-9 this)
(let ((s5-0 (-> this channel-array)))
((method-of-type speech-channel speech-channel-method-13) (the-as speech-channel s5-0))
(set! (-> s5-0 0 speech-table) (-> this speech-table))
(set! (-> s5-0 0 gui-channel) (gui-channel guard))
)
(let ((s5-1 (-> this channel-array 1)))
(speech-channel-method-13 s5-1)
(set! (-> s5-1 speech-table) (-> this speech-table))
(set! (-> s5-1 gui-channel) (gui-channel citizen))
)
0
(none)
)
;; definition for method 15 of type speech-control
;; WARN: Return type mismatch int vs none.
(defmethod speech-control-method-15 ((this speech-control) (arg0 process-drawable))
(when (not (logtest? (-> this channel-array 0 flags) (speech-channel-flag disable)))
(let ((v1-3 *target*))
(when v1-3
(cond
((focus-test? v1-3 dark)
(speech-control-method-12 this arg0 (speech-type speech-type-8))
)
((focus-test? v1-3 pilot)
(speech-control-method-12 this arg0 (speech-type speech-type-7))
)
(else
(speech-control-method-12 this arg0 (speech-type speech-type-6))
)
)
)
)
)
0
(none)
)
;; definition for method 16 of type speech-control
;; WARN: Return type mismatch int vs none.
(defmethod speech-control-method-16 ((this speech-control))
(set-action!
*gui-control*
(gui-action stop)
(the-as sound-id 1)
(gui-channel guard)
(gui-action none)
(the-as string #f)
(the-as (function gui-connection symbol) #f)
(the-as process #f)
)
(set-action!
*gui-control*
(gui-action stop)
(the-as sound-id 1)
(gui-channel citizen)
(gui-action none)
(the-as string #f)
(the-as (function gui-connection symbol) #f)
(the-as process #f)
)
(dotimes (s5-0 2)
(speech-channel-method-12 (-> this channel-array s5-0))
)
0
(none)
)
;; definition for method 9 of type speech-control
;; WARN: Return type mismatch int vs none.
(defmethod speech-control-method-9 ((this speech-control))
(dotimes (v1-0 57)
(set! (-> this speech-table v1-0) #f)
)
(dotimes (s5-0 2)
(speech-channel-method-12 (-> this channel-array s5-0))
)
(speech-table-set! this (speech-type speech-type-0) (new 'static 'speech-type-info
:priority 3
:request-timeout #x12c
:min-delay (seconds 1)
:max-delay (seconds 1)
:list (new 'static 'boxed-array :type string)
)
)
(speech-table-set! this (speech-type speech-type-3) (new 'static 'speech-type-info
:priority 3
:request-timeout #x12c
:min-delay (seconds 1)
:max-delay (seconds 1)
:list (new 'static 'boxed-array :type string
"kg136"
"kg139"
"kg140"
"kg141"
"kg142"
"kg134"
"kg157"
"kg143"
"kg156"
"kg176"
"kg177"
"kg536"
"kg551"
)
)
)
(speech-table-set! this (speech-type speech-type-9) (new 'static 'speech-type-info
:priority 1
:min-delay (seconds 2)
:max-delay (seconds 4)
:list (new 'static 'boxed-array :type string
"kg133"
"kg135"
"kg137"
"kg138"
"kg144"
"kg145"
"kg146"
"kg147"
"kg148"
"kg149"
"kg150"
"kg151"
"kg152"
"kg153"
"kg154"
"kg155"
"kg158"
"kg159"
"kg160"
"kg163"
"kg164"
"kg507"
"kg508"
"kg509"
"kg511"
"kg513"
"kg514"
"kg515"
"kg516"
"kg517"
"kg518"
"kg520"
"kg521"
"kg523"
"kg526"
"kg527"
"kg528"
"kg529"
"kg530"
"kg532"
"kg534"
"kg535"
"kg537"
"kg538"
"kg539"
"kg540"
"kg541"
"kg542"
"kg543"
"kg544"
"kg545"
"kg546"
"kg549"
"kg550"
)
)
)
(speech-table-set! this (speech-type speech-type-10) (new 'static 'speech-type-info
:flags (speech-type-flag random-order)
:priority 10
:request-timeout #x258
:min-delay (seconds 2)
:max-delay (seconds 4)
:list (new 'static 'boxed-array :type string
"kg165"
"kg165a"
"kg165b"
"kg166"
"kg166a"
"kg166b"
"kg167"
"kg167a"
"kg167b"
"kg168"
"kg168a"
"kg168b"
"kg169"
"kg169a"
"kg169b"
"kg170"
"kg170a"
"kg170b"
"kg171"
"kg171a"
"kg171b"
"kg172"
"kg172a"
"kg172b"
"kg173"
"kg173a"
"kg173b"
"kg174"
"kg174a"
"kg174b"
"kg175"
"kg175a"
"kg175b"
"kg510"
)
)
)
(speech-table-set! this (speech-type speech-type-11) (new 'static 'speech-type-info
:priority 2
:min-delay (seconds 0.1)
:max-delay (seconds 0.1)
:list (new 'static 'boxed-array :type string
"kg386a"
"kg428a"
"kg641"
"kg650"
"kg338a"
"kg339a"
"kg340a"
"kg341a"
"kg342a"
"kg343a"
"kg344a"
"kg512"
)
)
)
0
(none)
)
;; definition for symbol *speech-control*, type speech-control
(define *speech-control* (new 'static 'speech-control))
;; failed to figure out what this is:
(speech-control-method-14 *speech-control*)