all repos — mgba @ 2fdb5a1ff950ed4a7b8b9134a1c76a4087bc4997

mGBA Game Boy Advance Emulator

include/mgba/feature/commandline.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 COMMAND_LINE_H
 7#define COMMAND_LINE_H
 8
 9#include <mgba-util/common.h>
10
11CXX_GUARD_START
12
13#include <mgba-util/table.h>
14
15#include <mgba/internal/debugger/debugger.h>
16
17struct mArguments {
18	char* fname;
19	char* patch;
20	char* cheatsFile;
21	char* movie;
22	char* bios;
23	int logLevel;
24	int frameskip;
25
26	struct Table configOverrides;
27
28	enum mDebuggerType debuggerType;
29	bool debugAtStart;
30	bool showHelp;
31	bool showVersion;
32};
33
34struct mCoreConfig;
35struct mSubParser {
36	const char* usage;
37	bool (*parse)(struct mSubParser* parser, int option, const char* arg);
38	void (*apply)(struct mSubParser* parser, struct mCoreConfig* config);
39	const char* extraOptions;
40	void* opts;
41};
42
43struct mGraphicsOpts {
44	int multiplier;
45	bool fullscreen;
46};
47
48bool parseArguments(struct mArguments* args, int argc, char* const* argv,
49                    struct mSubParser* subparser);
50void applyArguments(const struct mArguments* args, struct mSubParser* subparser, struct mCoreConfig* config);
51void freeArguments(struct mArguments* args);
52
53void usage(const char* arg0, const char* extraOptions);
54void version(const char* arg0);
55
56void initParserForGraphics(struct mSubParser* parser, struct mGraphicsOpts* opts);
57
58CXX_GUARD_END
59
60#endif