all repos — mgba @ 3d53f23e8d3bab561ab8a7ad3d896160e26b304c

mGBA Game Boy Advance Emulator

GUI: Fix config loading
Jeffrey Pfau jeffrey@endrift.com
Mon, 15 Feb 2016 06:33:13 -0800
commit

3d53f23e8d3bab561ab8a7ad3d896160e26b304c

parent

5c2dbc59a1df816dc836ef2c05abae02bd543dbd

2 files changed, 15 insertions(+), 10 deletions(-)

jump to
M src/core/core.csrc/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.csrc/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);