all repos — mgba @ 0de46a78679adf820eba08c3f72e64202540b692

mGBA Game Boy Advance Emulator

GBA: Add API for getting Configuration structs for overrides and input
Jeffrey Pfau jeffrey@endrift.com
Thu, 29 Jan 2015 23:16:25 -0800
commit

0de46a78679adf820eba08c3f72e64202540b692

parent

370bbd83baee3f823e1d4c8ac81534d9ed60874a

M CHANGESCHANGES

@@ -45,6 +45,7 @@ - Debugger: Simplify debugger state machine to play nicer with the GBA thread loop

- Debugger: Merge Thumb BL instructions when disassembling - Debugger: Clean up debugger interface, removing obsolete state (fixes #67) - Debugger: Watchpoints now report address watched (fixes #68) + - GBA: Add API for getting Configuration structs for overrides and input 0.1.1: (2015-01-24) Bugfixes:
M src/gba/gba-config.csrc/gba/gba-config.c

@@ -257,6 +257,15 @@ break;

} } +// These two are basically placeholders in case the internal layout changes, e.g. for loading separate files +struct Configuration* GBAConfigGetInput(struct GBAConfig* config) { + return &config->configTable; +} + +struct Configuration* GBAConfigGetOverrides(struct GBAConfig* config) { + return &config->configTable; +} + void GBAConfigFreeOpts(struct GBAOptions* opts) { free(opts->bios); opts->bios = 0;
M src/gba/gba-config.hsrc/gba/gba-config.h

@@ -64,6 +64,9 @@

void GBAConfigMap(const struct GBAConfig* config, struct GBAOptions* opts); void GBAConfigLoadDefaults(struct GBAConfig* config, const struct GBAOptions* opts); +struct Configuration* GBAConfigGetInput(struct GBAConfig*); +struct Configuration* GBAConfigGetOverrides(struct GBAConfig*); + void GBAConfigFreeOpts(struct GBAOptions* opts); #endif
M src/platform/perf-main.csrc/platform/perf-main.c

@@ -81,7 +81,7 @@ context.renderer = &renderer.d;

} context.debugger = createDebugger(&args, &context); - context.overrides = &config.configTable; + context.overrides = GBAConfigGetOverrides(&config); char gameCode[5] = { 0 }; GBAConfigMap(&config, &opts);
M src/platform/qt/ConfigController.hsrc/platform/qt/ConfigController.h

@@ -76,7 +76,7 @@

QList<QString> getMRU() const; void setMRU(const QList<QString>& mru); - Configuration* overrides() { return &m_config.configTable; } // TODO: Make this not return the whole table + Configuration* overrides() { return GBAConfigGetOverrides(&m_config); } void saveOverride(const GBACartridgeOverride&); public slots:
M src/platform/sdl/main.csrc/platform/sdl/main.c

@@ -102,8 +102,8 @@

renderer.events.bindings = &inputMap; GBASDLInitBindings(&inputMap); GBASDLInitEvents(&renderer.events); - GBASDLEventsLoadConfig(&renderer.events, &config.configTable); // TODO: Don't use this directly - context.overrides = &config.configTable; + GBASDLEventsLoadConfig(&renderer.events, GBAConfigGetInput(&config)); + context.overrides = GBAConfigGetOverrides(&config); int didFail = 0; if (GBAThreadStart(&context)) {