all repos — mgba @ 7e973c207ac62df1964ffc11b3916b72b32f10ba

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	bool skipBios;
22	int logLevel;
23	int frameskip;
24	bool rewindEnable;
25	int rewindBufferCapacity;
26	int rewindBufferInterval;
27	float fpsTarget;
28	size_t audioBuffers;
29
30	int fullscreen;
31	int width;
32	int height;
33	bool lockAspectRatio;
34	bool resampleVideo;
35
36	bool videoSync;
37	bool audioSync;
38};
39
40void GBAConfigInit(struct GBAConfig*, const char* port);
41void GBAConfigDeinit(struct GBAConfig*);
42
43bool GBAConfigLoad(struct GBAConfig*);
44bool GBAConfigSave(const struct GBAConfig*);
45
46void GBAConfigDirectory(char* out, size_t outLength);
47
48const char* GBAConfigGetValue(const struct GBAConfig*, const char* key);
49
50void GBAConfigSetValue(struct GBAConfig*, const char* key, const char* value);
51void GBAConfigSetIntValue(struct GBAConfig*, const char* key, int value);
52void GBAConfigSetUIntValue(struct GBAConfig*, const char* key, unsigned value);
53void GBAConfigSetFloatValue(struct GBAConfig*, const char* key, float value);
54
55void GBAConfigSetDefaultValue(struct GBAConfig*, const char* key, const char* value);
56void GBAConfigSetDefaultIntValue(struct GBAConfig*, const char* key, int value);
57void GBAConfigSetDefaultUIntValue(struct GBAConfig*, const char* key, unsigned value);
58void GBAConfigSetDefaultFloatValue(struct GBAConfig*, const char* key, float value);
59
60void GBAConfigMap(const struct GBAConfig* config, struct GBAOptions* opts);
61void GBAConfigLoadDefaults(struct GBAConfig* config, const struct GBAOptions* opts);
62
63void GBAConfigFreeOpts(struct GBAOptions* opts);
64
65#endif