all repos — mgba @ fa884d071ecaa3e05ff20b45a67bf9500dd3d6b6

mGBA Game Boy Advance Emulator

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