diff options
author | Narr the Reg <juangerman-13@hotmail.com> | 2024-02-08 23:58:44 +0100 |
---|---|---|
committer | Narr the Reg <juangerman-13@hotmail.com> | 2024-02-10 07:23:22 +0100 |
commit | 7c2e9a6596c8b6c5d366c3eaaf926ad7db406486 (patch) | |
tree | 77657cc9413e380eb49e758647536a9dff4f7082 /src/core/hle/service/bcat/bcat_interface.cpp | |
parent | Merge pull request #12951 from liamwhite/more-ipc (diff) | |
download | yuzu-7c2e9a6596c8b6c5d366c3eaaf926ad7db406486.tar yuzu-7c2e9a6596c8b6c5d366c3eaaf926ad7db406486.tar.gz yuzu-7c2e9a6596c8b6c5d366c3eaaf926ad7db406486.tar.bz2 yuzu-7c2e9a6596c8b6c5d366c3eaaf926ad7db406486.tar.lz yuzu-7c2e9a6596c8b6c5d366c3eaaf926ad7db406486.tar.xz yuzu-7c2e9a6596c8b6c5d366c3eaaf926ad7db406486.tar.zst yuzu-7c2e9a6596c8b6c5d366c3eaaf926ad7db406486.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/bcat/bcat_interface.cpp | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/src/core/hle/service/bcat/bcat_interface.cpp b/src/core/hle/service/bcat/bcat_interface.cpp new file mode 100644 index 000000000..2d9a0efcc --- /dev/null +++ b/src/core/hle/service/bcat/bcat_interface.cpp @@ -0,0 +1,61 @@ +// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/hle/service/bcat/bcat_interface.h" +#include "core/hle/service/bcat/bcat_service.h" +#include "core/hle/service/bcat/delivery_cache_storage_service.h" +#include "core/hle/service/cmif_serialization.h" +#include "core/hle/service/filesystem/filesystem.h" + +namespace Service::BCAT { + +std::unique_ptr<BcatBackend> CreateBackendFromSettings([[maybe_unused]] Core::System& system, + DirectoryGetter getter) { + return std::make_unique<NullBcatBackend>(std::move(getter)); +} + +BcatInterface::BcatInterface(Core::System& system_, const char* name_) + : ServiceFramework{system_, name_}, fsc{system.GetFileSystemController()} { + // clang-format off + static const FunctionInfo functions[] = { + {0, C<&BcatInterface::CreateBcatService>, "CreateBcatService"}, + {1, C<&BcatInterface::CreateDeliveryCacheStorageService>, "CreateDeliveryCacheStorageService"}, + {2, C<&BcatInterface::CreateDeliveryCacheStorageServiceWithApplicationId>, "CreateDeliveryCacheStorageServiceWithApplicationId"}, + {3, nullptr, "CreateDeliveryCacheProgressService"}, + {4, nullptr, "CreateDeliveryCacheProgressServiceWithApplicationId"}, + }; + // clang-format on + + RegisterHandlers(functions); + + backend = + CreateBackendFromSettings(system_, [this](u64 tid) { return fsc.GetBCATDirectory(tid); }); +} + +BcatInterface::~BcatInterface() = default; + +Result BcatInterface::CreateBcatService(OutInterface<IBcatService> out_interface) { + LOG_INFO(Service_BCAT, "called"); + *out_interface = std::make_shared<IBcatService>(system, *backend); + R_SUCCEED(); +} + +Result BcatInterface::CreateDeliveryCacheStorageService( + OutInterface<IDeliveryCacheStorageService> out_interface) { + LOG_INFO(Service_BCAT, "called"); + + const auto title_id = system.GetApplicationProcessProgramID(); + *out_interface = + std::make_shared<IDeliveryCacheStorageService>(system, fsc.GetBCATDirectory(title_id)); + R_SUCCEED(); +} + +Result BcatInterface::CreateDeliveryCacheStorageServiceWithApplicationId( + u64 title_id, OutInterface<IDeliveryCacheStorageService> out_interface) { + LOG_DEBUG(Service_BCAT, "called, title_id={:016X}", title_id); + *out_interface = + std::make_shared<IDeliveryCacheStorageService>(system, fsc.GetBCATDirectory(title_id)); + R_SUCCEED(); +} + +} // namespace Service::BCAT |