diff --git a/src/core/core.c b/src/core/core.c index c2de4c4f5..ff7cb4bc2 100644 --- a/src/core/core.c +++ b/src/core/core.c @@ -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); } diff --git a/src/gba/gui/gui-runner.c b/src/gba/gui/gui-runner.c index b010aa0d3..6b38a7d56 100644 --- a/src/gba/gui/gui-runner.c +++ b/src/gba/gui/gui-runner.c @@ -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);