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 "gba/context/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 bool dirmode;
29 char* movie;
30
31 enum DebuggerType debuggerType;
32 bool debugAtStart;
33 bool showHelp;
34 bool showVersion;
35};
36
37struct SubParser {
38 const char* usage;
39 bool (*parse)(struct SubParser* parser, struct GBAConfig* config, int option, const char* arg);
40 const char* extraOptions;
41 void* opts;
42};
43
44struct GraphicsOpts {
45 int multiplier;
46 bool fullscreen;
47};
48
49struct GBAThread;
50
51bool parseArguments(struct GBAArguments* opts, struct GBAConfig* config, int argc, char* const* argv,
52 struct SubParser* subparser);
53void freeArguments(struct GBAArguments* opts);
54
55void usage(const char* arg0, const char* extraOptions);
56void version(const char* arg0);
57
58void initParserForGraphics(struct SubParser* parser, struct GraphicsOpts* opts);
59struct ARMDebugger* createDebugger(struct GBAArguments* opts, struct GBAThread* context);
60
61#endif