summaryrefslogtreecommitdiffstats
path: root/src/core/loader/loader.cpp
diff options
context:
space:
mode:
authordarkf <lw9k123@gmail.com>2014-12-30 04:47:41 +0100
committerdarkf <lw9k123@gmail.com>2014-12-30 04:47:41 +0100
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
yuzu-8ba9ac0f74abb0408a26207a76a0c1808bad8de0.tar.gz
yuzu-8ba9ac0f74abb0408a26207a76a0c1808bad8de0.tar.bz2
yuzu-8ba9ac0f74abb0408a26207a76a0c1808bad8de0.tar.lz
yuzu-8ba9ac0f74abb0408a26207a76a0c1808bad8de0.tar.xz
yuzu-8ba9ac0f74abb0408a26207a76a0c1808bad8de0.tar.zst
yuzu-8ba9ac0f74abb0408a26207a76a0c1808bad8de0.zip
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 @@
// Copyright 2014 Citra Emulator Project
-// Licensed under GPLv2
+// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
-#include <memory>
+#include <string>
+
+#include "common/make_unique.h"
#include "core/file_sys/archive_romfs.h"
+#include "core/loader/3dsx.h"
#include "core/loader/elf.h"
#include "core/loader/ncch.h"
-#include "core/hle/kernel/archive.h"
+#include "core/hle/service/fs/archive.h"
#include "core/mem_map.h"
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -22,7 +25,7 @@ namespace Loader {
*/
FileType IdentifyFile(const std::string &filename) {
if (filename.size() == 0) {
- ERROR_LOG(LOADER, "invalid filename %s", filename.c_str());
+ LOG_ERROR(Loader, "invalid filename %s", filename.c_str());
return FileType::Error;
}
@@ -42,6 +45,8 @@ FileType IdentifyFile(const std::string &filename) {
return FileType::CCI;
} else if (extension == ".bin") {
return FileType::BIN;
+ } else if (extension == ".3dsx") {
+ return FileType::THREEDSX;
}
return FileType::Unknown;
}
@@ -52,10 +57,14 @@ FileType IdentifyFile(const std::string &filename) {
* @return ResultStatus result of function
*/
ResultStatus LoadFile(const std::string& filename) {
- INFO_LOG(LOADER, "Loading file %s...", filename.c_str());
+ LOG_INFO(Loader, "Loading file %s...", filename.c_str());
switch (IdentifyFile(filename)) {
+ //3DSX file format...
+ case FileType::THREEDSX:
+ return AppLoader_THREEDSX(filename).Load();
+
// Standard ELF file format...
case FileType::ELF:
return AppLoader_ELF(filename).Load();
@@ -67,7 +76,8 @@ ResultStatus LoadFile(const std::string& filename) {
// Load application and RomFS
if (ResultStatus::Success == app_loader.Load()) {
- Kernel::CreateArchive(new FileSys::Archive_RomFS(app_loader), "RomFS");
+ Kernel::g_program_id = app_loader.GetProgramId();
+ Service::FS::CreateArchive(Common::make_unique<FileSys::Archive_RomFS>(app_loader), Service::FS::ArchiveIdCode::RomFS);
return ResultStatus::Success;
}
break;
@@ -76,7 +86,7 @@ ResultStatus LoadFile(const std::string& filename) {
// Raw BIN file format...
case FileType::BIN:
{
- INFO_LOG(LOADER, "Loading BIN file %s...", filename.c_str());
+ LOG_INFO(Loader, "Loading BIN file %s...", filename.c_str());
FileUtil::IOFile file(filename, "rb");