summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2014-08-27 06:04:26 +0200
committerbunnei <bunneidev@gmail.com>2014-08-31 05:23:33 +0200
commit738b88293ca82a7823d79d0406ac38019b7dec9c (patch)
tree5b2f042cae820f5b8ad622731bc378247fac7788 /src/core
parentThreading: Fix thread starting to execute first instruction correctly. (diff)
downloadyuzu-738b88293ca82a7823d79d0406ac38019b7dec9c.tar
yuzu-738b88293ca82a7823d79d0406ac38019b7dec9c.tar.gz
yuzu-738b88293ca82a7823d79d0406ac38019b7dec9c.tar.bz2
yuzu-738b88293ca82a7823d79d0406ac38019b7dec9c.tar.lz
yuzu-738b88293ca82a7823d79d0406ac38019b7dec9c.tar.xz
yuzu-738b88293ca82a7823d79d0406ac38019b7dec9c.tar.zst
yuzu-738b88293ca82a7823d79d0406ac38019b7dec9c.zip
Diffstat (limited to '')
-rw-r--r--src/core/loader/loader.cpp20
-rw-r--r--src/core/loader/loader.h1
2 files changed, 21 insertions, 0 deletions
diff --git a/src/core/loader/loader.cpp b/src/core/loader/loader.cpp
index 2b42e3c64..365f5a277 100644
--- a/src/core/loader/loader.cpp
+++ b/src/core/loader/loader.cpp
@@ -9,6 +9,7 @@
#include "core/loader/elf.h"
#include "core/loader/ncch.h"
#include "core/hle/kernel/archive.h"
+#include "core/mem_map.h"
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -39,6 +40,9 @@ FileType IdentifyFile(const std::string &filename) {
else if (!strcasecmp(extension.c_str(), ".cci")) {
return FileType::CCI; // TODO(bunnei): Do some filetype checking :p
}
+ else if (!strcasecmp(extension.c_str(), ".bin")) {
+ return FileType::BIN; // TODO(bunnei): Do some filetype checking :p
+ }
return FileType::Unknown;
}
@@ -69,6 +73,22 @@ ResultStatus LoadFile(const std::string& filename) {
break;
}
+ // Raw BIN file format...
+ case FileType::BIN:
+ {
+ INFO_LOG(LOADER, "Loading BIN file %s...", filename.c_str());
+
+ File::IOFile file(filename, "rb");
+
+ if (file.IsOpen()) {
+ file.ReadBytes(Memory::GetPointer(Memory::EXEFS_CODE_VADDR), (size_t)file.GetSize());
+ Kernel::LoadExec(Memory::EXEFS_CODE_VADDR);
+ } else {
+ return ResultStatus::Error;
+ }
+ return ResultStatus::Success;
+ }
+
// Error occurred durring IdentifyFile...
case FileType::Error:
diff --git a/src/core/loader/loader.h b/src/core/loader/loader.h
index 4ba10de52..68f843005 100644
--- a/src/core/loader/loader.h
+++ b/src/core/loader/loader.h
@@ -21,6 +21,7 @@ enum class FileType {
CXI,
CIA,
ELF,
+ BIN,
};
/// Return type for functions in Loader namespace