all repos — mgba @ 811d8281c3f285e9e7421cf290ecefaefb46069d

mGBA Game Boy Advance Emulator

src/platform/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 "core/config.h"
12
13enum DebuggerType {
14	DEBUGGER_NONE = 0,
15#ifdef USE_CLI_DEBUGGER
16	DEBUGGER_CLI,
17#endif
18#ifdef USE_GDB_STUB
19	DEBUGGER_GDB,
20#endif
21	DEBUGGER_MAX
22};
23
24struct GBAArguments {
25	char* fname;
26	char* patch;
27	char* cheatsFile;
28	char* movie;
29
30	enum DebuggerType debuggerType;
31	bool debugAtStart;
32	bool showHelp;
33	bool showVersion;
34};
35
36struct SubParser {
37	const char* usage;
38	bool (*parse)(struct SubParser* parser, struct mCoreConfig* config, int option, const char* arg);
39	const char* extraOptions;
40	void* opts;
41};
42
43struct GraphicsOpts {
44	int multiplier;
45	bool fullscreen;
46};
47
48struct GBAThread;
49
50bool parseArguments(struct GBAArguments* opts, struct mCoreConfig* config, int argc, char* const* argv,
51                    struct SubParser* subparser);
52void freeArguments(struct GBAArguments* opts);
53
54void usage(const char* arg0, const char* extraOptions);
55void version(const char* arg0);
56
57void initParserForGraphics(struct SubParser* parser, struct GraphicsOpts* opts);
58struct ARMDebugger* createDebugger(struct GBAArguments* opts, struct GBAThread* context);
59
60#endif