mirror of
https://github.com/CTCaer/hekate.git
synced 2024-11-05 02:27:39 +00:00
emummc: correct id size and also set id if emupath is used
This corrects a truncation that was happening and also if `emupath` key is used to change emuMMC on the fly, it now uses the path as id instead of 0.
This commit is contained in:
parent
ebefd1c2d3
commit
05c989a1ce
@ -109,7 +109,14 @@ bool emummc_set_path(char *path)
|
||||
if (found)
|
||||
{
|
||||
emu_cfg.enabled = 1;
|
||||
emu_cfg.id = 0;
|
||||
|
||||
// Get ID from path.
|
||||
u32 id_from_path = 0;
|
||||
u32 path_size = strlen(path);
|
||||
if (path_size >= 4)
|
||||
memcpy(&id_from_path, path + path_size - 4, 4);
|
||||
emu_cfg.id = id_from_path;
|
||||
|
||||
strcpy(emu_cfg.nintendo_path, path);
|
||||
strcat(emu_cfg.nintendo_path, "/Nintendo");
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ typedef struct _emummc_cfg_t
|
||||
{
|
||||
int enabled;
|
||||
u64 sector;
|
||||
u16 id;
|
||||
u32 id;
|
||||
char *path;
|
||||
char *nintendo_path;
|
||||
// Internal.
|
||||
|
Loading…
Reference in New Issue
Block a user