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