mirror of https://github.com/mgba-emu/mgba.git
3DS, PSP2, Wii: Last directory loaded is saved
This commit is contained in:
parent
20f8cdc3e0
commit
5ba2d00504
1
CHANGES
1
CHANGES
|
@ -54,6 +54,7 @@ Misc:
|
|||
- GBA Memory: Support reading/writing POSTFLG
|
||||
- Util: Add size counting to Table
|
||||
- Qt: Move last directory setting from qt.ini to config.ini
|
||||
- 3DS, PSP2, Wii: Last directory loaded is saved
|
||||
|
||||
0.5.1: (2016-10-05)
|
||||
Bugfixes:
|
||||
|
|
|
@ -171,6 +171,12 @@ void mGUIInit(struct mGUIRunner* runner, const char* port) {
|
|||
strncat(path, PATH_SEP "log", PATH_MAX - strlen(path));
|
||||
logger.vf = VFileOpen(path, O_CREAT | O_WRONLY | O_APPEND);
|
||||
mLogSetDefaultLogger(&logger.d);
|
||||
|
||||
const char* lastPath = mCoreConfigGetValue(&runner->config, "lastDirectory");
|
||||
if (lastPath) {
|
||||
strncpy(runner->params.currentPath, lastPath, PATH_MAX - 1);
|
||||
runner->params.currentPath[PATH_MAX - 1] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
void mGUIDeinit(struct mGUIRunner* runner) {
|
||||
|
@ -499,6 +505,8 @@ void mGUIRunloop(struct mGUIRunner* runner) {
|
|||
if (!GUISelectFile(&runner->params, path, sizeof(path), 0)) {
|
||||
break;
|
||||
}
|
||||
mCoreConfigSetValue(&runner->config, "lastDirectory", runner->params.currentPath);
|
||||
mCoreConfigSave(&runner->config);
|
||||
mGUIRun(runner, path);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue