nyx: Move emummc cfg load function
This commit is contained in:
@@ -47,6 +47,36 @@ extern hekate_config h_cfg;
|
||||
extern bool sd_mount();
|
||||
extern void sd_unmount(bool deinit);
|
||||
|
||||
void load_emummc_cfg(emummc_cfg_t *emu_info)
|
||||
{
|
||||
memset(emu_info, 0, sizeof(emummc_cfg_t));
|
||||
|
||||
// Parse emuMMC configuration.
|
||||
LIST_INIT(ini_sections);
|
||||
if (ini_parse(&ini_sections, "emuMMC/emummc.ini", false))
|
||||
{
|
||||
LIST_FOREACH_ENTRY(ini_sec_t, ini_sec, &ini_sections, link)
|
||||
{
|
||||
if (!strcmp(ini_sec->name, "emummc"))
|
||||
{
|
||||
LIST_FOREACH_ENTRY(ini_kv_t, kv, &ini_sec->kvs, link)
|
||||
{
|
||||
if (!strcmp("enabled", kv->key))
|
||||
emu_info->enabled = atoi(kv->val);
|
||||
else if (!strcmp("sector", kv->key))
|
||||
emu_info->sector = strtol(kv->val, NULL, 16);
|
||||
else if (!strcmp("id", kv->key))
|
||||
emu_info->id = strtol(kv->val, NULL, 16);
|
||||
else if (!strcmp("path", kv->key))
|
||||
emu_info->path = kv->val;
|
||||
else if (!strcmp("nintendo_path", kv->key))
|
||||
emu_info->nintendo_path = kv->val;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void save_emummc_cfg(u32 part_idx, u32 sector_start, const char *path)
|
||||
{
|
||||
sd_mount();
|
||||
|
||||
Reference in New Issue
Block a user