diff --git a/port/src/main.c b/port/src/main.c index 642007beb..9b4a6b641 100644 --- a/port/src/main.c +++ b/port/src/main.c @@ -151,6 +151,7 @@ PD_CONSTRUCTOR static void gameConfigInit(void) configRegisterFloat("Game.ScreenShakeIntensity", &g_ViShakeIntensityMult, 0.f, 10.f); configRegisterInt("Game.TickRateDivisor", &g_TickRateDiv, 0, 10); configRegisterInt("Game.SkipIntro", &g_SkipIntro, 0, 1); + configRegisterInt("Game.DisableMpDeathMusic", &g_MusicDisableMpDeath, 0, 1); for (s32 j = 0; j < MAX_PLAYERS; ++j) { const s32 i = j + 1; configRegisterFloat(strFmt("Game.Player%d.FovY", i), &g_PlayerExtCfg[j].fovy, 5.f, 175.f); diff --git a/port/src/optionsmenu.c b/port/src/optionsmenu.c index f5bb723fc..bf9b74e8d 100644 --- a/port/src/optionsmenu.c +++ b/port/src/optionsmenu.c @@ -724,6 +724,56 @@ struct menudialogdef g_ExtendedVideoMenuDialog = { NULL, }; +static MenuItemHandlerResult menuhandlerDisableMpDeathMusic(s32 operation, struct menuitem *item, union handlerdata *data) +{ + switch (operation) { + case MENUOP_GET: + return g_MusicDisableMpDeath; + case MENUOP_SET: + g_MusicDisableMpDeath = data->checkbox.value; + break; + } + + return 0; +} + +struct menuitem g_ExtendedAudioMenuItems[] = { + { + MENUITEMTYPE_CHECKBOX, + 0, + MENUITEMFLAG_LITERAL_TEXT, + (uintptr_t)"Disable MP Death Music", + 0, + menuhandlerDisableMpDeathMusic, + }, + { + MENUITEMTYPE_SEPARATOR, + 0, + 0, + 0, + 0, + NULL, + }, + { + MENUITEMTYPE_SELECTABLE, + 0, + MENUITEMFLAG_SELECTABLE_CLOSESDIALOG, + L_OPTIONS_213, // "Back" + 0, + NULL, + }, + { MENUITEMTYPE_END }, +}; + +struct menudialogdef g_ExtendedAudioMenuDialog = { + MENUDIALOGTYPE_DEFAULT, + (uintptr_t)"Extended Audio Options", + g_ExtendedAudioMenuItems, + NULL, + MENUDIALOGFLAG_LITERAL_TEXT, + NULL, +}; + static MenuItemHandlerResult menuhandlerCrouchMode(s32 operation, struct menuitem *item, union handlerdata *data) { static const char *opts[] = { @@ -1107,6 +1157,14 @@ struct menuitem g_ExtendedMenuItems[] = { 0, (void *)&g_ExtendedVideoMenuDialog, }, + { + MENUITEMTYPE_SELECTABLE, + 0, + MENUITEMFLAG_SELECTABLE_OPENSDIALOG | MENUITEMFLAG_LITERAL_TEXT, + (uintptr_t)"Audio\n", + 0, + (void *)&g_ExtendedAudioMenuDialog, + }, { MENUITEMTYPE_SELECTABLE, 0, diff --git a/src/game/music.c b/src/game/music.c index c6ed3dd5f..a3c3840f0 100644 --- a/src/game/music.c +++ b/src/game/music.c @@ -46,6 +46,10 @@ s32 g_MusicAge60 = 0; // The current age of the MP track being played s32 g_MusicLife60 = TICKS(120); // The max age of any MP track (this value is changed in MP code) s32 g_MusicSilenceTimer60 = 0; // Counts down the 2 second silence between MP track changes +#ifndef PLATFORM_N64 +s32 g_MusicDisableMpDeath = false; +#endif + #if VERSION < VERSION_NTSC_1_0 const char var7f1b2030nb[] = "MUSIC : musicPlayLevel\n"; const char var7f1b2048nb[] = "MUSIC : SWITCHING TO CORRECT AMBIENT TUNE\n"; @@ -516,6 +520,12 @@ void _musicStartMpDeath(f32 arg0) void musicStartMpDeath(void) { +#ifndef PLATFORM_N64 + if (g_MusicDisableMpDeath) { + return; + } +#endif + #if VERSION >= VERSION_NTSC_1_0 musicSaveInterval(); #endif diff --git a/src/include/data.h b/src/include/data.h index e94aaa7c5..0b93a521f 100644 --- a/src/include/data.h +++ b/src/include/data.h @@ -546,6 +546,7 @@ extern s32 g_PrevFrameFb; extern s32 g_BlurFb; extern s32 g_BlurFbCapTimer; extern s32 g_TickRateDiv; +extern s32 g_MusicDisableMpDeath; #define PLAYER_EXTCFG() g_PlayerExtCfg[g_Vars.currentplayerstats->mpindex & 3] #define PLAYER_DEFAULT_FOV (PLAYER_EXTCFG().fovy)