src/platform/commandline.h (view raw)
1#ifndef COMMAND_LINE_H
2#define COMMAND_LINE_H
3
4#include "util/common.h"
5
6#include "gba-config.h"
7
8enum DebuggerType {
9 DEBUGGER_NONE = 0,
10#ifdef USE_CLI_DEBUGGER
11 DEBUGGER_CLI,
12#endif
13#ifdef USE_GDB_STUB
14 DEBUGGER_GDB,
15#endif
16 DEBUGGER_MAX
17};
18
19struct StartupOptions {
20 char* fname;
21 char* patch;
22 bool dirmode;
23
24 enum DebuggerType debuggerType;
25 bool debugAtStart;
26};
27
28struct SubParser {
29 const char* usage;
30 bool (*parse)(struct SubParser* parser, struct GBAOptions* gbaOpts, int option, const char* arg);
31 const char* extraOptions;
32 void* opts;
33};
34
35struct GraphicsOpts {
36 int multiplier;
37};
38
39bool parseCommandArgs(struct StartupOptions* opts, struct GBAOptions* gbaOpts, int argc, char* const* argv, struct SubParser* subparser);
40void freeOptions(struct StartupOptions* opts);
41
42void usage(const char* arg0, const char* extraOptions);
43
44void initParserForGraphics(struct SubParser* parser, struct GraphicsOpts* opts);
45struct ARMDebugger* createDebugger(struct StartupOptions* opts);
46
47#endif