all repos — mgba @ b079c3bd56a59e7303c94cfb22a6a20345a982d6

mGBA Game Boy Advance Emulator

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

 1/* Copyright (c) 2013-2015 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 "gba/gba.h"
12
13#include "util/configuration.h"
14
15struct GBAConfig {
16	struct Configuration configTable;
17	struct Configuration defaultsTable;
18	char* port;
19};
20
21struct GBAOptions {
22	char* bios;
23	bool skipBios;
24	bool useBios;
25	int logLevel;
26	int frameskip;
27	bool rewindEnable;
28	int rewindBufferCapacity;
29	int rewindBufferInterval;
30	float fpsTarget;
31	size_t audioBuffers;
32
33	int fullscreen;
34	int width;
35	int height;
36	bool lockAspectRatio;
37	bool resampleVideo;
38	bool suspendScreensaver;
39
40	int volume;
41	bool mute;
42
43	bool videoSync;
44	bool audioSync;
45
46	enum GBAIdleLoopOptimization idleOptimization;
47};
48
49void GBAConfigInit(struct GBAConfig*, const char* port);
50void GBAConfigDeinit(struct GBAConfig*);
51
52bool GBAConfigLoad(struct GBAConfig*);
53bool GBAConfigSave(const struct GBAConfig*);
54
55void GBAConfigDirectory(char* out, size_t outLength);
56
57const char* GBAConfigGetValue(const struct GBAConfig*, const char* key);
58
59void GBAConfigSetValue(struct GBAConfig*, const char* key, const char* value);
60void GBAConfigSetIntValue(struct GBAConfig*, const char* key, int value);
61void GBAConfigSetUIntValue(struct GBAConfig*, const char* key, unsigned value);
62void GBAConfigSetFloatValue(struct GBAConfig*, const char* key, float value);
63
64void GBAConfigSetDefaultValue(struct GBAConfig*, const char* key, const char* value);
65void GBAConfigSetDefaultIntValue(struct GBAConfig*, const char* key, int value);
66void GBAConfigSetDefaultUIntValue(struct GBAConfig*, const char* key, unsigned value);
67void GBAConfigSetDefaultFloatValue(struct GBAConfig*, const char* key, float value);
68
69void GBAConfigMap(const struct GBAConfig* config, struct GBAOptions* opts);
70void GBAConfigLoadDefaults(struct GBAConfig* config, const struct GBAOptions* opts);
71
72struct Configuration* GBAConfigGetInput(struct GBAConfig*);
73struct Configuration* GBAConfigGetOverrides(struct GBAConfig*);
74
75void GBAConfigFreeOpts(struct GBAOptions* opts);
76
77#endif