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
43void GBAConfigDirectory(char* out, size_t outLength);
44
45const char* GBAConfigGetValue(const struct GBAConfig*, const char* key);
46
47void GBAConfigSetValue(struct GBAConfig*, const char* key, const char* value);
48void GBAConfigSetIntValue(struct GBAConfig*, const char* key, int value);
49void GBAConfigSetUIntValue(struct GBAConfig*, const char* key, unsigned value);
50void GBAConfigSetFloatValue(struct GBAConfig*, const char* key, float value);
51
52void GBAConfigSetDefaultValue(struct GBAConfig*, const char* key, const char* value);
53void GBAConfigSetDefaultIntValue(struct GBAConfig*, const char* key, int value);
54void GBAConfigSetDefaultUIntValue(struct GBAConfig*, const char* key, unsigned value);
55void GBAConfigSetDefaultFloatValue(struct GBAConfig*, const char* key, float value);
56
57void GBAConfigMap(const struct GBAConfig* config, struct GBAOptions* opts);
58void GBAConfigLoadDefaults(struct GBAConfig* config, const struct GBAOptions* opts);
59
60void GBAConfigFreeOpts(struct GBAOptions* opts);
61
62#endif