nyx: emummc: remove unneeded stuff, it's 2026.
This commit is contained in:
@@ -402,25 +402,6 @@ static void _create_emummc_migrated_mbox()
|
||||
lv_obj_set_top(mbox, true);
|
||||
}
|
||||
|
||||
static void _migrate_sd_raw_based()
|
||||
{
|
||||
mbr_ctx.sector_start = 2;
|
||||
|
||||
sd_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, mbr_ctx.sector_start, "emuMMC/ER00");
|
||||
_create_emummc_migrated_mbox();
|
||||
sd_unmount();
|
||||
}
|
||||
|
||||
static void _migrate_sd_raw_emummc_based()
|
||||
{
|
||||
char *tmp = (char *)malloc(0x80);
|
||||
@@ -449,43 +430,6 @@ static void _migrate_sd_raw_emummc_based()
|
||||
sd_unmount();
|
||||
}
|
||||
|
||||
static void _migrate_sd_file_based()
|
||||
{
|
||||
sd_mount();
|
||||
f_mkdir("emuMMC");
|
||||
f_mkdir("emuMMC/EF00");
|
||||
|
||||
f_rename("Emutendo", "emuMMC/EF00/Nintendo");
|
||||
FIL fp;
|
||||
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, "%c%c%c%c%s", 's', 'x', 'o', 's', "/emunand");
|
||||
f_rename(path, "emuMMC/EF00/eMMC");
|
||||
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
s_printf(path, "emuMMC/EF00/eMMC/boot%d.bin", i);
|
||||
s_printf(path2, "emuMMC/EF00/eMMC/BOOT%d", i);
|
||||
f_rename(path, path2);
|
||||
}
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
s_printf(path, "emuMMC/EF00/eMMC/full.%02d.bin", i);
|
||||
s_printf(path2, "emuMMC/EF00/eMMC/%02d", i);
|
||||
f_rename(path, path2);
|
||||
}
|
||||
|
||||
free(path);
|
||||
free(path2);
|
||||
|
||||
save_emummc_cfg(0, 0, "emuMMC/EF00");
|
||||
_create_emummc_migrated_mbox();
|
||||
sd_unmount();
|
||||
}
|
||||
|
||||
static void _migrate_sd_backup_file_based()
|
||||
{
|
||||
char *emu_path = (char *)malloc(128);
|
||||
@@ -566,61 +510,7 @@ static void _migrate_sd_backup_file_based()
|
||||
sd_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;
|
||||
}
|
||||
|
||||
mbr_ctx.part_idx = 0;
|
||||
mbr_ctx.sector_start = 0;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
mbr_ctx.part_idx = 0;
|
||||
mbr_ctx.sector_start = 0;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
mbr_ctx.part_idx = 0;
|
||||
mbr_ctx.sector_start = 0;
|
||||
|
||||
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))
|
||||
{
|
||||
@@ -637,7 +527,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))
|
||||
{
|
||||
@@ -654,8 +544,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;
|
||||
@@ -670,8 +558,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;
|
||||
}
|
||||
@@ -681,8 +567,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);
|
||||
@@ -699,40 +584,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);
|
||||
@@ -762,7 +626,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);
|
||||
@@ -781,8 +645,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;
|
||||
@@ -818,18 +680,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, "%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);
|
||||
@@ -878,10 +728,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);
|
||||
@@ -1237,7 +1083,7 @@ lv_res_t create_win_emummc_tools(lv_obj_t *btn)
|
||||
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, label_sep, LV_ALIGN_OUT_BOTTOM_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} };
|
||||
@@ -1258,17 +1104,17 @@ lv_res_t create_win_emummc_tools(lv_obj_t *btn)
|
||||
if (emu_info.enabled)
|
||||
{
|
||||
if (emu_info.sector)
|
||||
s_printf(txt_buf, "#00DDFF Type:# SD Raw Partition\n#00DDFF Sector:# 0x%08X\n#00DDFF Nintendo folder:# %s",
|
||||
s_printf(txt_buf, "#00DDFF Type:# SD Raw Partition\n#00DDFF Sector:# 0x%08X\n#00DDFF Nintendo folder:# %s\n",
|
||||
emu_info.sector, emu_info.nintendo_path ? emu_info.nintendo_path : "");
|
||||
else
|
||||
s_printf(txt_buf, "#00DDFF Type:# SD File\n#00DDFF Base folder:# %s\n#00DDFF Nintendo folder:# %s",
|
||||
s_printf(txt_buf, "#00DDFF Type:# SD File\n#00DDFF Base folder:# %s\n#00DDFF Nintendo folder:# %s\n",
|
||||
emu_info.path ? emu_info.path : "", emu_info.nintendo_path ? emu_info.nintendo_path : "");
|
||||
|
||||
lv_label_set_text(label_txt2, txt_buf);
|
||||
}
|
||||
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)
|
||||
@@ -1313,7 +1159,7 @@ lv_res_t create_win_emummc_tools(lv_obj_t *btn)
|
||||
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, label_sep, LV_ALIGN_OUT_BOTTOM_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);
|
||||
@@ -1330,7 +1176,7 @@ lv_res_t create_win_emummc_tools(lv_obj_t *btn)
|
||||
lv_label_set_recolor(label_txt4, true);
|
||||
lv_label_set_static_text(label_txt4,
|
||||
"Allows you to create a new #C7EA46 SD File# or #C7EA46 SD Raw Partition#\n"
|
||||
"emuMMC. You can create it from eMMC or a eMMC Backup.");
|
||||
"emuMMC. You can create it from eMMC or a eMMC Backup.\n");
|
||||
|
||||
lv_obj_set_style(label_txt4, &hint_small_style);
|
||||
lv_obj_align(label_txt4, btn3, LV_ALIGN_OUT_BOTTOM_LEFT, 0, LV_DPI / 3);
|
||||
@@ -1346,8 +1192,7 @@ lv_res_t create_win_emummc_tools(lv_obj_t *btn)
|
||||
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