Nyx: emuMMC Manage window, Tools UI, and misc updates

- Add gui_emu_tools: emuMMC Manage window with correct positioning (LV_PROTECT_PARENT + re-parent to win)
- Tools: single SD button (tap = SD partition manager, 3s hold = eMMC)
- Remove emuSD from Nyx UI (tabs, UMS, partition manager); keep bootloader emusd
- Shorten Create emuMMC description text by one character
- Storage/build/config and dependency updates

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-02-20 20:49:48 +01:00
parent 4eead2c14d
commit fed7f05831
81 changed files with 6932 additions and 3462 deletions

View File

@@ -24,12 +24,15 @@
#include "../config.h"
#include <libs/fatfs/ff.h>
#include "../storage/emummc.h"
#include "../storage/emusd.h"
enum emuMMC_Type
{
emuMMC_None = 0,
emuMMC_Partition,
emuMMC_File,
EmummcType_None = 0,
EmummcType_Partition_Sd = 1,
EmummcType_File_Sd = 2,
EmummcType_Partition_Emmc = 3,
EmummcType_File_Emmc = 4,
emuMMC_MAX
};
@@ -64,6 +67,22 @@ typedef struct
emummc_file_config_t file_cfg;
};
char nintendo_path[EMUMMC_FILE_PATH_MAX];
} emummc_emmc_config_t;
typedef struct
{
emummc_base_config_t base_cfg;
union
{
emummc_partition_config_t partition_cfg;
emummc_file_config_t file_cfg;
};
} emummc_sd_config_t;
typedef struct
{
emummc_emmc_config_t emmc_cfg;
emummc_sd_config_t sd_cfg;
} exo_emummc_config_t;
typedef struct _exo_cfg_t
@@ -75,7 +94,8 @@ typedef struct _exo_cfg_t
u8 uart_port;
u8 uart_invert;
u32 uart_baudrate;
u32 rsvd1[2];
u8 memory_mode_auto;
u8 rsvd1[7];
exo_emummc_config_t emummc_cfg;
} exo_cfg_t;
@@ -206,7 +226,7 @@ void config_exosphere(launch_ctxt_t *ctxt, u32 warmboot_base)
if (!ctxt->stock)
{
LIST_INIT(ini_exo_sections);
if (ini_parse(&ini_exo_sections, "exosphere.ini", false))
if (ini_parse(&ini_exo_sections, "emusd:exosphere.ini", false))
{
LIST_FOREACH_ENTRY(ini_sec_t, ini_sec, &ini_exo_sections, link)
{
@@ -214,6 +234,7 @@ void config_exosphere(launch_ctxt_t *ctxt, u32 warmboot_base)
if (!(ini_sec->type == INI_CHOICE) || strcmp(ini_sec->name, "exosphere"))
continue;
LIST_FOREACH_ENTRY(ini_kv_t, kv, &ini_sec->kvs, link)
{
if (!strcmp("debugmode_user", kv->key))
@@ -224,12 +245,14 @@ void config_exosphere(launch_ctxt_t *ctxt, u32 warmboot_base)
exo_cfg->uart_invert = atoi(kv->val);
else if (!strcmp("log_baud_rate", kv->key))
exo_cfg->uart_baudrate = atoi(kv->val);
else if (!strcmp("memory_mode_auto", kv->key)) {
exo_cfg->memory_mode_auto = atoi(kv->val);
}
else if (emu_cfg.enabled && !h_cfg.emummc_force_disable)
{
if (!strcmp("blank_prodinfo_emummc", kv->key))
cal0_blanking = atoi(kv->val);
}
else
} else
{
if (!strcmp("blank_prodinfo_sysmmc", kv->key))
cal0_blanking = atoi(kv->val);
@@ -245,7 +268,7 @@ void config_exosphere(launch_ctxt_t *ctxt, u32 warmboot_base)
if (!ctxt->exo_ctx.usb3_force)
{
LIST_INIT(ini_sys_sections);
if (ini_parse(&ini_sys_sections, "atmosphere/config/system_settings.ini", false))
if (ini_parse(&ini_sys_sections, "emusd:atmosphere/config/system_settings.ini", false))
{
LIST_FOREACH_ENTRY(ini_sec_t, ini_sec, &ini_sys_sections, link)
{
@@ -314,22 +337,72 @@ void config_exosphere(launch_ctxt_t *ctxt, u32 warmboot_base)
pkg1_warmboot_rsa_mod(warmboot_base);
}
// By default, disable emuMMC
exo_cfg->emummc_cfg.emmc_cfg.base_cfg.magic = EMUMMC_MAGIC;
exo_cfg->emummc_cfg.emmc_cfg.base_cfg.type = EmummcType_None;
if (emu_cfg.enabled && !h_cfg.emummc_force_disable)
{
exo_cfg->emummc_cfg.base_cfg.magic = EMUMMC_MAGIC;
exo_cfg->emummc_cfg.base_cfg.type = emu_cfg.sector ? emuMMC_Partition : emuMMC_File;
exo_cfg->emummc_cfg.base_cfg.fs_ver = emu_cfg.fs_ver;
exo_cfg->emummc_cfg.base_cfg.id = emu_cfg.id;
exo_cfg->emummc_cfg.emmc_cfg.base_cfg.fs_ver = emu_cfg.fs_ver;
exo_cfg->emummc_cfg.sd_cfg.base_cfg.fs_ver = emu_sd_cfg.fs_ver;
exo_cfg->emummc_cfg.emmc_cfg.base_cfg.id = emu_cfg.id;
if (emu_cfg.enabled == 4 && emu_cfg.sector) {
// emmc partition based
exo_cfg->emummc_cfg.emmc_cfg.base_cfg.type = EmummcType_Partition_Emmc;
} else if (emu_cfg.enabled == 4 && !emu_cfg.sector) {
// emmc file based
exo_cfg->emummc_cfg.emmc_cfg.base_cfg.type = EmummcType_File_Emmc;
} else if (emu_cfg.enabled == 1 && emu_cfg.sector) {
// sd partition based
exo_cfg->emummc_cfg.emmc_cfg.base_cfg.type = EmummcType_Partition_Sd;
} else if (emu_cfg.enabled == 1 && !emu_cfg.sector) {
// sd file based
exo_cfg->emummc_cfg.emmc_cfg.base_cfg.type = EmummcType_File_Sd;
} else {
// disabled
exo_cfg->emummc_cfg.emmc_cfg.base_cfg.type = EmummcType_None;
}
if (emu_cfg.sector)
exo_cfg->emummc_cfg.partition_cfg.start_sector = emu_cfg.sector;
exo_cfg->emummc_cfg.emmc_cfg.partition_cfg.start_sector = emu_cfg.sector;
else
strcpy((char *)exo_cfg->emummc_cfg.file_cfg.path, emu_cfg.path);
strcpy((char *)exo_cfg->emummc_cfg.emmc_cfg.file_cfg.path, emu_cfg.path);
if (!ctxt->stock && emu_cfg.nintendo_path && emu_cfg.nintendo_path[0])
strcpy((char *)exo_cfg->emummc_cfg.nintendo_path, emu_cfg.nintendo_path);
strcpy((char *)exo_cfg->emummc_cfg.emmc_cfg.nintendo_path, emu_cfg.nintendo_path);
else
strcpy((char *)exo_cfg->emummc_cfg.nintendo_path, "Nintendo");
strcpy((char *)exo_cfg->emummc_cfg.emmc_cfg.nintendo_path, "Nintendo");
}
exo_cfg->emummc_cfg.sd_cfg.base_cfg.magic = EMUMMC_MAGIC;
exo_cfg->emummc_cfg.sd_cfg.base_cfg.type = EmummcType_None;
if (emu_sd_cfg.enabled)
{
exo_cfg->emummc_cfg.sd_cfg.base_cfg.fs_ver = emu_sd_cfg.fs_ver;
exo_cfg->emummc_cfg.emmc_cfg.base_cfg.fs_ver = emu_sd_cfg.fs_ver;
exo_cfg->emummc_cfg.sd_cfg.base_cfg.id = emu_sd_cfg.id;
if (emu_sd_cfg.enabled == 4 && emu_sd_cfg.sector) {
// emmc partition based
exo_cfg->emummc_cfg.sd_cfg.base_cfg.type = EmummcType_Partition_Emmc;
} else if (emu_sd_cfg.enabled == 4 && !emu_sd_cfg.sector) {
// emmc file based
exo_cfg->emummc_cfg.sd_cfg.base_cfg.type = EmummcType_File_Emmc;
} else if (emu_sd_cfg.enabled == 1 && emu_sd_cfg.sector) {
// sd partition based
exo_cfg->emummc_cfg.sd_cfg.base_cfg.type = EmummcType_Partition_Sd;
} else if (emu_sd_cfg.enabled == 1 && !emu_sd_cfg.sector) {
// sd file based
exo_cfg->emummc_cfg.sd_cfg.base_cfg.type = EmummcType_File_Sd;
} else {
// disabled
exo_cfg->emummc_cfg.sd_cfg.base_cfg.type = EmummcType_None;
}
if (emu_sd_cfg.sector)
exo_cfg->emummc_cfg.sd_cfg.partition_cfg.start_sector = emu_sd_cfg.sector;
else
strcpy((char *)exo_cfg->emummc_cfg.sd_cfg.file_cfg.path, emu_sd_cfg.path);
}
// Copy over exosphere fatal for Mariko.