all repos — mgba @ f53f9555a26461fee86ba676e4f04d8bdecf7c40

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	bool resampleVideo;
33
34	bool videoSync;
35	bool audioSync;
36};
37
38void GBAConfigInit(struct GBAConfig*, const char* port);
39void GBAConfigDeinit(struct GBAConfig*);
40
41bool GBAConfigLoad(struct GBAConfig*);
42bool GBAConfigSave(const struct GBAConfig*);
43
44void GBAConfigDirectory(char* out, size_t outLength);
45
46const char* GBAConfigGetValue(const struct GBAConfig*, const char* key);
47
48void GBAConfigSetValue(struct GBAConfig*, const char* key, const char* value);
49void GBAConfigSetIntValue(struct GBAConfig*, const char* key, int value);
50void GBAConfigSetUIntValue(struct GBAConfig*, const char* key, unsigned value);
51void GBAConfigSetFloatValue(struct GBAConfig*, const char* key, float value);
52
53void GBAConfigSetDefaultValue(struct GBAConfig*, const char* key, const char* value);
54void GBAConfigSetDefaultIntValue(struct GBAConfig*, const char* key, int value);
55void GBAConfigSetDefaultUIntValue(struct GBAConfig*, const char* key, unsigned value);
56void GBAConfigSetDefaultFloatValue(struct GBAConfig*, const char* key, float value);
57
58void GBAConfigMap(const struct GBAConfig* config, struct GBAOptions* opts);
59void GBAConfigLoadDefaults(struct GBAConfig* config, const struct GBAOptions* opts);
60
61void GBAConfigFreeOpts(struct GBAOptions* opts);
62
63#endif