nyx: Add more info while formatting emuMMC USER

This commit is contained in:
CTCaer 2021-02-08 03:52:23 +02:00
parent 7a27a7b3b5
commit 38ce46a158
2 changed files with 18 additions and 7 deletions

View file

@ -651,6 +651,8 @@ static int _dump_emummc_raw_part(emmc_tool_gui_t *gui, int active_part, int part
if (resized_count)
{
lv_label_ins_text(gui->label_log, LV_LABEL_POS_LAST, "Done!\n");
// Calculate USER size and set it for FatFS.
u32 user_sectors = resized_count - user_offset - 33;
disk_set_info(DRIVE_EMU, SET_SECTOR_COUNT, &user_sectors);
@ -662,7 +664,7 @@ static int _dump_emummc_raw_part(emmc_tool_gui_t *gui, int active_part, int part
strcpy(user_part.name, "USER");
nx_emmc_bis_init(&user_part, true, sd_sector_off);
s_printf(gui->txt_buf, "\nFormatting USER...\n");
s_printf(gui->txt_buf, "Formatting USER... \n");
lv_label_ins_text(gui->label_log, LV_LABEL_POS_LAST, gui->txt_buf);
manual_system_maintenance(true);
@ -676,17 +678,18 @@ static int _dump_emummc_raw_part(emmc_tool_gui_t *gui, int active_part, int part
if (mkfs_error)
{
s_printf(gui->txt_buf, "#FF0000 USER format failed (%d)...#\nPlease try again...\n", mkfs_error);
s_printf(gui->txt_buf, "#FF0000 Failed (%d)!#\nPlease try again...\n", mkfs_error);
lv_label_ins_text(gui->label_log, LV_LABEL_POS_LAST, gui->txt_buf);
return 0;
}
lv_label_ins_text(gui->label_log, LV_LABEL_POS_LAST, "Done!\n");
// Flush BIS cache, deinit, clear BIS keys slots and reinstate SBK.
nx_emmc_bis_end();
hos_bis_keys_clear();
s_printf(gui->txt_buf, "Writing new GPT...\n");
s_printf(gui->txt_buf, "Writing new GPT... ");
lv_label_ins_text(gui->label_log, LV_LABEL_POS_LAST, gui->txt_buf);
manual_system_maintenance(true);
@ -706,7 +709,7 @@ static int _dump_emummc_raw_part(emmc_tool_gui_t *gui, int active_part, int part
if (gpt_entry_idx >= gpt_main.header.num_part_ents)
{
s_printf(gui->txt_buf, "#FF0000 No USER partition...#\nPlease try again...\n");
s_printf(gui->txt_buf, "\n#FF0000 No USER partition...#\nPlease try again...\n");
lv_label_ins_text(gui->label_log, LV_LABEL_POS_LAST, gui->txt_buf);
return 0;

View file

@ -1621,9 +1621,16 @@ static lv_res_t _create_mbox_partitioning_next(lv_obj_t *btn)
s_printf(txt_buf, "#FFDD00 Warning: This will partition the SD Card!#\n\n");
if (part_info.backup_possible)
strcat(txt_buf, "#C7EA46 Your files will be backed up and restored!#\n#FFDD00Any other partition will be wiped!#");
{
strcat(txt_buf, "#C7EA46 Your files will be backed up and restored!#\n"
"#FFDD00 Any other partition will be wiped!#");
}
else
strcat(txt_buf, "#FFDD00 Your files will be wiped!#\n#FFDD00 Use USB UMS to copy them over!#");
{
strcat(txt_buf, "#FFDD00 Your files will be wiped!#\n"
"#FFDD00 Any other partition will be also wiped!#\n"
"#FFDD00 Use USB UMS to copy them over!#");
}
lv_label_set_text(lbl_status, txt_buf);
@ -1909,7 +1916,8 @@ static void create_mbox_check_files_total_size()
else
{
lv_mbox_set_text(mbox,
"#FFDD00 The SD Card cannot be backed up!#\n\n"
"#FFDD00 The SD Card cannot be backed up!#\n"
"#FFDD00 Any other partition will be also wiped!#\n\n"
"You will be asked to back up your files later via UMS.");
}