From d1f3dbf06b6d408aeed1ab49b5a2c28727448014 Mon Sep 17 00:00:00 2001 From: Alex Taber Date: Wed, 8 May 2024 17:21:46 -0400 Subject: [PATCH] Throw warning on mono audio install. --- source/themes.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/source/themes.c b/source/themes.c index add6d14..9abc4ec 100644 --- a/source/themes.c +++ b/source/themes.c @@ -41,6 +41,7 @@ static Result install_theme_internal(Entry_List_s themes, int installmode) char* body = NULL; u32 body_size = 0; u32 shuffle_body_sizes[MAX_SHUFFLE_THEMES] = {0}; + bool mono_audio = false; if(installmode & THEME_INSTALL_SHUFFLE) { @@ -67,6 +68,7 @@ static Result install_theme_internal(Entry_List_s themes, int installmode) FSUSER_OpenFile(&body_cache_handle, ArchiveThemeExt, fsMakePath(PATH_ASCII, "/BodyCache_rd.bin"), FS_OPEN_WRITE, 0); } + for(int i = 0; i < themes.entries_count; i++) { Entry_s * current_theme = &themes.entries[i]; @@ -116,6 +118,11 @@ static Result install_theme_internal(Entry_List_s themes, int installmode) DEBUG("bgm too big\n"); return MAKERESULT(RL_PERMANENT, RS_CANCELED, RM_APPLICATION, RD_TOO_LARGE); } + + if (music[0x62] == 1) + { + mono_audio = true; + } } shuffle_music_sizes[shuffle_count] = music_size; @@ -193,6 +200,11 @@ static Result install_theme_internal(Entry_List_s themes, int installmode) if (music_size != 0) { + if (music[0x62] == 1) + { + mono_audio = true; + } + remake_file(fsMakePath(PATH_ASCII, "/BgmCache.bin"), ArchiveThemeExt, BGM_MAX_SIZE); res = buf_to_file(music_size, fsMakePath(PATH_ASCII, "/BgmCache.bin"), ArchiveThemeExt, music); free(music); @@ -285,7 +297,10 @@ static Result install_theme_internal(Entry_List_s themes, int installmode) free(savedata_buf); if(R_FAILED(res)) return res; //---------------------------------------- - + if (mono_audio) + { + throw_error("One or more installed themes use mono audio.\nMono audio causes a number of issues.\nCheck the wiki for more information.", ERROR_LEVEL_WARNING); + } return 0; }