diff options
Diffstat (limited to 'source/nds/gui.c')
-rw-r--r-- | source/nds/gui.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/source/nds/gui.c b/source/nds/gui.c index 495e3c8..427f7d7 100644 --- a/source/nds/gui.c +++ b/source/nds/gui.c @@ -1853,7 +1853,21 @@ u32 menu(u16 *screen, bool8 FirstInvocation) return 0; } - strcpy(gamepak_name, filename); + char tempPath[MAX_PATH]; + strcpy(tempPath, filename); + + //update folders and names for settings/config uses + char *dirEnd = strrchr(tempPath, '/'); + //make sure a valid path was provided + if(!dirEnd) + return 0; + + //copy file name as gamepak_name + strcpy(gamepak_name, dirEnd+1); + //then strip filename from directory path and set it + *dirEnd = '\0'; + strcpy(g_default_rom_dir, tempPath); + first_load = 0; load_game_config_file(); |