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