summaryrefslogtreecommitdiffstats
path: root/src/core/src/loader.cpp
diff options
context:
space:
mode:
authorShizZy <shizzy@6bit.net>2013-10-06 15:39:11 +0200
committerShizZy <shizzy@6bit.net>2013-10-06 15:39:11 +0200
commite0cfd6b0b8e7a58d6e09ae7572fca1855d0c1e30 (patch)
tree9561bd6d1399c246c0f03ce3b99a232ec8bb7822 /src/core/src/loader.cpp
parentfixed a typo in declaration of meta file system (diff)
downloadyuzu-e0cfd6b0b8e7a58d6e09ae7572fca1855d0c1e30.tar
yuzu-e0cfd6b0b8e7a58d6e09ae7572fca1855d0c1e30.tar.gz
yuzu-e0cfd6b0b8e7a58d6e09ae7572fca1855d0c1e30.tar.bz2
yuzu-e0cfd6b0b8e7a58d6e09ae7572fca1855d0c1e30.tar.lz
yuzu-e0cfd6b0b8e7a58d6e09ae7572fca1855d0c1e30.tar.xz
yuzu-e0cfd6b0b8e7a58d6e09ae7572fca1855d0c1e30.tar.zst
yuzu-e0cfd6b0b8e7a58d6e09ae7572fca1855d0c1e30.zip
Diffstat (limited to 'src/core/src/loader.cpp')
-rw-r--r--src/core/src/loader.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/core/src/loader.cpp b/src/core/src/loader.cpp
index 5b746b7eb..994ce85e9 100644
--- a/src/core/src/loader.cpp
+++ b/src/core/src/loader.cpp
@@ -29,7 +29,8 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
-bool LoadDirectory(std::string &filename) {
+/// Loads an extracted CXI from a directory
+bool LoadDirectory_CXI(std::string &filename) {
std::string full_path = filename;
std::string path, file, extension;
SplitPath(ReplaceAll(full_path, "\\", "/"), &path, &file, &extension);
@@ -40,11 +41,11 @@ bool LoadDirectory(std::string &filename) {
System::g_ctr_file_system.Mount("fs:", fs);
std::string final_name = "fs:/" + file + extension;
- //File::IOFile f(filename, "rb");
+ File::IOFile f(filename, "rb");
- //if (f.IsOpen()) {
+ if (f.IsOpen()) {
// TODO(ShizZy): read here to memory....
- //}
+ }
ERROR_LOG(TIME, "Unimplemented function!");
return true;
}
@@ -71,7 +72,7 @@ FileType IdentifyFile(std::string &filename) {
if (File::IsDirectory(filename)) {
if (IsBootableDirectory()) {
- return FILETYPE_CTR_DIRECTORY;
+ return FILETYPE_DIRECTORY_CXI;
} else {
return FILETYPE_NORMAL_DIRECTORY;
}
@@ -97,12 +98,9 @@ bool LoadFile(std::string &filename, std::string *error_string) {
INFO_LOG(LOADER,"Identifying file...");
// Note that this can modify filename!
switch (IdentifyFile(filename)) {
-
- case FILETYPE_CTR_DIRECTORY:
- {
- INFO_LOG(LOADER,"File is a BIN !");
- return LoadDirectory(filename);
- }
+
+ case FILETYPE_DIRECTORY_CXI:
+ return LoadDirectory_CXI(filename);
case FILETYPE_ERROR:
ERROR_LOG(LOADER, "Could not read file");