summaryrefslogtreecommitdiff
path: root/src/core/hle/service/filesystem
diff options
context:
space:
mode:
authorGravatar Liam2024-01-06 21:21:01 -0500
committerGravatar Liam2024-01-29 20:17:33 -0500
commit68303ed6016da0926df8b62e5a0c55c9b914f927 (patch)
tree35c805cffc86c668ae88641bd42358105ed6751a /src/core/hle/service/filesystem
parentam: return AppletDataBroker and use for frontend applets (diff)
downloadyuzu-68303ed6016da0926df8b62e5a0c55c9b914f927.tar.gz
yuzu-68303ed6016da0926df8b62e5a0c55c9b914f927.tar.xz
yuzu-68303ed6016da0926df8b62e5a0c55c9b914f927.zip
core: support offline web applet
Diffstat (limited to 'src/core/hle/service/filesystem')
-rw-r--r--src/core/hle/service/filesystem/fsp/fsp_srv.cpp48
1 files changed, 35 insertions, 13 deletions
diff --git a/src/core/hle/service/filesystem/fsp/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp/fsp_srv.cpp
index 2be72b021..5fe534c73 100644
--- a/src/core/hle/service/filesystem/fsp/fsp_srv.cpp
+++ b/src/core/hle/service/filesystem/fsp/fsp_srv.cpp
@@ -15,11 +15,13 @@
15#include "common/settings.h" 15#include "common/settings.h"
16#include "common/string_util.h" 16#include "common/string_util.h"
17#include "core/core.h" 17#include "core/core.h"
18#include "core/file_sys/content_archive.h"
18#include "core/file_sys/errors.h" 19#include "core/file_sys/errors.h"
19#include "core/file_sys/fs_directory.h" 20#include "core/file_sys/fs_directory.h"
20#include "core/file_sys/fs_filesystem.h" 21#include "core/file_sys/fs_filesystem.h"
21#include "core/file_sys/nca_metadata.h" 22#include "core/file_sys/nca_metadata.h"
22#include "core/file_sys/patch_manager.h" 23#include "core/file_sys/patch_manager.h"
24#include "core/file_sys/romfs.h"
23#include "core/file_sys/romfs_factory.h" 25#include "core/file_sys/romfs_factory.h"
24#include "core/file_sys/savedata_factory.h" 26#include "core/file_sys/savedata_factory.h"
25#include "core/file_sys/system_archive/system_archive.h" 27#include "core/file_sys/system_archive/system_archive.h"
@@ -33,18 +35,20 @@
33#include "core/hle/service/filesystem/save_data_controller.h" 35#include "core/hle/service/filesystem/save_data_controller.h"
34#include "core/hle/service/hle_ipc.h" 36#include "core/hle/service/hle_ipc.h"
35#include "core/hle/service/ipc_helpers.h" 37#include "core/hle/service/ipc_helpers.h"
38#include "core/loader/loader.h"
36#include "core/reporter.h" 39#include "core/reporter.h"
37 40
38namespace Service::FileSystem { 41namespace Service::FileSystem {
39enum class FileSystemType : u8 { 42enum class FileSystemProxyType : u8 {
40 Invalid0 = 0, 43 Code = 0,
41 Invalid1 = 1, 44 Rom = 1,
42 Logo = 2, 45 Logo = 2,
43 ContentControl = 3, 46 Control = 3,
44 ContentManual = 4, 47 Manual = 4,
45 ContentMeta = 5, 48 Meta = 5,
46 ContentData = 6, 49 Data = 6,
47 ApplicationPackage = 7, 50 Package = 7,
51 RegisteredUpdate = 8,
48}; 52};
49 53
50class ISaveDataInfoReader final : public ServiceFramework<ISaveDataInfoReader> { 54class ISaveDataInfoReader final : public ServiceFramework<ISaveDataInfoReader> {
@@ -357,12 +361,30 @@ void FSP_SRV::SetCurrentProcess(HLERequestContext& ctx) {
357void FSP_SRV::OpenFileSystemWithPatch(HLERequestContext& ctx) { 361void FSP_SRV::OpenFileSystemWithPatch(HLERequestContext& ctx) {
358 IPC::RequestParser rp{ctx}; 362 IPC::RequestParser rp{ctx};
359 363
360 const auto type = rp.PopRaw<FileSystemType>(); 364 struct InputParameters {
361 const auto title_id = rp.PopRaw<u64>(); 365 FileSystemProxyType type;
362 LOG_WARNING(Service_FS, "(STUBBED) called with type={}, title_id={:016X}", type, title_id); 366 u64 program_id;
367 };
368 static_assert(sizeof(InputParameters) == 0x10, "InputParameters has wrong size");
369
370 const auto params = rp.PopRaw<InputParameters>();
371 LOG_ERROR(Service_FS, "(STUBBED) called with type={}, program_id={:016X}", params.type,
372 params.program_id);
373
374 // FIXME: many issues with this
375 ASSERT(params.type == FileSystemProxyType::Manual);
376 const auto manual_romfs = romfs_controller->OpenPatchedRomFS(
377 params.program_id, FileSys::ContentRecordType::HtmlDocument);
363 378
364 IPC::ResponseBuilder rb{ctx, 2, 0, 0}; 379 ASSERT(manual_romfs != nullptr);
365 rb.Push(ResultUnknown); 380
381 const auto extracted_romfs = FileSys::ExtractRomFS(manual_romfs);
382 ASSERT(extracted_romfs != nullptr);
383
384 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
385 rb.Push(ResultSuccess);
386 rb.PushIpcInterface<IFileSystem>(system, extracted_romfs,
387 SizeGetter::FromStorageId(fsc, FileSys::StorageId::NandUser));
366} 388}
367 389
368void FSP_SRV::OpenSdCardFileSystem(HLERequestContext& ctx) { 390void FSP_SRV::OpenSdCardFileSystem(HLERequestContext& ctx) {