GUI: Fix config loading
Jeffrey Pfau jeffrey@endrift.com
Mon, 15 Feb 2016 06:33:13 -0800
2 files changed,
15 insertions(+),
10 deletions(-)
M
src/core/core.c
→
src/core/core.c
@@ -190,6 +190,8 @@ mCoreConfigMap(config, &core->opts);
#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); }
M
src/gba/gui/gui-runner.c
→
src/gba/gui/gui-runner.c
@@ -201,15 +201,6 @@ if (runner->core) {
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 @@ runner->params.drawEnd();
} 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);