nyx: emummc: remove unneeded stuff, it's 2026.
This commit is contained in:
@@ -920,25 +920,6 @@ static void _create_emummc_migrated_mbox()
|
||||
lv_obj_set_top(mbox, true);
|
||||
}
|
||||
|
||||
static void _migrate_sd_raw_based()
|
||||
{
|
||||
mbr_ctx.sector_start = 2;
|
||||
|
||||
boot_storage_mount();
|
||||
f_mkdir("emuMMC");
|
||||
f_mkdir("emuMMC/ER00");
|
||||
|
||||
f_rename("Emutendo", "emuMMC/ER00/Nintendo");
|
||||
FIL fp;
|
||||
f_open(&fp, "emuMMC/ER00/raw_based", FA_CREATE_ALWAYS | FA_WRITE);
|
||||
f_write(&fp, &mbr_ctx.sector_start, 4, NULL);
|
||||
f_close(&fp);
|
||||
|
||||
save_emummc_cfg(1, emummc_part_cfg.sector, "emuMMC/ER00", 0);
|
||||
_create_emummc_migrated_mbox();
|
||||
boot_storage_unmount();
|
||||
}
|
||||
|
||||
static void _migrate_sd_raw_emummc_based()
|
||||
{
|
||||
char *tmp = (char *)malloc(0x80);
|
||||
@@ -968,49 +949,6 @@ static void _migrate_sd_raw_emummc_based()
|
||||
boot_storage_unmount();
|
||||
sd_unmount();
|
||||
}
|
||||
|
||||
static void _migrate_sd_file_based()
|
||||
{
|
||||
sd_mount();
|
||||
boot_storage_mount();
|
||||
f_mkdir("sd:emuMMC");
|
||||
f_mkdir("sd:emuMMC/EF00");
|
||||
|
||||
f_rename("sd:Emutendo", "sd:emuMMC/EF00/Nintendo");
|
||||
FIL fp;
|
||||
|
||||
f_mkdir("emuMMC");
|
||||
f_mkdir("emuMMC/EF00");
|
||||
f_open(&fp, "emuMMC/EF00/file_based", FA_CREATE_ALWAYS | FA_WRITE);
|
||||
f_close(&fp);
|
||||
|
||||
char *path = (char *)malloc(128);
|
||||
char *path2 = (char *)malloc(128);
|
||||
s_printf(path, "sd:%c%c%c%c%s", 's', 'x', 'o', 's', "/emunand");
|
||||
f_rename(path, "sd:emuMMC/EF00/eMMC");
|
||||
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
s_printf(path, "sd:emuMMC/EF00/eMMC/boot%d.bin", i);
|
||||
s_printf(path2, "sd:emuMMC/EF00/eMMC/BOOT%d", i);
|
||||
f_rename(path, path2);
|
||||
}
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
s_printf(path, "sd:emuMMC/EF00/eMMC/full.%02d.bin", i);
|
||||
s_printf(path2, "sd:emuMMC/EF00/eMMC/%02d", i);
|
||||
f_rename(path, path2);
|
||||
}
|
||||
|
||||
free(path);
|
||||
free(path2);
|
||||
|
||||
save_emummc_cfg(0, 0, "emuMMC/EF00",0 );
|
||||
_create_emummc_migrated_mbox();
|
||||
sd_unmount();
|
||||
boot_storage_unmount();
|
||||
}
|
||||
|
||||
static u32 _copy_file(const char *src, const char* dest){
|
||||
u32 res = FR_OK;
|
||||
u8 *buf = (u8*)MIXD_BUF_ALIGNED;
|
||||
@@ -1169,58 +1107,7 @@ static void _migrate_sd_backup_file_based()
|
||||
boot_storage_unmount();
|
||||
}
|
||||
|
||||
static lv_res_t _create_emummc_mig1_action(lv_obj_t * btns, const char * txt)
|
||||
{
|
||||
switch (lv_btnm_get_pressed(btns))
|
||||
{
|
||||
case 0:
|
||||
_migrate_sd_file_based();
|
||||
break;
|
||||
case 1:
|
||||
_migrate_sd_raw_based();
|
||||
break;
|
||||
}
|
||||
|
||||
memset(&emummc_part_cfg, 0, sizeof(emummc_part_cfg));
|
||||
|
||||
nyx_mbox_action(btns, txt);
|
||||
|
||||
return LV_RES_INV;
|
||||
}
|
||||
|
||||
static lv_res_t _create_emummc_mig0_action(lv_obj_t * btns, const char * txt)
|
||||
{
|
||||
switch (lv_btnm_get_pressed(btns))
|
||||
{
|
||||
case 0:
|
||||
_migrate_sd_file_based();
|
||||
break;
|
||||
}
|
||||
|
||||
memset(&emummc_part_cfg, 0, sizeof(emummc_part_cfg));
|
||||
|
||||
nyx_mbox_action(btns, txt);
|
||||
|
||||
return LV_RES_INV;
|
||||
}
|
||||
|
||||
static lv_res_t _create_emummc_mig2_action(lv_obj_t * btns, const char * txt)
|
||||
{
|
||||
switch (lv_btnm_get_pressed(btns))
|
||||
{
|
||||
case 0:
|
||||
_migrate_sd_raw_based();
|
||||
break;
|
||||
}
|
||||
|
||||
memset(&emummc_part_cfg, 0, sizeof(emummc_part_cfg));
|
||||
|
||||
nyx_mbox_action(btns, txt);
|
||||
|
||||
return LV_RES_INV;
|
||||
}
|
||||
|
||||
static lv_res_t _create_emummc_mig3_action(lv_obj_t * btns, const char * txt)
|
||||
{
|
||||
switch (lv_btnm_get_pressed(btns))
|
||||
{
|
||||
@@ -1236,7 +1123,7 @@ static lv_res_t _create_emummc_mig3_action(lv_obj_t * btns, const char * txt)
|
||||
return LV_RES_INV;
|
||||
}
|
||||
|
||||
static lv_res_t _create_emummc_mig4_action(lv_obj_t * btns, const char * txt)
|
||||
static lv_res_t _create_emummc_mig1_action(lv_obj_t * btns, const char * txt)
|
||||
{
|
||||
switch (lv_btnm_get_pressed(btns))
|
||||
{
|
||||
@@ -1252,8 +1139,6 @@ static lv_res_t _create_emummc_mig4_action(lv_obj_t * btns, const char * txt)
|
||||
return LV_RES_INV;
|
||||
}
|
||||
|
||||
bool em_raw;
|
||||
bool em_file;
|
||||
static lv_res_t _create_emummc_migrate_action(lv_obj_t * btns, const char * txt)
|
||||
{
|
||||
bool backup = false;
|
||||
@@ -1268,8 +1153,6 @@ static lv_res_t _create_emummc_migrate_action(lv_obj_t * btns, const char * txt)
|
||||
emummc = true;
|
||||
break;
|
||||
case 2:
|
||||
break;
|
||||
case 3:
|
||||
nyx_mbox_action(btns, txt);
|
||||
return LV_RES_INV;
|
||||
}
|
||||
@@ -1279,8 +1162,7 @@ static lv_res_t _create_emummc_migrate_action(lv_obj_t * btns, const char * txt)
|
||||
lv_obj_set_size(dark_bg, LV_HOR_RES, LV_VER_RES);
|
||||
|
||||
static const char *mbox_btn_map[] = { "\222Continue", "\222Cancel", "" };
|
||||
static const char *mbox_btn_map1[] = { "\222SD File", "\222SD Partition", "\222Cancel", "" };
|
||||
static const char *mbox_btn_map3[] = { "\251", "OK", "\251", "" };
|
||||
static const char *mbox_btn_map1[] = { "\251", "OK", "\251", "" };
|
||||
lv_obj_t * mbox = lv_mbox_create(dark_bg, NULL);
|
||||
lv_mbox_set_recolor_text(mbox, true);
|
||||
lv_obj_set_width(mbox, LV_HOR_RES / 9 * 6);
|
||||
@@ -1297,40 +1179,19 @@ static lv_res_t _create_emummc_migrate_action(lv_obj_t * btns, const char * txt)
|
||||
s_printf(txt_buf,
|
||||
"#C7EA46 Found suitable emuMMC backup!#\n\n"
|
||||
"#FF8000 Do you want to migrate it?#\n");
|
||||
lv_mbox_add_btns(mbox, mbox_btn_map, _create_emummc_mig4_action);
|
||||
lv_mbox_add_btns(mbox, mbox_btn_map, _create_emummc_mig1_action);
|
||||
}
|
||||
else if (emummc)
|
||||
{
|
||||
s_printf(txt_buf,
|
||||
"#C7EA46 Found SD Partition based emuMMC!#\n\n"
|
||||
"#FF8000 Do you want to repair the config and partition type for it?#\n");
|
||||
lv_mbox_add_btns(mbox, mbox_btn_map, _create_emummc_mig3_action);
|
||||
}
|
||||
else if (em_raw && em_file)
|
||||
{
|
||||
s_printf(txt_buf,
|
||||
"#C7EA46 Found both foreign SD File and Partition emunand!#\n\n"
|
||||
"#FF8000 Choose what to migrate:#\n");
|
||||
lv_mbox_add_btns(mbox, mbox_btn_map1, _create_emummc_mig1_action);
|
||||
}
|
||||
else if (em_raw)
|
||||
{
|
||||
s_printf(txt_buf,
|
||||
"#C7EA46 Found foreign SD Partition emunand!#\n\n"
|
||||
"#FF8000 Do you want to migrate it?#\n");
|
||||
lv_mbox_add_btns(mbox, mbox_btn_map, _create_emummc_mig2_action);
|
||||
}
|
||||
else if (em_file)
|
||||
{
|
||||
s_printf(txt_buf,
|
||||
"#C7EA46 Found foreign SD File emunand!#\n\n"
|
||||
"#FF8000 Do you want to migrate it?#\n");
|
||||
lv_mbox_add_btns(mbox, mbox_btn_map, _create_emummc_mig0_action);
|
||||
}
|
||||
else
|
||||
{
|
||||
s_printf(txt_buf, "No emuMMC or foreign emunand found!\n");
|
||||
lv_mbox_add_btns(mbox, mbox_btn_map3, nyx_mbox_action);
|
||||
s_printf(txt_buf, "No emuMMC found!\n");
|
||||
lv_mbox_add_btns(mbox, mbox_btn_map1, nyx_mbox_action);
|
||||
}
|
||||
|
||||
lv_mbox_set_text(mbox, txt_buf);
|
||||
@@ -1366,7 +1227,7 @@ static lv_res_t _create_mbox_emummc_migrate(lv_obj_t *btn)
|
||||
lv_obj_set_style(dark_bg, &mbox_darken);
|
||||
lv_obj_set_size(dark_bg, LV_HOR_RES, LV_VER_RES);
|
||||
|
||||
static char *mbox_btn_map[] = { "\262Backup", "\262Fix RAW", "\262Emunand", "\222Cancel", "" };
|
||||
static char *mbox_btn_map[] = { "\262Backup", "\262Fix RAW", "\222Cancel", "" };
|
||||
lv_obj_t * mbox = lv_mbox_create(dark_bg, NULL);
|
||||
lv_mbox_set_recolor_text(mbox, true);
|
||||
lv_obj_set_width(mbox, LV_HOR_RES / 9 * 6);
|
||||
@@ -1386,8 +1247,6 @@ static lv_res_t _create_mbox_emummc_migrate(lv_obj_t *btn)
|
||||
|
||||
emmc_initialize(false);
|
||||
|
||||
em_raw = false;
|
||||
em_file = false;
|
||||
bool backup = false;
|
||||
bool emummc = false;
|
||||
bool rawnand_backup = false;
|
||||
@@ -1422,18 +1281,6 @@ static lv_res_t _create_mbox_emummc_migrate(lv_obj_t *btn)
|
||||
}
|
||||
}
|
||||
|
||||
if (!mbr_ctx.part_idx)
|
||||
{
|
||||
sdmmc_storage_read(&sd_storage, 0x4003, 1, efi_part);
|
||||
if (!memcmp(efi_part, "EFI PART", 8))
|
||||
em_raw = true;
|
||||
}
|
||||
|
||||
s_printf(path_buf, "sd:%c%c%c%c%s", 's', 'x', 'o','s', "/emunand/boot0.bin");
|
||||
|
||||
if (!f_stat(path_buf, NULL))
|
||||
em_file = true;
|
||||
|
||||
emummc_backup = false;
|
||||
|
||||
emmcsn_path_impl(path_buf, "", "BOOT0", &emmc_storage);
|
||||
@@ -1483,10 +1330,6 @@ static lv_res_t _create_mbox_emummc_migrate(lv_obj_t *btn)
|
||||
mbox_btn_map[1][0] = '\222';
|
||||
else
|
||||
mbox_btn_map[1][0] = '\262';
|
||||
if (em_raw || em_file)
|
||||
mbox_btn_map[2][0] = '\222';
|
||||
else
|
||||
mbox_btn_map[2][0] = '\262';
|
||||
|
||||
free(path_buf);
|
||||
free(mbr);
|
||||
@@ -2000,7 +1843,7 @@ lv_res_t create_tab_emummc_tools(lv_obj_t *parent)
|
||||
lv_obj_t *label_txt = lv_label_create(h1, NULL);
|
||||
lv_label_set_static_text(label_txt, "emuMMC Info & Selection");
|
||||
lv_obj_set_style(label_txt, lv_theme_get_current()->label.prim);
|
||||
lv_obj_align(label_txt, h1, LV_ALIGN_IN_TOP_LEFT, LV_DPI / 4, -LV_DPI / 9);
|
||||
lv_obj_align(label_txt, label_sep, LV_ALIGN_OUT_BOTTOM_LEFT, LV_DPI / 4, LV_DPI / 11);
|
||||
|
||||
lv_obj_t *line_sep = lv_line_create(h1, NULL);
|
||||
static const lv_point_t line_pp[] = { {0, 0}, { LV_HOR_RES - (LV_DPI - (LV_DPI / 4)) * 2, 0} };
|
||||
@@ -2042,7 +1885,7 @@ lv_res_t create_tab_emummc_tools(lv_obj_t *parent)
|
||||
}
|
||||
else
|
||||
{
|
||||
lv_label_set_static_text(label_txt2, "emuMMC is disabled and eMMC will be used for boot.\n\n");
|
||||
lv_label_set_static_text(label_txt2, "emuMMC is disabled and eMMC will be used for boot.\n\n\n");
|
||||
}
|
||||
|
||||
if (emu_info.path)
|
||||
@@ -2087,7 +1930,7 @@ lv_res_t create_tab_emummc_tools(lv_obj_t *parent)
|
||||
lv_obj_t *label_txt3 = lv_label_create(h2, NULL);
|
||||
lv_label_set_static_text(label_txt3, "emuMMC Tools");
|
||||
lv_obj_set_style(label_txt3, lv_theme_get_current()->label.prim);
|
||||
lv_obj_align(label_txt3, h2, LV_ALIGN_IN_TOP_LEFT, LV_DPI / 4, 0);
|
||||
lv_obj_align(label_txt3, label_sep, LV_ALIGN_OUT_BOTTOM_LEFT, LV_DPI / 4, LV_DPI / 5);
|
||||
|
||||
line_sep = lv_line_create(h2, line_sep);
|
||||
lv_obj_align(line_sep, label_txt3, LV_ALIGN_OUT_BOTTOM_LEFT, -(LV_DPI / 4), LV_DPI / 8);
|
||||
@@ -2120,8 +1963,7 @@ lv_res_t create_tab_emummc_tools(lv_obj_t *parent)
|
||||
label_txt4 = lv_label_create(h2, NULL);
|
||||
lv_label_set_recolor(label_txt4, true);
|
||||
lv_label_set_static_text(label_txt4,
|
||||
"Migrate a backup to a #C7EA46 SD File# or repair existing #C7EA46 SD Raw Partition#.\n"
|
||||
"Additionally it allows you to migrate from other emunand\nsolutions.");
|
||||
"Migrate a backup to a #C7EA46 SD File emuMMC# or repair an existing\n#C7EA46 SD Raw Partition emuMMC#.\n");
|
||||
lv_obj_set_style(label_txt4, &hint_small_style);
|
||||
lv_obj_align(label_txt4, btn4, LV_ALIGN_OUT_BOTTOM_LEFT, 0, LV_DPI / 3);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user