mirror of https://github.com/mgba-emu/mgba.git
GBA: Add API for getting Configuration structs for overrides and input
This commit is contained in:
parent
370bbd83ba
commit
0de46a7867
1
CHANGES
1
CHANGES
|
@ -45,6 +45,7 @@ Misc:
|
|||
- 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:
|
||||
|
|
|
@ -257,6 +257,15 @@ void GBAConfigLoadDefaults(struct GBAConfig* config, const struct GBAOptions* op
|
|||
}
|
||||
}
|
||||
|
||||
// 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;
|
||||
|
|
|
@ -64,6 +64,9 @@ void GBAConfigSetDefaultFloatValue(struct GBAConfig*, const char* key, float val
|
|||
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
|
||||
|
|
|
@ -81,7 +81,7 @@ int main(int argc, char** argv) {
|
|||
}
|
||||
|
||||
context.debugger = createDebugger(&args, &context);
|
||||
context.overrides = &config.configTable;
|
||||
context.overrides = GBAConfigGetOverrides(&config);
|
||||
char gameCode[5] = { 0 };
|
||||
|
||||
GBAConfigMap(&config, &opts);
|
||||
|
|
|
@ -76,7 +76,7 @@ public:
|
|||
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:
|
||||
|
|
|
@ -102,8 +102,8 @@ int main(int argc, char** argv) {
|
|||
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)) {
|
||||
|
|
Loading…
Reference in New Issue