summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinNoGUI/MainNoGUI.cpp
diff options
context:
space:
mode:
authorLeo Lam <leolino.lam@gmail.com>2017-10-26 17:15:02 +0200
committerGitHub <noreply@github.com>2017-10-26 17:15:02 +0200
commitc4914fbb8b9d90e1acdd77ce7504a0e4c4dfd21f (patch)
treecbe6d36771633db3eab33dc8b6d643f3bc7440fb /Source/Core/DolphinNoGUI/MainNoGUI.cpp
parent5393575c552c733be0df89fddf2493ab7437b389 (diff)
parent4cc1bd972a12186b320d5e1142f10ab145df3203 (diff)
Merge pull request #6094 from leoetlino/drop-wad-hack
Drop the direct WAD launch hack
Diffstat (limited to 'Source/Core/DolphinNoGUI/MainNoGUI.cpp')
-rw-r--r--Source/Core/DolphinNoGUI/MainNoGUI.cpp22
1 files changed, 17 insertions, 5 deletions
diff --git a/Source/Core/DolphinNoGUI/MainNoGUI.cpp b/Source/Core/DolphinNoGUI/MainNoGUI.cpp
index ecd2d3ba88..5619689abc 100644
--- a/Source/Core/DolphinNoGUI/MainNoGUI.cpp
+++ b/Source/Core/DolphinNoGUI/MainNoGUI.cpp
@@ -360,14 +360,26 @@ int main(int argc, char* argv[])
optparse::Values& options = CommandLineParse::ParseArguments(parser.get(), argc, argv);
std::vector<std::string> args = parser->args();
- std::string boot_filename;
+ std::unique_ptr<BootParameters> boot;
if (options.is_set("exec"))
{
- boot_filename = static_cast<const char*>(options.get("exec"));
+ boot = BootParameters::GenerateFromFile(static_cast<const char*>(options.get("exec")));
+ }
+ else if (options.is_set("nand_title"))
+ {
+ const std::string hex_string = static_cast<const char*>(options.get("nand_title"));
+ if (hex_string.length() != 16)
+ {
+ fprintf(stderr, "Invalid title ID\n");
+ parser->print_help();
+ return 1;
+ }
+ const u64 title_id = std::stoull(hex_string, nullptr, 16);
+ boot = std::make_unique<BootParameters>(BootParameters::NANDTitle{title_id});
}
else if (args.size())
{
- boot_filename = args.front();
+ boot = BootParameters::GenerateFromFile(args.front());
args.erase(args.begin());
}
else
@@ -408,9 +420,9 @@ int main(int argc, char* argv[])
DolphinAnalytics::Instance()->ReportDolphinStart("nogui");
- if (!BootManager::BootCore(BootParameters::GenerateFromFile(boot_filename)))
+ if (!BootManager::BootCore(std::move(boot)))
{
- fprintf(stderr, "Could not boot %s\n", boot_filename.c_str());
+ fprintf(stderr, "Could not boot the specified file\n");
return 1;
}