Files
jak-project/test/decompiler/reference/jak3/engine/sound/speech_REF.gc
T
water111 7348e6a4ff [decompiler] Update vector ops, reduce casts (#3849)
Update the decompiler to use the new vf macros.

Also, fix a bunch of silly casting issues where accessing inline fields
with an offset of 0 would be better than a cast:

![image](https://github.com/user-attachments/assets/885bbb07-634f-47b8-99f5-5a947941cdde)

---------

Co-authored-by: water111 <awaterford1111445@gmail.com>
2025-01-20 16:32:58 -05:00

629 lines
20 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 reset-channel! ((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 init! ((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 (debug) for function speech-type->string
(defun-debug speech-type->string ((arg0 speech-type))
(case arg0
(((speech-type race-daxter-start))
"race-daxter-start"
)
(((speech-type civ-f-touched-by-player))
"civ-f-touched-by-player"
)
(((speech-type civ-m-hit-by-player-vehicle))
"civ-m-hit-by-player-vehicle"
)
(((speech-type race-jak-lap))
"race-jak-lap"
)
(((speech-type race-jak-start))
"race-jak-start"
)
(((speech-type civ-m-player-stealing-vehicle))
"civ-m-player-stealing-vehicle"
)
(((speech-type race-daxter-got-hit))
"race-daxter-got-hit"
)
(((speech-type guard-go-hostile))
"guard-go-hostile"
)
(((speech-type race-jak-ambient))
"race-jak-ambient"
)
(((speech-type civ-f-shot-by-player))
"civ-f-shot-by-player"
)
(((speech-type guard-chatter))
"guard-chatter"
)
(((speech-type civ-f-alert))
"civ-f-alert"
)
(((speech-type civ-f-ambient))
"civ-f-ambient"
)
(((speech-type guard-generic-battle))
"guard-generic-battle"
)
(((speech-type guard-chatter-jak))
"guard-chatter-jak"
)
(((speech-type civ-f-avoiding-player-vehicle))
"civ-f-avoiding-player-vehicle"
)
(((speech-type guard-battle-victory-b))
"guard-battle-victory-b"
)
(((speech-type race-jak-pass))
"race-jak-pass"
)
(((speech-type race-daxter-jump))
"race-daxter-jump"
)
(((speech-type guard-bumped-by-jak))
"guard-bumped-by-jak"
)
(((speech-type race-errol-start))
"race-errol-start"
)
(((speech-type guard-bumped-by-jak-b))
"guard-bumped-by-jak-b"
)
(((speech-type race-daxter-pass))
"race-daxter-pass"
)
(((speech-type race-errol-win))
"race-errol-win"
)
(((speech-type race-jak-jump))
"race-jak-jump"
)
(((speech-type race-errol-got-passed))
"race-errol-got-passed"
)
(((speech-type race-daxter-hit))
"race-daxter-hit"
)
(((speech-type civ-f-hit-by-player-vehicle))
"civ-f-hit-by-player-vehicle"
)
(((speech-type guard-hit))
"guard-hit"
)
(((speech-type guard-go-hostile-b))
"guard-go-hostile-b"
)
(((speech-type civ-m-touched-by-player))
"civ-m-touched-by-player"
)
(((speech-type race-errol-last-lap))
"race-errol-last-lap"
)
(((speech-type guard-battle-victory))
"guard-battle-victory"
)
(((speech-type race-jak-last-lap))
"race-jak-last-lap"
)
(((speech-type race-jak-win))
"race-jak-win"
)
(((speech-type guard-chatter-b))
"guard-chatter-b"
)
(((speech-type race-errol-got-hit))
"race-errol-got-hit"
)
(((speech-type civ-m-cower))
"civ-m-cower"
)
(((speech-type race-errol-lose))
"race-errol-lose"
)
(((speech-type race-errrol-hit))
"race-errol-hit"
)
(((speech-type race-daxter-win))
"race-daxter-win"
)
(((speech-type race-daxter-ambient))
"race-daxter-ambient"
)
(((speech-type none))
"none"
)
(((speech-type guard-witness-death))
"guard-witness-death"
)
(((speech-type race-daxter-lap))
"race-daxter-lap"
)
(((speech-type civ-m-shot-by-player))
"civ-m-shot-by-player"
)
(((speech-type guard-change-targets-b))
"guard-change-targets-b"
)
(((speech-type civ-m-alert))
"civ-m-alert"
)
(((speech-type civ-m-ambient))
"civ-m-ambient"
)
(((speech-type civ-m-avoiding-player-vehicle))
"civ-m-avoiding-player-vehicle"
)
(((speech-type race-jak-hit))
"race-jak-hit"
)
(((speech-type race-errol-pass))
"race-errol-pass"
)
(((speech-type guard-chatter-jak-b))
"guard-chatter-jak-b"
)
(((speech-type guard-generic-battle-b))
"guard-generic-battle-b"
)
(((speech-type guard-witness-death-b))
"guard-witness-death-b"
)
(((speech-type race-errol-ambient))
"race-errol-ambient"
)
(((speech-type race-daxter-last-lap))
"race-daxter-last-lap"
)
(((speech-type civ-f-cower))
"civ-f-cower"
)
(((speech-type guard-hit-b))
"guard-hit-b"
)
(((speech-type guard-change-targets))
"guard-change-targets"
)
(((speech-type race-jak-got-hit))
"race-jak-got-hit"
)
(else
"*unknown*"
)
)
)
;; definition (debug) for function gui-status->string
(defun-debug gui-status->string ((arg0 gui-status))
(case arg0
(((gui-status ready))
"ready"
)
(((gui-status active))
"active"
)
(((gui-status stop))
"stop"
)
(((gui-status unknown))
"unknown"
)
(((gui-status hide))
"hide"
)
(((gui-status pending))
"pending"
)
(else
"*unknown*"
)
)
)
;; 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 (s3-0 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))
)
(vector-copy! (-> this target-pos) (target-pos 0))
(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 (and (!= (-> this request handle) #f)
(or (< (the-as time-frame (-> s5-1 request-timeout)) a0-8)
(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))
)
)
)
)
(reset-channel! this)
)
)
(let ((s4-0 (handle->process (-> this request handle))))
(when s4-0
(when (and (>= (- (-> *display* game-clock frame-counter) (the-as int (-> s5-1 time)))
(the-as time-frame (-> s5-1 delay))
)
(>= (- (-> *display* game-clock frame-counter) (-> this end-time))
(the-as time-frame (-> s5-1 delay-pre-time))
)
)
(let ((s2-0 (-> s5-1 list length))
(v1-40 (-> s5-1 play-index))
)
(when (> s2-0 0)
(cond
((logtest? (-> s5-1 flags) (speech-type-flag random-order))
(set! s3-0 (rand-vu-int-count s2-0))
(when (= s3-0 (-> s5-1 play-index))
(+! s3-0 1)
(if (>= s3-0 s2-0)
(set! s3-0 0)
)
)
)
(else
(set! s3-0 (+ v1-40 1))
(if (>= s3-0 s2-0)
(set! s3-0 0)
)
)
)
(set! (-> s5-1 play-index) s3-0)
(let ((s2-1 (-> s5-1 list s3-0)))
(mem-copy! (the-as pointer (-> this last-request)) (the-as pointer (-> this request)) 21)
(set! (-> this start-time) (-> *display* game-clock frame-counter))
(set! (-> this delay) (the-as uint (speech-channel-method-14 this (-> this request speech-type) 1.0)))
(if (logtest? (-> s5-1 flags) (speech-type-flag linked-next))
(set! (-> this speech-table (+ (-> this request speech-type) 1) play-index) s3-0)
)
(set! (-> this id) (add-process *gui-control* s4-0 (-> this gui-channel) (gui-action play) s2-1 -99.0 0))
)
(sound-params-set! *gui-control* (-> this id) #f -1 -1 -1 (-> *setting-control* user-current talker-volume))
(reset-channel! this)
(if (nonzero? (-> this id))
(logior! (-> this flags) (speech-channel-flag disable))
)
)
)
)
)
)
)
(else
(reset-channel! this)
)
)
)
)
(set! (-> this update-time) (-> *display* game-clock frame-counter))
(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 volume) (the int (* 1024.0 (-> *setting-control* user-current talker-volume))))
(set! (-> s5-2 params fo-min) 15)
(set! (-> s5-2 params fo-max) 90)
(set! (-> s5-2 params fo-curve) 9)
(let ((a1-14 (-> (the-as process-drawable s4-1) root trans)))
(let ((s4-2 pp))
(when (= a1-14 #t)
(if (and s4-2 (type? s4-2 process-drawable) (nonzero? (-> (the-as process-drawable s4-2) root)))
(set! a1-14 (-> (the-as process-drawable s4-2) root trans))
(set! a1-14 (the-as vector #f))
)
)
)
(sound-trans-convert (-> s5-2 params trans) a1-14)
)
(set! (-> s5-2 params mask) (the-as uint 481))
(-> 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 (>= (- (-> *display* game-clock frame-counter) (-> 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 14 of type speech-channel
;; WARN: Return type mismatch int vs none.
(defmethod speech-channel-method-14 ((this speech-channel) (arg0 speech-type) (arg1 float))
(let ((s4-0 (-> this speech-table arg0)))
0
(let ((v0-1
(the int
(* arg1 (the float (rand-vu-int-range (the-as int (-> s4-0 min-delay)) (the-as int (-> s4-0 max-delay)))))
)
)
)
(set! (-> s4-0 delay) (the-as uint v0-1))
(set! (-> s4-0 time) (the-as uint (-> *display* game-clock frame-counter)))
(when (logtest? (-> s4-0 flags) (speech-type-flag linked-next))
(let ((v1-11 (-> this speech-table (+ arg0 1))))
(set! (-> v1-11 delay) (the-as uint v0-1))
(set! (-> v1-11 time) (the-as uint (-> *display* game-clock frame-counter)))
)
)
)
)
(none)
)
;; definition for method 9 of type speech-channel
(defmethod speech-channel-method-9 ((this speech-channel) (arg0 process-drawable) (arg1 speech-type))
(let ((s3-0 (-> this speech-table arg1)))
(when (and s3-0 (>= (- (-> *display* game-clock frame-counter) (the-as int (-> s3-0 time)))
(the-as time-frame (-> s3-0 delay))
)
)
(when (and (logtest? (-> s3-0 flags) (speech-type-flag skip-first-time))
(logtest? (-> s3-0 flags) (speech-type-flag first-time))
)
(logclear! (-> s3-0 flags) (speech-type-flag first-time))
(speech-channel-method-14 this arg1 1.0)
(return 0)
)
(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 (-> s3-0 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! (-> this request time) (-> *display* game-clock frame-counter))
)
)
)
)
)
)
0
)
;; 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))
(set! (-> this last-request priority) -10000000000000000000000000000000000000.0)
)
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 17 of type speech-control
(defmethod speech-control-method-17 ((this speech-control) (arg0 speech-type) (arg1 float))
(let ((v1-2 (-> this speech-table arg0)))
(if v1-2
(speech-channel-method-14 (-> this channel-array (-> v1-2 channel)) arg0 arg1)
)
)
(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)
(logior! (-> arg1 flags) (speech-type-flag first-time))
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) (arg0 handle))
(dotimes (s4-0 2)
(speech-channel-method-10 (-> this channel-array s4-0) arg0)
)
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))
(speech-table-reset! this)
(let ((s5-0 (-> this channel-array)))
((method-of-type speech-channel init!) (-> s5-0 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)))
(init! s5-1)
(set! (-> s5-1 speech-table) (-> this speech-table))
(set! (-> s5-1 gui-channel) (gui-channel citizen))
)
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)
(reset-channel! (-> this channel-array s5-0))
)
0
(none)
)
;; definition for method 9 of type speech-control
;; WARN: Return type mismatch int vs none.
(defmethod speech-table-reset! ((this speech-control))
(dotimes (v1-0 61)
(set! (-> this speech-table v1-0) #f)
)
(dotimes (s5-0 2)
(reset-channel! (-> this channel-array s5-0))
)
(speech-table-set! this (speech-type none) (new 'static 'speech-type-info
:priority 3
:delay-pre-time (seconds 1)
:request-timeout (seconds 1)
:min-delay (seconds 1)
:max-delay (seconds 1)
:list (new 'static 'boxed-array :type string)
)
)
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-15 *speech-control*)
;; definition for method 13 of type speech-control
;; WARN: Return type mismatch int vs none.
(defmethod speech-control-method-13 ((this speech-control) (arg0 process-drawable) (arg1 speech-type) (arg2 int))
(if (not (-> *setting-control* user-current disable-guard-chatter?))
(speech-control-method-12 this arg0 (+ arg1 (logand arg2 1)))
)
0
(none)
)