MCPcopy Create free account
hub / github.com/CE-Programming/CEmu / main

Function main

gui/qt/main.cpp:11–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9#include <QtGui/QFontDatabase>
10
11int main(int argc, char *argv[]) {
12
13#if QT_VERSION_MAJOR < 6 && defined(Q_OS_WIN)
14 // DPI scaling fix must be applied at the very beginning before QApplication init
15 QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
16#endif
17 QApplication app(argc, argv);
18
19 QCoreApplication::setOrganizationName(QStringLiteral("cemu-dev"));
20 QCoreApplication::setApplicationName(QStringLiteral("CEmu"));
21 QCoreApplication::setApplicationVersion(QStringLiteral(CEMU_VERSION " (git: " CEMU_GIT_SHA ")"));
22
23 execPath = QCoreApplication::applicationFilePath();
24
25#if QT_VERSION_MAJOR < 6
26 app.setAttribute(Qt::AA_UseHighDpiPixmaps);
27#endif
28
29 // Add special jacobly font
30 QFontDatabase::addApplicationFont(QStringLiteral(":/fonts/resources/custom_fonts/TICELarge.ttf"));
31
32 // Setup QCommandParser with command line parameters
33 QCommandLineParser parser;
34 parser.setApplicationDescription(QStringLiteral("CEmu emulator"));
35 parser.addHelpOption();
36 parser.addVersionOption();
37
38 // Disable emulation speed throttling
39 QCommandLineOption unthrottledOption(QStringList() << QStringLiteral("u") << QStringLiteral("unthrottled"),
40 QCoreApplication::translate("main", "Disable emulation speed throttling."));
41 parser.addOption(unthrottledOption);
42
43 // Disable loading a saved state and disables saving to one on application close
44 QCommandLineOption noState(QStringList() << QStringLiteral("n") << QStringLiteral("no-state"),
45 QCoreApplication::translate("main", "Do not load state from disk."));
46 parser.addOption(noState);
47
48 // Sends files on start
49 QCommandLineOption sendFiles(QStringList() << QStringLiteral("s") << QStringLiteral("send"),
50 QCoreApplication::translate("main", "Send <File>"),
51 QCoreApplication::translate("main", "File"));
52 parser.addOption(sendFiles);
53
54 // Force file to archive on send
55 QCommandLineOption sendArchFiles(QStringList() << QStringLiteral("a") << QStringLiteral("send-arch"),
56 QCoreApplication::translate("main", "Force send <File> to archive"),
57 QCoreApplication::translate("main", "File"));
58 parser.addOption(sendArchFiles);
59
60 // Force file to archive on send
61 QCommandLineOption sendRAMFiles(QStringList() << QStringLiteral("m") << QStringLiteral("send-ram"),
62 QCoreApplication::translate("main", "Force send <File> to ram"),
63 QCoreApplication::translate("main", "File"));
64 parser.addOption(sendRAMFiles);
65
66 // Loads Rom file
67 QCommandLineOption loadRomFile(QStringList() << QStringLiteral("r") << QStringLiteral("rom"),
68 QCoreApplication::translate("main", "Load <RomFile>"),

Callers

nothing calls this directly

Calls 4

isInitializedMethod · 0.80
isResetAllMethod · 0.80
setupMethod · 0.80
isReloadMethod · 0.80

Tested by

no test coverage detected