summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Zach Hilman2018-11-15 22:35:16 -0500
committerGravatar Zach Hilman2018-11-15 22:35:16 -0500
commit4838bc8ddc466db2317ab20834aeaafd994dc1bb (patch)
treed638ba5a03814dc4d83f7bdc79d5bc750ba68e5d
parentfile_sys: Add framework for synthesizing open source archives (diff)
downloadyuzu-4838bc8ddc466db2317ab20834aeaafd994dc1bb.tar.gz
yuzu-4838bc8ddc466db2317ab20834aeaafd994dc1bb.tar.xz
yuzu-4838bc8ddc466db2317ab20834aeaafd994dc1bb.zip
fsp_srv: Add support for using open source archive if not found in NAND
Diffstat (limited to '')
-rw-r--r--src/core/hle/service/filesystem/fsp_srv.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp
index c1c83a11d..f06bb33ae 100644
--- a/src/core/hle/service/filesystem/fsp_srv.cpp
+++ b/src/core/hle/service/filesystem/fsp_srv.cpp
@@ -19,6 +19,7 @@
19#include "core/file_sys/nca_metadata.h" 19#include "core/file_sys/nca_metadata.h"
20#include "core/file_sys/patch_manager.h" 20#include "core/file_sys/patch_manager.h"
21#include "core/file_sys/savedata_factory.h" 21#include "core/file_sys/savedata_factory.h"
22#include "core/file_sys/system_archive/system_archive.h"
22#include "core/file_sys/vfs.h" 23#include "core/file_sys/vfs.h"
23#include "core/hle/ipc_helpers.h" 24#include "core/hle/ipc_helpers.h"
24#include "core/hle/kernel/process.h" 25#include "core/hle/kernel/process.h"
@@ -657,6 +658,15 @@ void FSP_SRV::OpenDataStorageByDataId(Kernel::HLERequestContext& ctx) {
657 auto data = OpenRomFS(title_id, storage_id, FileSys::ContentRecordType::Data); 658 auto data = OpenRomFS(title_id, storage_id, FileSys::ContentRecordType::Data);
658 659
659 if (data.Failed()) { 660 if (data.Failed()) {
661 const auto archive = FileSys::SystemArchive::SynthesizeSystemArchive(title_id);
662
663 if (archive != nullptr) {
664 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
665 rb.Push(RESULT_SUCCESS);
666 rb.PushIpcInterface(std::make_shared<IStorage>(archive));
667 return;
668 }
669
660 // TODO(DarkLordZach): Find the right error code to use here 670 // TODO(DarkLordZach): Find the right error code to use here
661 LOG_ERROR(Service_FS, 671 LOG_ERROR(Service_FS,
662 "could not open data storage with title_id={:016X}, storage_id={:02X}", title_id, 672 "could not open data storage with title_id={:016X}, storage_id={:02X}", title_id,