GBA Core: Fix override loading from foreign configs
Jeffrey Pfau jeffrey@endrift.com
Mon, 08 Feb 2016 20:43:48 -0800
3 files changed,
7 insertions(+),
2 deletions(-)
M
src/core/config.c
→
src/core/config.c
@@ -388,6 +388,10 @@ struct Configuration* mCoreConfigGetOverrides(struct mCoreConfig* config) {
return &config->configTable; } +const struct Configuration* mCoreConfigGetOverridesConst(const struct mCoreConfig* config) { + return &config->configTable; +} + void mCoreConfigFreeOpts(struct mCoreOptions* opts) { free(opts->bios); free(opts->shader);
M
src/core/config.h
→
src/core/config.h
@@ -88,6 +88,7 @@ void mCoreConfigLoadDefaults(struct mCoreConfig* config, const struct mCoreOptions* opts);
struct Configuration* mCoreConfigGetInput(struct mCoreConfig*); struct Configuration* mCoreConfigGetOverrides(struct mCoreConfig*); +const struct Configuration* mCoreConfigGetOverridesConst(const struct mCoreConfig*); void mCoreConfigFreeOpts(struct mCoreOptions* opts);
M
src/gba/core.c
→
src/gba/core.c
@@ -20,7 +20,7 @@ struct mCore d;
struct GBAVideoSoftwareRenderer renderer; int keys; struct mCPUComponent* components[GBA_COMPONENT_MAX]; - struct Configuration* overrides; + const struct Configuration* overrides; }; static bool _GBACoreInit(struct mCore* core) {@@ -74,7 +74,7 @@ struct GBA* gba = core->board;
#if !defined(MINIMAL_CORE) || MINIMAL_CORE < 2 struct GBACore* gbacore = (struct GBACore*) core; - gbacore->overrides = mCoreConfigGetOverrides(&core->config); + gbacore->overrides = mCoreConfigGetOverridesConst(config); struct VFile* bios = 0; if (core->opts.useBios) {