summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/fs
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2017-09-24 03:32:18 +0200
committerSubv <subv2112@gmail.com>2017-09-25 16:45:02 +0200
commit774e7deae8655a6f09530770c56ae2e75d55309b (patch)
tree897ebb18a3cff721f402d0be73559f4694d4b1d8 /src/core/hle/service/fs
parentMerge pull request #2952 from MerryMage/page-tables (diff)
downloadyuzu-774e7deae8655a6f09530770c56ae2e75d55309b.tar
yuzu-774e7deae8655a6f09530770c56ae2e75d55309b.tar.gz
yuzu-774e7deae8655a6f09530770c56ae2e75d55309b.tar.bz2
yuzu-774e7deae8655a6f09530770c56ae2e75d55309b.tar.lz
yuzu-774e7deae8655a6f09530770c56ae2e75d55309b.tar.xz
yuzu-774e7deae8655a6f09530770c56ae2e75d55309b.tar.zst
yuzu-774e7deae8655a6f09530770c56ae2e75d55309b.zip
Diffstat (limited to 'src/core/hle/service/fs')
-rw-r--r--src/core/hle/service/fs/archive.cpp18
-rw-r--r--src/core/hle/service/fs/archive.h7
2 files changed, 24 insertions, 1 deletions
diff --git a/src/core/hle/service/fs/archive.cpp b/src/core/hle/service/fs/archive.cpp
index 033fbc9aa..4ccb3cd32 100644
--- a/src/core/hle/service/fs/archive.cpp
+++ b/src/core/hle/service/fs/archive.cpp
@@ -20,6 +20,7 @@
#include "core/file_sys/archive_savedata.h"
#include "core/file_sys/archive_sdmc.h"
#include "core/file_sys/archive_sdmcwriteonly.h"
+#include "core/file_sys/archive_selfncch.h"
#include "core/file_sys/archive_systemsavedata.h"
#include "core/file_sys/directory_backend.h"
#include "core/file_sys/errors.h"
@@ -48,7 +49,7 @@ struct hash<Service::FS::ArchiveIdCode> {
return std::hash<Type>()(static_cast<Type>(id_code));
}
};
-}
+} // namespace std
static constexpr Kernel::Handle INVALID_HANDLE{};
@@ -564,6 +565,21 @@ void RegisterArchiveTypes() {
auto systemsavedata_factory =
std::make_unique<FileSys::ArchiveFactory_SystemSaveData>(nand_directory);
RegisterArchiveType(std::move(systemsavedata_factory), ArchiveIdCode::SystemSaveData);
+
+ auto selfncch_factory = std::make_unique<FileSys::ArchiveFactory_SelfNCCH>();
+ RegisterArchiveType(std::move(selfncch_factory), ArchiveIdCode::SelfNCCH);
+}
+
+void RegisterSelfNCCH(Loader::AppLoader& app_loader) {
+ auto itr = id_code_map.find(ArchiveIdCode::SelfNCCH);
+ if (itr == id_code_map.end()) {
+ LOG_ERROR(Service_FS,
+ "Could not register a new NCCH because the SelfNCCH archive hasn't been created");
+ return;
+ }
+
+ auto* factory = static_cast<FileSys::ArchiveFactory_SelfNCCH*>(itr->second.get());
+ factory->Register(app_loader);
}
void UnregisterArchiveTypes() {
diff --git a/src/core/hle/service/fs/archive.h b/src/core/hle/service/fs/archive.h
index 3a3371c88..e3c8fc2ef 100644
--- a/src/core/hle/service/fs/archive.h
+++ b/src/core/hle/service/fs/archive.h
@@ -21,6 +21,10 @@ static constexpr char SYSTEM_ID[]{"00000000000000000000000000000000"};
/// The scrambled SD card CID, also known as ID1
static constexpr char SDCARD_ID[]{"00000000000000000000000000000000"};
+namespace Loader {
+class AppLoader;
+}
+
namespace Service {
namespace FS {
@@ -259,6 +263,9 @@ void ArchiveInit();
/// Shutdown archives
void ArchiveShutdown();
+/// Registers a new NCCH file with the SelfNCCH archive factory
+void RegisterSelfNCCH(Loader::AppLoader& app_loader);
+
/// Register all archive types
void RegisterArchiveTypes();