all repos — mgba @ daaa2fa5236df5e8976e7e0ba7ac39e0d9233422

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