From 60584e861d15f5cf1f64890c03e8090460d3f7c4 Mon Sep 17 00:00:00 2001 From: Steveice10 <1269164+Steveice10@users.noreply.github.com> Date: Fri, 8 Dec 2023 23:35:01 -0800 Subject: [PATCH] fs: Stub ControlArchive. (#7237) --- src/core/hle/service/fs/fs_user.cpp | 20 +++++++++++++++++++- src/core/hle/service/fs/fs_user.h | 16 ++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/src/core/hle/service/fs/fs_user.cpp b/src/core/hle/service/fs/fs_user.cpp index cf9a74a04..9da46b7b7 100644 --- a/src/core/hle/service/fs/fs_user.cpp +++ b/src/core/hle/service/fs/fs_user.cpp @@ -334,6 +334,24 @@ void FS_USER::OpenArchive(Kernel::HLERequestContext& ctx) { } } +void FS_USER::ControlArchive(Kernel::HLERequestContext& ctx) { + IPC::RequestParser rp(ctx); + const auto archive_handle = rp.PopRaw(); + const auto action = rp.Pop(); + const auto input_size = rp.Pop(); + const auto output_size = rp.Pop(); + [[maybe_unused]] const auto input = rp.PopMappedBuffer(); + [[maybe_unused]] const auto output = rp.PopMappedBuffer(); + + LOG_WARNING(Service_FS, + "(STUBBED) called, archive_handle={:016X}, action={:08X}, input_size={:08X}, " + "output_size={:08X}", + archive_handle, action, input_size, output_size); + + IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); + rb.Push(RESULT_SUCCESS); +} + void FS_USER::CloseArchive(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx); const auto archive_handle = rp.PopRaw(); @@ -1010,7 +1028,7 @@ FS_USER::FS_USER(Core::System& system) {0x080A, &FS_USER::RenameDirectory, "RenameDirectory"}, {0x080B, &FS_USER::OpenDirectory, "OpenDirectory"}, {0x080C, &FS_USER::OpenArchive, "OpenArchive"}, - {0x080D, nullptr, "ControlArchive"}, + {0x080D, &FS_USER::ControlArchive, "ControlArchive"}, {0x080E, &FS_USER::CloseArchive, "CloseArchive"}, {0x080F, &FS_USER::FormatThisUserSaveData, "FormatThisUserSaveData"}, {0x0810, &FS_USER::CreateLegacySystemSaveData, "CreateLegacySystemSaveData"}, diff --git a/src/core/hle/service/fs/fs_user.h b/src/core/hle/service/fs/fs_user.h index 52f3b9a3e..f3cdd2b41 100644 --- a/src/core/hle/service/fs/fs_user.h +++ b/src/core/hle/service/fs/fs_user.h @@ -262,6 +262,22 @@ private: */ void OpenArchive(Kernel::HLERequestContext& ctx); + /** + * FS_User::ControlArchive service function + * Inputs: + * 1-2 : Archive Handle + * 3 : Action + * 4 : Input Size + * 5 : Output Size + * 6 : (Input Size << 4) | 0xA + * 7 : Input Pointer + * 8 : (Output Size << 4) | 0xC + * 9 : Output Pointer + * Outputs: + * 1 : Result of function, 0 on success, otherwise error code + */ + void ControlArchive(Kernel::HLERequestContext& ctx); + /** * FS_User::CloseArchive service function * Inputs: