From c6fc70282162bc8248de3fa8e9b67d9afd990585 Mon Sep 17 00:00:00 2001 From: Zedb0T <89345505+Zedb0T@users.noreply.github.com> Date: Mon, 8 Jul 2024 17:47:39 -0400 Subject: [PATCH 1/7] Add a override for certain sounds in sound-play. --- goal_src/jak1/engine/sound/gsound.gc | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/goal_src/jak1/engine/sound/gsound.gc b/goal_src/jak1/engine/sound/gsound.gc index caea67ed8e..74e23f2115 100644 --- a/goal_src/jak1/engine/sound/gsound.gc +++ b/goal_src/jak1/engine/sound/gsound.gc @@ -279,6 +279,28 @@ (sound-group ,group) ,position)) +(defun sound-play-by-name-hacks ((name sound-name) (id sound-id) (vol int) (pitch int) (bend int) (group sound-group) (trans symbol) (cmd sound-rpc-play)) + "A hack to play the menu-close sound in the original version it did not respect the sfx-volume setting." + (local-vars (sv-16 sound-group)) + (set! sv-16 group) + (let ((sound-trans (the-as vector trans))) + (when *sound-player-enable* + (cond + ((= name 8028901282589599085) ;; menu-close + (set! (-> cmd command) (sound-command play)) + (set! (-> cmd id) id) + (set! (-> cmd name) name) + (set! (-> cmd parms mask) (sound-mask)) + (set! (-> cmd parms group) sv-16) + (set! (-> cmd parms volume) (the int (* (-> *setting-control* default sfx-volume) 10.24))) + (set! (-> cmd parms pitch-mod) pitch) + (set! (-> cmd parms bend) bend) + (sound-trans-from-process cmd sound-trans) + (return id)) + (else + (return #f))))) + #f) + (defun sound-play-by-name ((name sound-name) (id sound-id) (vol int) (pitch int) (bend int) (group sound-group) (trans symbol)) "Play a sound called name with the specified params" (local-vars (sv-16 sound-group)) @@ -286,6 +308,10 @@ (let ((sound-trans (the-as vector trans))) (when *sound-player-enable* (let ((cmd (the-as sound-rpc-play (get-sound-buffer-entry)))) + ;; og:preserve-this fixes menu-close not respecting sfx setting. + (when (sound-play-by-name-hacks name id vol pitch bend group trans cmd) + (return id) + ) (set! (-> cmd command) (sound-command play)) (set! (-> cmd id) id) (set! (-> cmd name) name) From 26ec6e3d3ae35dcd73b164f57de3351f1aa5e6ac Mon Sep 17 00:00:00 2001 From: Zedb0T <89345505+Zedb0T@users.noreply.github.com> Date: Mon, 8 Jul 2024 18:05:48 -0400 Subject: [PATCH 2/7] Revert "Add a override for certain sounds in sound-play." This reverts commit c6fc70282162bc8248de3fa8e9b67d9afd990585. --- goal_src/jak1/engine/sound/gsound.gc | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/goal_src/jak1/engine/sound/gsound.gc b/goal_src/jak1/engine/sound/gsound.gc index 74e23f2115..caea67ed8e 100644 --- a/goal_src/jak1/engine/sound/gsound.gc +++ b/goal_src/jak1/engine/sound/gsound.gc @@ -279,28 +279,6 @@ (sound-group ,group) ,position)) -(defun sound-play-by-name-hacks ((name sound-name) (id sound-id) (vol int) (pitch int) (bend int) (group sound-group) (trans symbol) (cmd sound-rpc-play)) - "A hack to play the menu-close sound in the original version it did not respect the sfx-volume setting." - (local-vars (sv-16 sound-group)) - (set! sv-16 group) - (let ((sound-trans (the-as vector trans))) - (when *sound-player-enable* - (cond - ((= name 8028901282589599085) ;; menu-close - (set! (-> cmd command) (sound-command play)) - (set! (-> cmd id) id) - (set! (-> cmd name) name) - (set! (-> cmd parms mask) (sound-mask)) - (set! (-> cmd parms group) sv-16) - (set! (-> cmd parms volume) (the int (* (-> *setting-control* default sfx-volume) 10.24))) - (set! (-> cmd parms pitch-mod) pitch) - (set! (-> cmd parms bend) bend) - (sound-trans-from-process cmd sound-trans) - (return id)) - (else - (return #f))))) - #f) - (defun sound-play-by-name ((name sound-name) (id sound-id) (vol int) (pitch int) (bend int) (group sound-group) (trans symbol)) "Play a sound called name with the specified params" (local-vars (sv-16 sound-group)) @@ -308,10 +286,6 @@ (let ((sound-trans (the-as vector trans))) (when *sound-player-enable* (let ((cmd (the-as sound-rpc-play (get-sound-buffer-entry)))) - ;; og:preserve-this fixes menu-close not respecting sfx setting. - (when (sound-play-by-name-hacks name id vol pitch bend group trans cmd) - (return id) - ) (set! (-> cmd command) (sound-command play)) (set! (-> cmd id) id) (set! (-> cmd name) name) From 2058b24d29a8e04f722c5d2818e3c4472940ea7e Mon Sep 17 00:00:00 2001 From: Zedb0T <89345505+Zedb0T@users.noreply.github.com> Date: Mon, 8 Jul 2024 18:08:36 -0400 Subject: [PATCH 3/7] Requested changes --- goal_src/jak1/pc/progress-pc.gc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/goal_src/jak1/pc/progress-pc.gc b/goal_src/jak1/pc/progress-pc.gc index c39634babb..ce67113160 100644 --- a/goal_src/jak1/pc/progress-pc.gc +++ b/goal_src/jak1/pc/progress-pc.gc @@ -2906,7 +2906,7 @@ ;; override the enter handler for progress-going-out (set! (-> progress-going-out enter) (lambda :behavior progress () - (sound-play "menu-close") + (sound-play "menu-close" :vol (-> *setting-control* default sfx-volume)) ;; og:preserve-this Make this sound respect sfx setting (hide-progress-icons) (remove-setting! 'music) (apply-settings *setting-control*) From 61972841939170330b54e7a641213bd024870ce3 Mon Sep 17 00:00:00 2001 From: Zedb0T <89345505+Zedb0T@users.noreply.github.com> Date: Mon, 8 Jul 2024 18:18:07 -0400 Subject: [PATCH 4/7] Remove unnecessary comment --- goal_src/jak1/pc/progress-pc.gc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/goal_src/jak1/pc/progress-pc.gc b/goal_src/jak1/pc/progress-pc.gc index ce67113160..99ef707770 100644 --- a/goal_src/jak1/pc/progress-pc.gc +++ b/goal_src/jak1/pc/progress-pc.gc @@ -2906,7 +2906,7 @@ ;; override the enter handler for progress-going-out (set! (-> progress-going-out enter) (lambda :behavior progress () - (sound-play "menu-close" :vol (-> *setting-control* default sfx-volume)) ;; og:preserve-this Make this sound respect sfx setting + (sound-play "menu-close" :vol (-> *setting-control* default sfx-volume)) (hide-progress-icons) (remove-setting! 'music) (apply-settings *setting-control*) From 062e56b53ad6c5b8c0a897168d02d68ba55e4ef0 Mon Sep 17 00:00:00 2001 From: Zedb0T <89345505+Zedb0T@users.noreply.github.com> Date: Mon, 8 Jul 2024 18:41:29 -0400 Subject: [PATCH 5/7] Revert "Remove unnecessary comment" This reverts commit 61972841939170330b54e7a641213bd024870ce3. --- goal_src/jak1/pc/progress-pc.gc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/goal_src/jak1/pc/progress-pc.gc b/goal_src/jak1/pc/progress-pc.gc index 99ef707770..ce67113160 100644 --- a/goal_src/jak1/pc/progress-pc.gc +++ b/goal_src/jak1/pc/progress-pc.gc @@ -2906,7 +2906,7 @@ ;; override the enter handler for progress-going-out (set! (-> progress-going-out enter) (lambda :behavior progress () - (sound-play "menu-close" :vol (-> *setting-control* default sfx-volume)) + (sound-play "menu-close" :vol (-> *setting-control* default sfx-volume)) ;; og:preserve-this Make this sound respect sfx setting (hide-progress-icons) (remove-setting! 'music) (apply-settings *setting-control*) From 3245497ff9af548a27d8dffc39546e52647f0b07 Mon Sep 17 00:00:00 2001 From: Zedb0T <89345505+Zedb0T@users.noreply.github.com> Date: Mon, 8 Jul 2024 18:41:34 -0400 Subject: [PATCH 6/7] Revert "Requested changes" This reverts commit 2058b24d29a8e04f722c5d2818e3c4472940ea7e. --- goal_src/jak1/pc/progress-pc.gc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/goal_src/jak1/pc/progress-pc.gc b/goal_src/jak1/pc/progress-pc.gc index ce67113160..c39634babb 100644 --- a/goal_src/jak1/pc/progress-pc.gc +++ b/goal_src/jak1/pc/progress-pc.gc @@ -2906,7 +2906,7 @@ ;; override the enter handler for progress-going-out (set! (-> progress-going-out enter) (lambda :behavior progress () - (sound-play "menu-close" :vol (-> *setting-control* default sfx-volume)) ;; og:preserve-this Make this sound respect sfx setting + (sound-play "menu-close") (hide-progress-icons) (remove-setting! 'music) (apply-settings *setting-control*) From ded4d8e28b9cf209e779c0b1bdfe13b1dcdfdec1 Mon Sep 17 00:00:00 2001 From: Zedb0T <89345505+Zedb0T@users.noreply.github.com> Date: Mon, 8 Jul 2024 18:43:43 -0400 Subject: [PATCH 7/7] Requested changes pt 2 --- goal_src/jak1/engine/game/settings.gc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/goal_src/jak1/engine/game/settings.gc b/goal_src/jak1/engine/game/settings.gc index 6f18a8e273..e9f2515d79 100644 --- a/goal_src/jak1/engine/game/settings.gc +++ b/goal_src/jak1/engine/game/settings.gc @@ -157,7 +157,9 @@ (when *sound-player-enable* (when (!= (-> gp-0 sfx-volume) (-> s5-1 sfx-volume)) (seek! (-> gp-0 sfx-volume) (-> s5-1 sfx-volume) (* 100.0 (seconds-per-frame))) - (sound-set-volume (sound-group sfx) (-> gp-0 sfx-volume))) + (sound-set-volume (sound-group sfx) (-> gp-0 sfx-volume)) + ;; og:preserve-this Fix for menu-close + (sound-set-volume (sound-group sog3) (-> gp-0 sfx-volume))) (when (!= (-> gp-0 music-volume) (-> s5-1 music-volume)) (seek! (-> gp-0 music-volume) (-> s5-1 music-volume) (* 100.0 (seconds-per-frame))) (sound-set-volume (sound-group music) (-> gp-0 music-volume)))