all repos — mgba @ 721145a319e6a0c45e2302c4f468fe84a4fda331

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