From 61724235a2bca59e3948bb8f9ed550236fbe8a99 Mon Sep 17 00:00:00 2001 From: Steven Smith Date: Mon, 11 Apr 2016 09:25:04 -0700 Subject: [PATCH] Add support for browsing TWL Sound. --- source/ui/error.c | 8 +++++--- source/ui/mainmenu.c | 25 +++++++++++++------------ source/ui/section/files.c | 17 +++++++++++------ source/ui/section/section.h | 1 + 4 files changed, 30 insertions(+), 21 deletions(-) diff --git a/source/ui/error.c b/source/ui/error.c index 33404a3..c4b993f 100644 --- a/source/ui/error.c +++ b/source/ui/error.c @@ -296,7 +296,7 @@ static const char* description_to_string(Result res) { case 10: return "Not enough memory for allocation"; case 20: - return "Wrong permissions for unprivilaged load or store"; + return "Wrong permissions for unprivileged access"; case 26: return "Session closed by remote process"; case 47: @@ -343,11 +343,13 @@ static const char* description_to_string(Result res) { case 630: return "Archive permission denied"; case 702: - return "Invalid archive path / Inaccessible archive"; + return "Invalid path / Inaccessible archive"; case 705: return "Offset out of bounds"; case 721: return "Reached file size limit"; + case 760: + return "Unsupported operation"; case 761: return "ExeFS read size mismatch"; default: @@ -584,7 +586,7 @@ void error_display_res(void* data, void (*drawTop)(ui_view* view, void* data, fl int summary = R_SUMMARY(result); int module = R_MODULE(result); int description = R_DESCRIPTION(result); - snprintf(errorData->fullText, 4096, "%s\nResult code: 0x%08lX\nLevel: %s (%d)\nSummary: %s (%d)\nModule: %s (%d)\nDecription: %s (%d)", textBuf, result, level_to_string(result), level, summary_to_string(result), summary, module_to_string(result), module, description_to_string(result), description); + snprintf(errorData->fullText, 4096, "%s\nResult code: 0x%08lX\nLevel: %s (%d)\nSummary: %s (%d)\nModule: %s (%d)\nDesc: %s (%d)", textBuf, result, level_to_string(result), level, summary_to_string(result), summary, module_to_string(result), module, description_to_string(result), description); ui_push(prompt_create("Error", errorData->fullText, 0xFF000000, false, errorData, NULL, error_draw_top, error_onresponse)); } diff --git a/source/ui/mainmenu.c b/source/ui/mainmenu.c index 053f108..b7a077e 100644 --- a/source/ui/mainmenu.c +++ b/source/ui/mainmenu.c @@ -8,21 +8,22 @@ #include "section/section.h" #include "../screen.h" -#define MAINMENU_ITEM_COUNT 12 +#define MAINMENU_ITEM_COUNT 13 static u32 mainmenu_item_count = MAINMENU_ITEM_COUNT; static list_item mainmenu_items[MAINMENU_ITEM_COUNT] = { - {"SD", 0xFF000000, files_open_sd}, - {"CTR NAND", 0xFF000000, files_open_ctr_nand}, - {"TWL NAND", 0xFF000000, files_open_twl_nand}, - {"TWL Photo", 0xFF000000, files_open_twl_photo}, - {"Dump NAND", 0xFF000000, dump_nand}, - {"Titles", 0xFF000000, titles_open}, - {"Pending Titles", 0xFF000000, pendingtitles_open}, - {"Tickets", 0xFF000000, tickets_open}, - {"Ext Save Data", 0xFF000000, extsavedata_open}, - {"System Save Data", 0xFF000000, systemsavedata_open}, - {"Network Install to SD", 0xFF000000, networkinstall_open_sd}, + {"SD", 0xFF000000, files_open_sd}, + {"CTR NAND", 0xFF000000, files_open_ctr_nand}, + {"TWL NAND", 0xFF000000, files_open_twl_nand}, + {"TWL Photo", 0xFF000000, files_open_twl_photo}, + {"TWL Sound", 0xFF000000, files_open_twl_sound}, + {"Dump NAND", 0xFF000000, dump_nand}, + {"Titles", 0xFF000000, titles_open}, + {"Pending Titles", 0xFF000000, pendingtitles_open}, + {"Tickets", 0xFF000000, tickets_open}, + {"Ext Save Data", 0xFF000000, extsavedata_open}, + {"System Save Data", 0xFF000000, systemsavedata_open}, + {"Network Install to SD", 0xFF000000, networkinstall_open_sd}, {"Network Install to NAND", 0xFF000000, networkinstall_open_nand}, }; diff --git a/source/ui/section/files.c b/source/ui/section/files.c index 6e19b72..1d16553 100644 --- a/source/ui/section/files.c +++ b/source/ui/section/files.c @@ -268,16 +268,21 @@ void files_open_sd() { } void files_open_ctr_nand() { - FS_Archive sdmcArchive = {ARCHIVE_NAND_CTR_FS, fsMakePath(PATH_EMPTY, "")}; - files_open(sdmcArchive); + FS_Archive ctrNandArchive = {ARCHIVE_NAND_CTR_FS, fsMakePath(PATH_EMPTY, "")}; + files_open(ctrNandArchive); } void files_open_twl_nand() { - FS_Archive sdmcArchive = {ARCHIVE_NAND_TWL_FS, fsMakePath(PATH_EMPTY, "")}; - files_open(sdmcArchive); + FS_Archive twlNandArchive = {ARCHIVE_NAND_TWL_FS, fsMakePath(PATH_EMPTY, "")}; + files_open(twlNandArchive); } void files_open_twl_photo() { - FS_Archive sdmcArchive = {ARCHIVE_TWL_PHOTO, fsMakePath(PATH_EMPTY, "")}; - files_open(sdmcArchive); + FS_Archive twlPhotoArchive = {ARCHIVE_TWL_PHOTO, fsMakePath(PATH_EMPTY, "")}; + files_open(twlPhotoArchive); +} + +void files_open_twl_sound() { + FS_Archive twlSoundArchive = {ARCHIVE_TWL_SOUND, {PATH_EMPTY, 0, ""}}; + files_open(twlSoundArchive); } \ No newline at end of file diff --git a/source/ui/section/section.h b/source/ui/section/section.h index db0f299..fa257cd 100644 --- a/source/ui/section/section.h +++ b/source/ui/section/section.h @@ -9,6 +9,7 @@ void files_open_sd(); void files_open_ctr_nand(); void files_open_twl_nand(); void files_open_twl_photo(); +void files_open_twl_sound(); void networkinstall_open(FS_MediaType dest); void networkinstall_open_sd(); void networkinstall_open_nand();