all repos — mgba @ eccddde2834544da2ce62dfb3abe2c596207bd5f

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