all repos — mgba @ 3ed2993e8ced10194017d2f10527f1aae864e9ac

mGBA Game Boy Advance Emulator

src/platform/commandline.h (view raw)

 1#ifndef COMMAND_LINE_H
 2#define COMMAND_LINE_H
 3
 4#include "util/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	// Passed only
19	char* fname;
20	char* bios;
21	char* patch;
22	bool dirmode;
23
24	enum DebuggerType debuggerType;
25	bool debugAtStart;
26
27	// Configurable
28	int logLevel;
29	int frameskip;
30	int rewindBufferCapacity;
31	int rewindBufferInterval;
32};
33
34struct SubParser {
35	const char* usage;
36	bool (*parse)(struct SubParser* parser, int option, const char* arg);
37	const char* extraOptions;
38	void* opts;
39};
40
41struct GraphicsOpts {
42	// Passed only
43	int multiplier;
44
45	// Configurable
46	int fullscreen;
47	int width;
48	int height;
49};
50
51bool parseCommandArgs(struct StartupOptions* opts, int argc, char* const* argv, struct SubParser* subparser);
52void freeOptions(struct StartupOptions* opts);
53
54void usage(const char* arg0, const char* extraOptions);
55
56void initParserForGraphics(struct SubParser* parser, struct GraphicsOpts* opts);
57struct ARMDebugger* createDebugger(struct StartupOptions* opts);
58
59#endif