diff options
author | wwylele <wwylele@gmail.com> | 2016-06-01 09:42:37 +0200 |
---|---|---|
committer | wwylele <wwylele@gmail.com> | 2016-07-03 07:23:59 +0200 |
commit | ab2eef396ad6633f67419daa1b473898bef1c43a (patch) | |
tree | 00a23ca7b18a992b958a8ce058e719c470460610 /src/core/hle/service/fs | |
parent | Service::CFG: move known block ID to an enum (diff) | |
download | yuzu-ab2eef396ad6633f67419daa1b473898bef1c43a.tar yuzu-ab2eef396ad6633f67419daa1b473898bef1c43a.tar.gz yuzu-ab2eef396ad6633f67419daa1b473898bef1c43a.tar.bz2 yuzu-ab2eef396ad6633f67419daa1b473898bef1c43a.tar.lz yuzu-ab2eef396ad6633f67419daa1b473898bef1c43a.tar.xz yuzu-ab2eef396ad6633f67419daa1b473898bef1c43a.tar.zst yuzu-ab2eef396ad6633f67419daa1b473898bef1c43a.zip |
Diffstat (limited to 'src/core/hle/service/fs')
-rw-r--r-- | src/core/hle/service/fs/archive.cpp | 24 | ||||
-rw-r--r-- | src/core/hle/service/fs/archive.h | 6 |
2 files changed, 22 insertions, 8 deletions
diff --git a/src/core/hle/service/fs/archive.cpp b/src/core/hle/service/fs/archive.cpp index 81b9abe4c..cc7af7218 100644 --- a/src/core/hle/service/fs/archive.cpp +++ b/src/core/hle/service/fs/archive.cpp @@ -255,7 +255,7 @@ using FileSys::ArchiveFactory; /** * Map of registered archives, identified by id code. Once an archive is registered here, it is - * never removed until the FS service is shut down. + * never removed until UnregisterArchiveTypes is called. */ static boost::container::flat_map<ArchiveIdCode, std::unique_ptr<ArchiveFactory>> id_code_map; @@ -516,12 +516,7 @@ ResultCode CreateSystemSaveData(u32 high, u32 low) { return RESULT_SUCCESS; } -/// Initialize archives -void ArchiveInit() { - next_handle = 1; - - AddService(new FS::Interface); - +void RegisterArchiveTypes() { // TODO(Subv): Add the other archive types (see here for the known types: // http://3dbrew.org/wiki/FS:OpenArchive#Archive_idcodes). @@ -558,10 +553,23 @@ void ArchiveInit() { RegisterArchiveType(std::move(systemsavedata_factory), ArchiveIdCode::SystemSaveData); } +void UnregisterArchiveTypes() { + id_code_map.clear(); +} + +/// Initialize archives +void ArchiveInit() { + next_handle = 1; + + AddService(new FS::Interface); + + RegisterArchiveTypes(); +} + /// Shutdown archives void ArchiveShutdown() { handle_map.clear(); - id_code_map.clear(); + UnregisterArchiveTypes(); } } // namespace FS diff --git a/src/core/hle/service/fs/archive.h b/src/core/hle/service/fs/archive.h index 006606740..f7a50a3a7 100644 --- a/src/core/hle/service/fs/archive.h +++ b/src/core/hle/service/fs/archive.h @@ -235,5 +235,11 @@ void ArchiveInit(); /// Shutdown archives void ArchiveShutdown(); +/// Register all archive types +void RegisterArchiveTypes(); + +/// Unregister all archive types +void UnregisterArchiveTypes(); + } // namespace FS } // namespace Service |