summaryrefslogtreecommitdiff
path: root/src/citra/citra.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2014-06-25 09:46:14 -0400
committerGravatar bunnei2014-06-25 09:46:14 -0400
commit469fe42fad01fc45e454e6acfa413eeae92e587e (patch)
tree4cf876688cc2d03d34512f8f1a25bc26d853f1fb /src/citra/citra.cpp
parentMerge pull request #7 from archshift/travis-osx (diff)
parentLoader: Refactored loading functions to only read data from binary if called. (diff)
downloadyuzu-469fe42fad01fc45e454e6acfa413eeae92e587e.tar.gz
yuzu-469fe42fad01fc45e454e6acfa413eeae92e587e.tar.xz
yuzu-469fe42fad01fc45e454e6acfa413eeae92e587e.zip
Merge pull request #22 from bunnei/loader-improvements
Refactor loader code and add preliminary NCCH support
Diffstat (limited to 'src/citra/citra.cpp')
-rw-r--r--src/citra/citra.cpp25
1 files changed, 9 insertions, 16 deletions
diff --git a/src/citra/citra.cpp b/src/citra/citra.cpp
index 5a8642d1b..036af3735 100644
--- a/src/citra/citra.cpp
+++ b/src/citra/citra.cpp
@@ -8,7 +8,7 @@
8 8
9#include "core/system.h" 9#include "core/system.h"
10#include "core/core.h" 10#include "core/core.h"
11#include "core/loader.h" 11#include "core/loader/loader.h"
12 12
13#include "citra/emu_window/emu_window_glfw.h" 13#include "citra/emu_window/emu_window_glfw.h"
14 14
@@ -16,28 +16,21 @@
16 16
17/// Application entry point 17/// Application entry point
18int __cdecl main(int argc, char **argv) { 18int __cdecl main(int argc, char **argv) {
19 std::string program_dir = File::GetCurrentDir();
20
21 LogManager::Init(); 19 LogManager::Init();
22 20
23 EmuWindow_GLFW* emu_window = new EmuWindow_GLFW;
24
25 System::Init(emu_window);
26
27 std::string boot_filename;
28
29 if (argc < 2) { 21 if (argc < 2) {
30 ERROR_LOG(BOOT, "Failed to load ROM: No ROM specified"); 22 ERROR_LOG(BOOT, "Failed to load ROM: No ROM specified");
23 return -1;
31 } 24 }
32 else {
33 boot_filename = argv[1];
34 }
35 std::string error_str;
36 25
37 bool res = Loader::LoadFile(boot_filename, &error_str); 26 std::string boot_filename = argv[1];
27 EmuWindow_GLFW* emu_window = new EmuWindow_GLFW;
28
29 System::Init(emu_window);
38 30
39 if (!res) { 31 if (Loader::ResultStatus::Success != Loader::LoadFile(boot_filename)) {
40 ERROR_LOG(BOOT, "Failed to load ROM: %s", error_str.c_str()); 32 ERROR_LOG(BOOT, "Failed to load ROM!");
33 return -1;
41 } 34 }
42 35
43 Core::RunLoop(); 36 Core::RunLoop();