mirror of
https://github.com/d0k3/GodMode9.git
synced 2025-06-26 13:42:47 +00:00
Allow recursive CMAC fxing for applicable drives
This commit is contained in:
parent
ab557e6ae5
commit
28e542245b
@ -1570,11 +1570,13 @@ u32 GodMode(bool is_b9s) {
|
|||||||
int srch_t = ((strncmp(curr_entry->path + 1, ":/title", 7) == 0) ||
|
int srch_t = ((strncmp(curr_entry->path + 1, ":/title", 7) == 0) ||
|
||||||
(*tpath && PathExist(tpath))) ? ++n_opt : -1;
|
(*tpath && PathExist(tpath))) ? ++n_opt : -1;
|
||||||
int srch_f = ++n_opt;
|
int srch_f = ++n_opt;
|
||||||
|
int fixcmac = (!*current_path && (strspn(curr_entry->path, "14AB") == 1)) ? ++n_opt : -1;
|
||||||
int dirnfo = ++n_opt;
|
int dirnfo = ++n_opt;
|
||||||
int drvnfo = (!*current_path) ? ++n_opt : -1;
|
int drvnfo = (!*current_path) ? ++n_opt : -1;
|
||||||
int stdcpy = (*current_path && strncmp(current_path, OUTPUT_PATH, 256) != 0) ? ++n_opt : -1;
|
int stdcpy = (*current_path && strncmp(current_path, OUTPUT_PATH, 256) != 0) ? ++n_opt : -1;
|
||||||
if (srch_t > 0) optionstr[srch_t-1] = "Search for titles";
|
if (srch_t > 0) optionstr[srch_t-1] = "Search for titles";
|
||||||
if (srch_f > 0) optionstr[srch_f-1] = "Search for files...";
|
if (srch_f > 0) optionstr[srch_f-1] = "Search for files...";
|
||||||
|
if (fixcmac > 0) optionstr[fixcmac-1] = "Fix CMACs for drive";
|
||||||
if (dirnfo > 0) optionstr[dirnfo-1] = "Directory info";
|
if (dirnfo > 0) optionstr[dirnfo-1] = "Directory info";
|
||||||
if (drvnfo > 0) optionstr[drvnfo-1] = "Drive info";
|
if (drvnfo > 0) optionstr[drvnfo-1] = "Drive info";
|
||||||
if (stdcpy > 0) optionstr[stdcpy-1] = "Copy to " OUTPUT_PATH;
|
if (stdcpy > 0) optionstr[stdcpy-1] = "Copy to " OUTPUT_PATH;
|
||||||
@ -1593,6 +1595,9 @@ u32 GodMode(bool is_b9s) {
|
|||||||
cursor = 1;
|
cursor = 1;
|
||||||
scroll = 0;
|
scroll = 0;
|
||||||
}
|
}
|
||||||
|
} else if (user_select == fixcmac) {
|
||||||
|
ShowString("%s\nFixing CMACs for drive...", namestr);
|
||||||
|
RecursiveFixFileCmac(curr_entry->path);
|
||||||
} else if (user_select == dirnfo) {
|
} else if (user_select == dirnfo) {
|
||||||
u64 tsize = 0;
|
u64 tsize = 0;
|
||||||
u32 tdirs = 0;
|
u32 tdirs = 0;
|
||||||
|
@ -236,12 +236,10 @@ u32 FixFileCmac(const char* path) {
|
|||||||
|
|
||||||
u32 RecursiveFixFileCmacWorker(char* path) {
|
u32 RecursiveFixFileCmacWorker(char* path) {
|
||||||
FILINFO fno;
|
FILINFO fno;
|
||||||
|
DIR pdir;
|
||||||
|
|
||||||
if (fvx_stat(path, &fno) != FR_OK) return 1; // path does not exist
|
if (fvx_opendir(&pdir, path) == FR_OK) { // process folder contents
|
||||||
if (fno.fattrib & AM_DIR) { // process folder contents
|
|
||||||
DIR pdir;
|
|
||||||
char* fname = path + strnlen(path, 255);
|
char* fname = path + strnlen(path, 255);
|
||||||
if (fvx_opendir(&pdir, path) != FR_OK) return 1;
|
|
||||||
*(fname++) = '/';
|
*(fname++) = '/';
|
||||||
|
|
||||||
while (f_readdir(&pdir, &fno) == FR_OK) {
|
while (f_readdir(&pdir, &fno) == FR_OK) {
|
||||||
@ -258,7 +256,7 @@ u32 RecursiveFixFileCmacWorker(char* path) {
|
|||||||
}
|
}
|
||||||
f_closedir(&pdir);
|
f_closedir(&pdir);
|
||||||
*(--fname) = '\0';
|
*(--fname) = '\0';
|
||||||
} else if (CheckCmacPath(path) == 0)
|
} else if (CheckCmacPath(path) == 0) // fix single file CMAC
|
||||||
return FixFileCmac(path);
|
return FixFileCmac(path);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user