summaryrefslogtreecommitdiff
path: root/src/menus.c
diff options
context:
space:
mode:
authortortugaveloz <danielcampora@outlook.es>2026-02-06 07:28:54 +0100
committerGitHub <noreply@github.com>2026-02-06 00:28:54 -0600
commitd7413601a664ea571baa5389e8de5a6f6a7e5620 (patch)
tree215751ecd55dca2fa1a3cfd97a6fcf0509efe933 /src/menus.c
parentc902e200ab1b465f557b2e35c1cdc1a06a74eba8 (diff)
Surround support (#642)
* Added surround option. * Added surround effect. * Remove printf. * fix. --------- Co-authored-by: Lywx <kiritodev01@gmail.com>
Diffstat (limited to 'src/menus.c')
-rw-r--r--src/menus.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/menus.c b/src/menus.c
index ab24e419b..d9b84c0a9 100644
--- a/src/menus.c
+++ b/src/menus.c
@@ -1,4 +1,5 @@
#include <libultraship.h>
+#include <libultraship/bridge/audiobridge.h>
#include <macros.h>
#include <defines.h>
#include <common_structs.h>
@@ -152,7 +153,7 @@ const s8 unref_800F2BDC[4] = { 1, 0, 0, 0 };
// from sScreenModePlayerTable, note the 2 is not set since that's for vertical 2p screen
const s8 sScreenModeIdxFromPlayerMode[4] = { 0, 1, 3, 4 };
-const union GameModePack sSoundMenuPack = { { SOUND_STEREO, SOUND_HEADPHONES, SOUND_UNUSED, SOUND_MONO } };
+const union GameModePack sSoundMenuPack = { { SOUND_STEREO, SOUND_HEADPHONES, SOUND_SURROUND, SOUND_MONO } };
/**************************/
@@ -298,9 +299,6 @@ void options_menu_act(struct Controller* controller, u16 controllerIdx) {
} else {
gSoundMode = SOUND_STEREO;
}
- if (gSoundMode == SOUND_UNUSED) {
- gSoundMode = SOUND_MONO;
- }
set_sound_mode();
switch (gSoundMode) {
case SOUND_STEREO:
@@ -309,6 +307,9 @@ void options_menu_act(struct Controller* controller, u16 controllerIdx) {
case SOUND_HEADPHONES:
play_sound2(SOUND_MENU_HEADPHONES);
return;
+ case SOUND_SURROUND:
+ play_sound2(SOUND_MENU_SURROUND);
+ return;
case SOUND_MONO:
play_sound2(SOUND_MENU_MONO);
return;
@@ -1146,9 +1147,6 @@ void splash_menu_act(struct Controller* controller, u16 controllerIdx) {
case DEBUG_MENU_SOUND_MODE: {
if ((btnAndStick & R_JPAD) && (gSoundMode < 3)) {
gSoundMode += 1;
- if (gSoundMode == SOUND_UNUSED) {
- gSoundMode = SOUND_MONO;
- }
play_sound2(SOUND_MENU_CURSOR_MOVE);
set_sound_mode();
gSaveData.main.saveInfo.soundMode = gSoundMode;
@@ -1157,9 +1155,6 @@ void splash_menu_act(struct Controller* controller, u16 controllerIdx) {
}
if ((btnAndStick & L_JPAD) && (gSoundMode > 0)) {
gSoundMode -= 1;
- if (gSoundMode == SOUND_UNUSED) {
- gSoundMode = SOUND_HEADPHONES;
- }
play_sound2(SOUND_MENU_CURSOR_MOVE);
set_sound_mode();
gSaveData.main.saveInfo.soundMode = gSoundMode;
@@ -2078,8 +2073,15 @@ void set_sound_mode(void) {
union GameModePack pack;
pack = sSoundMenuPack;
- if ((gSoundMode == SOUND_STEREO) || (gSoundMode == SOUND_HEADPHONES) || (gSoundMode == SOUND_MONO)) {
+ if ((gSoundMode == SOUND_STEREO) || (gSoundMode == SOUND_HEADPHONES) ||
+ (gSoundMode == SOUND_SURROUND) || (gSoundMode == SOUND_MONO)) {
func_800C3448(pack.modes[gSoundMode] | 0xE0000000);
+
+ if (gSoundMode == SOUND_SURROUND) {
+ SetAudioChannels(audioMatrix51);
+ } else {
+ SetAudioChannels(audioStereo);
+ }
}
}