Skip to content

Commit

Permalink
Hide "force audio output" option
Browse files Browse the repository at this point in the history
  • Loading branch information
TuxSH committed Mar 27, 2023
1 parent 4025f25 commit 3e63994
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 28 deletions.
Binary file modified arm9/data/config_template.ini
Binary file not shown.
47 changes: 21 additions & 26 deletions arm9/source/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,19 +446,6 @@ static int configIniHandler(void* user, const char* section, const char* name, c
} else {
CHECK_PARSE_OPTION(-1);
}
} else if (strcmp(name, "force_audio_output") == 0) {
if (strcasecmp(value, "off") == 0) {
cfg->multiConfig |= 0 << (2 * (u32)FORCEAUDIOOUTPUT);
return 1;
} else if (strcasecmp(value, "headphones") == 0) {
cfg->multiConfig |= 1 << (2 * (u32)FORCEAUDIOOUTPUT);
return 1;
} else if (strcasecmp(value, "speakers") == 0) {
cfg->multiConfig |= 2 << (2 * (u32)FORCEAUDIOOUTPUT);
return 1;
} else {
CHECK_PARSE_OPTION(-1);
}
} else {
CHECK_PARSE_OPTION(-1);
}
Expand Down Expand Up @@ -559,7 +546,23 @@ static int configIniHandler(void* user, const char* section, const char* name, c
return 1;
}
}
CHECK_PARSE_OPTION(-1);

if (strcmp(name, "force_audio_output") == 0) {
if (strcasecmp(value, "off") == 0) {
cfg->multiConfig |= 0 << (2 * (u32)FORCEAUDIOOUTPUT);
return 1;
} else if (strcasecmp(value, "headphones") == 0) {
cfg->multiConfig |= 1 << (2 * (u32)FORCEAUDIOOUTPUT);
return 1;
} else if (strcasecmp(value, "speakers") == 0) {
cfg->multiConfig |= 2 << (2 * (u32)FORCEAUDIOOUTPUT);
return 1;
} else {
CHECK_PARSE_OPTION(-1);
}
} else {
CHECK_PARSE_OPTION(-1);
}
} else {
CHECK_PARSE_OPTION(-1);
}
Expand Down Expand Up @@ -647,7 +650,7 @@ static size_t saveLumaIniConfigToStr(char *out)
1 + (int)MULTICONFIG(DEFAULTEMU), 4 - (int)MULTICONFIG(BRIGHTNESS),
splashPosStr, (unsigned int)cfg->splashDurationMsec,
pinNumDigits, n3dsCpuStr,
autobootModeStr, forceAudioOutputStr,
autobootModeStr,

cfg->hbldr3dsxTitleId, rosalinaMenuComboStr,
(int)cfg->ntpTzOffetMinutes,
Expand All @@ -660,6 +663,8 @@ static size_t saveLumaIniConfigToStr(char *out)

cfg->autobootTwlTitleId, (int)cfg->autobootCtrAppmemtype,

forceAudioOutputStr,

(int)CONFIG(PATCHUNITINFO), (int)CONFIG(DISABLEARM11EXCHANDLERS),
(int)CONFIG(ENABLESAFEFIRMROSALINA)
);
Expand Down Expand Up @@ -812,7 +817,6 @@ void configMenu(bool oldPinStatus, u32 oldPinMode)
"PIN lock: Off( ) 4( ) 6( ) 8( ) digits",
"New 3DS CPU: Off( ) Clock( ) L2( ) Clock+L2( )",
"Hbmenu autoboot: Off( ) 3DS( ) DSi( )",
"Force audio: Off( ) Headphones( ) Speakers( )"
};

static const char *singleOptionsText[] = { "( ) Autoboot EmuNAND",
Expand Down Expand Up @@ -864,15 +868,6 @@ void configMenu(bool oldPinStatus, u32 oldPinMode)
"configuration file to configure\n"
"this feature.",

"Force audio output to HPs or speakers.\n\n"
"Currently only for NATIVE_FIRM.\n\n"
"Due to software limitations, this gets\n"
"undone if you actually insert then\n"
"remove HPs (just enter then exit sleep\n"
"mode if this happens).\n\n"
"Also gets bypassed for camera shutter\n"
"sound.",

"If enabled, an EmuNAND\n"
"will be launched on boot.\n\n"
"Otherwise, SysNAND will.\n\n"
Expand Down Expand Up @@ -951,7 +946,7 @@ void configMenu(bool oldPinStatus, u32 oldPinMode)
{ .visible = true },
{ .visible = ISN3DS },
{ .visible = true },
{ .visible = true },
// { .visible = true }, audio rerouting, hidden
};

struct singleOption {
Expand Down
2 changes: 1 addition & 1 deletion arm9/source/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

#define CONFIG_FILE "config.ini"
#define CONFIG_VERSIONMAJOR 3
#define CONFIG_VERSIONMINOR 6
#define CONFIG_VERSIONMINOR 7

#define BOOTCFG_NAND BOOTCONFIG(0, 7)
#define BOOTCFG_FIRM BOOTCONFIG(3, 7)
Expand Down
Binary file modified sysmodules/rosalina/data/config_template.ini
Binary file not shown.
4 changes: 3 additions & 1 deletion sysmodules/rosalina/source/luma_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ static size_t LumaConfig_SaveLumaIniConfigToStr(char *out, const CfgData *cfg)
1 + (int)MULTICONFIG(DEFAULTEMU), 4 - (int)MULTICONFIG(BRIGHTNESS),
splashPosStr, (unsigned int)cfg->splashDurationMsec,
pinNumDigits, n3dsCpuStr,
autobootModeStr, forceAudioOutputStr,
autobootModeStr,

cfg->hbldr3dsxTitleId, rosalinaMenuComboStr,
(int)cfg->ntpTzOffetMinutes,
Expand All @@ -182,6 +182,8 @@ static size_t LumaConfig_SaveLumaIniConfigToStr(char *out, const CfgData *cfg)

cfg->autobootTwlTitleId, (int)cfg->autobootCtrAppmemtype,

forceAudioOutputStr,

(int)CONFIG(PATCHUNITINFO), (int)CONFIG(DISABLEARM11EXCHANDLERS),
(int)CONFIG(ENABLESAFEFIRMROSALINA)
);
Expand Down

0 comments on commit 3e63994

Please sign in to comment.