GUI: Fix config loading

This commit is contained in:
Jeffrey Pfau 2016-02-15 06:33:13 -08:00
parent 5c2dbc59a1
commit 3d53f23e8d
2 changed files with 15 additions and 10 deletions

View File

@ -190,6 +190,8 @@ void mCoreLoadForeignConfig(struct mCore* core, const struct mCoreConfig* config
#ifndef MINIMAL_CORE
mDirectorySetMapOptions(&core->dirs, &core->opts);
#endif
core->setAudioBufferSize(core, core->opts.audioBuffers);
if (core->opts.audioBuffers) {
core->setAudioBufferSize(core, core->opts.audioBuffers);
}
core->loadConfig(core, config);
}

View File

@ -201,15 +201,6 @@ void mGUIRun(struct mGUIRunner* runner, const char* path) {
runner->core->init(runner->core);
mInputMapInit(&runner->core->inputMap, &GBAInputInfo);
mCoreInitConfig(runner->core, runner->port);
if (runner->core->platform(runner->core) == PLATFORM_GBA) {
((struct GBA*) runner->core->board)->luminanceSource = &runner->luminanceSource.d;
}
if (runner->core->config.port && runner->keySources) {
size_t i;
for (i = 0; runner->keySources[i].id; ++i) {
mInputMapLoad(&runner->core->inputMap, runner->keySources[i].id, mCoreConfigGetInput(&runner->core->config));
}
}
found = mCoreLoadFile(runner->core, path);
if (!found) {
runner->core->deinit(runner->core);
@ -231,6 +222,18 @@ void mGUIRun(struct mGUIRunner* runner, const char* path) {
}
return;
}
if (runner->core->platform(runner->core) == PLATFORM_GBA) {
((struct GBA*) runner->core->board)->luminanceSource = &runner->luminanceSource.d;
}
if (runner->core->config.port && runner->keySources) {
size_t i;
for (i = 0; runner->keySources[i].id; ++i) {
mInputMapLoad(&runner->core->inputMap, runner->keySources[i].id, mCoreConfigGetInput(&runner->core->config));
}
}
// TODO: Do we need to load more defaults?
mCoreConfigSetDefaultIntValue(&runner->core->config, "volume", 0x100);
mCoreLoadConfig(runner->core);
mCoreAutoloadSave(runner->core);
if (runner->setup) {
runner->setup(runner);