all repos — mgba @ 8fc39428913b7695c59e642e5a889bc97236b4b7

mGBA Game Boy Advance Emulator

src/gba/gba-config.h (view raw)

 1/* Copyright (c) 2013-2014 Jeffrey Pfau
 2 *
 3 * This Source Code Form is subject to the terms of the Mozilla Public
 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 6#ifndef GBA_CONFIG_H
 7#define GBA_CONFIG_H
 8
 9#include "util/common.h"
10
11#include "util/configuration.h"
12
13struct GBAConfig {
14	struct Configuration configTable;
15	struct Configuration defaultsTable;
16	char* port;
17};
18
19struct GBAOptions {
20	char* bios;
21	int logLevel;
22	int frameskip;
23	int rewindBufferCapacity;
24	int rewindBufferInterval;
25	float fpsTarget;
26	size_t audioBuffers;
27
28	int fullscreen;
29	int width;
30	int height;
31	bool lockAspectRatio;
32
33	bool videoSync;
34	bool audioSync;
35};
36
37void GBAConfigInit(struct GBAConfig*, const char* port);
38void GBAConfigDeinit(struct GBAConfig*);
39
40bool GBAConfigLoad(struct GBAConfig*);
41bool GBAConfigSave(const struct GBAConfig*);
42
43const char* GBAConfigGetValue(const struct GBAConfig*, const char* key);
44
45void GBAConfigSetValue(struct GBAConfig*, const char* key, const char* value);
46void GBAConfigSetIntValue(struct GBAConfig*, const char* key, int value);
47void GBAConfigSetUIntValue(struct GBAConfig*, const char* key, unsigned value);
48void GBAConfigSetFloatValue(struct GBAConfig*, const char* key, float value);
49
50void GBAConfigSetDefaultValue(struct GBAConfig*, const char* key, const char* value);
51void GBAConfigSetDefaultIntValue(struct GBAConfig*, const char* key, int value);
52void GBAConfigSetDefaultUIntValue(struct GBAConfig*, const char* key, unsigned value);
53void GBAConfigSetDefaultFloatValue(struct GBAConfig*, const char* key, float value);
54
55void GBAConfigMap(const struct GBAConfig* config, struct GBAOptions* opts);
56void GBAConfigLoadDefaults(struct GBAConfig* config, const struct GBAOptions* opts);
57
58void GBAConfigFreeOpts(struct GBAOptions* opts);
59
60#endif