diff options
author | BassAceGold | 2013-02-06 02:04:39 -0500 |
---|---|---|
committer | Nebuleon Fumika | 2013-02-06 02:05:03 -0500 |
commit | ea330e8f79c16894deda51509e769cbd02ff83df (patch) | |
tree | 8381b7cd37adefa1a606dd484bbc057b77e6498e /source/nds/gui.c | |
parent | 4ac61d443d5786db1b1e365e0005a1d5740183b0 (diff) | |
download | snesemu-ea330e8f79c16894deda51509e769cbd02ff83df.tar.gz snesemu-ea330e8f79c16894deda51509e769cbd02ff83df.tar.bz2 snesemu-ea330e8f79c16894deda51509e769cbd02ff83df.zip |
Fix settings not getting loaded with a ROM provided by plugin arguments.
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(); |