summaryrefslogtreecommitdiff
path: root/src/core/loader/loader.cpp
diff options
context:
space:
mode:
authorGravatar darkf2014-12-29 19:47:41 -0800
committerGravatar darkf2014-12-29 19:47:41 -0800
commit8ba9ac0f74abb0408a26207a76a0c1808bad8de0 (patch)
treef1c7c3393fa726435b5b90bf335567c93e528ef1 /src/core/loader/loader.cpp
parentAdd comment regarding __WIN32__ in SkyEye code (diff)
parentMerge pull request #367 from bunnei/usat_ssat (diff)
downloadyuzu-8ba9ac0f74abb0408a26207a76a0c1808bad8de0.tar.gz
yuzu-8ba9ac0f74abb0408a26207a76a0c1808bad8de0.tar.xz
yuzu-8ba9ac0f74abb0408a26207a76a0c1808bad8de0.zip
Fix merge conflicts
Diffstat (limited to 'src/core/loader/loader.cpp')
-rw-r--r--src/core/loader/loader.cpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/core/loader/loader.cpp b/src/core/loader/loader.cpp
index a268e021a..87580cb2a 100644
--- a/src/core/loader/loader.cpp
+++ b/src/core/loader/loader.cpp
@@ -1,13 +1,16 @@
1// Copyright 2014 Citra Emulator Project 1// Copyright 2014 Citra Emulator Project
2// Licensed under GPLv2 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <memory> 5#include <string>
6
7#include "common/make_unique.h"
6 8
7#include "core/file_sys/archive_romfs.h" 9#include "core/file_sys/archive_romfs.h"
10#include "core/loader/3dsx.h"
8#include "core/loader/elf.h" 11#include "core/loader/elf.h"
9#include "core/loader/ncch.h" 12#include "core/loader/ncch.h"
10#include "core/hle/kernel/archive.h" 13#include "core/hle/service/fs/archive.h"
11#include "core/mem_map.h" 14#include "core/mem_map.h"
12 15
13//////////////////////////////////////////////////////////////////////////////////////////////////// 16////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -22,7 +25,7 @@ namespace Loader {
22 */ 25 */
23FileType IdentifyFile(const std::string &filename) { 26FileType IdentifyFile(const std::string &filename) {
24 if (filename.size() == 0) { 27 if (filename.size() == 0) {
25 ERROR_LOG(LOADER, "invalid filename %s", filename.c_str()); 28 LOG_ERROR(Loader, "invalid filename %s", filename.c_str());
26 return FileType::Error; 29 return FileType::Error;
27 } 30 }
28 31
@@ -42,6 +45,8 @@ FileType IdentifyFile(const std::string &filename) {
42 return FileType::CCI; 45 return FileType::CCI;
43 } else if (extension == ".bin") { 46 } else if (extension == ".bin") {
44 return FileType::BIN; 47 return FileType::BIN;
48 } else if (extension == ".3dsx") {
49 return FileType::THREEDSX;
45 } 50 }
46 return FileType::Unknown; 51 return FileType::Unknown;
47} 52}
@@ -52,10 +57,14 @@ FileType IdentifyFile(const std::string &filename) {
52 * @return ResultStatus result of function 57 * @return ResultStatus result of function
53 */ 58 */
54ResultStatus LoadFile(const std::string& filename) { 59ResultStatus LoadFile(const std::string& filename) {
55 INFO_LOG(LOADER, "Loading file %s...", filename.c_str()); 60 LOG_INFO(Loader, "Loading file %s...", filename.c_str());
56 61
57 switch (IdentifyFile(filename)) { 62 switch (IdentifyFile(filename)) {
58 63
64 //3DSX file format...
65 case FileType::THREEDSX:
66 return AppLoader_THREEDSX(filename).Load();
67
59 // Standard ELF file format... 68 // Standard ELF file format...
60 case FileType::ELF: 69 case FileType::ELF:
61 return AppLoader_ELF(filename).Load(); 70 return AppLoader_ELF(filename).Load();
@@ -67,7 +76,8 @@ ResultStatus LoadFile(const std::string& filename) {
67 76
68 // Load application and RomFS 77 // Load application and RomFS
69 if (ResultStatus::Success == app_loader.Load()) { 78 if (ResultStatus::Success == app_loader.Load()) {
70 Kernel::CreateArchive(new FileSys::Archive_RomFS(app_loader), "RomFS"); 79 Kernel::g_program_id = app_loader.GetProgramId();
80 Service::FS::CreateArchive(Common::make_unique<FileSys::Archive_RomFS>(app_loader), Service::FS::ArchiveIdCode::RomFS);
71 return ResultStatus::Success; 81 return ResultStatus::Success;
72 } 82 }
73 break; 83 break;
@@ -76,7 +86,7 @@ ResultStatus LoadFile(const std::string& filename) {
76 // Raw BIN file format... 86 // Raw BIN file format...
77 case FileType::BIN: 87 case FileType::BIN:
78 { 88 {
79 INFO_LOG(LOADER, "Loading BIN file %s...", filename.c_str()); 89 LOG_INFO(Loader, "Loading BIN file %s...", filename.c_str());
80 90
81 FileUtil::IOFile file(filename, "rb"); 91 FileUtil::IOFile file(filename, "rb");
82 92