diff options
author | Liam <byteslice@airmail.cc> | 2024-02-12 02:34:27 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2024-02-12 15:17:25 +0100 |
commit | 203d2135293ccc6addd8f93c885e1ea54f3239b6 (patch) | |
tree | eed7c8416f994e2c768b2c0d10c1f481aada68be /src/core/hle/service/am/storage.cpp | |
parent | am: rewrite IStorageAccessor, ITransferStorageAccessor (diff) | |
download | yuzu-203d2135293ccc6addd8f93c885e1ea54f3239b6.tar yuzu-203d2135293ccc6addd8f93c885e1ea54f3239b6.tar.gz yuzu-203d2135293ccc6addd8f93c885e1ea54f3239b6.tar.bz2 yuzu-203d2135293ccc6addd8f93c885e1ea54f3239b6.tar.lz yuzu-203d2135293ccc6addd8f93c885e1ea54f3239b6.tar.xz yuzu-203d2135293ccc6addd8f93c885e1ea54f3239b6.tar.zst yuzu-203d2135293ccc6addd8f93c885e1ea54f3239b6.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/am/storage.cpp | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/src/core/hle/service/am/storage.cpp b/src/core/hle/service/am/storage.cpp deleted file mode 100644 index 12d95eebd..000000000 --- a/src/core/hle/service/am/storage.cpp +++ /dev/null @@ -1,59 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "core/hle/service/am/am_results.h" -#include "core/hle/service/am/library_applet_storage.h" -#include "core/hle/service/am/service/storage_accessor.h" -#include "core/hle/service/am/storage.h" -#include "core/hle/service/ipc_helpers.h" - -namespace Service::AM { - -IStorage::IStorage(Core::System& system_, std::shared_ptr<LibraryAppletStorage> impl_) - : ServiceFramework{system_, "IStorage"}, impl{std::move(impl_)} { - static const FunctionInfo functions[] = { - {0, &IStorage::Open, "Open"}, - {1, &IStorage::OpenTransferStorage, "OpenTransferStorage"}, - }; - - RegisterHandlers(functions); -} - -IStorage::IStorage(Core::System& system_, std::vector<u8>&& data) - : IStorage(system_, CreateStorage(std::move(data))) {} - -IStorage::~IStorage() = default; - -void IStorage::Open(HLERequestContext& ctx) { - LOG_DEBUG(Service_AM, "called"); - - if (impl->GetHandle() != nullptr) { - IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(AM::ResultInvalidStorageType); - return; - } - - IPC::ResponseBuilder rb{ctx, 2, 0, 1}; - rb.Push(ResultSuccess); - rb.PushIpcInterface<IStorageAccessor>(system, impl); -} - -void IStorage::OpenTransferStorage(HLERequestContext& ctx) { - LOG_DEBUG(Service_AM, "called"); - - if (impl->GetHandle() == nullptr) { - IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(AM::ResultInvalidStorageType); - return; - } - - IPC::ResponseBuilder rb{ctx, 2, 0, 1}; - rb.Push(ResultSuccess); - rb.PushIpcInterface<ITransferStorageAccessor>(system, impl); -} - -std::vector<u8> IStorage::GetData() const { - return impl->GetData(); -} - -} // namespace Service::AM |