From eec40f8f6f5fea63640721027408887291e19f61 Mon Sep 17 00:00:00 2001 From: archshift Date: Thu, 1 May 2014 15:13:06 -0700 Subject: Use runtime arguments to specify boot filename. --- src/citra/citra.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/citra/citra.cpp b/src/citra/citra.cpp index d55b97393..00bab3203 100644 --- a/src/citra/citra.cpp +++ b/src/citra/citra.cpp @@ -24,7 +24,7 @@ int __cdecl main(int argc, char **argv) { System::Init(emu_window); - std::string boot_filename = "homebrew.elf"; + std::string boot_filename = argv[1]; std::string error_str; bool res = Loader::LoadFile(boot_filename, &error_str); -- cgit v1.2.3 From 62528320ea31e94202d649855a5eef79e127edd9 Mon Sep 17 00:00:00 2001 From: archshift Date: Thu, 1 May 2014 20:41:42 -0700 Subject: Check arg count before attempting to access it. --- src/citra/citra.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/citra/citra.cpp b/src/citra/citra.cpp index 00bab3203..d8325772e 100644 --- a/src/citra/citra.cpp +++ b/src/citra/citra.cpp @@ -24,7 +24,14 @@ int __cdecl main(int argc, char **argv) { System::Init(emu_window); - std::string boot_filename = argv[1]; + std::string boot_filename; + + if (argc < 2) { + ERROR_LOG(BOOT, "Failed to load ROM: No ROM specified"); + } + else { + boot_filename = argv[1]; + } std::string error_str; bool res = Loader::LoadFile(boot_filename, &error_str); -- cgit v1.2.3 From bd316ca0c0e244baf8f77b635eae85f744a62cf1 Mon Sep 17 00:00:00 2001 From: archshift Date: Sun, 4 May 2014 15:47:42 -0700 Subject: Fixed indents --- src/citra/citra.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/citra/citra.cpp b/src/citra/citra.cpp index d8325772e..80896505f 100644 --- a/src/citra/citra.cpp +++ b/src/citra/citra.cpp @@ -25,13 +25,13 @@ int __cdecl main(int argc, char **argv) { System::Init(emu_window); std::string boot_filename; - - if (argc < 2) { - ERROR_LOG(BOOT, "Failed to load ROM: No ROM specified"); - } - else { - boot_filename = argv[1]; - } + + if (argc < 2) { + ERROR_LOG(BOOT, "Failed to load ROM: No ROM specified"); + } + else { + boot_filename = argv[1]; + } std::string error_str; bool res = Loader::LoadFile(boot_filename, &error_str); -- cgit v1.2.3